Dates and Times in XML Schema Part 2

Some comments regarding dates and times in XML Schema Part 2 [Schema-2]

These questions are prompted by a reading of XML Schema Part 2 in
conjunction with ISO 8601:2000. (XML Schema references ISO 8601:1988, but I
do not have a copy of this to hand; I believe the differences are minor.)

1. Schema-2 states in D.3.2 that the year "0000" is not legal. ISO 8601
defines a "prolaptic Gregorian calendar" [I think "proleptic" is probably
intended, but that's not relevant] containing the consecutive years -0002,
-0001, -0000, +0001 +0002. Does D.3.2 therefore imply that a date
represented in Schema-2 as -0002-05-05 is the same as the date represented
in ISO 8601 as -0001-05-05? If this were so, I would expect this deviation
to be stated rather more explicitly.

2. ISO 8601 allows either comma or period as the decimal separator in the
seconds value, and states that the preferred option is a comma. Schema-2
appears to express a preference for the period, but it makes no explicit
statement about whether comma is legal, and doesn't mention any deviation
from ISO 8601 in this area. 

3. Schema-2 states that "The ˇvalue spaceˇ of dateTime is the space of
Combinations of date and time of day values as defined in § 5.4 of [ISO
8601]." The implication of this is that 2002-02-02T12:00:00Z is a distinct
value in the value space from 2002-02-02T07:00:00-05:00. But if this is so,
then the canonical lexical representation (which is always in UTC with
timezone designator Z) cannot represent all values in the value space.

4. Less importantly, the description of the value space could also be read
as indicating that 12:00:00Z and 12:00:00+00:00 are distinct values, and
that the year 02002 is distinct from the year 2002.

5. Schema-2 states that for a time value, the canonical representation of
midnight is 00:00:00, but it does not make any similar statement for a
dateTime. Does this imply that 2002-02-02T00:00:00Z and 2002-02-01T24:00:00Z
represent distinct values in the value space?

6. Schema-2 states that "The ˇvalue spaceˇ of date is the set of Gregorian
calendar dates as defined in § 5.2.1 of [ISO 8601]." It then says: "Since
the lexical representation allows an optional time zone indicator...".
However, there is nothing in § 5.2.1 of ISO 8601 (at least not the 2000
edition) which suggests that a date can have an optional time zone
indicator, or that suggests how it would be written if it were allowed. If
this deviation from ISO 8601 is deliberate, which it seems to be, it should
surely be flagged in Appendix D3. In fact, this seems to be the only case
where Schema-2 specifies a format that is definitely not allowed by ISO
8601; the other deviations are either restrictions, or things that ISO 8601
permits provided the parties agree.

7. Why does Schema-2 define no canonical representation of date (unlike
dateTime and time)?

Similar comments apply to the other data types such as gMonthDay, but I
haven't studied these in detail.

Michael Kay
Software AG

Received on Thursday, 7 February 2002 11:01:22 UTC