title: XPath - Compare values from different documents
body: <p>This is my XPath expression</p>
  
  <pre><code>$XMLDESCRIPTION/myItems/ITEM[@TYPE="ok" and boolean($XML/myElements/element[ends-with(Description/@code, string(@CODE))])]
  </code></pre>
  
  <p>The ITEM node in $XMLDESCRIPTION has an attribute called CODE and i want to check in $XML if there is an "element" with a Description/@code that matches the @CODE from $XMLDESCRIPTION</p>
  
  <p>The question is: how do I access the @CODE attribute in the $XML part of my filter?</p>
  
  <p>extra info:</p>
  
  <ol>
  <li>I'm working in an XSLT context (I use stylevision)</li>
  <li>The expression works fine if I type a
  fixed value in the "ends-with" part instead of string(@CODE)</li>
  </ol>
  
  <p><strong>XML</strong>
  This is my $XMLDESCRIPTION snippet</p>
  
  <pre><code>&lt;myItems&gt;
      &lt;ITEM CODE="003423" TYPE="ok"&gt;Hello&lt;/ITEM&gt;
      &lt;ITEM CODE="003123" TYPE="ok"&gt;hello12&lt;/ITEM&gt;
      &lt;ITEM CODE="003223" TYPE="notok"&gt;Hellollo&lt;/ITEM&gt;
      &lt;ITEM CODE="005423" TYPE="notok"&gt;Hellolol&lt;/ITEM&gt;
      &lt;ITEM CODE="003424" TYPE="ok"&gt;HellossSSSDDFFSQSSQDFQSDF&lt;/ITEM&gt;
      &lt;ITEM CODE="003442" TYPE="ok"&gt;Helloee&lt;/ITEM&gt;
      &lt;ITEM CODE="003342" TYPE="ok"&gt;Hellodd&lt;/ITEM&gt;
      &lt;ITEM CODE="008900" TYPE="ok"&gt;Helloee&lt;/ITEM&gt;
      &lt;ITEM CODE="003888" TYPE="inprogress"&gt;Helloaa&lt;/ITEM&gt;
  &lt;/myItems&gt;
  </code></pre>
  
  <p>this is a snippet from my $XML document</p>
  
  <pre><code>&lt;myElements&gt;
      &lt;element&gt;&lt;Description code="009999"&gt;myinformation&lt;/Description&gt;&lt;/element&gt;
      &lt;element&gt;&lt;Description code="008888"&gt;myinformation&lt;/Description&gt;&lt;/element&gt;
      &lt;element&gt;&lt;Description code="003424"&gt;myinformation&lt;/Description&gt;&lt;/element&gt;
      &lt;element&gt;&lt;Description code="002222"&gt;myinformation&lt;/Description&gt;&lt;/element&gt;
      &lt;element&gt;&lt;Description code="003333"&gt;myinformation&lt;/Description&gt;&lt;/element&gt;
      &lt;element&gt;&lt;Description code="005555"&gt;myinformation&lt;/Description&gt;&lt;/element&gt;
  &lt;/myElements&gt;
  </code></pre>
  
  <p>With those two xml examples my outcome should be "HellossSSSDDFFSQSSQDFQSDF" because that's the only element that has an existing description node with a code "003424" in $XML so that's the only ITEM element's content that the xpath should get.</p>