Project

Profile

Help

Bug #1968

closed

Shared indexes when xsl:key definition is context sensitive

Added by Michael Kay almost 11 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2013-12-30
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.5, 9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

I haven't confirmed this by testing, but I suspect there could be a problem if a key is defined like this:

<xsl:variable name="v" select="base-uri(.)"/>

<xsl:key name="k" match="*[. = $v]" use="name()"/>

<xsl:param name="p" as="document-node()"/>

<xsl:template match="/">

<xsl:value-of select="key('k', 'abcd', $p)"/>

</xsl:template>

If this stylesheet is invoked twice with different initial context items but with the same value of $p, the two invocations will attempt to share the same index supporting the key definition k, but actually the key definitions are different for the two stylesheet invocations because of the dependency on $v.

Please register to edit this issue

Also available in: Atom PDF