title: xsl for-each outputs all data rather than one at a time
body: <p>Want to preface this by saying I have 0 experience with XML/XSL, and am not familiar with the terminology I should be using. </p>
  
  <p>I'm working on code that uses an xml file. The xml file (the important parts I guess) is formatted something like this:</p>
  
  <pre><code>&lt;All&gt; 
    &lt;Cases&gt; 
      &lt;Case&gt; 
        &lt;extension-fields&gt; 
          &lt;extension-field display-text="whatever"&gt; 
            &lt;value&gt;X&lt;/value&gt; 
          &lt;/extension-field&gt; 
        &lt;/extension-fields&gt; 
      &lt;/Case&gt;  
      &lt;Case&gt; 
        &lt;extension-fields&gt; 
          &lt;extension-field display-text="whatever"&gt; 
            &lt;value&gt;Y&lt;/value&gt; 
          &lt;/extension-field&gt; 
        &lt;/extension-fields&gt; 
      &lt;/Case&gt; 
    &lt;/Cases&gt; 
  &lt;/All&gt;
  </code></pre>
  
  <p>Each case has its own set of extension fields. </p>
  
  <p>I'm trying to pull individual extension-field value where the display-text = 'whatever' for each of my Cases. The way I've written this is the following: </p>
  
  <pre><code>&lt;xsl:for-each select="All/Cases/Case"&gt;
    &lt;w:tc&gt; 
      &lt;w:tcPr&gt; 
        &lt;w:tcW w:w="{$Col2}" w:type="dxa"/&gt;  
        &lt;w:vAlign w:val="top"/&gt; 
      &lt;/w:tcPr&gt;  
      &lt;w:p&gt; 
        &lt;w:pPr&gt; 
          &lt;w:jc w:val="right"/&gt; 
        &lt;/w:pPr&gt;  
        &lt;w:r&gt; 
          &lt;w:t&gt; 
            &lt;xsl:value-of select="/All/Cases/Case/extension-fields/extension-field[@display-text = 'whatever']/value"/&gt; 
          &lt;/w:t&gt; 
        &lt;/w:r&gt; 
      &lt;/w:p&gt; 
    &lt;/w:tc&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>(this is shoved somewhere in a table and I wasn't sure if it was all relevant so I just showed the whole part I'm having trouble with)</p>
  
  <p>I'm expecting to see each Case's individual values in the output (so each case number will have the its X and Y value next to it) but instead, I'm seeing every single case has both values X Y next to it. Now what I think's happening is the for-each on the case, each matter is looping through the whole  part rather than the individual case, but I'm having trouble figuring out why.</p>