Assuming <par>
is the context node for this test, it seems seems you're running the sum() function on just this <par>
element (I guess the result you're seeing is just the value of the currently selected <par>
element?).
I think it's just a matter of selecting the right nodes for the sum() function, i.e. all <par>
nodes:
<td class="sub"><xsl:value-of select="sum(//par[@holeNumber > 9 and @holeNumber
< 18])" /></td>
Still, this is more or less guesswork, since it would be much more informative if you just posted a relevant snippet of the XML source (instead of an image), and of the incorrect output. Would make your problem easier to grasp for golf-illiterates.