W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

custom date type in xml schema

From: Hanna <lhnhanna@hotmail.com>
Date: Thu, 6 Feb 2003 12:36:06 +0800
To: <xmlschema-dev@w3.org>
Message-ID: <OE37vcTAcGlVADHpc0000006f83@hotmail.com>
Dear all,
         I would like to ask how to customize date type such as MM-DD-CCYY, or YY/MM/DD instead of the default CCYY-MM-DD in schema. 
        I have tried the following but the validation result is that the date value is invalid.
        Please help.
xsd:
<simpleType name='mydatetype'>
        <restriction base='date'>
            <pattern value='MM-DD-CCYY'/ >
        </restriction>
</simpleType>

xml:
      <birthday>10-29-2002</birthday>
Regards,
Hanna
Received on Thursday, 6 February 2003 01:26:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT