This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Increment/decrement a variable in XSL


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]