recursive calls in xslt

DKSV

New Member
I read that using recursion with Divide and Conquer method is efficient. Could anyone suggest how can i improve the recursion call below. All it does is repeat the element "a", 80 times to the output. However it just repeats eighty times without any algorithm. Also how does it improve the performance(any links or pointers?)\[code\]<xsl:variable name="maxcount" select="'80'" /><xsl:variable name="count" select="'1'" /><xsl:if test="$count > 0"> <xsl:call-template name="copyrec"> <xsl:with-param name="index" select="'1'" /> </xsl:call-template></xsl:if><xsl:template name="copyrec"> <xsl:param name="index" /> <xsl:if test="$index <= $maxcount"> <xsl:variable name="tmpind" select="$index"/> <a>this element repeats 80 times</a> <xsl:call-template name="copyrec"> <xsl:with-param name="index" select="$tmpind + 1" /> </xsl:call-template> </xsl:if></xsl:template>\[/code\]
 
Back
Top