Menu

#6 Simple validation

open
nobody
5
2007-02-13
2007-02-13
Anonymous
No

I would like to see more validation config in XML mapping if possible like
<?xml version='1.0'?>
<!DOCTYPE PZMAP SYSTEM
"http://pzfilereader.sourceforge.net/pzfilereader.dtd" >
<PZMAP>
<COLUMN name="FIRSTNAME" require="true" maxlenght="15"/>
<COLUMN name="LASTNAME" require="true" maxlenght="15"/>
<COLUMN name="ADDRESS" require="true" maxlenght="40"/>
<COLUMN name="CITY" require="true" maxlenght="20"/>
<COLUMN name="STATE" require="true" maxlenght="2"/>
<COLUMN name="ZIP" require="true" maxlenght="9"/>

</PZMAP>

Discussion

  • Paul Zepernick

    Paul Zepernick - 2007-02-13

    Logged In: YES
    user_id=1028753
    Originator: NO

    Hi,

    Thank you very much for the suggestion. What do you think should happen if a record were not not validate? Would you recommend adding it to the current error collection, or have a separate collection of errors for these? Would these then be excluded from the DataSet?

    Thanks for your interest in PZFileReader!

    Thanks,

    Paul Zepernick

     
  • Nobody/Anonymous

    Logged In: NO

    Maybe add a defaultvalue if it is empty
    <COLUMN name="ZIP" require="true" maxlenght="9" defaultvalue="00000"/>

     
  • Nobody/Anonymous

    Logged In: NO

    I would think that the validation error to current error collection would efficient. I would add another method isAnError() and user default current row.

    By the way I love PZFileReader

     

Log in to post a comment.