[Bug 5671] [F&O] Type promotion in fn:min and fn:max

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

           Summary: [F&O] Type promotion in fn:min and fn:max
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: oliver@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


The summary for fn:min/fn:max says:
Selects an item from the input sequence $arg whose value is [less/greater] than
or equal to the value of every other item in the input sequence

However further down in their summaries:
This function returns an item from the converted sequence rather than the input
sequence.

Could this be worded more clearly.


Reading the rules for promotion:
Numeric and xs:anyURI values are converted to the least common type that
supports the [le/ge] operator by a combination of type promotion and subtype 

>From reading this I would say that if your input is a single value of type
xs:unsignedShort, then you would return a value of type xs:integer, as this is
"the least common type that supports the [le/ge] operator"; however the XQTS
test K2-SeqMINFunc-15 seems to disagree with me here.  What is the correct
behaviour?

Received on Wednesday, 30 April 2008 14:00:01 UTC