
June 25th, 2004, 01:19 PM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Retrieving a local variable from a different template
Any help on the code below would be greately appreciated. I need help accessing a variable that I set in a different template in the same xslt file. I am not 100% sure if this is even possible. If it is, I would need to know the path syntax to access the variable.
Here's the template and code where the variable is set (with extraneous code removed):
<!--SETTING LOCAL VARIABLE IN A TEMPLATE-->
<xsl:template match="navigation">
<xsl:variable name="myvariable">Hello World</xsl:variable>
</xsl:template>
<!--TRYING TO RETRIEVE VARIABLE IN A DIFFERENT TEMPLATE-->
<xsl:template match="channel">
<td><xsl:copy-of select="$myvariable" /></td>
</xsl:template>
I get the following error:
"Could not find variable with the name of myvariable"
Please help!!!
Thank you,
Sean
|