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

Re: Variable scope when using imported stylesheets

Subject: Re: Variable scope when using imported stylesheets
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 24 Aug 2004 16:53:07 -0400
xsl variable scope
Ralph,

At 10:47 AM 8/24/2004, you wrote:
I think what I can do is to declare the variables within the imported template and thus get my abbreviation:

<xsl:template>
 <xsl:for-each select="baseDboFileReference">
   <xsl:call-template name="calledOne" />
 </xsl:for-each>
</xsl:template>

<xsl:template name="calledOne">
  <xsl:variable name="runOutOfIdeas" select="FileRefEval" />
  [siblings]
</xsl:template>

Yes, but this could as well be:


<xsl:template match="  ">
 <xsl:apply-templates select="baseDboFileReference"/>
</xsl:template>

<xsl:template match="baseDboFileReference">
  <xsl:variable name="runOutOfIdeas" select="FileRefEval" />
  [siblings]
</xsl:template>

In other situations (in a situation where you might actually want to call a named template, not just apply templates), you might want to pass the value in from the calling template. In this case you'd use a parameter, not a variable.

Cheers,
Wendell

___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau


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.