XPath expressions with a SAX parser

mirod mirod at xmltwig.com
Thu Mar 15 08:54:48 GMT 2007

Nik Clayton wrote:
> dakkar wrote:
>> Nik Clayton wrote:
>>> 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).
>> XML::Twig. Really, try it. mirod wrote it exactly to handle very large
>> documents, and to use XPath expressions on them.
> Thanks for the pointer.  It's a bit weird that the preferred approach to 
> halting a parse when all the necessary data has been retrieved is 
> die-wrapped-in-eval, but I can live with that.

I suppose I could mask this by adding (yet another!) method, like
stop_parsing or finish_NOW or something, that would do that without the
calling code needing to know about it. Would that make sense?


More information about the london.pm mailing list