A datatype of textDateType is considered to be an undesirable choice for dates. However, it is included for those who wish to use non-standard date formats. The other two date types are parsedDateType, which declares a date with separate year, month, day tags, and isoDateType, which uses the ISO 8601 standard format.
The textDateType is a free format string with a mandatory type attribute. It is strictly up to the application program to interpret the type attribute and to be able to parse the text string if necessary.
This datatype was developed to support the use of non-standard date formats, such as the American format of mm/dd/yy or the European format of dd/mm/yy.
<xsd:complexType name="textDateType"> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute name="type" type="xsd:string" use="required"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType>
<xsd:element name="SpudDate" type="textDateType"/>
<xsd:element name="CompletionDate>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="USDate" type="textDateType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<SpudDate type="USFormat">4/22/99</SpudDate>
<CompletionDate>
<USDate type="dd/mm/yy">6/3/99</USDate>
</CompletionDate>