[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: tail-recursion

Subject: RE: tail-recursion
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Thu, 28 Aug 2003 16:19:36 +0100
head recursion
> Your template parseRows is intrinsically tail-recursive - basically
this
> means that after calling itself, it does nothing else before
returning.

Isn't the template head-recursive... it does all of the xsl:value-of 's
as it unwinds from the stack.

I thought if it was tail recursive it would do the value-of first, then
call itself.  




> > <xsl:template name="parseRows">
> > 	<xsl:param name="catContents"/>
> > 	<xsl:param name="font-size" select="'-1'"/>
> > 	<xsl:choose>
> > 		<xsl:when test="contains($catContents,'~!~')">
> > 			<xsl:call-template name="parseRow">
> > 				<xsl:with-param name="rowContents"
> > select="substring-before($catContents,'~!~')"/>
> > 				<xsl:with-param
> > name="font-size" select="$font-size"/>
> > 			</xsl:call-template>
> > 			<xsl:call-template name="parseRows">
> > 				<xsl:with-param name="catContents"
> > select="substring-after($catContents,'~!~')"/>
> > 				<xsl:with-param
> > name="font-size" select="$font-size"/>
> > 			</xsl:call-template>
> > 		</xsl:when>
> > 		<xsl:otherwise>
> > 			<xsl:value-of select="$catContents"/>
> > 		</xsl:otherwise>
> > 	</xsl:choose>
> > </xsl:template>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • tail-recursion
    • I-Lin Kuo - Thu, 28 Aug 2003 09:44:12 -0400 (EDT)
      • <Possible follow-ups>
      • Andrew Welch - Thu, 28 Aug 2003 11:19:45 -0400 (EDT) <=
      • I-Lin Kuo - Thu, 28 Aug 2003 11:22:12 -0400 (EDT)
      • Andrew Welch - Thu, 28 Aug 2003 11:23:07 -0400 (EDT)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.