[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Variables


Subject: Re: [xsl] Variables
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Fri, 01 Aug 2003 12:56:36 +0200

AROSO Jose Antonio wrote:
When I save something in a variable in a loop for-each i dont have access to
this variable out of the loop for-each.
...
<xsl:for-each select="Attribute_Groups/Attribute">
	<xsl:variable name="aname" select="@Name" />
	........
</xsl:for-each>

How can i access the variable aname out of the loop for-each?

You can't. The scope of a variable is the element where it was declared. Your problem is that you want to program XSLT the same way you'd do it in, say, JavaScript. If you give a description of the original problem someone will show you a XSLT solution.

J.Pietschmann



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



Current Thread
Keywords