Re: [xml] XPath and namespaces

On Thu, Apr 01, 2004 at 06:20:51PM +0200, Petr Novak wrote:
I read at
that it can be solbed by xmlXPathRegisterNs(). So I tried

  xmlXPathRegisterNs(context, NULL, "";);
  xmlXPathRegisterNs(context, "", "";);

(because I don't use prefix), bud it still not works. What am I doing

  Because as XPath is specified the name foo will *never* match 
an element (or attribute) named foo in a namespace. Read the XPath
spec that's defined there, I pointed it in the list at least a dozen
time already I'm sure. You must set a prefix in the XPath and register
the prefix.


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]