Re: Xpath

Francisco Obispo <[email protected]> Sun, 9 Dec 2012 20:39:50 -0800
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
On Dec 9, 2012, at 8:14 PM, Stephen Wilcoxon <[email protected]> wrote:

> XML::LibXML::SAX seems to be fairly poorly documented (but that's true of all of XML::LibXML).
> 


I have not had problems with XML::LibXML's documentation.


> I would discourage the use of a DOM parser as it reads everything into memory so suffers performance issues as documents get larger (and can run out of memory).  If I'm going to read everything into memory, I just use XML::Simple.
> 

It all depends on the use you have, if its large documents, I would encourage a SAX-based parser, XML::Parser::ExpatXS, which is really fast. If its small documents, The DOM interface will work just fine, specially when you need to perform validation (DTD, Schema, RelaxNG, etc.).

With the DOM doc in memory you can perform XPath searches, which is fast, again for small docs.

You might also want to take a look at XML::Rabbit, which uses Moose and allows you to build Perl objects from XML docs.

Any of these approaches will work for you, you would have to share some of your requirements for me to give you more guidance.. is it performance? code readability/maintainability ? system constraints?




Francisco Obispo 
Director of Applications and Services - ISC
email: [email protected]
Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
PGP KeyID = B38DB1BE

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs