Miguel J. Jiménez said:
Hi, I need to make a FOR structure using XSL... ie. I want to make a structure for moving between 0 and x, being x a variable name... How can I do this?
The short answer is, you don't. But here's a template that uses recursion to do pretty much the same:
<xsl:template name="recur">
<xsl

aram name="n" select="number(1)"/>
<!-- 1-based rather than 0-based is more XML-ian

--> <xsl

aram name name="max"/>
<!-- your code here. $n holds the current loop number if you want to refer to it.
Note that changing this template to iterate downwards is a little more efficient and correct, IMO. Then you have no $max, you specify $n as your highest value, and the test is $n > 0 and encases this whole section rather than just the recursive call-template.
-->
<xsl:if test="$n < $max">
<xsl:call-template name="recur">
<xsl:with-param name="max" select="$max"/>
<xsl:with-param name="n" select="1 + $n"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
Call that template specifying $max as the value you want to iterate up to. If you must start at 0 rather than 1, specify $n as 0.