<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>1720</bug_id>
          
          <creation_ts>2005-07-18 21:28:34 +0000</creation_ts>
          <short_desc>[FS] what is the &quot;operand&quot; of fs:convert-operand?  what is the type of $actual?</short_desc>
          <delta_ts>2005-09-06 13:09:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Formal Semantics 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 2000</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fred Zemke">fred.zemke</reporter>
          <assigned_to name="Jerome Simeon">simeon</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4831</commentid>
    <comment_count>0</comment_count>
    <who name="Fred Zemke">fred.zemke</who>
    <bug_when>2005-07-18 21:28:34 +0000</bug_when>
    <thetext>7.1.3 The fs:convert-operand function
What is the &quot;operand&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5085</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-07-21 19:18:45 +0000</bug_when>
    <thetext>That&apos;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

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5231</commentid>
    <comment_count>2</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2005-07-26 16:24:54 +0000</bug_when>
    <thetext>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&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>