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 8217 - [XSLT] Confusing text on function conversion rules for sequence constructors
Summary: [XSLT] Confusing text on function conversion rules for sequence constructors
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: All All
: P5 trivial
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://www.w3.org/TR/xslt20/#dt-funct...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-06 14:25 UTC by Henry Zongaro
Modified: 2010-07-15 09:46 UTC (History)
0 users

See Also:


Attachments

Description Henry Zongaro 2009-11-06 14:25:35 UTC
A colleague pointed out the following potentially confusing text to me.  According to section 5.3 of XSLT 2.0,[1] "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."

The following paragraph then says, "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)."

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 "function conversion rules" in that second paragraph have a hyper-text link to the preceding paragraph.

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

[1] http://www.w3.org/TR/xslt20/#dt-function-conversion-rules
Comment 1 Michael Kay 2009-11-06 14:51:22 UTC
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 <term>function conversion rules</term> 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 <xsl:with-param>. 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.
Comment 2 Michael Kay 2010-05-27 16:59:00 UTC
Agreed to adopt the change proposed in comment #1 in an erratum
Comment 3 Michael Kay 2010-07-15 09:46:24 UTC
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).