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,
SB


In reply to XML reader and checker by SmilingBuddha

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.