Java Mailing List Archive

Home » JDOM Projects »

[jdom-interest] Re: Formatting XML

Oliver Hirschi


Author LoginPost Reply
"Rolf" <jdom@(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:
©2008 - Jax Systems, LLC, U.S.A.