[xsl] text nodes not merged

Subject: [xsl] text nodes not merged
From: Wolfgang Jeltsch <wolfgang@xxxxxxxxxxx>
Date: Thu, 14 Sep 2006 17:13:22 +0200
Hello,

please consider this stylesheet:

	<?xml version="1.0"?>
	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
		xmlns:example="http://www.example.com/";
		version="2.0">
	  <xsl:function name="example:double-text">
	    <xsl:param name="node"/>
	    <xsl:value-of select="$node"/>
	    <xsl:text>#</xsl:text>
	  </xsl:function>
	  <xsl:template match="/">
	    <hello>
	      <xsl:for-each select="example:double-text(/)">
	        <hi>
	          <xsl:value-of select="."/>
	        </hi>
	      </xsl:for-each>
	    </hello>
	  </xsl:template>
	</xsl:stylesheet>

According to http://www.w3.org/TR/xslt20/#constructing-complex-content
(point 6 in the list there), the two text nodes created by the function's 
sequence constructor should be merged, as far as I can see.  However, they 
aren't which is shown by the fact that the stylesheet outputs two hi elements 
instead of one.  What's wrong here?

By the way, I use the open-source edition of Saxon 8.7.3J on Debian GNU/Linux 
3.1.

Best wishes,
Wolfgang

Current Thread