Just forwarding this to the user mailöing list as well ...
 
Werner

________________________________

        From: Vinodh Rajaraman (vrajaram) [mailto:[EMAIL PROTECTED] 
        Sent: Mittwoch, 10. Mai 2006 08:20
        To: dev@castor.codehaus.org
        Subject: [castor-dev] XSD validation
        
        
         
        Hi, 
         
        I am using Castor Source generator for a XSD which has an entry as 
follows:
         
                <xs:element name="device_name" nillable = "false" 
type="xs:string" />
         
                I wanted to ensure that the the entry device_name is not 
"empty", or not "white space characters". so i introduced this "nillable = 
false" after googling. However the code for checking null is not generated by 
Castor. So i added the code as below for validation? Will castor not generate 
such checks? or am i doing sth wrong here? 
         
        Kindly help me out. 
         
        However, the code generated for validation, is as follows:  

        fieldValidator.setMinOccurs(1);
                { //-- local scope
                    StringValidator typeValidator = new StringValidator();
                    typeValidator.setWhiteSpace("preserve");
                    //added by me
                    typeValidator.setMinLength(1);
                    
                    fieldValidator.setValidator(typeValidator);
                }
                desc.setValidator(fieldValidator);

        Cheers

        Vinodh

        

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to