dcsimg
Add a Node into a Document dynamicaly?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Fredrik_Andersson
Posted On:   Thursday, November 22, 2001 01:42 AM

Hello! I would like to add a Node into an existing document dynamically, but I can't find out how to do this. I use org.w3c.dom , which I have to use! I can't choose something else. I have an XML-skeleton that looks like this: I load that skeleton into an Document with: FileInputStream is = new FileInputStream(_skeletonFile); Parser parser = new Parser(_skeletonFile.getPath()); _document = parser.readStream(is); But, now how do I dynamically add an third element/node to the Document????? Best    More>>

Hello!


I would like to add a Node into an existing document dynamically, but I can't find out how to do this.


I use org.w3c.dom , which I have to use! I can't choose something else.


I have an XML-skeleton that looks like this:











I load that skeleton into an Document with:

FileInputStream is = new FileInputStream(_skeletonFile);

Parser parser = new Parser(_skeletonFile.getPath());

_document = parser.readStream(is);




But, now how do I dynamically add an third element/node to the Document?????



Best regards
Fredrik

   <<Less

Re: Add a Node into a Document dynamicaly?

Posted By:   Anonymous  
Posted On:   Thursday, November 22, 2001 01:05 PM

dom.getElementsByTagName("a").item(0).appendChild(dom.createElement("b"))
About | Sitemap | Contact