Fw: [xml] filtering a resulting NodeSet with xPath?

It seems that I failed to obtain any attention from the xml gurus... The I must try again.

My doubt is :
- I don't undestand how libxslt implements its capacity of apply a xpath's query over a nodeset (even if this last is a result of another nodeset), since don't exists any API (in xpath.c) that allows to do so. Does the gurus have any pointer to a way to implement this functionality without using an XSLT transformation? Mabye ...

xmlNodeSetPtr nodeSet = evalXpath(doc,"//a");
xmlNodeSetPtr refinedNodeSet = evalXpath(nodeSet,"[ id='3']");

Thank for any help


----- Original Message ----- From: "Agustín Villena" <avillena tutopia com>
To: <>
Sent: Monday, November 22, 2004 9:51 AM
Subject: [xml] filtering a resulting NodeSet with xPath?

I need to implement in a fast way the functionality of filter a nodeset (obtained applying an xPath to an XML), hopefully aplying a new xPath.
The xPath API only applies to and xmlDocPtr, not to and xmlNodeSetPtr...
The XMLs that i need to filter has as many as 100.000 nodes, therefore performence is a must!


<elem id="0">1<elem>
<elem id="1">0<elem>
<elem id="0">0<elem>

First filter
/root/elem[ id="0"]

expected result:
<elem id="0">1<elem>
<elem id="0">0<elem>

Second filter
<elem id="0">1<elem>

This is equivalent to make an XSL that saves the first nodeset in a variable (named for example "result") and apply

Any advice?
xml mailing list, project page  http://xmlsoft.org/
xml gnome org

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