Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


In reply to Re: Getting started with XML by Molt
in thread Getting started with XML by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found