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 22877 - [XSLT 3.0] Binding component references in xsl:key definitions
Summary: [XSLT 3.0] Binding component references in xsl:key definitions
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-04 13:26 UTC by Michael Kay
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2013-08-04 13:26:00 UTC
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 "fixed" 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.
Comment 1 Michael Kay 2013-09-25 15:21:36 UTC
Contrary to what is suggested in the bug report, we don'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.
Comment 2 Michael Kay 2013-09-26 07:56:54 UTC
The change described in comment 1 was accepted and has been applied.