• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Problem serializing processing instruction with LSSerializer

 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!