title: XSLT If nested node attributes values are less than 800
body: <p>Given this XML</p>
  
  <pre><code>    &lt;ContentBlock&gt;
      &lt;Content&gt;
          &lt;QuickStatus Balance="0" Credits="0" Trolley="600" Delivery="100" Available="-700" Pending="0" /&gt;
          &lt;TrolleyItems&gt;
              &lt;TrolleyItem Description="Test Item 1" value="150" /&gt;
              &lt;TrolleyItem Description="Test Item 2" value="150" /&gt;
              &lt;TrolleyItem Description="Test Item 3" value="300" /&gt;
          &lt;/TrolleyItems&gt;
      &lt;/Content&gt;
  &lt;/ContentBlock&gt;
  </code></pre>
  
  <p>I need to check if each of the trolly items value attributes are under 800 and then show the Final delivery attribute if at least one of the items are under 800. But only need to show the Delivery value once.</p>
  
  <p>My XSLT .xsl file code looks like this.</p>
  
  <pre><code>&lt;xsl:for-each select="Content/TrolleyItems/TrolleyItem"&gt;
      &lt;xsl:if test="ContentBlock/Content/TrolleyItems/TrolleyItem/@value &amp;lt; 800"&gt;
          &lt;tr style="border-bottom: 1px dashed #000;"&gt;
              &lt;xsl:for-each select="Content/Final"&gt;
              &lt;td&gt;Delivery Fee&lt;/td&gt;&lt;td&gt;&lt;xsl:value-of select="@Delivery"/&gt;&lt;/td&gt;
              &lt;/xsl:for-each&gt;
          &lt;/tr&gt;
          &lt;/xsl:if&gt;
          &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>What I need is to output one item for the @Delivery attribute.</p>
  
  <p>It will only show one time for example the answer will be: "Delivery Costs: 100". So Delivery is only charged when the item value is less than 800</p>
  
  <p>![enter image description here][1]</p>
  
  <p>Thanks for the help.</p>