W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

Re: IS it possible to have a blank date element

From: Stefan Wachter <Stefan.Wachter@gmx.de>
Date: Wed, 20 Nov 2002 18:21:13 +0100 (MET)
To: helen.mauger@rawlinson-hunter.gg
Cc: xmlschema-dev@w3.org
Message-ID: <24160.1037812873@www23.gmx.net>

Maybe you can use a union type:

<simpleType name="DateOrEmpty">
  <memberTypes="date">
    <simpleType>
      <restriction base="string">
        <length value="0"/>
      </restriction>
    <simpleType>
  </memberType>
</simpleType>

<element xsi:type="DateOrEmpty"/>

should now be valid.

> Hi
>  
> I am creating a schema that has amongst its elements a date element ie
> type
> = xs:date. This element is causing me a headache as it is not mandatory. I
> have been unable to find a way to allow this element to be left blank (I
> have tried setting minOcc to 0 but I get the error "Invalid value for
> datatype date"). I am beginning to thing that I will have to create a
> default of 9999-01-01 to allow people to skip over this field. Can anyone
> tell me different
>  
> Thanks
> 
> Helen 
> 
> 
> 
> 
> _______________________________________________________________________ 
> 
> The information contained in this email is confidential and is intended 
> for the use of the addressee only. Any unauthorised dissemination or 
> copying of this email, and any use of disclosure of information 
> contained in it, is strictly prohibited and may be illegal. 
> 
> Please let us know immediately by telephone if the email has been sent 
> to you in error (+44 1481 711166). 
> ________________________________________________________________________
> 
Received on Wednesday, 20 November 2002 12:21:33 GMT

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