This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3358 - [F+O] Rules for min() and max() handling of non-primitive types
Summary: [F+O] Rules for min() and max() handling of non-primitive types
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Ashok Malhotra
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-18 21:43 UTC by Michael Kay
Modified: 2006-07-02 12:02 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2006-06-18 21:43:30 UTC
The rules for min() and max() do not make it clear what the result type is, in the situation where some or all of the items in the input sequence are of a derived numeric type. For example, if all the items in the sequence are of type my:hatsize which is derived from xs:integer, is the result of type my:hatsize or of type xs:integer?

The relevant statement is "For numeric values, the numeric promotion rules defined in 6.2 Operators on Numeric Values are used to promote all values to a single common type.". But if you follow the references on numeric promotion, you get to XPath Appendix B.2, which is written on the assumption that there is a required type, which is not the case here. So this rule doesn't tell us what the "single common type" should be.

Note that if the items in the sequence all belong to a type derived from string or from date, the result of the function will be one of the items in the sequence with its original type. One would therefore expect the same behaviour for a homogenous sequence of derived numeric values.
Comment 1 Michael Kay 2006-07-02 03:34:44 UTC
It was agreed at the F2F in Saclay that numeric values appearing in the arguments to min() and max() will "be converted to their least common type by a combination of type promotion and subtype substitution. " This is a phrase that is already used in XPath, and although there is no formal definition of the terms, it appears to be clear what is meant.

I am marking this as FIXED, leaving it for Ashok to close when we have confirmation that the action is complete.