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
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss