[jdom-interest] Bug

Jason Hunter jhunter at collab.net
Fri Jan 5 03:47:00 PST 2001

Hmm...  You're probably using XMLOutputter to output with no line
separation because the original file has line separation already.  That
makes the elements print nicely.  Thing is, parsers don't give notice of
the whitespace outside the root element.  So when you say no new lines,
it adds none, not even after the declaration.  Sort of a bug, sort of
not.  Definitely not a problem with the core, just in how to tweak the

Maybe the thing to do is put a new line there regardless?  Doesn't seem
like it'd hurt anything.  Other brainstorms?


> ChristianNUESA \"Chun\" wrote:
> Hello,
> Given this example (please notice the begining tag -- in bold);
> <?xml version="1.0" encoding="UTF-8"?>
> <test>
>     <CostItem>
>         </AcctNum>
>         </AcctDesc>
>     </CostItem>
> </test>
> If I would read that xml and put some data in it using JDOM and use
> the JDOM's outputer object, ther result would this;
> <?xml version="1.0" encoding="UTF-8"?><test>
>     <CostItem>
>         <AcctNum>test</AcctNum>
>         <AcctDesc>test</AcctDesc>
>     </CostItem>
> </test>
> The indent of <test> suddenly is out of place. Has someone fix this
> already?
> christian NUESA
> Software Manager, R&D Group
> Entertainment Partner
> (818) 955-6241

More information about the jdom-interest mailing list