[jdom-interest] Re: bloated RC2 files - extra white space

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu May 8 07:15:08 PDT 2003


At 9:09 AM -0400 5/8/03, Abe Mishler wrote:

>Well, normalizing isn't going to solve my problem completely. Yes, 
>I'm back to smaller filesizes but what I failed to predict was that 
>data inside constructs such as CDATA would lose its integrity - we 
>need to store white space characters inside CDATA. I haven't tried 
>the XMLOutputter(Format.getPrettyFormat()) but I need to vote that 
>automatically normalizing shouldn't be done in place of trimming.

It sounds like you're confusing CDATA sections with 
xml:space="preserve". Absolutely *nothing* about XML processing 
should change if the content of the CDATA sections were replaced by 
the actual characters and/or numeric character references. CDATA 
sections have *zero* semantic value. They are syntax sugar, nothing 
more. They have no impact on the meaning or treatment of white space.

Perhaps I missed it, but I don't think you've yet provided a complete 
example of the problem that we can analyze. If I missed it, please 
point me at it. We saw the XML output I know, but I've yet to see the 
original XML document or the Java source code. Until you provide 
that, we can't really verify (or deny) that there is in fact a 
problem here, much less figure out how to fix it if indeed we need to 
do that.
-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA



More information about the jdom-interest mailing list