XML Data validation in Perl

Discussion in 'Perl' started by krishna, Jul 17, 2003.

  1. krishna

    krishna Guest

    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.
    krishna, Jul 17, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page