Last active
February 8, 2016 22:55
-
-
Save jessgusclark/44f2c05b1981cab047b5 to your computer and use it in GitHub Desktop.
Integer Loop in XSLT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:template name="main-template"> | |
<xsl:call-template name="remaining-template-loop"> | |
<xsl:with-param name="total" select="10"/> | |
</xsl:call-template> | |
</xsl:template> | |
<xsl:template name="remaining-template-loop"> | |
<xsl:param name="total" /> | |
<xsl:param name="count" select="1" /> | |
<xsl:if test="$count < $total"> | |
<!-- Do something meaningful here --> | |
<xsl:value-of select="concat($count, ', ')" /> | |
<xsl:call-template name="remaining-template-loop"> | |
<xsl:with-param name="total" select="$total" /> | |
<xsl:with-param name="count" select="$count + 1"/> | |
</xsl:call-template> | |
</xsl:if> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment