Is there any way to reorder elements in a Node objects such that they match an xsd:sequence
order? I\'ve read through the docs for Node.normalize
, but
You can manipulate XML directly in Java using the following packages:
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
You'll need to put an XML parser such as saxon ( see http://saxon.sourceforge.net/ ) on your classpath
You can manipulate the XML 'by hand', reading bits of the input document and creating the required output document or you can write an xslt style sheet and use it to transform the document straight from your Java code.
Try here for a starting point:
http://oreilly.com/catalog/javaxslt/chapter/ch05.html