[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: AW: xsl:variable

Subject: RE: AW: xsl:variable
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Thu, 22 Jul 2004 11:49:23 -0400
xsl modify variable
> From: Evan Wellens [mailto:evanw@xxxxxxxxxxxxxxxxxxxx]
>
> Many thanks , this has been driving me crazy..

Just to summarize the responses, in xslt you have basically two
approaches when you find yourself wanting to modify a global variable
within a template -

1) Pass it into the template as a parameter and compute deltas to get
the current value you want.  This may or may not require a recursive
approach depending on what you want to do and the design of your
template.

2) Compute the value you want based on some local criteria, such as
position, count of ancestors, etc.

If you ask why you are not allowed to change the value of a variable
once it is bound, reflect on the fact that in xslt, the order of
operations is not specified.  You should just assume that templates may
be invoked in any order and assembled correctly later on.  Given that,
you definitely would not want to modify a global variable, since you
would never know what its current value would be at any template
invocation!

Cheers,

Tom P

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.