Re: [xsl] Increment/decrement a variable in XSL

Subject: Re: [xsl] Increment/decrement a variable in XSL
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 3 Apr 2002 11:14:00 +0100
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.
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


Current Thread