XML Data validation in Perl

K

krishna

I have an XML file like....

<DateCreated>
<Year>2000</Year>
<Month>09</Month>
<Day>25</Day>
</DateCreated>
<DateCreated>
<Month>10</Month>
<Day>28</Day>
</DateCreated>

I need to validate all the elements between <DateCreated> and
</DateCreated> each time.ie I want to read the first set of records
<DateCreated>
<Year>2000</Year>
<Month>09</Month>
<Day>25</Day>
</DateCreated>
Validate it. If they look good ie - Year/Month/Day elements preset,
then write them out to a file.

Then read the next set
<DateCreated>
<Month>10</Month>
<Day>28</Day>
</DateCreated>

Validate it. It set is malformed ie - Year/Month/Day any one tag
missing, I need to toss that out, and continue reading the next set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top