|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: selecting elements only if they all have a particu
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








