You can always define it as a limited simple string-based type limited by a regular expression:
<xs:simpleType name="FormattedDateType"> <xs:restriction base="xs:string"> <xs:pattern value="\d{8}"/> </xs:restriction> </xs:simpleType>
If you want to become really smart, you can configure the regular expression to be even more suitable for the date (for example, it contains information that the month can only be 01-12, etc.):
<xs:simpleType name="FormattedDateType"> <xs:restriction base="xs:string"> <xs:pattern value="\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])"/> </xs:restriction> </xs:simpleType>
Mark
marc_s
source share