Re: datetime fractional second clarification

At 3:35 AM -0500 050114, Edwin Shin wrote:
>I'm a little confused by the statement "The fractional second 
>string, if present, must not end in '0'" in 
>http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/.
>
>Section 3.2.7.2 states:
>Except for trailing fractional zero digits in the seconds 
>representation, ...[t]he fractional second string, if present, must 
>not end in '0'.

Your ellipsis leaves out important stuff.  There are two separate
statements here.

   1.  In most ways the lexical mapping for dateTime is inherently
       one-to-one.  The things that make it not 1-1 are threefold,
       one of which is that, for example, '2001-01-01T01:01:01.0000'
       and '2001-01-01T01:01:01' both represent the same value.

   2.  "When there is more than one possible representation,..."
       is the beginning of the second statement.  The part of
       that which you quote, says that when generating the "canonical"
       representation for that value, it's the latter of the two
       examples above that you must use.

Note that this section is about generating "canonical" representations
of dateTime values.  In most cases, a dateTime value (without timezone,
to make the examples simpler) has only one lexical value, except that
you can add trailing fractional zero digits and still represent the
same value.  Which representation is "canonical" (which means sort of
"this is the 'standard' representation when there's more than one
representation available") is the question being answered here, and
the answer is:  Don't use any (redundant) trailing fractional digits.

>Now, section 3.2.6 states:
>All minimally conforming processors must support ... a minimum 
>fractional second precision of milliseconds or three decimal digits 
>(i.e. s.sss).
>
>So perhaps 3.2.7.2 is not forbidding the value 
>2002-10-10T17:00:00.010, but it is forbidding 2002-10-10T17:00:00.0? 
>However, is it also forbidding 2002-10-10T17:00:00.000 (I hope not)?

Certainly not.  2002-10-10T17:00:00.000 *is* 2002-10-10T17:00:00 .
All 3.2.7.2 is saying that the "canonical" way of representing that
value is the string '2002-10-10T17:00:00'.

I think you've mixed up values with their lexical representations.
-- 
Dave Peterson
SGMLWorks!

davep@iit.edu

Received on Friday, 14 January 2005 17:39:25 UTC