Bug #6463
openTrace omits xsl:copy and literal result element with Saxon-HE 12.5J
0%
Description
Comparing traces between Saxon-HE 12.5J and Saxon-HE 12.4J, I am seeing some omitted items for xsl:copy and literal result elements. Here is an example.
XSLT file, demo.xsl¶
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="demo-imported.xsl" />
<!--
Makes <iron> into <shield>
This template overrides an imported template.
-->
<xsl:template as="element(shield)" match="iron">
<shield>
<xsl:apply-templates select="@* | node()" />
</shield>
</xsl:template>
<!--
Makes <iron> into <gold>
Only in alchemy mode.
-->
<xsl:mode name="alchemy" on-multiple-match="fail" on-no-match="fail" />
<xsl:template as="element(gold)" match="iron" mode="alchemy">
<gold>
<xsl:apply-templates select="@* | node()" />
</gold>
</xsl:template>
</xsl:stylesheet>
Imported XSLT file, demo-imported.xsl¶
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Identity template
-->
<xsl:template as="node()" match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<!--
Makes <iron> into <sword>
This template will be overridden.
-->
<xsl:template as="element(sword)" match="iron">
<sword>
<xsl:apply-templates select="@* | node()" />
</sword>
</xsl:template>
</xsl:stylesheet>
XML file, source.xml¶
<?xml version="1.0" encoding="UTF-8"?>
<iron weight="1" />
Command to reproduce problem¶
java -cp "%SAXON_CP%" net.sf.saxon.Transform -s:source.xml -xsl:demo.xsl -T 2>trace-saxon12p5.xml
Saxon 12.4 trace¶
<trace saxon-version="12.4" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<source node="/iron" line="2" file="source.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="48" module="demo.xsl">
<source node="/iron/@weight" line="2" file="source.xml">
<xsl:template match="@*" line="8" column="48" module="demo-imported.xsl">
<xsl:copy line="9" column="13" module="demo-imported.xsl">
</xsl:copy>
</xsl:template>
</source><!-- /iron/@weight -->
</xsl:apply-templates>
</LRE>
</xsl:template>
</source><!-- /iron -->
</trace>
Saxon 12.5 trace¶
The <LRE>
and <xsl:copy>
elements don't appear.
<trace saxon-version="12.5" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<source node="/iron" line="2" file="source.xml">
<xsl:template match="iron" line="11" column="50" module="demo.xsl">
<xsl:apply-templates line="13" column="48" module="demo.xsl">
<source node="/iron/@weight" line="2" file="source.xml">
<xsl:template match="@*" line="8" column="48" module="demo-imported.xsl">
</xsl:template>
</source><!-- /iron/@weight -->
</xsl:apply-templates>
</xsl:template>
</source><!-- /iron -->
</trace>
For convenience, I'm uploading a ZIP-file that contains the XSLT, XML, and trace files. As background, this test case is based on https://github.com/xspec/xspec/tree/master/tutorial/coverage
.
Files
Updated by A Galtman 6 months ago
I'm attaching another ZIP-file. one-copy-missing-one-copy-present.zip
. that reproduces a case in which one xsl:copy
is missing from the trace and another is present. The Saxon command is:
java -cp "%SAXON_CP%" net.sf.saxon.Transform -s:source-xsl-copy.xml -xsl:xsl-copy-01.xsl -T 2>trace-copy-saxon12p5.xml
This test case is based on https://github.com/xspec/xspec/blob/master/test/end-to-end/cases-coverage/xsl-copy-01.xsl (thanks, Adrian).
Please register to edit this issue