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

Related Posts:

  • XSL - Select Node by variable name Case 1 <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svg="http://www.w3.org/2000/svg"    xmlns:fo="http://www.w3.org/1999/XSL/Format"  &nbs… Read More
  • XSLT - Resize External GraphicResize External Graphic <fo:external-graphic  src="s\image.png"   content-height="scale-to-fit"  height="2.00in"   content-width="2.00in"  scaling="non-uniform"/> Or <xsl:attribute-set na… Read More
  • XSL - Select Node Name LocaleName <xsl:value-of select="local-name()" />   Name <xsl:value-of select="name()" /> Select Parent node as node <xsl:value-of select="*[name(parent::*)]" /> … Read More
  • XSL - xsl:call-template or xsl:function XSL version 1.0 There is no xsl:function in XSL version 1.0 <xsl:template name="helloWorld"> <xsl:text>Hello World!</xsl:text> </xsl:template> (...) <xsl:template match… Read More
  • XSL - Global Variable Change Global Variable in XSL http://stackoverflow.com/questions/9608432/incrementing-and-checking-the-counter-variable-in-xslt Cannot increment a variable in XSLT because all XSLT variables are constant. There are, however, seve… Read More

0 comments:

Post a Comment