Project

Profile

Help

Bug #5118

closed

Incorrect handling of multiple xsl:mode declarations for the same mode

Added by Martin Honnen about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2021-10-08
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 11
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

When I try to run a streamable transformation where I have the streamable declaration first in a single <xsl:mode streamable="yes"/> and later on a second xsl:mode with e.g. <xsl:mode on-no-match="shallow-copy"/> both Saxon EE 10.6 Java and SaxonCS 11 EE seem to build a tree based on the TIMING or -t output.

Simple repro: XML:

<root>
  <data>This is a test.</data>
</root>

XSLT:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="3.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="#all"
  expand-text="yes">

  <xsl:mode streamable="yes"/>

  <xsl:template match="/" name="xsl:initial-template">
    <xsl:next-match/>
    <xsl:comment>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</xsl:comment>
  </xsl:template>

 <xsl:mode on-no-match="shallow-copy"/>

</xsl:stylesheet>

Output with Saxon EE 10.6 from the command line:

PS C:\Users\marti\OneDrive\Documents\xslt\xslt4-examples\streamable-identity> java -jar 'C:\Program Files\Saxonica\SaxonEE10-6J\saxon-ee-10.6.jar' -t -s:.\input-sample1.xml -xsl:.\identity-streamable-two-separate-mode-declarations1.xsl
Saxon-EE 10.6J from Saxonica
Java version 1.8.0_292
Using license serial number V.....
Stylesheet compilation time: 615.5411ms
Processing file:/C:/Users/marti/OneDrive/Documents/xslt/xslt4-examples/streamable-identity/./input-sample1.xml
Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Building tree for file:/C:/Users/marti/OneDrive/Documents/xslt/xslt4-examples/streamable-identity/./input-sample1.xml using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 3.1059ms
Tree size: 6 nodes, 15 characters, 0 attributes
<?xml version="1.0" encoding="UTF-8"?><root>
  <data>This is a test.</data>
</root><!--Run with SAXON EE 10.6 -->Execution time: 88.7911ms
Memory used: 62Mb

Output with SaxonCS:

PS C:\Users\marti\OneDrive\Documents\xslt\xslt4-examples\streamable-identity> & 'C:\Program Files\Saxonica\SaxonCS-11.0\SaxonCS.exe' transform -t -s:.\input-sample1.xml -xsl:.\identity-streamable-two-separate-mode-declarations1.xsl
SaxonCS-EE 11.0 from Saxonica
.NET 5.0.9 on Windows 10.0.19043.0
Using license serial number V.....
Stylesheet compilation time: 566,8583ms
Processing file:///C:/Users/marti/OneDrive/Documents/xslt/xslt4-examples/streamable-identity/input-sample1.xml
Building tree for file:///C:/Users/marti/OneDrive/Documents/xslt/xslt4-examples/streamable-identity/input-sample1.xml using Saxon.Hej.tree.tiny.TinyBuilder
Tree built in 5,9621ms
Tree size: 6 nodes, 65536 characters, 0 attributes
<?xml version="1.0" encoding="UTF-8"?><root>
  <data>This is a test.</data>
</root><!--Run with SAXON EE 11.0 -->Execution time: 100,9325ms
Memory used: 0Mb

Please register to edit this issue

Also available in: Atom PDF