user84
user84

Reputation: 1

XSL global value assignment

i have declare one XSL variable

I wanted to chage value of that variable dynamically

ex. var X = 0

if i wanted to reassing X = 100.

It only assign first value to variable , how can i do that in XSL for global assignment of values?

Upvotes: 0

Views: 818

Answers (2)

carillonator
carillonator

Reputation: 4743

<xsl:variable>s are actually constants, you can't change them. If you see one inside a for-each loop, for example, a variable is actually being defined every time the loop runs, not changed.

You may want to check out parameters. They only work in certain situations, but you can pass a value into a template (either with call-template or apply-templates) with a parameter, sort of like you would a variable.

Here is some info

Upvotes: 0

Lucero
Lucero

Reputation: 60236

XSL "variables" are in fact not variable at all, they are always assigned when they are defined and keep their value for the duration of their lifetime.

Upvotes: 1

Related Questions