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