posted 23 years ago
Hi
I have an existing xml File and i use Xerces to read it in.
<code>
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbf.newDocumentBuilder();
org.w3c.dom.Document sourceDoc = builder.parse(new FileInputStream(outputPath));
</code>
But now i want to create a ProcessingInstruction ,i read the api and found that method :
createProcessingInstruction(java.lang.String target, java.lang.String data)
this method returns a ProcessingInstruction which i have to add lateron on the Dom tree.But how can i add this ProcessingInstruction BEFORE the Root-Element.
Has anyone of u already done that ? Must i create a new Document to add the ProcessingInstruction before the root-element ?
Thx a lot,
Holger