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

Re: Re: XSL-List Digest V3 #713

Subject: Re: [xsl] Re: XSL-List Digest V3 #713
From: VZAKON@xxxxxxxxxxxxx
Date: Wed, 25 Apr 2001 09:31:00 -0400
Re:  Re: XSL-List Digest V3 #713
This XSL...

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<html>
		<xsl:call-template name="loop">
			<xsl:with-param name="until" select="5"/>
		</xsl:call-template>
		</html>
	</xsl:template>

	<xsl:template name="loop">
		<xsl:param name="until"/>
		<xsl:param name="x">0</xsl:param>
		<xsl:if test="$x &lt; $until">
			<!-- do something with $x -->
			<xsl:value-of select = "$x"/><br/>

			<!-- increment x -->
			<xsl:call-template name="loop">
				<xsl:with-param name="until" select = "number($until)"/>
				<xsl:with-param name="x" select = "number($x)+1"/>
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>

... will "transform" any xml into:

<html>0</br>1</br>2</br>3</br>4</br></html>

Vladimir

>Date:Tuesday, 24 April 2001 1:06pm ET
>To:xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>From:sameulhe@xxxxxxx
>Subject: Re: [xsl] Re: XSL-List Digest V3 #713
>
>
>Banesh
>
>I think it is a little difficulty for xslt to do this,because in xslt,the
value
> of varialbe can not be reset.
>
>ÔÚ 2001-04-24 18:06:00 ÄúдµÀ£º
>>Hello,
>>
>>Can anybody help me to solve this. I am using a for loop to display some
>>information. In that loop i want increment the value of a variable i.e.,
>>x=x+1. How to do this in xsl.
>>
>>Advance thanks
>>
>>
>> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>Best regard
>            HeHangjun
>            sameulhe@xxxxxxx
>			hehangjun@xxxxxxxx
>
>
> 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.