You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Da...@dvg.de on 2001/03/19 15:47:01 UTC

Moving entire sub-tree between the XML documents

Suppose a follow situation.

I have two XML documents. I'm trying to move a complete sub tree from one
document to another.

DOM_Document src_doc;
DOM_Document trg_doc;

DOM_Node src_node = find_src_node(src_doc);
DOM_Node trg_node = find_trg_node(trg_node);

trg_node = src_node;

Opps. This piece of code doesn't function, because the found Node is just a
copied-Node and not the original one.

Any ideas?

Well, one can traverse all the tree and copy every child recursively. Is
there another
solution?

Thank in advance.
David Ostrovsky