xsd:dateTime is uncompliant?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jsnX

    xsd:dateTime is uncompliant?

    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,012 255000+0000

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

  • Martin Honnen

    #2
    Re: xsd:dateTime is uncompliant?



    jsnX wrote:
    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.


    --

    Martin Honnen

    Comment

    • jsnX

      #3
      Re: xsd:dateTime is uncompliant?

      Martin Honnen wrote:
      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.

      Comment

      • Joseph Kesselman

        #4
        Re: xsd:dateTime is uncompliant?

        jsnX wrote:
        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.

        --
        Joe Kesselman / Beware the fury of a patient man. -- John Dryden

        Comment

        • Martin Honnen

          #5
          Re: xsd:dateTime is uncompliant?



          jsnX wrote:
          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.


          --

          Martin Honnen

          Comment

          Working...