Bug #1811
closedLocal variable used in a pattern
100%
Description
The error
* Internal Saxon error: local variable encountered whose binding has been deleted
occurs when a local variable is used in a pattern (e.g. a count pattern in xsl:number) and this is the only reference to that variable. For example
<xsl:variable name="href" select="..." as="xs:string"/>
<xsl:number select="$prmTopicRef"
level="any"
count="*[string(@href)=$href]"
from="*[contains(@class,' map/map ')]"
format="1"/>
Reported today by Toshihiko Makita on saxon-help mailing list
Updated by Michael Kay over 11 years ago
There are actually two bugs.
(a) the reference to the variable is not identified as a "looping reference", which means that the compiler attempts to inline the variable. It should not do this, because the value of the variable (as it appears in a predicate) is used repeatedly
(b) the inlining of the variable is not correctly implemented for a variable reference within a pattern; the declaration of the variable is removed from the expression tree, but the reference to the variable remains.
Patches for both problems are being committed to the 9.5 (and 9.6) branches.
Updated by O'Neil Delpratt over 11 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 9.5.1.1
Bug now closed. Applied to the Saxon 9.5.1.1 maintenance release.
Please register to edit this issue