Thanks Daniel. My test shows that for copying namespaces, I only need to
do: 

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

And I don't need to do following:

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


So what's the difference between "ns" and "nsDef" of a node?

Thanks,
Yong Chen


> -----Original Message-----
> From: Daniel Veillard [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 09, 2007 11:51 PM
> To: Yong Chen (yongche)
> Cc: [email protected]
> Subject: 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/
> [EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  
> http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search 
> engine  http://rpmfind.net/
> 
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to