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

RE: What's your visual metaphor for XSL Transformation

Subject: RE: What's your visual metaphor for XSL Transformations?
From: "W Charlton" <XSLList@xxxxxxxxxx>
Date: Thu, 22 Mar 2007 08:47:30 -0000
RE:  What's your visual metaphor for XSL Transformation
Kamal wrote

Snip--
"this is what I think of when I think of recursion". In the past I would 
often draw circles in the air when I was trying to deal with a recursive 
problem, which reminds me of Ouroboros.
Snip--

I see your point. Ouroboros is more easily applied to politicians; they just
don't know when to stop! Stopping in recursive templates is essential.


Continuing on my ant/aphid analogy.

I see recursion as the task one ant has to milk all the aphids.
 
<xsl:for-each select="Branch">
	<xsl:call-template name="MilkAphid">
		<xsl:with-param name="pUnmilkedAphid"
select="count(Aphid/AphidMilk)"/>
	</xsl:call-template>
</xsl:for-each>
<xsl:template name="MilkAphid">
	<xsl:param name="pUnmilkedAphids"/>
	<xsl:choose>
		<xsl:when test="not(pUnmilkedAphids) or $pUnmilkedAphids =
'' "/>
		<xsl:when test="$pUnmilkedAphids &gt; 0">
			<xsl:value-of select="Aphid/AphidMilk"/>
			<xsl:call-template name="MilkAphid">
				<xsl:with-param name="pUnmilkedAphid"
select="$pUnmilkedAphids - 1"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise/>
	</xsl:choose>
</xsl:template>

Sooner or later analogies break down, but it IS Friday:)

William Charlton
The yMonda team
yMonda Limited
w: www.ymonda.net
--~--

Current Thread

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-2011 All Rights Reserved.