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

Variable Scope

Subject: Variable Scope
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Wed, 11 May 2005 09:37:30 -0700
xsl variable scope
Hello,

So far I have not ran into any troubles with variable scope, and I am
refering to globabl variable scope - variables defined within my base
template.  I am having trouble now with a MAX_DATE variable I have
defined.  So, I am wondering about execution plan and where/when
variables are available.  Given the following inclusiong/import plan I
will attempt to describe where it appears that MAX_DATE(s) scope is
out-of-scope.

base_template.xsl
  MAX_DATE is defined (see definition below)

working_template_a.xsl
  {imports} base_template
  {includes} working_template_b.xsl
  {includes} working_template_c.xsl
  {includes} working_template_d.xsl
  {includes} ... additional working templates ..

MAX_DATE inside of any template definition inside of any included file
above is fine.  MAX_DATE used as part of a variable definition at the
top (outside a template rule) of any of these include files throws the
error:  "The variable or param MAX_DATE is either not defined or it is
out of scope".

Any ideas on this?


Note:  CreateNewDate template is defined in base_template.xsl
<xsl:variable name="MAX_DATE">
<xsl:call-template name="CreateNewDate">
  <xsl:with-param name="start_year" select="$FISCAL_YEAR" />
  <xsl:with-param name="start_month">06</xsl:with-param>
  <xsl:with-param name="start_day">30</xsl:with-param>
</xsl:call-template>
</xsl:variable>

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.