Re: [xslt] (no subject)
- From: Noam Postavsky <npostavs users sourceforge net>
- To: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: Re: [xslt] (no subject)
- Date: Thu, 01 Mar 2012 00:40:28 -0500
Phil Shafer <phil juniper net> writes:
> Denis Davidov writes:
>>Create new dict using xmlDictCreate and then fill it with
>> xmlDictLookup - correct?
>
> IIRC the dict is used automagikally.
I seem to remember Daniel Veillard mentioning that this only happens
with the newer xmlReadFile() functions, but not with xmlParseFile().
>
>>Could you show me how could I set my node as the context node? I've
>> tried to replace xmlXPathContextPtr->node with my node, but the
>> program crashed (while my ugly method works fine).
I have an example of this in XMLStarlet [1], it's essentially
xmlNodePtr ctxt_node = ctxt->node; // save original context node
for (i = 0; i < nodes->nodeNr; i++)
{
ctxt->node = nodes->nodeTab[i]; // set new context node
// get result of XPath expression
res = xmlXPathConvertString(xmlXPathCompiledEval(xpath, ctxt));
...
}
ctxt->node = ctxt_node; // restore original context node
[1] http://xmlstar.git.sourceforge.net/git/gitweb.cgi?p=xmlstar/xmlstar;a=blob;f=src/xml_edit.c;hb=1.3.1#l245
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]