Re: [xml] xpathEval and namespaces

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 Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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