W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

Re: Date

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Wed, 04 Jul 2001 15:58:33 +0200
Message-ID: <3B432109.8194D205@dyomedea.com>
To: xmlschema-dev@w3.org

Ashok Malhotra wrote:
> 
> To write the schema, you would first create a simple type that restricts
> "string" with a pattern corresponding to the format discussed above.

The drawback if you do so is that all the semantic of a date type will
be lost.

This means for instance that you won't be able to constrain you type by
adding facets that work on datetypes.

In this specific case (CCYYMMDD) where the lexical space of your
datatypes is a subset of a the lexical space for xs:decimal, applying
the pattern on a decimal datatype such as xs:nonNegativeInteger instead
of applying it on xs:string would allow you to keep some of these facets
(minInclusive, minExclusive, maxInclusive and maxExclusive) and to
consider the datatype as ordered (might be useful for XPath 2.0).

Hope this helps.

Eric
> 
> All the best, Ashok
> ===========================================================
> Ashok Malhotra              <mailto: ashokma@microsoft.com>
> Microsoft Corporation
> 212 Hessian Hills Road
> Croton-On-Hudson, NY 10520 USA
> Redmond: 425-703-9462                New York: 914-271-6477
> 
-- 
See you at XTech in San Diego.
             http://conferences.oreillynet.com/cs/os2001/view/e_spkr/790
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------
Received on Wednesday, 4 July 2001 09:58:40 GMT

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