[jdom-interest] XML file formatting using XMLOutputter

Richard L. Cannon richard.cannon at jhuapl.edu
Fri Jan 26 05:58:17 PST 2001

I have been working with JDOM beta 5 and have come across a peculiar 
problem when trying to read in a document, modify it, and write it back out.  
I cannot get the document to have consistently clean formatting.

If I read an XML document with newlines and indentations, add new 
elements to it, and write it back out, the output will not be consistently 
formatted.  If I the Outputter is instantiated to insert newlines and 
indentations, the new elements will look right, but the previous elements 
will now have double newlines and indentations.

On the other hand, if the Outputter is instantiated to NOT insert newlines
or indentations, the previous elements will look right, indentations.but the
new elements won't have any newlines or indentations.

I think what I need is a way to read an XML document which has newlines 
and indents, and strip all of them out before doing any modifications or writing
the document back out.

Has anyone else run into this problem or does anyone have a solution?

Rick Cannon
rick.cannon at jhuapl.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20010126/cf8aee37/attachment.htm

More information about the jdom-interest mailing list