You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Kohli, Naveen" <NK...@CriticalSites.com> on 2003/04/11 17:36:30 UTC

cloneNode

I am trying to extract couple of nodes from a given XML document and put
them in a new document. I got the nodes from the source doc and called
cloneNode(true) to do a deep copy. When I tried to append the clone node to
new document, it throws exception [WRONG_PARENT_DOCUMENT] something like
that..... How can this be accomplished. Is there a way to modify the
document of cloned node.

Thanks,
Naveen

Re: cloneNode

Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Kohli," == Kohli, Naveen <NK...@CriticalSites.com> writes:

    Kohli,> I am trying to extract couple of nodes from a given XML
    Kohli,> document and put them in a new document. I got the nodes
    Kohli,> from the source doc and called cloneNode(true) to do a
    Kohli,> deep copy. When I tried to append the clone node to new
    Kohli,> document, it throws exception [WRONG_PARENT_DOCUMENT]
    Kohli,> something like that..... How can this be accomplished. Is
    Kohli,> there a way to modify the document of cloned node.

You need to use importNode.
-- 
Colin Paul Adams
Preston Lancashire

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org