Re: [xml] Setting a context from a patricular node



-----Original Message-----
From: xml-bounces gnome org [mailto:xml-bounces gnome org] On Behalf
Of
Abhishek Jain
Sent: Wednesday, November 07, 2007 3:22 PM
To: xml gnome org
Subject: [xml] Setting a context from a patricular node

Hi,

I want to set the xmlXPathContext from a particular node say
xmlNodePtr
node1 in a xmlDocPtr doc so that my XPath is evaluated in the subtree
of
node1.

Please let me know how can i do that.

While I'd be more comfortable if I could find this documented, so far as
I can tell the recommended approach is to set the "node" field of the
xmlXPathContext, i.e., context->node = node1; in your case.

I'd also note that some library calls will change the node, so you
should reset it before reusing a context.

-- James




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