title: Umbraco - error when using umbraco.library:NiceUrl(...)
body: <pre><code>&lt;!-- Get the url of a node based on a list of positions (starting point = language root) --&gt;
  &lt;xsl:template name="getUrl"&gt;
    &lt;xsl:param name="id" /&gt;
    &lt;xsl:param name="positions" /&gt;
    &lt;xsl:param name="i" select="0" /&gt;
    &lt;xsl:param name="max" /&gt;
  
    &lt;!-- Return the url --&gt;
    &lt;xsl:if test="$i = $max"&gt;    
      &lt;xsl:value-of select="umbraco.library:NiceUrl($id)" /&gt;    
    &lt;/xsl:if&gt;
  
    &lt;xsl:if test="$i &amp;lt; $max"&gt;
      &lt;xsl:call-template name="getUrl"&gt;
        &lt;xsl:with-param name="id"&gt;
          &lt;!-- Define the id of the next item in the tree structure --&gt;
          &lt;xsl:for-each select="//* [@id = $id]/child::* [@isDoc]"&gt;
            &lt;xsl:if test="position() = number(umbraco.library:Split($positions, ',')/value[number($i)])"&gt;  
              &lt;xsl:value-of select="@id" /&gt;
            &lt;/xsl:if&gt;
          &lt;/xsl:for-each&gt;
        &lt;/xsl:with-param&gt;
        &lt;xsl:with-param name="positions"&gt;
          &lt;xsl:value-of select="$positions"/&gt;
        &lt;/xsl:with-param&gt;
        &lt;xsl:with-param name="i"&gt;
          &lt;xsl:value-of select="$i + 1"/&gt;
        &lt;/xsl:with-param&gt;
        &lt;xsl:with-param name="max"&gt;
          &lt;xsl:value-of select="$max"/&gt;
        &lt;/xsl:with-param&gt;    
      &lt;/xsl:call-template&gt;
    &lt;/xsl:if&gt;  
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>I am using a macro with XLST file.
  When using this code, I get an error (Value was either too large or too small for an Int32).
  The error occurs on these two lines:</p>
  
  <pre><code>&lt;xsl:value-of select="umbraco.library:NiceUrl($id)" /&gt; 
  &lt;xsl:call-template name="getUrl"&gt;
  </code></pre>
  
  <p>Can someone tell me what I'm doing wrong here, becuase this XSLT file works fine on every page, except for new pages I create. </p>