title: checking value of a variable inside a higher-precendence variable in XSLT
body: <p>I need to be able to check what the "current" value of a variable is inside a redeclaration of that same variable in a different xslt that includes the other.</p>
  
  <p>main.xslt:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:import href="other.xslt"/&gt;
      &lt;xsl:variable name="email"&gt;
          &lt;xsl:if test="string-length($email) = 0"&gt;
              bar@foo.com
          &lt;/xsl:if&gt;
      &lt;/xsl:variable&gt;
      &lt;xsl:template match="/"&gt;
          &lt;Email&gt;
              &lt;xsl:value-of select="$email"/&gt;
          &lt;/Email&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>other.xslt:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:variable name="email"&gt;foo@bar.com&lt;/xsl:variable&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>What I would like to do is be able to check what the value of the lower-precedence variable will be to see if I need to overwrite it in the variable in the current xslt.  (disclaimer - the current code crashes viciously) </p>