Re: [xml] XPath on a subtree




On 23 Mar 2013, at 13:54, Daniel Veillard wrote:

 I though I had added a macro but searched for it an no it's not there.
In the python bindings there is an extra function called

libxml2mod.xmlXPathSetContextNode()

That was what I was thinking of, but ...

xmlXPathObjectPtr
xmlXPathNodeEval(xmlNodePtr node, const xmlChar *str, xmlXPathContextPtr ctx)

as a simple wrapper around xmlXPathEval

... that would be equally useful.

actually it's good to set the doc too at that point before reusing
the context in the loop.

     ctxt->doc = doc;

Isn't the doc set when you create the context? xmlXPathNewContext takes
a doc ptr.

-- 
Alex Bligh






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