Re: [xml] Namespace equality with Python bindings



On Tue, Aug 12, 2003 at 10:40:48PM -0400, Anthony Carrico wrote:
In libxml2 with Python bindings, what is the proper way to check for
xmlNS equality? Is a pointer compare possible?
  no

Is a string compare necessary? Is it like this?:

  yes

ns = root.searchNsByHref(doc, "http://blahblah";)
ns.content == root.ns().content

Is this kind of "semantic" issue documented someplace?

  yes in the code ! all the node objects at the python level
are wrappers objects around the internal C objects. The comparison
must be done between the C objects, the python ones are allocated
on the fly.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
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]