Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Working with XML

by cjf (Parson)
on Mar 17, 2002 at 20:13 UTC ( [id://152345]=perlquestion: print w/replies, xml ) Need Help??

cjf has asked for the wisdom of the Perl Monks concerning the following question:

I'm starting a inventory update system project and I'm looking at options for manipulating XML data. I've already decided on Perl for the project, but I'm not sure which modules I should be using.

I will be both parsing and writing what should be fairly simple XML documents that will easily fit into memory. I'm not concerned with any learning curve, so the simplicity of XML::Simple or the complexity or other modules, is not really an issue to me. However, speed is an issue, obviously the faster the better.

I did a search here and came across mirod's reviews of XML::Simple and XML::Parser. These seem to be by far the most mentioned modules on the site, but a search on CPAN turns up many other related modules. Are there other modules I should be looking at? Which ones do you use, and what do you feel the advantages of them are? Thanks in advance for your replies.

Replies are listed 'Best First'.
Re: Working with XML
by count0 (Friar) on Mar 17, 2002 at 21:12 UTC
    mirod has an excellent overview of processing XML with Perl at his site

    It covers basic concepts of XML, tree vs. stream processing, and (what will probably be most beneficial to you in this case) an overview of many of the most commonly used modules, their pros and cons, etc.
Re: Working with XML
by lestrrat (Deacon) on Mar 17, 2002 at 22:04 UTC
Re: Working with XML
by vek (Prior) on Mar 18, 2002 at 02:21 UTC
    You mention that speed is an issue. I would heartily recommend XML::LibXML over XML::Parser. I had been an XML::Parser user and just recently (for grins) installed XML::LibXML and was very impressed with the performance gains. So much so that I took XML::Parser out of some production code and replaced it with XML::LibXML.
Re: Working with XML
by rjray (Chaplain) on Mar 18, 2002 at 05:38 UTC

    The advantage that XML::Parser has over XML::LibXML is that the former bundles the C-level parser with it (James Clark's expat parser). While XML::LibXML is in fact faster (and supports a real SAX interface layer), it requires the presence of libxml2, which is generally a part of any GNOME-enabled Linux environment, but may not be present on other systems. They can retrieve and install it, of course, but that is an extra step that may deter some people.

    If you have enough control over the environment in your situation to ensure that libxml2 is not a problem, then I would recommend going with XML::LibXML.

    --rjray

      Well, actually since version 2.30 XML::Parser does not include expat anymore, you have to get it from Sourceforge, so I guess we have a tie.

      I should add to the advice already given here that one of the best source of information on Perl and XML is Kip Hampton's column on xml.com.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://152345]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found