|
[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
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 > 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 --~--
|
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
|






