I just
tried this, but it doesn't help.
-----Original Message-----You may not use outputformat correctly for the second serialization. You have to set these two properties :
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 28, 2001 11:05 AM
To: [EMAIL PROTECTED]
Subject: Re: Output DOM to a String in a more readable format
outputFormat.setPreserveSpace(false);
outputFormat.setIndenting(true);If not, the indentation is not done and you will get more or less what you had in the initial string (with some missing cariage returns, that's the point).
Sebastien
Lei Chen wrote:
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