[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:if with "and' in test expression triggers error wh

Subject: 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
xsl if test expression
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.