Something like this :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
        <xsl:template match="/">
                <p>Test Page</p>
                
                <xsl:call-template name="forloop">
                        <xsl:with-param name="counter" select="1"/>
                </xsl:call-template>
        </xsl:template>
        
        <xsl:template name="forloop">
                <xsl:param name="counter"/>
                
                <p><xsl:value-of select="$counter"/></p>
                
                <xsl:if test="$counter &lt; 5">
                        <xsl:call-template name="forloop">
                                <xsl:with-param name="counter" select="$counter +1"/>
                        </xsl:call-template>
                </xsl:if>
        </xsl:template>
</xsl:stylesheet>



> Somebody knows how to implement a for-like loop in XSLT? I found the
> following example in XSLT 2.0, but it doesn't work in 1.0:
>
>   <xsl:for-each select="1 to 5">
>     <xsl:variable name="x" select="$x+1"/>
>   <xsl:for-each>

-- 
Kind regards,
Yves Vindevogel

Implements
Kortrijkstraat 2 bus 1  --  9700 Oudenaarde  --  Belgium
Phone/Fax: +32 (55) 45.74.73  --  Mobile: +32 (478) 80.82.91
Mail: [EMAIL PROTECTED]  --  www.implements.be

Quote: The winner never says participating is more important than winning.

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to