Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 65443 invoked from network); 3 Oct 2004 22:13:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Oct 2004 22:13:06 -0000 Received: (qmail 45546 invoked by uid 500); 3 Oct 2004 22:12:59 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 45504 invoked by uid 500); 3 Oct 2004 22:12:59 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 45491 invoked by uid 99); 3 Oct 2004 22:12:59 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [202.135.116.201] (HELO unxcoms01.ecnetwork.co.nz) (202.135.116.201) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 03 Oct 2004 15:12:58 -0700 Received: from serpent.ecnetwork.co.nz (serpent [202.135.190.10]) by unxcoms01.ecnetwork.co.nz (8.12.8/8.12.8) with ESMTP id i93MCpBH028515 for ; Mon, 4 Oct 2004 11:12:51 +1300 Received: from [202.135.190.30] (unknown [202.135.190.30]) by serpent.ecnetwork.co.nz (Postfix) with ESMTP id 0D3011049 for ; Mon, 4 Oct 2004 10:15:32 +1200 (NZST) Subject: Re: Digester trimming whitespaces From: Simon Kitching To: Jakarta Commons Users List In-Reply-To: <008001c4a792$5fe8c290$716ea8c0@MARCOM1> References: <008001c4a792$5fe8c290$716ea8c0@MARCOM1> Content-Type: text/plain Message-Id: <1096837955.913.11.camel@pcsimon> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 04 Oct 2004 10:12:36 +1300 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Fri, 2004-10-01 at 20:40, Marco Mistroni wrote: > Hello all, > I am currently having a problem (?) with digester in the > Sense that in parsing XML is 'trimming' whitespaces.. Hi Marco, Yes, some Digester rules do this deliberately. If you look at the source for CallParamRule, CallMethodRule, etc. you will see something like: bodyText = bodyText.trim(); As this code precedes my involvement in Digester, I can't say exactly what the motivation was for doing this, but presume there was a good reason. I certainly have been using digester fairly heavily and not needed to allow leading/trailing whitespace in element bodies. However I can understand that some people might need to. I would recommend that you take a copy of the source of whatever rule is causing you problems and rename the class (including changing the package declaration to something in your namespace), then delete the trim() call. If you feel like contributing a patch to add some kind of boolean flag to the original Rule class to allow people to enable/disable trimming of whitespace (including unit tests) then I think there would be some interest in applying this to Digester - I certainly think that would be useful. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org