[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Recursive for loop & xslt 2.0
Hi, I used an example of a recursive for loop as below: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="/"> <html> <head><title>Say Hello Ten Times!</title></head> <body> <b>I am going to say hello Ten Times!</b> <!-- begin_: Send_Loop_To_HTML --> <xsl:call-template name="for.loop"> <xsl:with-param name="i">1</xsl:with-param> <xsl:with-param name="count">10</xsl:with-param> </xsl:call-template> </body> </html> </xsl:template> <!--begin_: Define_The_Output_Loop --> <xsl:template name="for.loop"> <xsl:param name="i" /> <xsl:param name="count" /> <!--begin_: Line_by_Line_Output --> <xsl:if test="$i <= $count"> <br /> <b><xsl:value-of select="$i" />.</b>Hello world! </xsl:if> <!--begin_: RepeatTheLoopUntilFinished--> <xsl:if test="$i <= $count"> <xsl:call-template name="for.loop"> <xsl:with-param name="i"> <xsl:value-of select="$i + 1"/> </xsl:with-param> <xsl:with-param name="count"> <xsl:value-of select="$count"/> </xsl:with-param> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> As soon as I change the xsl:stylesheet/@version to "2.0" it stops working as expected. Can you please let me know what am I missing? Thanks, Viente
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|