Cloning a tree 2003-01-13 - By Joseph Kesselman
See documentation for the DOM Level 2 Node.cloneNode() method. But note that this is not guaranteed to work on Document nodes; in some implementations, you may have to create a new Document, and then use the DOM Level 2 importNode() method to copy the children of the old Document into the new one... so see the docs for that too. (See also http://www.w3.org/DOM/faq.html#ownerdoc for discussion of why importNode is different from cloneNode.)
If you're writing DOM Level 1 code, then yes, you must provide your own code to walk and copy the tree.
______________________________________ Joe Kesselman / IBM Research
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|