<?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>3690</bug_id>
          
          <creation_ts>2006-09-10 07:23:16 +0000</creation_ts>
          <short_desc>The set of all possible modes is not clearly defined</short_desc>
          <delta_ts>2006-09-14 23:19:21 +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>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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="Colin Adams">colin</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>11549</commentid>
    <comment_count>0</comment_count>
    <who name="Colin Adams">colin</who>
    <bug_when>2006-09-10 07:23:16 +0000</bug_when>
    <thetext>Section 2.3 says that an optional initial mode must be supplied, but it does not specify what is the possible sets of values that this take.

This is relevant when the initial template candidates include one with a mode of #all.

Does #all match all theoretically valid modes (i.e. the local name is a valid NCName, and the namespace URI, if present, is a lexically valid URI), or does it match only those nodes that are present in the (compiled) stylesheet?

I had assumed the latter, but a test case assumes the former.

I have read over the spec again, to see if my assumption can be dis-proven, but I cannot see that. Nor can I see it the other way, so I think the spec. is ambiguous.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11551</commentid>
    <comment_count>1</comment_count>
    <who name="Colin Adams">colin</who>
    <bug_when>2006-09-10 08:00:33 +0000</bug_when>
    <thetext>When I raised the bug, I was only concerned that the ambiuity was resolved one way or the other.
But now having thought about it a bit more, it is clear to me that it should be resolved in the direction of only allowing modes that are specifically defined in the compiled stylesheet.

The only reason for supplying an initial mode is to override the default mode. So it makes no sense to supply a mode that is not defined. And it is very harmful, if the selected initial template (or some descendant of it in the match/call chain) should then dispatch on the current mode.

The user is entitled to a good error message if (s)he mis-types the name of the initial mode.

I can think of no use cases for the opposite interpretation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11667</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-09-13 19:36:23 +0000</bug_when>
    <thetext>I agree. I would propose:

(a) In 6.5 change

the token #all, to indicate that the template rule is applicable to all modes.

to

the token #all, to indicate that the template rule is applicable to all modes (that is, to the default mode and to every mode that is named in an xsl:apply-templates instruction or xsl:template declaration anywhere in the stylesheet)

(b) In 2.3 change

Optionally, an initial mode.

to

Optionally, an initial mode. This must be either the default mode, or a mode that is explicitly named in the mode attribute of an xsl:template declaration within the stylesheet.

(c) Add to this paragraph: If an initial mode is supplied, then an initial context node MUST be supplied, and an initial template MUST NOT be supplied.

(d) Add error codes for the above conditions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11713</commentid>
    <comment_count>3</comment_count>
    <who name="Colin Adams">colin</who>
    <bug_when>2006-09-14 07:17:35 +0000</bug_when>
    <thetext>Sounds good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11727</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-09-14 17:58:51 +0000</bug_when>
    <thetext>The proposal in comment #2 was accepted at today&apos;s telcon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11766</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-09-14 23:19:21 +0000</bug_when>
    <thetext>Spec now updated</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>