Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Getting started with XML

by Molt (Chaplain)
on Jul 25, 2005 at 09:15 UTC ( #477729=note: print w/replies, xml ) Need Help??

in reply to Getting started with XML

I appreciate I'm going against a lot of previous recommendations here, but I really don't think module::XML::Simple is that simple. Whilst the interface is nice and simple the actual Perl data structure that comes back can seem amazingly crufty, with things changing from scalars to array refs when there's more than one subnode, and othersuch trickery. I ended up giving up on this for that reason, I appreciate though that others do have different opinions on this (Re: Vi vs. Emacs) so just take this as an alternate view.

My personal recommendation for handling XML, regardless of your initial level of proficiency, is XML::LibXML. This is a very large and complex module, and can be a nightmare to get working due to it having a C library dependancy (libxml, oddly enough). Where it does shine is by providing a simple interface to XPath in the XML::LibXML::node::findnodes() command. XPath is the only technology I've seen which makes pulling out stuff far down an XML structure easier than pulling teeth. Another, possibly lesser, advantage is that if you should ever now need to do some heavier-duty stuff in XML you have experience in one of the most adaptable XML modules- less retraining time.

You may also want to have a look at the "Perl and XML" book by the shiny O'Reilly people if you're thinking you'll end up doing a lot of XML, it's a thin book but it does allow you have an overview of a lot of different approaches.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://477729]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2023-03-24 17:06 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (61 votes). Check out past polls.