Subject: [xsl] Unique headers From: "Kanthi Damodaran" <kanthi_damodaran@xxxxxxxxxxx> Date: Wed, 04 Apr 2001 13:34:13 |
<MoviesList> <Movie> <Type>General</Type> <Title>Chocolat</Title> </Movie> <Movie> <Type>General</Type> <Title>Billy</Title> </Movie> <Movie> <Type>Mystery</Type> <Title>Ellen Brokovich</Title> </Movie> <Movie> <Type>Mystery</Type> <Title>Pelican Brief</Title> </Movie> <Movie> <Type>Horror</Type> <Title>Nightmare on Elm Street</Title> </Movie> <Movie> <Type>Horror</Type> <Title>Blair Witch Project</Title> </Movie> <Movie> <Type>General</Type> <Title>The Emperor's Groove</Title> </Movie> <Movie> <Type>General</Type> <Title>Toy Story</Title> </Movie> </MoviesList>
Chocolat Billy Mystery Ellen Brokovich Pelican Brief Horror Nightmare on Elm Street Blair Witch Project The Emperor's Groove Toy Story
<xsl:variable name="grpTypes" select="'Mystery Horror'"/> <xsl:template match="text()"/> <xsl:template match="Type"> <xsl:choose> <xsl:when test="contains($grpTypes, concat(' ', .))"> <xsl:if test="not(. = preceding::Type)"> <xsl:value-of select="concat(., '
')"/> </xsl:if> <xsl:value-of select="../Title"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="../Title"/> </xsl:otherwise> </xsl:choose> <xsl:text>
</xsl:text> </xsl:template>
Chocolat Billy Mystery Ellen Brokovich Mystery Pelican Brief Horror Nightmare on Elm Street Horror Blair Witch Project The Emperor's Groove Toy Story
Any ideas on how to get this done correctly? Thanks in advance. Kanthi
_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How to display an attribute v, Kavitha Gowda | Thread | Re: [xsl] Unique headers, Jeni Tennison |
Re: [xsl] Absolute path for a DTD a, Paul Grosso | Date | Re: [xsl] Latest XSLTMark benchmark, Uche Ogbuji |
Month |