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

Reply via email to