
13 Jul
2007
13 Jul
'07
6:57 p.m.
On 13/07/07, Phil Endecott <spam_from_boost_dev@chezphil.org> wrote:
Stefan Seefeld wrote:
Phil Endecott wrote:
For example, I might need to efficiently find all the <foo> nodes in a large tree. How would I do that with your library?
You'd do an XPath query.
I'm pretty sure that libxml2 would visit every node in the tree to do that. With XSLT you can use the "key" mechanism to make this more efficient, but XPath alone doesn't get you that.
No, but it's *very* easy to write a bit of code to do that - I've done so today, using Stefan's code. Also - when libxslt builds the key, it will more than likely run an XPath query to gather the nodes that are indexed. Remember - libxslt is built on top of libxml2's XPath implementation. Stuart Dootson