[xsl] xsl:if with "and' in test expression triggers error when running in xslt 2.0 mode?

Subject: [xsl] xsl:if with "and' in test expression triggers error when running in xslt 2.0 mode?
From: Taras Tielkes <taras@xxxxxxx>
Date: Tue, 17 Jun 2003 12:49:50 +0200
Hi,

Source document structure is
/doc
	/line
	/line
	...

My stylesheet contains some code to group these lines into a 3-column table.
Along the way some cleanup is done:
1) no rows will be inserted if all the cells are empty
2) the last row will not be inserted if it contains less than 3 cells.

Running the stylesheet quoted below in Saxon 7.5.1 triggers the error:
"A sequence of more than one item is not allowed here" at the line
containing the xsl:if element.

When I set the version attribute to "1.0" the sheet seems to work fine.

What makes ik fail when running in xslt 2.0 mode?

Thanks,

tt

----------------------------------------------------------------------------
-

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    
    <xsl:output method="xml" indent="yes"/>
    
    <xsl:template match="/">
        
        <table>
            <xsl:for-each select="doc/line[position() mod 3 = 1]">
                <xsl:variable name="rows"
	
select="self::line|following-sibling::line[position() lt 3]"/>
                
                <xsl:if test="count($rows) = 3 and normalize-space($rows)">
                    <row>
                        <xsl:for-each select="$rows">
                            <col>
                                <xsl:value-of select="."/>
                            </col>
                        </xsl:for-each>
                    </row>
                </xsl:if>
                
            </xsl:for-each>
        </table>

    </xsl:template>
    
</xsl:stylesheet>

----------------------------------------------------------------------------
-

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread