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

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5671





------- 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