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 1720 - [FS] what is the "operand" of fs:convert-operand? what is the type of $actual?
Summary: [FS] what is the "operand" of fs:convert-operand? what is the type of $actual?
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows 2000
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-18 21:28 UTC by Fred Zemke
Modified: 2005-09-06 13:09 UTC (History)
0 users

See Also:


Attachments

Description Fred Zemke 2005-07-18 21:28:34 UTC
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.
Comment 1 Jerome Simeon 2005-07-21 19:18:45 UTC
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

Comment 2 Jim Melton 2005-07-26 16:24:54 UTC
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.