I am creating a script which will execute jobs and log their status in a database.

In an effort to make it extensible I want to be able to define the structure of the jobs in XML and then have Perl read the XML template, multiply parts of the XML for as many devices as needed and then create specific entries in the database for each level of the job structure.
(Example XML below shows we will create entries for BATCH, BATCH SECTIONS, JOB_SECTIONS, JOBS)

I'm still learning XML and could do with some help deciding on which approach to use amongst the myriad XML modules out there. I'm thinking Template Toolkit to generate the XML and then perhaps DBIx::XML::DataLoader to get the data into the database.

<?xml version="1.0" encoding="UTF-8"?> <BATCH Name Of The Batch JOB=""> <BATCH_SECTIONS> <UPLOAD> <Dependent_On/> <Section_ID/> <JOB_SECTIONS> <SWITCH_NAME_1> <JOBS> <JOB> <ID/> <TYPE>UPLOAD</TYPE> <SUBTYPE>TNB</SUBTYPE> </JOB> <JOB> <ID/> <TYPE>UPLOAD</TYPE> <SUBTYPE>SLT</SUBTYPE> </JOB> <JOB> <ID/> <TYPE>UPLOAD</TYPE> <SUBTYPE>USAGE</SUBTYPE> </JOB> </JOBS> </SWITCH_NAME_1> </JOB_SECTIONS> </UPLOAD> <PARSE/> <QUERY/> </BATCH_SECTIONS> </BATCH>

janitored by ybiC: Balanced <readmore> tags around example XML


In reply to XML Direction Needed by set_uk

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.