• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem serializing processing instruction with LSSerializer  RSS feed

Karthik Shiraly
Posts: 1210
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

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
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!