• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

ProcessingInstruction - how to place before root elem

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Goodbye moon men. Hello tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic