<?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>29209</bug_id>
          
          <creation_ts>2015-10-19 09:14:59 +0000</creation_ts>
          <short_desc>[xslt30] Template rules within xsl:override</short_desc>
          <delta_ts>2015-10-28 17:17:19 +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 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>sca.w3c</cc>
          
          <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>123764</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-19 09:14:59 +0000</bug_when>
    <thetext>The last paragraph in 6.1 is clearly wrong:

If the parent of the xsl:template element is an xsl:override element, then there must be a name attribute and no match attribute, and the package that is the target of the containing xsl:use-package element must contain among its components a named template whose symbolic identifier is the same as this named template, and which has a compatible signature.

because it does not allow adding template rules to a mode accepted from the used package.

I think it should read:

If the parent of the xsl:template element is an xsl:override element, then one of the following conditions must be true:

1. there must be a name attribute and no match attribute, and the package identified by the containing xsl:use-package element must contain among its components a named template whose symbolic identifier is the same as this named template, and which has a compatible signature.

2. there is a match attribute and a mode attribute, and no name attribute; the mode attribute must contain a single token which is the name of a mode that is exposed, with visibility equal to *public*, by the package identified by the containing xsl:use-package element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123767</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-10-19 12:30:17 +0000</bug_when>
    <thetext>We might add that the token #unnamed is never accessible here. Should we allow #all as a token? Why would we require a single token, is it for simplicity?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123783</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-19 17:23:34 +0000</bug_when>
    <thetext>I was under the impression it was already restricted to a single explicitly named mode, but I may have been mistaken.

The #unnamed mode is never public, so it is automatically excluded.

I think we should exclude #all because it&apos;s very unclear what it is supposed to mean in this context.

But a list of explicitly named modes works, I think. Also, I found text under xsl:override that permits a template with both a name and a match pattern. So change the proposed text to:

If the parent of the xsl:template element is an xsl:override element, then one or both of the following conditions must be true:

1. there is a name attribute, and the package identified by the containing xsl:use-package element contains among its components a named template whose symbolic identifier is the same as this named template, and which has a compatible signature.

2. there is a match attribute and a mode attribute, and the mode attribute contains a list of tokens each of which is the name of a mode that is exposed, with visibility equal to *public*, by the package identified by the containing xsl:use-package element.

Note: #unnamed is not allowed because the unnamed mode never has public visibility. The token #all is not allowed because its intended meaning is not obvious.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123841</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-22 10:53:19 +0000</bug_when>
    <thetext>Condition 2 above fails to allow for default-mode. So the proposed text becomes:

If the parent of the xsl:template element is an xsl:override element, then one or both of the following conditions must be true:

1. there is a name attribute, and the package identified by the containing xsl:use-package element contains among its components a named template whose symbolic identifier is the same as this named template, and which has a compatible signature.

2. there is a match attribute, and one of the following conditions is true:

2a. There is a mode attribute that contains a list of tokens each of which is the name of a mode that is exposed, with visibility equal to *public*, by the package identified by the containing xsl:use-package element.

2b. There is an ancestor-or-self element having a default-mode attribute whose value is the name of a mode that is exposed, with visibility equal to *public*, by the package identified by the containing xsl:use-package element.

Note: #unnamed is not allowed because the unnamed mode never has public visibility. The token #all is not allowed because its intended meaning is not obvious.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123864</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-22 20:08:33 +0000</bug_when>
    <thetext>The changes were accepted and have been applied. A further refinement was noted: the mode attribute of an xsl:template element within xsl:override can contain the token #default provided the default mode is a public mode exposed by the used package.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>