You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Balchandra Kemkar <bk...@cadence.com> on 2007/05/11 07:06:20 UTC

Problem in adoptNode function

Hi,
 
 
Whenever I use adoptNode function, it throws an exception
"NOT_SUPPORTED".
In net at many places I found that adoptNode is not implemented fully.
 
Is there any other way to change the owner document of the DOM node?
I cant use importNode as it creates a copy of the DOM node.
 
In my code I want to change the owner document of a DOM node without
copying it.
 
 
Regards,
Bala

Re: Problem in adoptNode function

Posted by David Bertoni <db...@apache.org>.
Balchandra Kemkar wrote:
> Hi,
>  
>  
> Whenever I use adoptNode function, it throws an exception
> "NOT_SUPPORTED".
> In net at many places I found that adoptNode is not implemented fully.
>  
> Is there any other way to change the owner document of the DOM node?
> I cant use importNode as it creates a copy of the DOM node.
>  
> In my code I want to change the owner document of a DOM node without
> copying it.

Because of the way the Xerces-C DOM implements memory management, it's not 
possible to implement DOMNode::adoptNode() completely.  In particular, as 
you've discovered, you cannot use adoptNode() to change ownership of a node 
from one document to another.

Dave