Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

acme (189)

acme
  (email not shown publicly)
http://www.astray.com/

Leon Brocard (aka acme) is an orange-loving Perl eurohacker with many varied contributions to the Perl community, including the GraphViz module on the CPAN. YAPC::Europe was all his fault. He is still looking for a Perl Monger group he can start which begins with the letter 'D'.

Journal of acme (189)

Wednesday March 14, 2007
06:12 AM

XML Parsing and Generating

[ #32681 ]
There are a ton of XML libraries on the CPAN but XML isn't as simple as you think. For parsing and generating XML I use and recommend XML::LibXML which wraps a fast and robust C library. For some good examples read the Perl Advent Calendar on XML::LibXML and XML::LibXML - An XML::Parser Alternative.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I agree that XML::LibXML is an excellent module for parsing XML. I tend to steer people towards it [perlmonks.org] when they start dreaming up new features for XML::Simple.

    When generating XML, I almost always use either the Template Toolkit or HTML::Mason.

    • In the true spirit of overkill, I found myself using XML::LibXML *and* XML::Simple in the same program today.

      I needed to validate some XML against a schema so XML::LibXML::Schema helped nicely. But after validation, the data structure provided by XMLin() was *exactly* what I needed so I thought bugger it I'll just use both ;-)

      XML::LibXML and XML::Simple for teh win!
  • I dunno exactly why but whenever I need to do non-trivial XML I keep finding myself going back to XML::SAX.
  • Actually that pretty much sums up the recommended use case for XML::Simple. If what it gives you is exactly what you need then use it. Otherwise use XML::LibXML.