Does reading XML data like in the following code create the DOM tree in memory?
my $xml = new XML::Simple;
my $data = $xml->XMLin($blast_output,ForceArray => 1);
For large XML files should I use a SAX parser, with handlers, etc.?
For large XML files, you can either use XML::LibXML, in DOM mode if the document fits in memory, or using the pull mode (see XML::LibXML::Reader) or XML::Twig (which I wrote, so I'm biased, but it works generally well for files that are too big to fit in memory).
I am not a fan of SAX, which is hard to use and in fact quite slow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With