https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2021-05-12T17:56:09ZSaxonica Developer CommunitySaxon - Bug #4970: line/column number in trace listenerhttps://saxonica.plan.io/issues/4970?journal_id=179632021-05-12T17:56:09ZMichael Kaymike@saxonica.com
<ul><li><strong>Category</strong> set to <i>Diagnostics</i></li><li><strong>Assignee</strong> set to <i>Michael Kay</i></li><li><strong>Priority</strong> changed from <i>Low</i> to <i>Normal</i></li></ul><p>It seems there was a change in design for tracing in 10.x - instead of wrapping each expression/instruction in a TraceExpression as it is created, we post process the compiled code adding trace expressions into the tree on completion. The effect is that the TraceExpression for an ApplyTemplates instruction (for example), now takes the location information from the compiled ApplyTemplates instruction in the expression tree, not from the source xsl:apply-elements element in the source tree. This turns out to be inaccurate, because we are not systematically transferring the location information from source instructions to compiled instructions - instead, it is being inferred from parent instructions or child expressions.</p> Saxon - Bug #4970: line/column number in trace listenerhttps://saxonica.plan.io/issues/4970?journal_id=179642021-05-12T18:22:48ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Applies to branch</strong> <i>10, trunk</i> added</li><li><strong>Fix Committed on Branch</strong> <i>10, trunk</i> added</li></ul><p>The location information used to be set in StyleElement.makeTraceInstruction(), which still exists in vestigial form although it no longer does anything useful. I think we can probably fix it by repurposing (and renaming) this method, since it is called in all the right places.</p>
<p>This fixes the two cases where instruction information is inaccurate (xsl:apply-templates and xsl:copy). It doesn't fix the remaining difference in this example, namely the lack of a column number for xsl:template. This omission is unlikely to matter for most people, but I guess we should try and provide it for consistency.</p>
<p>So I've added a column number attribute to <code>TemplateRule</code> and <code>Actor</code>.</p> Saxon - Bug #4970: line/column number in trace listenerhttps://saxonica.plan.io/issues/4970?journal_id=184652021-09-16T13:59:44ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in Maintenance Release</strong> <i>10.6</i> added</li></ul><p>Bug fix applied in the Saxon 10.6 maintenance release</p> Saxon - Bug #4970: line/column number in trace listenerhttps://saxonica.plan.io/issues/4970?journal_id=248292023-10-09T09:10:34ZAir Quick
<ul></ul><p>Saxon-HE 12.3:</p>
<pre><code>$ cat in.xml
<?xml version="1.0" encoding="UTF-8"?>
<iron weight="1" />
$ java -jar ${SAXON_JAR} -s:in.xml -xsl:'https://github.com/xspec/xspec/raw/v2.0.7/tutorial/coverage/demo.xsl' -T
<trace saxon-version="12.3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<source node="/iron" line="2" file="in.xml">
<xsl:template match="iron" line="11" column="50" module="demo.xsl">
<LRE name="shield" line="12" column="11" module="demo.xsl">
<xsl:apply-templates line="13" column="3" module="demo.xsl">
<source node="/iron/@weight" line="2" file="in.xml">
<xsl:template match="@* | node()" line="8" column="48" module="demo-imported.xsl">
<xsl:copy line="10" column="3" module="demo-imported.xsl">
</xsl:copy>
</xsl:template>
</source><!-- /iron/@weight -->
</xsl:apply-templates>
</LRE>
</xsl:template>
</source><!-- /iron -->
<?xml version="1.0" encoding="UTF-8"?><shield weight="1"/></trace>
</code></pre>
<p>Compared to 9.9.1.8, <code>xsl:apply-templates</code> and <code>xs:copy</code> still look incorrect.</p>