You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Kasun Indrasiri <ka...@gmail.com> on 2008/02/13 06:02:30 UTC

Issue in using 'detach' for cloning

Hi,

-There is an issue in axiom_node_detach function which is related to
namespaces. Once we detach a child node from a root node
 and then free the allocated memory for root node, the associated
namespace for the detached node is also freed.

 For e.g. If we try to axiom_node_to_string -> it prints 'null' . But we can
get any other attribute (local name or text) from the detached node.

- And also for cloning nodes, we should have a better approach than
'detach'. Because, detach remove the node from the original node.

Thanks,

Kasun

Re: Issue in using 'detach' for cloning

Posted by Samisa Abeysinghe <sa...@wso2.com>.
Dinesh Premalal wrote:
> Hi Kasun,
> "Kasun Indrasiri" <ka...@gmail.com> writes:
>   
>>  For e.g. If we try to axiom_node_to_string -> it prints 'null' . But we can
>> get any other attribute (local name or text) from the detached node.
>>
>> - And also for cloning nodes, we should have a better approach than 'detach'.
>> Because, detach remove the node from the original node.
>>     
>
> I think we better implement cloning method for axiom_node. Could you
> please raise a jira with the description of the problem?
>   

We have discussed this before, however, I cannot locate the threads. 
Practically, it is impossible to implement cloning for an axiom_node. 
Because, all the linked lists would have to be cloned. That includes all 
children and their namespaces and attributes. Just have a look at the 
current implementation of axiom_node and you would sure to realize the 
complexities of cloning.

Samisa...


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


Re: Issue in using 'detach' for cloning

Posted by Senaka Fernando <se...@wso2.com>.
Hi Kasun, and Dinesh,

How about serializing the node and deserializing the node? This would not
cause issues with especially having to clone namespaces etc. We could get
the output string and then create an xml_reader and parse it and get the
cloned copy. Thoughts?

Regards,
Senaka

> Hi Kasun,
> "Kasun Indrasiri" <ka...@gmail.com> writes:
>>  For e.g. If we try to axiom_node_to_string -> it prints 'null' . But we
>> can
>> get any other attribute (local name or text) from the detached node.
>>
>> - And also for cloning nodes, we should have a better approach than
>> 'detach'.
>> Because, detach remove the node from the original node.
>
> I think we better implement cloning method for axiom_node. Could you
> please raise a jira with the description of the problem?
>
> thanks,
> Dinesh
>
> --
> http://nethu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>


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


Re: Issue in using 'detach' for cloning

Posted by Dinesh Premalal <xy...@gmail.com>.
Hi Kasun,
"Kasun Indrasiri" <ka...@gmail.com> writes:
>  For e.g. If we try to axiom_node_to_string -> it prints 'null' . But we can
> get any other attribute (local name or text) from the detached node.
>
> - And also for cloning nodes, we should have a better approach than 'detach'.
> Because, detach remove the node from the original node.

I think we better implement cloning method for axiom_node. Could you
please raise a jira with the description of the problem?

thanks,
Dinesh

-- 
http://nethu.org

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