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??
Dear Monks:

I have some data in XML format:
<job_def> <entry name="DCMAKE"> <option name="QUEUE">batch</option> <option name="RAM">100</option> <option name="LICENSE"> <member> <arg name="NAME">qhvsim</arg> <arg name="NUMBER">1</arg> <arg name="DURATION">2</arg> </member> <member> <arg name="NAME">synopsys</arg> <arg name="NUMBER">1</arg> <arg name="DURATION">3</arg> </member> </option> <option name="RUN_OS"> <member>SUNSOL_58</member> <member>LINUX72</member> </option> </entry> </job_def>

I need to process the above data using some Perl XML parser with the following constraints:
1) I have certain checks that I need to apply on the above data (using DTD).
2) Also, in the above example the user may or may not give certain "arg" names and values for example "NUMBER". In that case I need to take some default value (present in the XML file itself).
3) Also, as can be seen above I need a parser which supports different structures for different "options". For example: option QUEUE takes a scalar value, option LICENSE takes a hash-like structure and option RUN_OS takes an array-like structure.

I was using XML::Simple until now, but that doesn't do anything about DTD nor about default values. My question to you wise monks is how do I go about chossing the XML parser/checker with the above constraints. Any specific names will be greatly appreciated.
Best regards,

In reply to XML reader and checker by SmilingBuddha

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 chilling in the Monastery: (4)
As of 2022-09-29 11:14 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (125 votes). Check out past polls.