[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 ?

Subject: Re: How can I use a variable out of it scope ?
From: "frank Stein" <freeposte@xxxxxxxxxxx>
Date: Wed, 31 Jan 2001 09:51:33
frank stein
I see.
<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:template>

<xsl:template match="Level_2">

	<xsl:variable name="my_var">
		<xsl:for-each select="Level_2">
			<xsl:value-of select="./@Name"/>
		 </xsl:for-each>
	</xsl:variable>
</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

> I would like to use a variable out of it scope.

You can't.


> <xsl:template match="level_2"> > <!-- How could I use "my_var" ? --> > </xsl:template>

Some processors have extension functions that allow this (saxon:assign
being one of the guilty parties) but the design of XSLT is totally
influenced by the fact that it is a side effect free language.

It's not that imperative programming is necessarily evil, but if you
want to program in that style it makes more sense to use a language that
has assignment statements (omnimark, perl, ....) rather than trying to
twist a language that does not.

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.

David

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


_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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.