Bug #3028
closedWrong line number for xsl:variable in XSLT Trace
100%
Description
See the context and data in bug #3207.
The line number put in the trace for the xsl:variable instructions is wrong: it seems to take the line number of the parent element.
Example in the test case provided:
<xsl:template match="u" line="9" column="25" module="cover-test.xsl">
<xsl:param name="what" line="10" column="43" module="cover-test.xsl">
</xsl:param>
<xsl:param name="when" line="11" column="42" module="cover-test.xsl">
</xsl:param>
The following 3 variables are actually in lines 12, 13, 15 in the XSL stylesheet, not in line 9 :
<xsl:variable name="url" line="9" column="25" module="cover-test.xsl">
<xsl:variable name="role" line="9" column="25" module="cover-test.xsl">
<xsl:variable name="position" line="9" column="25" module="cover-test.xsl">
<xsl:choose line="17" column="15" module="cover-test.xsl">
The following 2 variables are actually in lines 19, 20, not in line 18
<xsl:variable name="shorturl" line="18" column="46" module="cover-test.xsl">
<xsl:variable name="protocol" line="18" column="46" module="cover-test.xsl">
In version 6.5.5 I haven't seen this bug.
Updated by Ben Guillon over 7 years ago
Updated by Michael Kay over 7 years ago
When StyleElement.compileSequenceConstructor() turns a local xsl:variable into an internal LetExpression, the location for the LetExpression is set to the location of the containing sequence constructor rather than the location of the xsl:variable.
There is an additional problem which I shall fix at the same time (already fixed on the 9.8 branch): the location information being used is a reference to the element node in the source stylesheet, which prevents the raw stylesheet tree being garbage collected once the expression tree has been constructed. The location information should be copied to prevent this.
Updated by Michael Kay over 7 years ago
- Category set to Diagnostics
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Priority changed from Low to Normal
- Applies to branch 9.8 added
- Fix Committed on Branch 9.7, 9.8 added
Updated by O'Neil Delpratt over 7 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.7.0.12 added
Bug fix applied in the Saxon 9.7.0.12 maintenance release.
Updated by O'Neil Delpratt almost 7 years ago
- Applies to branch deleted (
9.8) - Fix Committed on Branch trunk added
- Fix Committed on Branch deleted (
9.8)
Please register to edit this issue