Project

Profile

Help

Bug #3028

closed

Wrong line number for xsl:variable in XSLT Trace

Added by Ben Guillon over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2016-11-13
Due date:
% Done:

100%

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

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.

Actions #1

Updated by Ben Guillon over 7 years ago

Data are attached to bug #3027, not #3207

Actions #2

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.

Actions #3

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
Actions #4

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.

Actions #5

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

Also available in: Atom PDF