Jos Snellings wrote:
Hmmm, I guess the XPath expression is known before the parsing begins?
I remember I have done a similar thing, where a chunk had to be isolated
from a document that came by via a SAX stream, but here the xpath
expression was something like: "/element1/elemen...@id=somenumber]".

Theorem: any XPath expression can be evaluated with a SAX filter.
Proof?
Do you know some exceptions?

What about this one : //foo[bar[position() = 3]//baz], find all elements "foo" whose 3rd "bar" child has a "baz" descendent element.

This requires to buffer the contents of every "foo" element to inspect their chidren sub-tree.

Sylvain

--
Sylvain Wallez - http://bluxte.net

Reply via email to