Variable scope in XSLT?
<p>Here is my XSLT:</p>

<pre><code>&lt;xsl:choose&gt;  
  &lt;xsl:when test="string-length(/*/location/name)"&gt;
    &lt;xsl:variable name="pagurl"&gt;/location/&lt;xsl:value-of select="/*/location/@id" /&gt;comments&lt;/xsl:variable&gt;
  &lt;/xsl:when&gt;
  &lt;xsl:otherwise&gt;
    &lt;xsl:variable name="pagurl"&gt;/state/&lt;xsl:value-of select="/*/state/@code" /&gt;/comments&lt;/xsl:variable&gt;
  &lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt;

&lt;div class="pagination_outer" id="pager"&gt;
  &lt;xsl:call-template name="pagination"&gt;
    &lt;xsl:with-param name="url"&gt;&lt;xsl:value-of select="$pagurl"/&gt;&lt;/xsl:with-param&gt;                                
  &lt;/xsl:call-template&gt;
&lt;/div&gt;
</code></pre>

<p>I am doing the following:</p>

<ol>
<li>Assigning a variable <code>$pagurl</code> to a value based on a string length.</li>
<li>Trying to use the variable inside the call <code>&lt;xsl:with-param
name="url"&gt;&lt;xsl:value-of select="$pagurl"/&gt;&lt;/xsl:with-param&gt;</code></li>
</ol>

<p>When I include this call the page never seems to finish loading however when I do not use it the page loads just fine. <strong>I imagine there's an error in my usage of this.</strong> </p>

<p>I do not think it's necessary to see the <code>pagination template</code> as it works fine if I hardcode a value. </p>

<p>Suggestions?</p>