Re: Xpath
Nick Wellnhofer <[email protected]> Mon, 10 Dec 2012 14:58:18 +0100
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
On 10/12/2012 14:35, Tod Harter wrote:
> If you have a large document and need high performance, say if you need
> to do this transform on a huge file on a repetitive basis, then you may
> want to delve into SAX.
I found the SAX parser of XML::LibXML rather slow compared to parsing
whole document trees and using XPath. That's primarily because there is
a lot of back-and-forth between Perl and C code.
Also note that when using XML::LibXML, there's a third option: a pull
parser based on libxml2's xmlTextReader. See
https://metacpan.org/module/XML::LibXML::Reader
It's faster than the SAX parser and like the SAX parser, it's suitable
for large documents.
Nick
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs