[jdom-interest] XMLOutputer b5 seems to output differently than B4

Dino Fancellu dino.fancellu at ntlworld.com
Tue Oct 10 16:37:45 PDT 2000

I found something that worked for me.

XMLOutputter outputter = new XMLOutputter("  ",true);
outputter.setLineSeparator("\r"); // i.e. just a line feed

Now b5 outputs like b4 XMLOutputter()

B5 uses "\r\n" as the default line seperator, which leads to ugly
formatting, well, on my Windows box anyway.

In fact b4 just did a out.println(), which of course uses the system
line.seperator, so b4 could well have seperated
lines differently on different boxes.

Just for those of you wanting XMLOutputter to act the same as it did in b4
(well, on windows anyway).
I do so cringe when things break from previous behaviour without a good
explanation of how to unbreak it.

Hope this helps any others seeing the same thing.


More information about the jdom-interest mailing list