Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

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

Parsing XML??? is amongst several posts I have seen on PerlMonks asking how to extract information from an XML file.

To have an idea on how to perform that kind of common task, you might want to have a look at Ways to Rome, an article I maintain that lists a whole bunch (16 at the time of writing) of ways to do this kind of extraction/reporting.

And please, _DO NOT USE THE REGEXP METHOD_ (was that strong enough?). For your own good.

Note that the article does not include XML::Simple, as the XML document (the XML Spec itself) includes mixed content (and no, I did not choose the document on purpose, in fact I inherited the article from Ingo Macherius ;--). If XML::Simple can process your document, then by all means use it.

Contributions are welcome BTW: a version using an as-generic-as-possible entity pre-processor, or a patch to the module, would allow me to include XML::SAX::PurePerl for example, XML::GDOME and XML::SAX::Machines, or princepawn's favorite could also be added.


In reply to XML Examples (and a call for participation) by mirod

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 avoiding work at the Monastery: (6)
As of 2024-04-24 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found