Actions
Bug #4493
closedend tag not written when using xsl:iterate/xsl:break with early exit
Start date:
2020-03-22
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
10
Fix Committed on Branch:
10
Fixed in Maintenance Release:
Platforms:
Description
I have a stylesheet using streaming and xsl:iterate
with xsl:break
doing some early exit, in Saxon 9.9 the result is well-formed document but with 10 the end tag of the root element (created as a literal result element) is missing.
XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:saxon="http://saxon.sf.net/"
exclude-result-prefixes="#all" version="3.0">
<xsl:output indent="yes"/>
<xsl:mode streamable="yes" on-no-match="shallow-skip"/>
<xsl:template match="/">
<items>
<xsl:iterate select="root/items/item">
<xsl:copy-of select=".[@cat != 'bar']"/>
<xsl:if test="@cat = 'bar'">
<xsl:break/>
</xsl:if>
</xsl:iterate>
</items>
</xsl:template>
</xsl:stylesheet>
XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<items>
<item cat="foo">
<value>item 1</value>
</item>
<item cat="foo">
<value>item 2</value>
</item>
<item cat="foo">
<value>item 3</value>
</item>
<item cat="foo">
<value>item 4</value>
</item>
<item cat="foo">
<value>item 5</value>
</item>
<item cat="bar">
<value>item 6</value>
</item>
<item cat="bar">
<value>item 7</value>
</item>
<item cat="bar">
<value>item 8</value>
</item>
<item cat="bar">
<value>item 9</value>
</item>
</items>
</root>
Output with Saxon-EE 10.0J
:
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item cat="foo">
<value>item 1</value>
</item>
<item cat="foo">
<value>item 2</value>
</item>
<item cat="foo">
<value>item 3</value>
</item>
<item cat="foo">
<value>item 4</value>
</item>
<item cat="foo">
<value>item 5</value>
</item>
Output with Saxon-EE 9.9.1.7J
:
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item cat="foo">
<value>item 1</value>
</item>
<item cat="foo">
<value>item 2</value>
</item>
<item cat="foo">
<value>item 3</value>
</item>
<item cat="foo">
<value>item 4</value>
</item>
<item cat="foo">
<value>item 5</value>
</item>
</items>
Files
Please register to edit this issue
Actions