[jdom-interest] XMLOutputter help needed.
jhunter at collab.net
Thu Mar 29 09:57:08 PST 2001
Alex Colic wrote:
> I have an xml document that a class reads, makes some changes to and then
> saves. I have been using:
> XMLOutputter out=new XMLOutputter(" ", true);
> to indent the lines two spaces and to add a new line.
> The problem is that as the file is read and saved the indentation is
> commutative. First the indent is two spaces, then four spaces etc.
> Any idea on what I can do to prevent that?
setTrimText(true) which allows the outputter to trim whitespace before
adding its own. Make sure you use the latest version. I made
improvements on this since beta6. It's not 100% perfectly formatted
now, but it's pretty dang good and I'll get it perfect.
More information about the jdom-interest