RE: ORA-FO-197-C: casting between dayTimeDuration and yearMonthDuration

Steve:
Thanks for finding this subtle bug.  Fixed as per your suggestion 2.

All the best, Ashok

-----Original Message-----
From: public-qt-comments-request@w3.org
[mailto:public-qt-comments-request@w3.org] On Behalf Of Stephen Buxton
Sent: Tuesday, February 17, 2004 2:35 AM
To: public-qt-comments@w3.org
Subject: ORA-FO-197-C: casting between dayTimeDuration and
yearMonthDuration


SECTION 17.9: casting to duration types

The second and third bullets describe how to cast between 
xdt:yearMonthDuration and xdt:dayTimeDuration.  The second bullet
tells how to cast "...a type derived from xs:duration..."
(which might be xdt:dayTimeDuration) to xdt:yearMonthDuration.
(The result is P0M).  Similarly, the third bullet tells how to 
cast from xdt:dayTimeDuration to xdt:yearMonthDuration
(the result is PT0S).  This contradicts the table in section
17.1, which says that these casts are not possible.

This could be fixed in several ways:

1. The description of the table in section 1 could be changed.
Currently it says that "N indicates that there are no supported
conversions".  As worded, this sounds merely descriptive
rather than prescriptive.  The description could be changed to read 
"N indicates that the conversion results in an error" (though 
it would still be necessary to specify which error).

2. The second and third bullets could be reworded to specifically
exclude xdt:yearMonthDuration and xdt:dayTimeDuration, respectively,
and types derived from them.

3. The second and third bullets could be removed entirely.
In that case casting to xdt:yearMonthDuration and 
xdt:dayTimeDuration would fall under the general guidelines in
17.4 "Casting within a branch of the type hierarchy", meaning 
that their pattern facets would have to be satisfied in order for
the cat to succeed.

4. The second and third bullets could be reworded to raise an 
error if the components to be discarded are not already 0 in 
the source.  Though this would still permit casting the zero
values of xdt:yearMonthDuration and xdt:dayTimeDuration to 
one another, so the table would have to say that the conversions
may succeed.

- Steve B.

Received on Tuesday, 30 March 2004 15:29:12 UTC