<xs:simpleType name="LanguageType"> <xs:restriction base="xs:string"> <xs:minLength value="2"/> <xs:maxLength value="3"/> <xs:pattern value="[a-z]{2,3}|[A-Z]{2,3}"/> </xs:restriction> </xs:simpleType>