Hi all (third attempt to get complete message over),

I have the following schema which I use with the Source Code Generator:
<element name="Position" >
        <complexType>
                <sequence>
                        <element name="Coordinate" type="CoordinateType"  minOccurs="1"
maxOccurs="1" />
                </sequence>
        </complexType>
</element>


<simpleType name="CoordinateType">
        <restriction base="xsd:integer">
                <minInclusive value="1"/>
                <maxInclusive value="100"/>
        </restriction>
</simpleType>


which correctly creates the validation as follows
(PositionDescriptor.java):

 //-- validation code for: _coordinate
        fieldValidator = new FieldValidator();
        fieldValidator.setMinOccurs(1);
        { //-- local scope
            IntegerValidator iv = new IntegerValidator();
            iv.setMinInclusive(1);
            iv.setMaxInclusive(100);
            fieldValidator.setValidator(iv);
        }
        desc.setValidator(fieldValidator);


However, I need to have the Coordinate element to be unbounded .. eg:
<element name="Position" >
        <complexType>
                <sequence>
                        <element name="Coordinate" type="CoordinateType"  minOccurs="1"
maxOccurs="unbounded" />
                </sequence>
        </complexType>
</element>

unfortunately, the validation then is removed from the resulting java
file eg:

 //-- validation code for: _coordinateList
        fieldValidator = new FieldValidator();
        fieldValidator.setMinOccurs(0);
        desc.setValidator(fieldValidator);


Thus no validation for the CoordinateType !!!!



Any suggestions on how to resolve this will be much appreciated !

Thanks.

Dr. Louis Coetzee

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to