RE: [xsl] recursive loop in XSL stylesheet is failing

Subject: RE: [xsl] recursive loop in XSL stylesheet is failing
From: "Robby Pelssers" <robby.pelssers@xxxxxxxxx>
Date: Thu, 25 Mar 2010 21:19:10 +0100
I do actually the same in this function:

  <xsl:function name="nxp:getRowSpanForSymbolAndParameter" as="xs:integer">
    <xsl:param name="_currentRowSpan" as="xs:integer"/>
    <xsl:param name="_currentRow"/>
    <xsl:param name="_nextRow"/>
    <xsl:choose>
      <!-- we check next rows recursively -->
      <xsl:when test="deep-equal($_currentRow/entry[1], $_nextRow/entry[1])
and deep-equal($_currentRow/entry[2], $_nextRow/entry[2])">
        <xsl:value-of
select="nxp:getRowSpanForSymbolAndParameter($_currentRowSpan + 1, $_nextRow,
$_nextRow/following-sibling::row[1])"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$_currentRowSpan"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:function>

The currentrowspan is increased on each recursive call.  But you can easily
use the same approach when using templates.

Cheers,
Robby




-----Original Message-----
From: George [mailto:news.net@xxxxxxx]
Sent: Thursday, March 25, 2010 9:02 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] recursive loop in XSL stylesheet is failing

Great stuff!!

Thank you very much, guys.
Send you some virtual drinks.

Cheers,
George

Current Thread