xsl-list
[Top] [All Lists]

RE: No to display the values which are already existing

2003-06-27 08:09:00
Hi

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Tengshe, Ashish
Sent: Wednesday, June 25, 2003 7:40 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] No to display the values which are already existing


Thanks, Works fine Now!

You could also use here the muenchian method, something like:
<xsl:key match="Title" name="list" use="Author"/>

<xsl:template match="Store">
 <table>
  <tr>
   <td>Author</td>
   <td>Title</td>
  </tr>
  <xsl:apply-templates mode="header"
select="Title[generate-id()=generate-id(key('list',Author))]"/>
 </table>
</xsl:template>

<xsl:template match="Title" mode="header">
 <tr>
  <td><xsl:apply-templates select="Author"/></td>
  <td><xsl:apply-templates select="Name"/></td>
 </tr>
 <!-- don't need to select the current one because it already have been
displayied -->
 <xsl:apply-templates
select="key('list',Author)[not(generate-id()=generate-id(current()))]"/>
</xsl:template>

<xsl:template match="Title">
 <tr>
  <td><xsl:text> </xsl:text></td>
  <td><xsl:apply-templates select="Name"/></td>
 </tr>
</xsl:template>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list