Thanks for your replies guys. Using XMLSerializer and OutputFormat, I am able to generate well formated XML String. However if later on I am trying to re-generate the DOM from the String using the following method:
 
         Document doc = builder.parse( new InputSource( new StringReader(xmlString) ) );
 
and then print it using XMLSerializer and OutputFormat. Some of the carriage returns are missing. In this case, I am generating DOM from scratch, and there is no comments involved.
 
Any ideas?
 
-Lei
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 28, 2001 1:45 AM
To: [EMAIL PROTECTED]
Subject: Re: Output DOM to a String in a more readable format

Take care that there was a kind of bug in the serializer. There was no indentation nor cariage return around comments. Thus, if your file has many comments, it could even be serialized on a single line.
This problem has been fixed recently (last week I think) and you have to download the latest sources from CVS to benefit from this fix.

Sebastien
 

Lei Chen wrote:

 Hi,I was running the DOMGenerate example which generates a DOM and output it to a String using Serializer. Is it possible to make the String more humanly readable i.e. (newline separated and properly indented) ? Since this will be very useful for debugging.-Lei

Reply via email to