[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Filtering out duplicates in current-group()
> I tried this: > > <xsl:for-each-group select="Song" > group-by="substring(Year, 1, 3)"> > <p>Decade: <xsl:value-of > select="current-grouping-key()"/>0's</p> > <xsl:for-each-group select="current-group()" > group-by="Title"> > <p style="margin-left: 1pc;"> > <xsl:apply-templates > select="current-group()/Title"/> > </p> > </xsl:for-each-group> > </xsl:for-each-group> > > but still get two "Strangers in the Night". Well, your inner current-group() holds two copies of "Strangers in the Night" and if you apply-templates to both of them, you're going to get both of them output. The whole point of grouping them is that you process them as a group, not individually. For example you might do <p><xsl:apply-templates select="current-group()[1]/Title"/></p> <p><xsl:apply-templates select="current-group()/*[not(self::Title)]"/></p> Michael Kay http://www.saxonica.com/
|
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
|