Bug #1751
closedWrong location information when debugging
100%
Description
I have run a transformation over the attached sample files with trace information:
As you can see in the log, the location information starting with variable *v* is wrong (for example variable *v* is located on line *4*):
<pre>
<trace saxon-version="9.5.0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<source node="/" line="0" file="deb.xml">
<xsl:template match="/" line="2" module="deb.xsl">
<xsl:variable name="a" line="3" module="deb.xsl">
<xsl:variable name="v" line="3" module="deb.xsl">
<xsl:choose line="4" module="deb.xsl">
The problem appears to be related to variable a which is unused. Also, if you disable the optimizations the line information is correct:
java -cp saxon9ee.jar;saxon-license.lic net.sf.saxon.Transform -s:deb.xml -xsl:deb.xsl -T -opt:0
Correct output:
<trace saxon-version="9.5.0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<source node="/" line="0" file="deb.xml">
<xsl:template match="/" line="2" module="deb.xsl">
<xsl:variable name="a" line="3" module="deb.xsl">
<xsl:variable name="v" line="4" module="deb.xsl">
<xsl:choose line="5" module="deb.xsl">
Files
Updated by O'Neil Delpratt over 11 years ago
- Category set to Internals
- Status changed from New to Resolved
- Assignee set to O'Neil Delpratt
- % Done changed from 0 to 100
Thanks for reporting the issue to found. It is indeed a bug which we have managed to resolve and commit to subversion.
During the optimization the rewritten expressions were over-writing the location information unnecessarily when it should maintain it, when it is known. Fix applied in the ExpressionTool class.
Updated by Michael Kay over 11 years ago
The patch had a side-effect which I am correcting; it meant that the "Container" information for nodes in the expression tree could be null, leading to a NullPointerException.
Updated by O'Neil Delpratt over 11 years ago
- Status changed from Resolved to Closed
- Found in version changed from 9.5.0.1 to 9.5
- Fixed in version set to 9.5.0.2
Please register to edit this issue