I'm wondering which XML parser people thing would be best in my situation for Perl. I've done a lot of reading and have tried the XML::LibXML
and XML::SAX
. The first used up too much memory and the second didn't appear to be that quick to me (even after switching off the pure perl parser).
My needs are fairly specific. I am receiving a largish response of up to 50MB via the Net::SSH
library. I would like to pass this data to an XML library as I receive it so as to keep the minimum amount of data in memory. I need to then look for data in certain tags and do whatever with it, in some cases sum a bunch of values, in other cases just extract values and write them to files or whatever. So I need an XML parser that can work serially, works quick and uses the minimum of memory. The data I get is in chunks of up to 1024 bytes so I would like to be able to just do something like $myparser->sendData($mynewData)
and then have functions called when a new tag is opened or closed similar to what XML::SAX
does.
I don't necessarily need XPath or XSLT.