The last is my point.
Doing
//sometag/someothertag[athirdtag/@someattr='foobar']/afourthtag/text()
in SAX would require a lot more code than just a selectSingleNode
call.
But that wouldn't even be SAX - it's an entirely different universe. I
know that's your point, but it leaves me confused. If you use SAX,
there wouldn't even be a need to search - everything would already be
right where you could find it. The whole question of searching would
never even come up.
That is one of the advantages of SAX over DOM. With DOM, you have this
huge memory structure that you have to search with XPath expressions
that are hard to figure out and run really slowly. With SAX you read
things right into an object model where you don't have to look for
things, and you can access them directly. Searching is irrelevant.