Subject: [xsl] Sorting under for-each-group From: "Mark Wilson" <drmark@xxxxxxxxxxxxxxx> Date: Tue, 8 Aug 2006 09:52:18 -0400 |
I have spent a lot of time on it but have not been able to solve the sort within groupings problem. Can someone help? stylesheet and xml input sample below
Thanks, Mark
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="/"> <List> <xsl:for-each-group select="/List/Entry" group-by="Subject"> <Entry> <xsl:copy-of select="Subject"/> <xsl:for-each select="current-group()"> <Item> <xsl:copy-of select="*[not(self::Subject)]"/> </Item> </xsl:for-each> </Entry> </xsl:for-each-group> </List> </xsl:template> </xsl:stylesheet>
-------------------------------- - <List> - <Entry> <Subject>Catalogs. Austria</Subject> <Author>Sieger, Hermann Walter</Author> - <Book> <Title>Zeppelinpost spezial-katalog</Title> </Book> - </Entry> - <Entry> <Subject>Catalogs. Austria</Subject> <Author>Kolar, Hugo</Author> - <Book> <Title>Katalog znamok Rakzsko 1850-1918</Title> <Edition>Second</Edition> </Book> </Locator> </Entry> </List>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl:sequence, andrew welch | Thread | Re: [xsl] Sorting under for-each-gr, andrew welch |
Re: [xsl] xsl:sequence, Florent Georges | Date | Re: [xsl] xsl:sequence, andrew welch |
Month |