title: How to insert a variable into an xslt document function
body: <p>ok, sorry. I have this two xml files.
  ProvlaLingua1.xml </p>
  
  <pre><code>&lt;VENDOR&gt;
      &lt;IMMAGINI_SITO&gt;True&lt;/IMMAGINI_SITO&gt;
      &lt;VERSIONE_SKYWALKER&gt;1&lt;/VERSIONE_SKYWALKER&gt;
      &lt;CDLINGUA&gt;IT&lt;/CDLINGUA&gt;
  &lt;/VENDOR&gt;
  </code></pre>
  
  <p>and this second ProvaLingua2.xml</p>
  
  <pre><code>    &lt;LINGUA&gt;
            &lt;EN&gt;
                &lt;TAG1&gt;The book is on the table&lt;/TAG1&gt;
                &lt;TAG2&gt;The cat is on the table&lt;/TAG2&gt;
            &lt;/EN&gt;
            &lt;IT&gt;
                &lt;TAG1&gt;Il libro è sul tavolo&lt;/TAG1&gt;
                &lt;TAG2&gt;Finche la barca va lasciala andare&lt;/TAG2&gt;
             &lt;/IT&gt;
  &lt;/LINGUA&gt;
  </code></pre>
  
  <p>so I need to check ProvaLingua1 to get the CDLINGUA valor and then extract a valor from ProvaLingua2.
  I need something like </p>
  
  <pre><code>&lt;xsl:variable name="LANGUAGE" select="document('ProvaLingua1.xml')VENDOR/CDLINGUA"/&gt;
  &lt;xsl:value-of select="document('ProvaLingua2.xml')/LINGUA/A VARIABLE HERE/TAG2" /&gt;
  </code></pre>
  
  <p>I need to put variable "LANGUAGE" to get an extraction, I can't do it with:</p>
  
  <pre><code>&lt;xsl:choose&gt;
      &lt;xsl:when test="$language='IT'"&gt;
  
          &lt;xsl:value-of select="document('ProvaLingua2.xml')/LINGUA/IT/TAG1" /&gt;&lt;br /&gt;
          &lt;xsl:value-of select="document('ProvaLingua.xml')/LINGUA/IT/TAG2" /&gt;&lt;br /&gt;
      &lt;/xsl:when&gt;
  
  &lt;/xsl:choose&gt;
  </code></pre>
  
  <p>because otherwise I'd need to write too many rows for any language.
  Thank you for any help</p>