XPath expressions with a SAX parser

Nik Clayton nik at ngo.org.uk
Tue Mar 13 08:22:30 GMT 2007


Morning all,

Is it possible to use XML::XPath (or similar) with a SAX parser?

I'm trying to do is retrieve a (small) subset of elements from an XML 
document (that may be very large).  XML::XPath works when the document 
is small, but fails to scale when the document is very large (even if 
the subset of elements I'm trying to retrieve is a fairly constant size).

I'd like to keep using the XPath syntax (because it's nice and compact), 
rather than write my own SAX event handler (because that will be more code).

Poking around CPAN doesn't show anything useful, although it's possible 
I've missed something given the huge number of XML::* modules available.

N


More information about the london.pm mailing list