<?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>22877</bug_id>
          
          <creation_ts>2013-08-04 13:26:00 +0000</creation_ts>
          <short_desc>[XSLT 3.0] Binding component references in xsl:key definitions</short_desc>
          <delta_ts>2014-05-15 14:00:35 +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>Working 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>
          
          
          <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>91620</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-08-04 13:26:00 +0000</bug_when>
    <thetext>The definition of a key can include function calls in its use= attribute, or in predicates within its match= attribute. It can also contain references to global variables and to named templates rules; potentially it can use apply-templates.

We therefore need to consider what happens when the functions/templates/variables that it references are overridden in a using package.

The scope of keys is local to a package, and a call to the key() function can only appear within the package containing the declaration of the key. Therefore, I think we get the right effect if outward component references from a key definition are always &quot;fixed&quot; to components in the package containing the key declaration, and are never subsequently re-bound. This has the additional merit that the compiler knows the full definition of the key when compiling the package, and can use this knowledge.

We need to explain this, with examples, in section 3.6.4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93803</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-09-25 15:21:36 +0000</bug_when>
    <thetext>Contrary to what is suggested in the bug report, we don&apos;t think outward references from the key should be treated as final if the target components are in fact overridden. Keys should be treated as private components that can contain outward references but cannot be overridden or exposed in using packages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93862</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-09-26 07:56:54 +0000</bug_when>
    <thetext>The change described in comment 1 was accepted and has been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>