Re: [xml] Copy properties and namespaces



On Fri, Feb 09, 2007 at 07:13:26PM -0800, Yong Chen (yongche) wrote:

Hi,

I've a question regarding copying one node's properties and namespaces.

First, I want to copy all properties of node A to B, is it correct to do
following?

                B->properties=xmlCopyPropList(B, A->properties)


Then, I also know that node A has several namespaces defined (such as
xmlns:first="www.first.com" xmlns:second="www.second.com"), I want to
copy all of them to node B, should I do both of following?

               B->ns=xmlCopyNamespaceList(A->ns);
And
               B->nsDef=xmlCopyNamespaceList(A->nsDef);


  yes, in libxml2 they are separate kind of objects,

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]