If you extract the nodes you want right off the bat in the for-each loop you should get the results you want. Just change your XPath to read: /catalog/cd[price > 10 and position() = 1]. See below.
Code:
<xsl:for-each select="catalog/cd[price > 10 and position() = 1]">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:for-each>
If that doesn't work you could also do this, although performance isn't as good:
Code:
<xsl:for-each select="catalog/cd[price > 10]">
<xsl:if test="position() = 1">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="artist"/></td>
</tr>
</xsl:if>
</xsl:for-each>
Bookmarks