[jdom-interest] Re: Formatting XML

Oliver Hirschi o.hirschi at bluewin.ch
Wed Feb 27 23:10:29 PST 2008


"Rolf" <jdom at tuis.net> schrieb im Newsbeitrag 
news:47C57F43.5050404 at tuis.net...
> 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 




More information about the jdom-interest mailing list