J
Jason Cavett
I've done some research and figured out how to fix my problem, but now
I'm wondering why this whitespace problem happens.
When I use the following code...
OutputFormat format = new OutputFormat(document);
format.setIndenting(false);
XMLSerializer serializer = new XMLSerializer(new
FileOutputStream(file), format);
serializer.serialize(document);
....to write an XML document (org.w3c.dom.Document), the resulting
output is fine. But, if set indenting to true (to make the XML look
pretty), I get all these weird block characters in the resulting txt
file. The file still opens up okay in my browser, but my application
can't seem to handle it because the reader wants to treat those block
characters as nodes.
Any idea why this happens? Is there a way to fix this and still allow
indenting in my document?
Thanks
I'm wondering why this whitespace problem happens.
When I use the following code...
OutputFormat format = new OutputFormat(document);
format.setIndenting(false);
XMLSerializer serializer = new XMLSerializer(new
FileOutputStream(file), format);
serializer.serialize(document);
....to write an XML document (org.w3c.dom.Document), the resulting
output is fine. But, if set indenting to true (to make the XML look
pretty), I get all these weird block characters in the resulting txt
file. The file still opens up okay in my browser, but my application
can't seem to handle it because the reader wants to treat those block
characters as nodes.
Any idea why this happens? Is there a way to fix this and still allow
indenting in my document?
Thanks