Re: Another variable question

Subject: Re: Another variable question
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 3 Jun 1999 20:24:36 +0100 (BST)


> Because of the side-effect free nature of XSL, a bound variable cannot have
> its value changed.

> >(I cannot use counters
> >for this purpose because I  will have to do other operations in the future),

> You will need to recalculate the changing value you need, based on your
> changing position in the source node tree, each time you need a new value.

You don't necessarily need to recalculate. As in any other  functional
programming language, you don't have global variables (nasty things
anyway) but you can pass information explictly as arguments to
functions.

In the case of xsl this means declaring your variable as a
param-variable
in any template where it might be used, and explicitly passing on a
value via xsl:param in calls to xsl:apply-templates.

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread