<?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>8217</bug_id>
          
          <creation_ts>2009-11-06 14:25:35 +0000</creation_ts>
          <short_desc>[XSLT] Confusing text on function conversion rules for sequence constructors</short_desc>
          <delta_ts>2010-07-15 09:46:24 +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>XSLT 2.0</component>
          <version>Recommendation</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xslt20/#dt-function-conversion-rules</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Zongaro">zongaro</reporter>
          <assigned_to name="Michael Kay">mike</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>29391</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Zongaro">zongaro</who>
    <bug_when>2009-11-06 14:25:35 +0000</bug_when>
    <thetext>A colleague pointed out the following potentially confusing text to me.  According to section 5.3 of XSLT 2.0,[1] &quot;Except where otherwise indicated, the actual value of an expression is converted to the required type using the function conversion rules....  The relevant rules are those that apply when XPath 1.0 compatibility mode is set to false.&quot;

The following paragraph then says, &quot;This specification also invokes the XPath 2.0 function conversion rules to convert the result of evaluating an XSLT sequence constructor to a required type (for example, the sequence constructor enclosed in an xsl:variable, xsl:template, or xsl:function  element).&quot;

Reading that, one might easily be lead to believe that when the function conversion rules apply to an expression, only the rules with compatibility mode set to false apply, but when they apply to a sequence constructor, the setting of the compatibility mode for the sequence constructor is taken into account.

The only clue that compatibility mode of false always applies for sequence constructors too is the fact that the words &quot;function conversion rules&quot; in that second paragraph have a hyper-text link to the preceding paragraph.

To avoid confusion, I would suggest adding the following sentence after &quot;or xsl:function element)&quot;:  &quot;Again, the relevant rules are those that apply when XPath 1.0 compatibility mode is set to false.&quot;

[1] http://www.w3.org/TR/xslt20/#dt-function-conversion-rules</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29393</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-11-06 14:51:22 +0000</bug_when>
    <thetext>A better fix might be to make the definition into a real definition, and add a clarifying note: change

[Definition: Except where otherwise indicated, the actual value of an expression is converted to the required type using the function conversion rules. These are the rules defined in [XPath 2.0]  for converting the supplied argument of a function call to the required type of that argument, as defined in the function signature. The relevant rules are those that apply when XPath 1.0 compatibility mode  is set to false.]

to

[Definition: When used in this specification without further qualification, the term &lt;term&gt;function conversion rules&lt;/term&gt; means the function conversion rules defined in [XPath 2.0], applied with XPath 1.0 compatibility mode set to false.]

Note: These are the rules defined in [XPath 2.0] for converting the supplied argument of a function call to the required type of that argument, as defined in the function signature. The same rules are used in XSLT for converting the value of a variable to the declared type of the variable, or the result of evaluating a function or template body to the declared type of the function or template. They are also used when parameters are supplied to a template using &lt;xsl:with-param&gt;. In all such cases, the rules that apply are the XPath 2.0 rules without XPath 1.0 compatibility mode. The rules with XPath 1.0 compatibility mode set to true are used only for XPath function calls, and for the operands of certain XPath operators.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35861</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-05-27 16:59:00 +0000</bug_when>
    <thetext>Agreed to adopt the change proposed in comment #1 in an erratum</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36899</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-15 09:46:24 +0000</bug_when>
    <thetext>This will be erratum E50.

(Note in applying to the 3.0 spec, the definition we link to in XPath may have changed and have a better target for XSLT to point to).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>