Re: Date in xml schema

> the date datatype (type="xs:date") in schema definition supports only
> "YYYY-MM-DD" format but I need to have my date in "DD/MM/YYYY"(Brazil
> format) format. Is this possible in schema 1.0? If no, i think that is
> must be part of requirements of new version(1.1). Please, i'm waiting a
> reply...

XML Schema 1.0 only supports a subset of the ISO-8601 date/time formats 
as you observe, and there are apparently no plans to change that 
(looking at the latest 1.1 Working Drafts and at the 1.1 Requirements 
document [1]).

The usual alternative is to derive a new type from xs:string and use a 
pattern facet to restrict the format.  The downside is that the type is 
a string instead of a date, so it can't support date-aware min/max 
restrictions, for instance.

The requirements document is only a Working Draft, so technically it is 
not too late to file comments on it (to this mailing list), but my 
sense is that the requirements are effectively closed.

xan

[1] http://www.w3.org/TR/2003/WD-xmlschema-11-req-20030121/#N4002A9

Received on Thursday, 14 April 2005 18:50:38 UTC