Formatting output

"Oliver Hirschi" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Hi

I'm realy confused. In my example formatting the output does not work 
correctly and I have no idea to solve this. I'm using JDOM 1.1.

1. I read a SVG file with JDOM.
2. I make some changes in the xml-tree (new elements, detach elements, 
etc.)
3. I write the tree to file with the following code:
------------------
XMLOutputter oXMLOutputter = new XMLOutputter();
Format oFormat = Format.getPrettyFormat();
oXMLOutputter.setFormat(oFormat);
FileOutputStream oFileOutputStream = new FileOutputStream(sFileChart);
OutputStreamWriter oOutputStreamWriter = new 
OutputStreamWriter(oFileOutputStream, "UTF-8");
oXMLOutputter.output(oDoc_Chart, oOutputStreamWriter);
------------------

Now, my written XML is not formatted "pretty", e.g. where I detached an 
element, a blank line is in the file and the identing is also not 
correct. I also tried to set "oFormat.setLineSeparator("\n\n\n");", so 
there comes three newlines before the root-element, but the content of 
the root-element is not formatted???

Great thanks & kind regards,
Oliver Hirschi 


_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.