This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Filling gaps in a list of values
- From: "Andrew Welch" <andrew at thebristoldirectory dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 22 Jan 2002 14:04:14 -0000
- Subject: RE: [xsl] Filling gaps in a list of values
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Jeni,
I was reading your answer to the previous 'filling gaps in a list' problem
and have a question that Im hoping you can answer for me-
Does the variable $node 'pick up' a different node on each iteration of the
template? Is the variable changing on each iteration, or is something else
going on?
Thanks in advance
cheers
andrew
===
<xsl:template name="countDown">
<xsl:param name="from" select="1" />
<xsl:param name="to" select="1" />
<xsl:variable name="node" select="node[@order = $from]" />
<xsl:value-of select="concat('order ', $from, ': ')" />
<xsl:choose>
<xsl:when test="$node">
<xsl:value-of select="$node/@name" />
</xsl:when>
<xsl:otherwise>no name</xsl:otherwise>
</xsl:choose>
<xsl:text>
</xsl:text>
<xsl:if test="$from > $to">
<xsl:call-template name="countDown">
<xsl:with-param name="from" select="$from - 1" />
<xsl:with-param name="to" select="$to" />
</xsl:call-template>
</xsl:if>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list