title: xslt select a node value based on the value of another node
body: <p>I am being tasked with creating a csv file using XSLT to produce the information. So far I have almost everything that I need however, there is one bit that i am struggling to get as per the example below. </p>
  
  <pre><code>&lt;issuesExport xmlns="http://www.mynamesapce.co.uk/import"&gt;
  &lt;materials&gt;
  &lt;material&gt;
    &lt;code&gt;WB821&lt;/code&gt;
    &lt;name&gt;CONCENTRATE&lt;/name&gt;
  &lt;/material&gt;
  &lt;material&gt;
    &lt;code&gt;WB820&lt;/code&gt;
    &lt;name&gt;ADDITIVE&lt;/name&gt;
  &lt;/material&gt;
  &lt;/materials&gt;
  &lt;issues&gt;
   &lt;issue&gt;
    &lt;formulaCode&gt;TEST&lt;/formulaCode&gt;
    &lt;materialBatch&gt;
      &lt;materialCode&gt;WB821&lt;/materialCode&gt;
      &lt;batchNumber&gt;sdfsd&lt;/batchNumber&gt;
      &lt;isManualAddBatch&gt;false&lt;/isManualAddBatch&gt;
      &lt;isFinished&gt;true&lt;/isFinished&gt;
      &lt;weight&gt;0&lt;/weight&gt;
      &lt;cost&gt;0&lt;/cost&gt;
    &lt;/materialBatch&gt;
    &lt;issueBatchNumber&gt;df34323&lt;/issueBatchNumber&gt;
  &lt;/issue&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>What I need to do is to grab the name from //material/name where issue/materialBatch/materialCode = material/code.</p>
  
  <p>my current XSLT looks like this</p>
  
  <pre><code>&lt;xsl:if test="i:materialBatch/i:materialCode=//i:material/i:code"&gt;
    &lt;xsl:value-of select="//i:materials/i:material/i:name"/&gt;
  &lt;/xsl:if&gt;
  </code></pre>
  
  <p>Which is always evaluating to true and giving my a result of CONCENTRATE.</p>
  
  <p>I would be grateful if someone could tell me where I am going wrong </p>
  
  <p>Thank you</p>