- From: Ashok Malhotra <ashokma@microsoft.com>
- Date: Wed, 10 Dec 2003 07:36:16 -0800
- To: "Kay, Michael" <Michael.Kay@softwareag.com>, <public-qt-comments@w3.org>
The special rules should also apply to subtypes of integer. But it's not clear where such a clarification should go since 17.8.4 discusses only casting to integer. In section 17.4 which discusses casting to derived types there is a paragraph that reads: "In some cases, casting from a parent type to a derived type requires special rules. See 17.8 Casting to numeric types for rules regarding casting to xs:integer and 17.9 Casting to duration types for rules regarding casting to xdt:yearMonthDuration and xdt:dayTimeDuration." Should we add wording to this para that clarifies that the special rules apply to subtypes as well? I'll remove the references to xs:anySimpleType. All the best, Ashok -----Original Message----- From: public-qt-comments-request@w3.org [mailto:public-qt-comments-request@w3.org] On Behalf Of Kay, Michael Sent: Wednesday, December 10, 2003 5:19 AM To: public-qt-comments@w3.org Subject: [F+O] Casting to subtypes of xs:integer The normal rules for casting to a derived type are that the value must satisfy all the facets of the target type. But there are special rules in section 17.8.4 for xs:integer, which cause the supplied value to be truncated towards zero. It's not clear whether or not these special rules also apply if the target type is a subtype of xs:integer. For example, xs:short(4.3). I think they should apply. But the rules then need to be modified to allow this. For example, the clause "and TV is xs:integer(IV)" is wrong. Michael Kay PS: these rules still have references to xs:anySimpleType. This doesn't belong in the casting rules because it's not an atomic type. It's gone from the table, but not from the text.
Received on Wednesday, 10 December 2003 10:36:17 UTC