RE: [xml] Crashes trying XPath stuff with Python bindings


Have you already looked at lxml? It's built on top of Libxml2/Libxslt
may be easier to handle on the Python side:



-----Original Message-----
From: xml-bounces gnome org [mailto:xml-bounces gnome org] On 
Behalf Of Gary Coady
Sent: Friday, June 09, 2006 7:55 PM
To: Andreas Pakulat
Cc: xml gnome org
Subject: Re: [xml] Crashes trying XPath stuff with Python bindings

Andreas Pakulat wrote:

I'm not sure I'm doing the right thing here, thus I'm not 
(yet) filing a
bugreport. I want to use the python bindings for libxml2 and thus
installed libxml2 (2.6.26) and libxslt (1.1.17). Now doing my first
steps results in crashes of the python interpreter:

import libxml2

I'll have to let somebody else comment on whether that *should* work
(there's no dictionary, so I guess the code should create 
one?), and I'm
not sure if that method is supposed to be used by external users.

But you should be able to get past the problem with

import libxml2
doc = libxml2.parseFile('/home/andreas/temp/file1.xml')
xpath = doc.xpathNewContext()
result = xpath.xpathEvalExpression('//body')

xml mailing list, project page
xml gnome org

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