Project

Profile

Help

Bug #2841

closed

closing tag of result elements missing when using streamed grouping of grounded nodes

Added by Martin Honnen almost 8 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Streaming
Sprint/Milestone:
-
Start date:
2016-07-15
Due date:
% Done:

100%

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

Description

In https://saxonica.plan.io/issues/2830, besides the main issue about the position() being wrong, I also reported that "the closing tag is missing". Unfortunately while the latest release fixes the main issue, the problem about the missing closing tag does not seem to have been fixed.

It seems a general problem with streamed grouping of grounded nodes and result elements as a wrapper, for instance when I run


<?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:math="http://www.w3.org/2005/xpath-functions/math" exclude-result-prefixes="xs math"
	version="3.0">
	
	<xsl:strip-space elements="*"/>
	<xsl:output indent="yes"/>
	
	<xsl:mode streamable="yes" on-no-match="shallow-copy"/>
	
	<xsl:template match="books">
		<root>
			<subjects>
				<xsl:for-each-group select="copy-of(book)" group-by="subject">
					<subject name="{current-grouping-key()}">
						<xsl:apply-templates select="current-group()"/>
					</subject>
				</xsl:for-each-group>
			</subjects>
		</root>
	</xsl:template>
	
	<xsl:template match="book/subject"/>
	
</xsl:stylesheet>

against

<?xml version="1.0" encoding="UTF-8"?>
<books>
	<book>
		<title>book 1</title>
		<subject>XSLT</subject>
	</book>
	<book>
		<title>book 2</title>
		<subject>XQuery</subject>
	</book>
	<book>
		<title>book 3</title>
		<subject>XSLT</subject>
	</book>
	<book>
		<title>book 4</title>
		<subject>C#</subject>
	</book>
</books>

then the result using Saxon Saxon-EE 9.7.0.7J from the command line is

<?xml version="1.0" encoding="UTF-8"?>
<root>
   <subjects>
      <subject name="XSLT">
         <book>
            <title>book 1</title>
         </book>
         <book>
            <title>book 3</title>
         </book>
      </subject>
      <subject name="XQuery">
         <book>
            <title>book 2</title>
         </book>
      </subject>
      <subject name="C#">
         <book>
            <title>book 4</title>
         </book>
      </subject>

with both end tags of the result elements missing.

Please register to edit this issue

Also available in: Atom PDF