|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: resetting a variable
> From: Aananth.S [mailto:aananth.solaiyappan@xxxxxxxxxx] > Sent: Tuesday, October 14, 2003 10:05 AM > Subject: resetting a variable > > Hi, > > Is there a way i can reset the value of a variable .. > suppose i have > > <xsl:variable name="hello" select="100"/> > <xsl:for-each select="//manyrows> > <!-- i need to set the variable to hello to the value of > manyrows/rowval --> > </xsl:for-each> > How do i accomplish this? VFAQ. Once an XSLT variable is bound to a value, you can't change it. By moving the variable element inside your for-each loop: <xsl:for-each select="//manyrows"> <xsl:variable name="hello" select="manyrows/rowval"/> <!-- etc. --> </xsl:for-each> you can then have a new value for $hello in each iteration. However, this variable will only be in scope within the for-each loop and would cease to exist once the loop has ended. hth, b. | brian martinez brian.martinez@xxxxxxxxxxx | | lead gui programmer 303.357.3548 | | cheap tickets, part of trip network fax 303.357.3380 | | 6560 greenwood plaza blvd., suite 400 englewood, co 80111 | | cendant travel distribution services http://www.cheaptickets.com/ | XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








