File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How copy an org.w3c.dom.Document object? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How copy an org.w3c.dom.Document object?" Watch "How copy an org.w3c.dom.Document object?" New topic
Author

How copy an org.w3c.dom.Document object?

Dan Bizman
Ranch Hand

Joined: Feb 25, 2003
Posts: 387
In my code, I've created a Document object via LSParser.parse(...). I will need to use the basic document created many times but each time, the data needs to be changed inside it (and form diff. threads, so likely concurrently). I don't want to have to reparse the XML string every time (that's pretty intensive). is there a known way to copy this object and get the entire hierarchy?
Aryan Khan
Ranch Hand

Joined: Sep 12, 2004
Posts: 289
Take a look at Document.cloneNode(true) and Document.importNode(true).

Ahmad


OCP/MCP/SCJP/SCWCD/IBM XML/SCMAD/SCEA-1
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How copy an org.w3c.dom.Document object?
 
Similar Threads
How do I add a object (copy) to a que or hashmap, and not a reference?
JTable Copy/paste functionality
disabling right click using jquery
Many-To-Many relationship probs...
Difference