XPath expressions with a SAX parser

Luis Motta Campos luismottacampos at yahoo.co.uk
Tue Mar 13 09:04:19 GMT 2007


On Mar 13, 2007, at 9:22 AM, Nik Clayton wrote:
> 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.

   Have you looked at http://search.cpan.org/~mirod/XML-DOM- 
XPath-0.13/XPath.pm ?

--
Luis Motta Campos is a software engineer,
perl fanatic evangelist, and amateur {cook, photographer}




More information about the london.pm mailing list