Re: [xml] type of documents is a string??



On Mon, Jun 19, 2006 at 11:37:07PM +0200, Andreas Pakulat wrote:
On 19.06.06 15:48:50, Andreas Pakulat wrote:
On 14.06.06 23:21:12, Andreas Pakulat wrote:
I'm resending this mail, as it seems that the mailing list has come back
to live (I can see the earlier post in the archive, but it never made it
back to me).

I'm using the python bindings of libxml2 2.6.26 and 

doc=libxml2.parseFile('/home/andreas/temp/file1.xml')
print doc.type
document_xml

returns a string and not the expected value libxml2.XML_DOCUMENT_NODE.
Is that right? Am I doing something wrong?

This is even worse, libxml2 "translates" the types to some arbitrary
strings for at least document, element and text nodes and this is not
documented anywhere.

I'm going to file a bug report tomorrow, if there's nobody who can
explain this.

  that's normal. The bindings have been working that way forever.
XML_DOCUMENT_NODE and other node types are internal C values, they 
got exported by the bindings generator but are not accessible from
Python.
  Those 'arbitrary' strings are I think the string I saw the first
time I checked existing XML python bindings so I reused them.

Daniel

-- 
Daniel Veillard      | Red Hat http://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]