Re: parsing a huge xml document

Liam Quin <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
On Thu, Sep 10, 2009 at 01:21:41PM +0200, Jenda Krynicky wrote:
> From: subs subs <[email protected]>
> > Iam new to perl-xml parsing. I need to parse a huge xml document (about 4gb)
> > Can anybody suggest which perl module will be efficient in terms of memory
> > and speed
> 
> Depends on what do you mean by "parse". I mean, sure you want to 
> extract the tags and their attributes and contents, but what then?

Jenda askes better questions than I did...

> Anyway, Mirod already advertised his XML::Twig, so I'll likewise 
> advertise mine XML::Rules. If you need to skip parts of the XML, 
> tweak the structure generated from other parts and handle (whatever 
> that means) the parts as soon as they are parsed, XML::Rules can 
> help.
Interesting!

Others have mentioned that SAX is slow (although I think one of
SAX readers is based on libxml and shouldbe quite fast), and
that the documentatoin is needlessly difficult and obscure, which
I'd 100% agree with.  But, note that SAX gives you a callback at
the start & end of each element, etc., and does not store th
document in memory, if htat's an issue.

Liam

-- 
Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin/
http://www.holoweb.net/~liam/ * http://www.fromoldbooks.org/
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.