Thanks for the tip!!!

Indeed changing the element length into min-/maxLength worked!
Checked the source code and indeed setLength() sets both the min and max
length 
of the validation.

----------------------------------------------------------------------------
----
        <xsd:element  name="eccnCode"> 
          <xsd:simpleType> 
            <xsd:restriction  base="xsd:string"> 
              <xsd:minLength  value="0"  /> 
              <xsd:maxLength  value="20" /> 
            </xsd:restriction> 
          </xsd:simpleType> 
        </xsd:element> 
----------------------------------------------------------------------------
----



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]]
> Sent: vrijdag 12 april 2002 15:57
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] xsd:string -> xsd:length results in a
> ValidationException: "strings of this type must have a length of 20"
> 
> 
> Have you tried using something like this?
> 
>             <xsd:element name="eccnCode">
>                <xsd:simpleType>
>                   <xsd:restriction base="xs:string">
>                      <xsd:minLength value="15"/>
>                      <xsd:maxLength value="20"/>
>                   </xsd:restriction>
>                </xsd:simpleType>
>             </xsd:element>
> 
> -----Original Message-----
> From: Verhagen, Tjeerd [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 12, 2002 7:17 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] xsd:string -> xsd:length results in a
> ValidationException: "strings of this type must have a length of 20"
> 
> 
> XML Schema:
> --------------------------------------------------------------
> ----------
> ----
> ----
>         <xsd:element  name="eccnCode">
>           <xsd:simpleType>
>             <xsd:restriction  base="xsd:string">
>               <xsd:length  value="20"/>
>             </xsd:restriction>
>           </xsd:simpleType>
>         </xsd:element>
> --------------------------------------------------------------
> ----------
> ----
> ----
> 
> The value bean toString():
> 
>   eccnCode: "AABBCCDD"
> 
> Why gives this an exception when I do a valueBean.validate()? 
> 
>   ValidationException: "strings of this type must have a length of 20"
> 
> I thought that this length restriction represent the maximum 
> length? And
> not
> also the minimum length?
> 
> 
> Tjeerd
> 
> This e-mail and any attachment is for authorised use by the intended
> recipient(s) only.  It may contain proprietary material, confidential
> information and/or be subject to legal privilege.  It should not be
> copied, disclosed to, retained or used by, any other party.  
> If you are
> not an intended recipient then please promptly delete this e-mail and
> any attachment and all copies and inform the sender.  Thank you.
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 



This e-mail and any attachment is for authorised use by the intended recipient(s) 
only.  It may contain proprietary material, confidential information and/or be subject 
to legal privilege.  It should not be copied, disclosed to, retained or used by, any 
other party.  If you are not an intended recipient then please promptly delete this 
e-mail and any attachment and all copies and inform the sender.  Thank you.

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

Reply via email to