Re: [xml] xpathEval and namespaces
- From: Daniel Veillard <veillard redhat com>
- To: Jos Vos <jos xos nl>
- Cc: xml gnome org
- Subject: Re: [xml] xpathEval and namespaces
- Date: Tue, 14 Sep 2004 08:04:00 -0400
On Tue, Sep 14, 2004 at 12:47:43PM +0200, Jos Vos wrote:
With this even docroot.xpathEval('/head') gives an empty nodeset back
(docroot is my root node object), while it works fine when I remove
the namespace attributes.
that's normal /foo does not select namespaced nodes, it's the XPath spec.
It's probably #1 FAQ for XPath. As explained dozens of time you must
bin a prefix to that namespace in the XPath context and use the prefix in
the query. I don't remember if/how it's doable from Python.
Daniel
--
Daniel Veillard | Red Hat Desktop team 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]