This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Breaking up is hard to do.
- To: xsl-list at mulberrytech dot com
- Subject: Re: Breaking up is hard to do.
- From: Steve Tinney <stinney at sas dot upenn dot edu>
- Date: Sun, 20 Feb 2000 00:48:49 -0500
- References: <91023B9A71E1D311B3910050049D57D50E62@rksrv1.redknee.com>
- Reply-To: xsl-list at mulberrytech dot com
> 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