[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How can I use a variable out of it scope ?
> I would like to use a variable out of it scope. I understand. If you said what you were trying to do at a higher level, perhaps someone may suggest how it would be done more naturally in XSLT.
The following code puts on "my_var" the totality of the Name attributes of each element "Level_1" : <xsl:template match="Level_1"> <xsl:variable name="my_var"> <xsl:for-each select="Level_2"> <xsl:value-of select="./@Name"/> </xsl:for-each> </xsl:variable> <xsl:apply-template/> </xsl:template> Now myvar contains "Name_1Name_2...Name_n..." as a string. And I want to use it on the Level_2 match: <xsl:template match="Level_2"> <!-- Here I would like to use my_var but I can't cause I'm out of "my_var" scope --> <!-- Do you know how can I recover "Name_1Name_2...Name_n..." ? --> </xsl:template> From: David Carlisle <davidc@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: How can I use a variable out of it scope ? Date: Wed, 31 Jan 2001 09:28:00 GMT
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|