This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL - Variable Assignment
- To: "XSL News Group (E-mail)" <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] Re: XSL - Variable Assignment
- From: "G. Ken Holman" <gkholman at CraneSoftwrights dot com>
- Date: Mon, 30 Apr 2001 18:35:14 +0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
At 01/04/30 15:54 +0600, Thushara Perera wrote:
>Can someone please tell me how to assign a value to a variable in XSL ?
>
>I have defined the variable as below:
>
> <xsl:variable name="foundFlag" select="'Yes'"/>
>
>and later on I want to CHANGE the value of this variable to 'NO'.
>
>How can I do that, PLEASE ?
This language has no side effects, hence, you cannot change variables once
they are bound. Having given a value to "foundFlag", you cannot change it.
You must solve your problem differently and not consider the use of global
variables.
............... Ken
--
G. Ken Holman mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML/OmniMark services, training, products.
Book: Practical Transformation Using XSLT and XPath ISBN 1-894049-06-3
Article: What is XSLT? http://www.xml.com/pub/2000/08/holman/index.html
Next public instructor-led training: 2001-05-01,05-14,05-15,05-16,
- 05-17,05-21,05-22,06-18,06-21,07-20,07-21,09-19
Training Blitz: 3-days XSLT/XPath, 2-days XSLFO in Ottawa 2001-06-18/22
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list