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