Re: xsl:variable {RE: XSL to handle display mutiple pages}

Subject: Re: xsl:variable {RE: XSL to handle display mutiple pages}
From: Mike Brown <mike@xxxxxxxx>
Date: Tue, 7 Nov 2000 17:08:00 -0700 (MST)
Xu, Xiaocun wrote:
> 	I read in the book that once set, xsl:variable is non-changable.

Correct, for as long as the variable is in scope. When/where the variable
goes out of scope, you can assign it to something else.

> How do I have a changable variable, xsl:param?

No, xsl:param lets you assign a default value. It is usually used in
conjuction with xsl:with-param to pass a value to a template where the
variable would have otherwise been out of scope.

Understand that a variable is a *name* assigned to an *object* of one of
the basic types: boolean, number, string, node-set, result tree fragment.
When we talk about a variable's "value" we usually mean the object,
because a variable's "string-value" is the object's string-value, and is a
distinct concept.

xsl:variable or xsl:param just provide ways to bind a name to an object.
Once such a binding is made, you cannot bind the variable to another name.

What is it you are trying to do? Chances are, you are trying to do
procedural programming in a functional, declarative language, and there's
another way to accomplish the same result that doesn't rely on variable

   - Mike
Mike J. Brown, software engineer at         My XML/XSL resources: in Denver, Colorado, USA 

 XSL-List info and archive:

Current Thread