Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#844 current() within xsl:number

v9.1
closed
Michael Kay
5
2012-10-08
2008-07-09
Michael Kay
No

When the current() function is called within a pattern appearing as part of an instruction (that is, the count or from patterns of xsl:number, or the group-starting|ending-with patterns of xsl:for-each-group), a Saxon internal error may occur while compiling the stylesheet. The message is

"*** Internal Saxon error: local variable encountered whose binding has been deleted Variable name: saxon:current987654321

The stack trace will generally contain a number of nested calls to:

net.sf.saxon.expr.ExpressionTool.allocateSlots( ExpressionTool.java:527)

A patch is being placed in Subversion.

Discussion

  • Michael Kay
    Michael Kay
    2008-07-10

    Logged In: YES
    user_id=251681
    Originator: YES

    There is a further bug in this area. The specification states that current(), when used within a pattern, refers to the node that is being matched against the pattern. Saxon however is interpreting it as meaning the node that is the context node at the point where the xsl:number instruction is evaluated (which may or may not be the node that is being numbered, but in general will not be the same as the node that is being tested against the "count" or "from" pattern). This second bug is present in 9.1 and all previous releases. It also affects the pattern used in the match attribute of xsl:key. It does not affect the match attribute of xsl:template, or the group-starting-with and group-ending-with attributes of xsl:for-each-group, because in those cases Saxon first sets the context node to be the same as the node that is being tested against the pattern.

     
  • Michael Kay
    Michael Kay
    2008-07-10

    Logged In: YES
    user_id=251681
    Originator: YES

    The second bug (incorrect interpretation of current() in a pattern) will be fixed by patch in both the 9.0 and 9.1 Subversion branches.

     
  • Michael Kay
    Michael Kay
    2008-09-02

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.1.0.2