IntelliJ Java IDE
The moose likes XML and Related Technologies and the fly likes How to combine two DOM document into One Dom document Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "How to combine two DOM document into One Dom document" Watch "How to combine two DOM document into One Dom document" New topic
Author

How to combine two DOM document into One Dom document

Raj Sethi
Greenhorn

Joined: Mar 11, 2001
Posts: 9
Hi
Has anyone got any tips to,combine two DOm document to one Document.I would appreciate your help.

Raj
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5781
Take a look at the cloneNode() method on the org.w3c.dom.Node class.
You can take the root node of the second DOM tree, clone it and attach it to a particular node in the first DOM tree.
Disclaimer - I haven't tried this myself, but it should work!
------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.


Open Group Certified Master IT Architect.
Sun Certified Architect(SCEA).
Daniel Olson
Ranch Hand

Joined: Jan 05, 2001
Posts: 81
Here is a link to an article called
Use XSLT to Merge XML Documents http://www.xmlmag.com/upload/free/features/xml/2001/06jun01/rj0103/rj0103.asp
Also there is another article in XML Developers Journal this month or last month that give three different ways to combine documents.
Raj Sethi
Greenhorn

Joined: Mar 11, 2001
Posts: 9
Originally posted by Daniel Olson:
Here is a link to an article called
Use XSLT to Merge XML Documents http://www.xmlmag.com/upload/free/features/xml/2001/06jun01/rj0103/rj0103.asp
Also there is another article in XML Developers Journal this month or last month that give three different ways to combine documents.

Raj Sethi
Greenhorn

Joined: Mar 11, 2001
Posts: 9
Originally posted by Raj Sethi:

Thanks Ajith,Daniel
I want to this task using java not XSl,I will give a try to cloneNode().
Has anyone familiar with importNode().what it does and how it does that would be good.
 
 
subject: How to combine two DOM document into One Dom document
 
Threads others viewed
Java XPath on multiple files
DOM & SAX
combining 2 dom trees
Adding data to an XML file?
Reading a simple XML File
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture