Re: [xml] Crashes trying XPath stuff with Python bindings
- From: Gary Coady <gary lyranthe org>
- To: Andreas Pakulat <apaku gmx de>
- Cc: xml gnome org
- Subject: Re: [xml] Crashes trying XPath stuff with Python bindings
- Date: Fri, 09 Jun 2006 18:55:29 +0100
Andreas Pakulat wrote:
Hi,
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
doc=libxml2.parseFile('/home/andreas/temp/file1.xml')
xpath=libxml2.xpathContext(doc)
result=xpath.xpathEvalExpression('//body')
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')
Gary.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]