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

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





--- Comment #9 from Michael Dyck <jmdyck@ibiblio.org>  2008-07-19 08:04:46 ---
On further reflection (working on Bug #5459), I don't think the new wording
correctly captures our intent.

Consider a sequence containing both values matching xs:anyURI and values
matching xs:string. I believe the intent is that all of those values will
be converted to xs:string (when forming the "converted sequence"). But if
we say "numeric and xs:anyURI values are converted to the least common type
reachable by a combination of type promotion and subtype substitution",
then we'll look at just the xs:anyURI values, convert them to a common type
(some subtype of xs:anyURI, possibly xs:anyURI itself), and leave the
xs:string values untouched. Then, when we say "All items in $arg must be
numeric or derived from a single base type for which the ge/le operator is
defined", it fails, because the xs:anyURI values and xs:string values are
not derived from a single base type. [I'm assuming that where it says
"$arg", it actually means "converted sequence", otherwise other things
happen.]

...

Also, in that latter quoted sentence, the "numeric or" is unnecessary,
since all numeric values have already been converted to a common type,
which certainly qualifies as "derived from a single base type".

We say "... a single base type for which the ge operator is defined. In
addition, the values in the sequence must have a total order." But does the
second sentence actually add anything?

It's odd that we would require values of two subtypes of xs:integer to be
converted to a common type (because they're numeric values), but not
require values of two subtypes of (say) xs:date to be converted to a common
type. Wouldn't it be correct to say that *all* values are converted to a
common type, not just numerics and xs:anyURI? (If so, it's redundant to say
"all items ... must be ... derived from a single base type".)

And it's odd that we say "Duration values must either all be
xs:yearMonthDuration values or must all be xs:dayTimeDuration values",
since surely that's implied by the "derived from a single base type"
requirement.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Saturday, 19 July 2008 08:05:22 UTC