users@jaxb.java.net

Re: max length field validations

From: arun_rocky <arunkumaravel.d_at_cognizant.com>
Date: Sat, 14 Feb 2009 00:41:32 -0800 (PST)

hi wolfgang,

  i like to add these commands in Java beans. for requirement = true i am
using @XmlElement(required=true), so do we have any commands like this for
checking maxLength and minLength of an element. thanks in advance mate..




Wolfgang Laun-2 wrote:
>
> You can define a simpleType like this:
>
> <xsd:simpleType name="ShortNameType">
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="1"/>
> <xsd:maxLength value="3"/>
> </xsd:restriction>
> </xsd:simpleType>
>
> It'll still result in java.lang.String, just like xsd:String. Only
> validation will check your XML's compliance with the min/maxLength facets.
>
> -W
>
>
>

-- 
View this message in context: http://www.nabble.com/max-length-field-validations-tp22010264p22010383.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.