xsd:dateTime is uncompliant?

J

jsnX

I'm having trouble determining whether or not the period in an
xsd:dateTime like this:

2006-10-04T03:42:12.3Z

should in fact be a comma, as date(1) would have it:

date --utc --iso-8601=ns
2006-10-04T04:02:01,012255000+0000

The examples of ISO-8601 I've seen online seem to side with date(1) and
not W3C XML Schema Datatypes.
 
M

Martin Honnen

jsnX said:
I'm having trouble determining whether or not the period in an
xsd:dateTime like this:

2006-10-04T03:42:12.3Z

should in fact be a comma, as date(1) would have it:

I don't know what "date(1)" refers to but the schema specification
<http://www.w3.org/TR/xmlschema-2/#dateTime>
makes it clear what lexical representation an xs:dateTime can have:

The ·lexical space· of dateTime consists of finite-length sequences of
characters of the form:
'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?

I don't see any comma in there.
 
J

jsnX

Martin said:
I don't know what "date(1)" refers to...

The date(1) command is available on UNIX. The '1' in parentheses refers
to it's section in the help pages. When you ask it for an ISO-8601
date, it spits out a comma and not a period.
...the schema specification makes it clear...

I'm not asking what the schema spec says - I'm asking whether it's
wrong or not. All the examples of ISO-8601 that I've seen use a comma,
not a period - and the schema spec claims conformance to ISO-8601.
 
J

Joseph Kesselman

jsnX said:
I'm not asking what the schema spec says - I'm asking whether it's
wrong or not. All the examples of ISO-8601 that I've seen use a comma,
not a period - and the schema spec claims conformance to ISO-8601.

Actually, no. The Schema spec actually says only that "The date and time
datatypes described in this recommendation were inspired by [ISO 8601]"
-- not that their lexical or value spaces are identical to that ISO
specification.

For what it's worth, ISO-8601 appears to accept *either* comma or period
as its decimal-point mark, though I'm told comma is considered preferred.

So you could try contacting the W3C and suggesting that comma be added
as an acceptable alternative, either as an erratum or in a future
revision of the Datatypes spec. I think you'll get some pushback, since
this would mean new documents could break old processors, but you might
be able to get them to add a variant (superset type?) of dateTime which
accepts either.
 
M

Martin Honnen

jsnX said:
I'm not asking what the schema spec says - I'm asking whether it's
wrong or not. All the examples of ISO-8601 that I've seen use a comma,
not a period - and the schema spec claims conformance to ISO-8601.

Where exactly does it do that, claiming conformance to ISO-8601? It
mentions ISO-8601 but it defines its own lexical representation and in
my understanding that defines what is right or wrong in terms of the
specification. Compliance with a different standard ISO standard is not
what the XSD data types specification demands for xs:dateTime.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,005
Messages
2,570,264
Members
46,860
Latest member
JeremiahCo

Latest Threads

Top