Friday, April 19, 2013

XSL - Loop/Recursive

Lopp/Recursive Template

<xsl:template name="recursive">
  <xsl:param name="num" />
  <xsl:if test="not($num = 500)">

  do something ...
  <xsl:call-template name="recursive">
     <xsl:with-param name="num" select="$num + 50" />
  </xsl:call-template>
</xsl:if>
</xsl:template>


Call Template

<xsl:call-template name="recursive">
     <xsl:with-param name="num" select="0" />
</xsl:call-template>


Reference

http://stackoverflow.com/questions/13199515/xsl-loop-inside-a-template

0 comments:

Post a Comment