<xs:simpleType name="t_date"> <xs:restriction base="xs:string"> <xs:pattern value="\d{4}(\-(0[1-9])|(1[0-2])(\-(0[1-9])|([12][0-9])|(3[01]))?)?"/> </xs:restriction> </xs:simpleType>