The project started this Tuesday.
I started with converting the structure of the XML data into Perl hash using XML::Simple. Also, the data structure could serve as the validation data.
Consider this XML data:
<Order>
<Number>01234</Number>
<Status>OPEN</Status>
</Order>
Converting the XML to Perl hash using XML::Simple (with KeepRoot => 1) yields:
The hash structure could be manipulated as validation data:$VAR1 = {
'Order' => {
'Status' => 'OPEN',
'Number' => '01234'
}
};
Iterating through the data structure to extract the data and the SQL statement to extract content from database, it is feasible to validate the entire XML structure provided a validation data with similar structure using an algorithm.$VAR1 = {
'Order' => {
'Status' => 'SELECT Status FROM Order WHERE ORDER_ID = <value>',
'Number' => 'SELECT OrdNum FROM Order WHERE ORDER_ID = <value>'
}
};
No comments:
Post a Comment