Project

Profile

Help

Bug #2562

closed

Missing end tag in result after using xsl:break

Added by Michael Kay almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2015-12-28
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7
Fixed in Maintenance Release:
Platforms:

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:copy

<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

Also available in: Atom PDF