Subject: Re: Breaking up is hard to do. From: Steve Tinney <stinney@xxxxxxxxxxxxx> Date: Sun, 20 Feb 2000 00:48:49 -0500 |
> 2. Recursion using call-template. > Because call-template does not change the current node list > I am unable to move or traverse the node list. > Each call to 'colCounter' generates three input fields, but only > one has data output as there is only one element in the node > list inside the called template. There is a bug in your recursion code, I suppose. Try something like the following: <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:call-template name="triples"> <xsl:with-param name="nodes" select="/*/f"/> </xsl:call-template> </xsl:template> <xsl:template name="triples"> <xsl:param name="nodes"/> <tr><td><xsl:value-of select="$nodes[1]"/></td> <td><xsl:value-of select="$nodes[2]"/></td> <td><xsl:value-of select="$nodes[3]"/></td></tr> <xsl:if test="count($nodes) > 3"> <xsl:call-template name="triples"> <xsl:with-param name="nodes" select="$nodes[position() > 3]"/> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> Steve XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Breaking up is hard to do., Joel Hughes | Thread | Re: Breaking up is hard to do., Steve Muench |
Postscript directly from XSL, Jon Smirl | Date | Re: Breaking up is hard to do., Steve Muench |
Month |