<?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>1745</bug_id>
          
          <creation_ts>2005-07-19 04:06:22 +0000</creation_ts>
          <short_desc>[FS] editorial: 7.1.3 The fs:convert-operand function</short_desc>
          <delta_ts>2007-02-25 23:16:49 +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>All</rep_platform>
          <op_sys>All</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>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Dyck">jmdyck</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>4857</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2005-07-19 04:06:22 +0000</bug_when>
    <thetext>7.1.3 The fs:convert-operand function

&quot;$actual as item?&quot;
    In every use of fs:convert-operand in the FS, the first argument is
    the result of a call to fn:data, which means it must be of type
    &quot;xdt:anyAtomicType*&quot;. So &quot;item?&quot; could be narrowed to
    &quot;xdt:anyAtomicType?&quot;.

&quot;is of type&quot;
    Change to &quot;is an instance of&quot;? (That&apos;s the terminology that XQuery
    uses.)

&quot;a. if $expected is of type xdt:untypedAtomic, returns $actual cast to
xs:string&quot;
    After &quot;xdt:untypedAtomic&quot;, insert &quot;or xs:string&quot; (with corresponding
    changes to STA / rules 2 and 4), otherwise I think there is a
    discrepancy between semantics of fs:convert-operand and the semantics
    described in XQuery 3.5.2 for General Comparisons.
    Specifically, if $actual is an instance of xdt:untypedAtomic, and
    $expected is an instance of a subtype of xs:string, fs:convert-operand
    will (currently) follow 2c and cast $actual to the type of $expected
    (the subtype of xs:string), whereas 3.5.2 says that it should be cast
    to xs:string. With the suggested change, fs:convert-operand will
    follow 2a and cast $actual to xs:string.

    (Yes, I&apos;m doubtful that this is an important distinction, but it&apos;s a
    simple change, and it makes it easier to see that fs:convert-operand
    agrees with the XQuery doc, so why not do it?)

&quot;Otherwise, the operand is returned unchanged&quot;
    Change to &quot;Otherwise, returns $actual&quot;.

STA
&quot;No conversion is needed for numeric (or empty) operands.&quot;
    Actually, no conversion is necessary unless $actual is an instance of
    xdt:untypedAtomic.

STA / rule 1 / premise 2
&quot;statEnv |- Type1 &lt;: (xs:decimal|xs:float|xs:double)?&quot;
    Change to
        statEnv |- not( Type1 &lt;: xdt:untypedAtomic? )

STA / rule (2|3) / premise 1
&quot;statEnv |- Expr1 &lt;: Type1&quot;
    Change &quot;&lt;:&quot; to &quot;:&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>9108</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2006-04-10 15:50:01 +0000</bug_when>
    <thetext>Fixed as suggested.
- Jerome</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12296</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2006-10-05 08:01:27 +0000</bug_when>
    <thetext>I said:
&gt;
&gt; &quot;a. if $expected is of type xdt:untypedAtomic, returns $actual cast to
&gt; xs:string&quot;
&gt;     After &quot;xdt:untypedAtomic&quot;, insert &quot;or xs:string&quot; (with corresponding
&gt;     changes to STA / rules 2 and 4),

The 2006-06 CR does not have those corresponding changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13600</commentid>
    <comment_count>3</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2007-01-16 17:59:27 +0000</bug_when>
    <thetext>Added the proper changes to STA rules 2 and 4.
- Jerome
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>