Increment value in XSLT


/ Published in: XSLT
Save to your folder(s)

When you want to increment a value in XSLT, this is an option.


Copy this code and paste it in your HTML
  1. <xsl:template name="sections">
  2. <xsl:param name="i" select="1" />
  3. <xsl:param name="boundary" select="11" />
  4.  
  5. <xsl:value-of select="$i" />
  6.  
  7. <xsl:if test="$i &lt; $boundary">
  8. <xsl:call-template name="sections">
  9. <xsl:with-param name="i" select="$i + 1" />
  10. </xsl:call-template>
  11. </xsl:if>
  12. </xsl:template>

URL: xslt-increment

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.