Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

In this case XML::Simple will not work, as your XML includes mixed content (text with tags inside, such as <p>foo <b>bar</b> baz</p>).

To make sense of the various XML modules you can have a look at Kip Hampton's excellent column on, look at my old Processing XML with Perl article or start hanging out on the perl-xml mailing list.

The recent trend in XML processing with Perl is to move away from XML::Parser based modules and to use more modules based libXML 2, the GNOME XML library. That said a lot of the "good ole" XML modules would work just fine in your case: XML::Parser of course, but also XML::Twig (of course!), probably XML::PYX, as suggested by Davorg XML::XPath would work too, and XML::DOM would work too (if you decide to use it you might want to check out XML::DOM::Twig).

BTW the reason XML::Parser is sortta frowned upon these days is that it has a non-standard interface (newer modules use standard SAX or DOM interfaces, XML::Parser predates both). Those interfaces are sounder and more common, which means that for example you can read CSV data and process it with XML tools if you use a CSV parser with a SAX output such as Illya Strin's XML::SAXDriver::CSV .

Last but not least Matt Sergeant would kill me if I failed to mention his new XML::SAX::PurePerl, which is, surprisingly, a SAX parser written in pure Perl, which means you don't have to install external libraries such as expat or libXML 2, which can be a pain on some systems.

In reply to Re: XM-Hell by mirod
in thread XM-Hell by Chady

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 or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2021-11-27 21:35 GMT
Find Nodes?
    Voting Booth?

    No recent polls found