Forgive my 'newbie' answer, but it seems like what you're trying to do would be better suited to xsl:param than xsl:variable. Why not try using an xsl:param instead?

You don't need to read further (move along folks, there's nothing interesting to see here), but as I understand it, an xsl:variable must be defined at the top of an xsl:template and cannot be changed. From the Michael Fitzgerald's book, XSL Essentials:

  ...the value bound by param is considered only
  a default or intial value because you can later
  pass a new value to a parameter either from outside
  of the stylesheet, such as from the command line,
  or from another template using the with-param

  As for the value of variable, as a general rule,
  once it is set, it is set, and you can't change
  it dynamically....Under certain conditions, though,
  you can change the value of a local variable in a

Again, as I understand it, those "certain conditions" are essentially if you assign a xsl:variable name="myVar-1" select="Price[1]", and then the value of "Price[1]" (where Price[1] is the first position of the "Price" nodein a group of "Price" nodes) changes, it is effectively changing the xsl:variable.

Like I said. Nothing interesting to see here...



At 02:42 AM 12/3/2002, you wrote:
Is there a way to change the value of a global xsl variable?
is it possible to declare a vraiable at some location in the stylesheet and
affect it a value at some other location?


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

- Clay Leeds
- Web Developer

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to