Re: [xml] XPath, namespaces and no results. :(



On Tue, Mar 15, 2005 at 11:57:26AM +0000, Arthur Yarwood wrote:
   xmlChar player1Path[] = "/MELODY/TRACK[ Name='Player1']";
[...]
   int foo = xmlXPathRegisterNs(context, BAD_CAST "", BAD_CAST 
[...]
Otherwise any other ideas on what I'm doing wrong?

  Your problem is that you don't understand XPath namespaces ...
The FAQ entry
    http://xmlsoft.org/wiki/index.php?title=Libxslt:FAQ
is quite clear in my opinion, and you're not following the suggestions !

xmlChar player1Path[] = "/foo:MELODY/foo:TRACK[ Name='Player1']";
int foo = xmlXPathRegisterNs(context, BAD_CAST "foo", BAD_CAST "http://www.foo.com";);


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]