repeating from 1 to n, xslt

Repetition

1. Repeating something n times.

1.

Repeating something n times.

Evan Lenz

For example, to output <br /> n times.

You'd have to use a recursive named template like the following:

<xsl:template name="line-breaks">
  <xsl:param name="n"/>
  <xsl:if test="number($n) > 0">
    <br/>
    <xsl:call-template name="line-breaks">
      <xsl:with-param name="n" select="number($n) - 1"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>