Re: [xml] Using Xpath with default namespace and null prefix

On Tue, Feb 09, 2010 at 04:07:06PM +0100, François Delyon wrote:
  /* valid example */
  exsltStrXpathCtxtRegister(ctxt, NULL);
xmlXPathRegisterNs(ctxt, "str", "";);
xmlXPathEval((const xmlChar *)"str:concat(n)", ctxt);

Now calls <>.

exsltStrXpathCtxtRegister(ctxt, NULL) must occur once when I create
the context.
But the NSregistrations and the Xpath evaluations are up to the
users of my application.

I am not a user of xmlint, but I suppose that the same problem occurs.

  Well xmllint uses only libxml2 and not any of libxslt nor libexslt
xmlXPathRegisterNs is only used if you use the --shell option and use
setns command to registed a namespace for XPath evaluation.


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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