cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Cordes <mcord...@maine.edu>
Subject Re: LOOP
Date Thu, 01 Feb 2001 15:17:59 GMT
I'm not sure i understand, but if you want to loop from 1 to n 
here is a way to do it:

<xsl:call-template name="looper">
	<xsl:with-param name="iterations" select="'5'"/>
</xsl:call-template>	

<xsl:template name="looper">
	<xsl:param name="iterations"/>

	<xsl:if test="$iterations &gt; 0">
		<!-- This is the body of your for loop-->
		<!-- do something here -->

		<!-- recursive call -->
		<xsl:call-template name="looper">
			<xsl:with-param name="iterations" select="$iterations - 1"/>
		</xsl:call-template>	
	</xsl:if>
</xsl:template>

btw - this should be posted on the mulberrytech list and something
like it is definitely in their faq.

If you have more xslt questions and cannot solve them using either 
resource feel free to email me off this list.

-matt


On Thu, Feb 01, 2001 at 10:11:14AM -0200, Adenilson Roberto Carvalho wrote:
> Hi people,
> 
> Can anyone please tell me how I can do the following loop in XSL:
> 
>  for (i=0;i<n; i++)  {
>       writemsg(msg);
>                              }
> I've tried too many ways to solve this but I can't find a good
> solution...
> 
> 
> Thanks
> 
> 
> Adenilson
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
> 

Mime
View raw message