Re: [xml] xmllint and namespaces

On Fri, Oct 25, 2002 at 10:45:24AM +0200, Stefan Kost wrote:
I don't get it. I read the XPath spec over and over again, but there is nothing 
that convinces me that I am doing something wrong.

  you need to read more then,

before using the context. Now that namespace has a "ns->prefix==NULL", should I 
still attach it or better use
It seems to make no difference. I don't use "xmlXPathRegisterNs()" as there is 
no version of it accepting a xmlNsPtr.

Repeat after me 
 "There is no notion of a default namespace in an XPath query"

As a result libml2 does NOT allot to define a default namespace for
an XPath context. 

<bar xmlns=""/>

cannot be seclected with

it can be selected with
"//foo:bar" when the XPath context contains a namespace binding
for the foo prefix mapping to the namespace name "";.
Just do it ! There is NO other way.


Daniel Veillard      | Red Hat Network
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]