Re: XSL iteration

Subject: Re: XSL iteration
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 Dec 1999 18:41:32 GMT
in case you do want xslt not ie5...
the following is untested but probably works.

On each pass it applies templates with i set to some value between 1 and
10. 


David

<xsl:template match="/">
<xsl:call-template name="for">
  <xsl:with-param name="from" select="1"/>
  <xsl:with-param name="to" select="10"/>
</xsl:call-template>
</xsl:template>


<xsl:template name="for">
<xsl:param name="from" />
<xsl:param name="to" />
<xsl:if test="$from &lt;= $to">
  <xsl:apply-templates>
    <xsl:with-param name="i" select="$from"/>
  </xsl:apply-templates>
<xsl:call-template name="for">
  <xsl:with-param name="from" select="$from+1"/>
  <xsl:with-param name="to" select="$to"/>
</xsl:call-template>
</xsl:if>
</xsl:template>


and then just define your templates to have a parameter named "i"
which you can test for....


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


Current Thread