W3C home > Mailing lists > Public > public-qt-comments@w3.org > June 2006

[Bug 3358] [F+O] Rules for min() and max() handling of non-primitive types

From: <bugzilla@wiggum.w3.org>
Date: Sun, 18 Jun 2006 21:43:31 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1Fs53L-00069n-26@wiggum.w3.org>

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

           Summary: [F+O] Rules for min() and max() handling of non-
                    primitive types
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: ashok.malhotra@oracle.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


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.
Received on Sunday, 18 June 2006 21:43:35 UTC

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