- Identify artists with more than one CD. The set of CDs
are in author order
- Preceding and following CD's artist element are looked at
- Note that the order of both preceding-sibling
and following-sibling node-sets are ordered from the context node
<xsl:template match="cdlist">
<xsl:for-each select="cd">
<tr>
<xsl:choose>
<xsl:when test="artist=preceding-sibling::cd[1]/artist
or artist=following-sibling::cd[1]/artist">
<td style="color:red"><xsl:value-of select="artist"/></td>
<td style="color:red"><xsl:value-of select="title"/></td>
<td style="color:red"><xsl:value-of select="filed"/></td>
</xsl:when>
<xsl:otherwise>
<td style="color:green"><xsl:value-of select="artist"/></td>
<td style="color:green"><xsl:value-of select="title"/></td>
<td style="color:green"><xsl:value-of select="filed"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
</xsl:template>