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

using <xsl:variable>

Subject: using <xsl:variable>
From: "Dhruv Raheja" <dhruv_r@xxxxxxxxxxx>
Date: Tue, 26 Sep 2000 10:17:49 EDT
using xsl variable
Hello,
I have a variable whose value I need to increment by 1 every time the template is called. i.e. I have an element called <figure> in which I have defined a variable called "fig". I need to increment the value of fig every time <figure> is called. I initially used the following instructions:


<xsl:template match="figure">
<xsl:variable name="fig" select="($fig+1)"/>
<xsl:value-of select="$fig"/>
------
</xsl:template>

However when I saw the output, all the fig values were displayed as 1. I realized that since fig was a local variable, it was being initialized each time the <figure> template was being called. I need to find a way to "remember" the previous value of fig each time <figure> is called, something similar to "$fig=$fig + 1". Is it possible to write such an expression? Hope someone can help.

Thanks a lot,
Dhruv

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at http://profiles.msn.com.


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.