aspose file tools*
The moose likes XML and Related Technologies and the fly likes Problem serializing processing instruction with LSSerializer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problem serializing processing instruction with LSSerializer" Watch "Problem serializing processing instruction with LSSerializer" New topic
Author

Problem serializing processing instruction with LSSerializer

Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 509
    
    6
Greetings!

I'm facing a problem while using the DOM 3 Load-Save API's LSSerializer to serialize a DOM Document. The Document contains 2 processing instructions and a document element with child nodes. But when it's serialized, the second processing instruction <?metadataRepository?> appears after the document element in output file. Details are below. Please advise what I'm doing wrong.

Details:
Sun JRE 1.6.0_07
Using the internal Xerces API shipped with JRE
Windows XP

What the code does is:
1. Load the file WellFormedSmallSample.xml using Documentbuilder.parse() to get a Document.
2. Save this Document back to another file TestLSOutput.xml using DOM 3 LSSerializer



Input file WellFormedSmallSample.xml:



Output file



Application output


The output file contains <?metadataRepository?> processing instruction after <repository> element. How do I correct this?

Thank you
Karthik
 
 
subject: Problem serializing processing instruction with LSSerializer