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

Re: Scope of variables

Subject: Re: Scope of variables
From: "Mike Haarman" <mhaarman@xxxxxxxxxxxxxxxxxx>
Date: Thu, 8 May 2003 15:19:14 -0500
declaring template variable
----- Original Message ----- 
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>

> The scope of the variable is the enclosing block, which in this case are
> "when" or "otherwise" blocks.  This question comes up all the time on
> the list.  Just check the FAQs and pay attention to some of the other
> threads.  Outside its scope the variable is not available.

There is a common gotcha, as well.

It should be noted that variables in template bodies and not constrained to the
template bodies of blocks, as above, scope to the template enclosing their
declaration and all following::sibling templates and their children in document
order in the stylesheet, yet not to child templates called or applied from
within that declaring template.  Variables declared at the top-level of the
stylesheet are available throughout the transformation.

hth,

Mike


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


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.