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: Harindranath P R [mailto:[EMAIL PROTECTED]]
Sent: zaterdag 13 april 2002 8:03
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"


Use maxLen to set a maximum length 
 Regards, 
- Hari. 
-- 
+----------------------------------------------------+ 
| Harindranath P. R.                                 | 
+----------------------+-----------------------------+ 
|Alopa Networks Inc.   | phone: +91-80-6618004 (O)   | 
|Santa Clara, USA,     |        +91-80-6768714 (R)   | 
|Bangalore, India      | fax:   +91-80-6618057       | 
|http://www.alopa.com/ | email: [EMAIL PROTECTED]  | 
+----------------------+-----------------------------+ 


-----Original Message----- 
From: Verhagen, Tjeerd [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 12, 2002 5:47 PM 
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 



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