This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
7.1.3 The fs:convert-operand function What is the "operand" in step 3 of the description? There are two arguments, so it could be $actual or $expected. All the other steps return $actual, possibly after a cast, so one would assume that the operand in step 3 is also $actual. But the type of $actual is item? and the return type is xdt:anyAtomicType, so it seems like a mistake to say that $actual is returned unchanged. Possibly the type of $actual is really xdt:anyAtomicType? . A cursory search for the first few invocations of fs:convert-operand shows that its argument is the output of fn:data, whose return type is xdt:anyAtomicType* . So we could probably change the signature of fs:convert-operand so that $actual is xdt:anyAtomicType*, but then the rules do not tell us what to do if the cardinality is greater than 1. Possibly the answer is that the type of $actual is xdt:anyAtomicType?, and if the input piped from fn:data has a cardinality greater than 1, then there is a type error because there is no function whose signature matches the invocation.
That's a good catch. Yes the operand intended in the 3rd bullet is $actual. The intended signature is to take an optional atomic value (it is always applied in a context of an operator which expects an optional atomic value, like arithmetic operations, or value comparisons, or bounded by existential quantification). The I believe we should make the following two fixes: * We should change the 3rd bullet to: 3. Otherwise, $actual is returned unchanged. * We should change the signature to: fs:convert-operand($actual as xdt:anyAtomicType?, $expected as xdt:anyAtomicType) as xdt:anyAtomicType ? - Jerome
This is the formal response from the XML Query WG and the XSL WG. We agree with the comment and will make the change outlined in Additional Comment #1. Please let us know if you agree with this resolution of your issue, by adding a comment to the issue record and changing the Status of the issue to Closed. Or, if you do not agree with this resolution, please add a comment explaining why. If you wish to appeal the WG's decision to the Director, then also change the Status of the record to Reopened. If you wish to record your dissent, but do not wish to appeal the decision to the Director, then change the Status of the record to Closed. If we do not hear from you in the next two weeks, we will assume you agree with the WG decision.