W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2008

[Bug 5671] [FO] Type promotion in fn:min and fn:max

From: <bugzilla@farnsworth.w3.org>
Date: Tue, 20 May 2008 20:57:16 +0000
To: public-qt-comments@w3.org
Message-Id: <E1JyYtY-0008JN-2R@farnsworth.w3.org>


------- Comment #3 from mike@saxonica.com  2008-05-20 20:57 -------
>The least common supertype of xs:unsignedShort and xs:positiveInteger is
xs:nonNegativeInteger, so the text suggests that the two items in the input
sequence are converted to xs:nonNegativeInteger

Yes, precisely.

>Subtype substitution does not change the actual type of a value

The phrase about conversion to the least common type is used in a number of
places in the XPath/XQuery language specs. The formula used in some cases is
"converted to the least common type reachable by a combination of type
promotion and subtype substitution". Would you be more comfortable with that?

Incidentally, my interpretation of this rule is that it guarantees that the
result will be an instance of xs:nonNegativeInteger. It does not say that the
value might not also be an instance of some other type, such as
xs:unsignedShort. Functions (and expressions generally) are always free to
return a result that belongs to a subtype of the required type.
Received on Tuesday, 20 May 2008 20:57:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:23 UTC