This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Filling gaps in a list of values




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>&#xA;</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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]