This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: AW: For loop
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: AW: [xsl] For loop
- From: Devan Govender <Devan dot Govender at softwarefutures dot com>
- Date: Thu, 12 Jul 2001 14:00:57 +0200
- Organization: Software Futures
- References: <58EA8B005C0D4146894203A77711F0820220F8@KNECHT.PFEILGMBH.DE>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Is it possible to do the following :
<xsl:for-each select="EMPLOYEE_NO">
<tr>
<td WIDTH="62"><font face="Verdana" size="1"> <xsl:value-of
select="."/> </font></td>
<td WIDTH="89"><font face="Verdana" size="1"> <xsl:value-of
select="CONTRACT"/> </font></td>
<td WIDTH="191"><font face="Verdana" size="1" align="CENTER">
<xsl:value-of select="MEMBER_NAME"/> </font></td>
</tr>
<xsl:variable name="temp">
<xsl:value-of select="$counting+1"/>
</xsl:variable>
<xsl:if test="$temp = 10">
<xsl:call-template name="BILLING_TEMP2">
<xsl:with-param name="counting" select="$temp"/>
<xsl:with-param name="counter2" select="$temp2"/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
<xsl:template name="BILLING_TEMP2">
<xsl:param name="counting"/>
<xsl:param name="counter2"/>
<xsl:if test="$counting < $counter2">
<xsl:call-template name="BILLING_TEMP">
<xsl:with-param name="counter" select="1"/>
<xsl:with-param name="counting" select="$counting + 1"/>
</xsl:call-template>
</xsl:template>
to simulate a for loop ???
Michael Schafer wrote:
>
> Devan,
>
> there isn't a break or continue statement. The condition IS in the
> pattern in the select attribute of the <xsl:for-each..> Element. The
> pattern defines a nodeset and the loop will be processed for all nodes
> in this set.
>
> So what you have to do is to define a suitable pattern.
>
> Michael.
>
> -----Ursprungliche Nachricht-----
> Von: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]Im Auftrag von Devan
> Govender
> Gesendet: Donnerstag, 12. Juli 2001 13:34
> An: xsl-list@lists.mulberrytech.com
> Betreff: Re: [xsl] For loop
>
> I have read about the for-each construct.
> What I need though is a way of looping and stopping the loop under
> a certain condition
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
"I count religion but a childish toy, and hold there is no sin but
ignorance." -Christopher Marlowe, 1592
"HEAVEN does'nt want me & HELL is afraid I'll take over"
DEVAN GOVENDER
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list