Bug #2562
closedMissing end tag in result after using xsl:break
100%
Description
See https://saxonica.plan.io/boards/3/topics/6262
Saxon - Help: Getting incomplete result document when using xsl:break in xsl:iterate in xsl:copy with streaming mode
Martin Honnen
I am getting an incomplete result document with a missing closing end tag of the root element when using the following stylesheet with Saxon 9.7 EE:
<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="xs">
<xsl:param name="elements-to-copy" as="xs:integer" select="5"/>
<xsl:mode streamable="yes"/>
<xsl:output indent="yes"/>
<xsl:template match="/*">
<xsl:iterate select="*">
<xsl:copy-of select="."/>
<xsl:if test="position() eq $elements-to-copy">
<xsl:break/>
</xsl:if>
</xsl:iterate>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The input document is
......
...
...
...
...
...
...
The output is lacking the closing end tag of the root element:
......
...
...
...
As the xsl:copy is outside of the xsl:iterate I would expect the root element to be closed properly.
Please register to edit this issue