[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: AW: For loop

Subject: RE: AW: For loop
From: Bedwell Tom <Tom.Bedwell@xxxxxxx>
Date: Thu, 12 Jul 2001 14:12:50 +0100
xsl for each counting loop
You're trying to make XSLT work like a procedural language, which it isn't.
Far better to work with the language than against it. As previous posters
have said, you should use the xsl:for-each select attribute  to choose a set
of nodes you wish to process.

Tom

-----Original Message-----
From: Devan Govender [mailto:Devan.Govender@xxxxxxxxxxxxxxxxxxx]
Sent: 12 July 2001 13:01
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: AW:  For loop


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 &lt; $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@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]Im Auftrag von Devan
> Govender
> Gesendet: Donnerstag, 12. Juli 2001 13:34
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: Re:  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

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.