Hi,
<xsl:key name="roomTypeId" match="//date/roomType"
use="@id"/>
The match pattern can be just "roomType".
<xsl:template match="/property">
<table>
<tr><td><xsl:value-of select="@name"/></td></tr>
</table>
<table width="300" border="0" cellspacing="0"
cellpadding="2">
<tr>
<td width="22"> </td>
<td>roomType</td>
<td>cost</td>
</tr>
<xsl:apply-templates
select="//date/roomType[count(.|key('roomTypeId',@id)[1])=1
and @count > 0]"/>
(Because of personal preference, I rewrote the expression to use generate-id.)
<xsl:apply-templates select="vacancy/month/date/roomType[generate-id() =
generate-id(key('roomTypeId',@id)) and not(key('roomTypeId',@id)/@count <=
0)]"/>
Cheers,
Jarno