I have a piece of code that look similar to this:
<xsl:choose>
<xsl:when test="some_test">
<xsl:value-of select="Something" />
You are:
<xsl:variable name="age">12</xsl:variable>
years
</xsl:when>
</xsl:choose>
My problem is that I would like to use the variable $age outside of the choose. How do I do that?
A similar problem is that I have several templates in my XSLT-file, and one of them is the main template. This one:
<xsl:template match="/">
</xsl:template>
Inside of this template, I call several other templates, and again I would like to use some of the variables from the other templates.
In example, if I have this code:
<xsl:template match="/">
<xsl:call-template name="search">
</xsl:call-template>
</xsl:template>
<xsl:template name="search">
<xsl:variable name="searchVar">Something...</xsl:variable>
</xsl:template>
Then I would like to use the $searchVar inside of my main-template.
It's kind of the same issue I think, but I can't seem to figure this one out.
And I run Umbraco as my CMS by the way :)
I hope that some of you have the answer.
Thanks - Kim