[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Increment/decrement a variable in XSL
Subject: Re: Increment/decrement a variable in XSL
From: Petr Cimprich <petr@xxxxxxxxxxxx>
Date: Wed, 03 Apr 2002 15:03:39 +0200
|
Jeni Tennison wrote:
Hi Shaik,
I am trying to compare user entered answers with the actual answers.
If it matches increment the number.
Is it possible to increment or decrement a variable in XSL ?
No. Variables in XSLT can't be "updated".
There are two possible ways that you could achieve what you're after.
The third and the most straightforward way is to use extension
functions. However, such a solution would depend on the processor in use
(to some extent at least).
Petr
First, it might be possible to construct a path that locates all the
correct answers and for you to count them using the count() function.
Alternatively, you'll need to step through the answers one by one
using a recursive template and passing a parameter, which you "update"
to keep count of how many of the answers are correct.
If you need help with either of those, please give an example of your
source XML document and the result that you want from it.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
Petr Cimprich
Ginger Alliance
www.gingerall.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
RSS 2.0 |
|
Atom 0.3 |
|
|