Java Mailing List Archive

http://www.junlu.com/

Home » JDOM Projects »

[jdom-interest] Re: Formatting XML

Oliver Hirschi

2008-02-28


Author LoginPost Reply
"Rolf" <jdom@(protected)
news:47C57F43.5050404@(protected)...
> Hi Oliver....
>
> Raw format is intended to output the file in the same format as it
> was imported.... so, if you raw format output a file that was pretty
> to start with, it will be unchanged.
>
> Perhaps you are looking for Format.getCompactFormat().
>
> I just wrote a small test program, and ran it against a file that has
> an uncommon format. I can confirm that getPrettyFormat() makes it
> pretty, getRawFormat leaves u unchanged, and getCompactFormat makes
> it all on one line....

Hi Rolf

I found the mistake:
There was a xml:space="preserve" attribute in the root-element...
After removing this it works well!

Thanks & Regards,
Oliver Hirschi


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.