[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to group a list twice
Hi, I'm facing a problem with a probably very simple solution, but I can't get it working the way I would like to. The main idea is to group the following xml according to <firstLevel> and inside of this group according to <secondLevel>. ---<snip>-- <response> <record> <firstLevel>firstname1</firstLevel> <secondLevel>secondname1</secondLevel> <thirdLevel>thirdname1</thirdLevel> </record> </response> ---<snip>-- I've managed the 1st grouping using the Muenchian Method <xsl:key name="class" match="record" use="firstLevel"/> <xsl:template match="response"> <xsl:apply-templates select="record[generate-id(.) = generate-id(key('first', firstLevel)[1])]" mode="classList"/> </xsl:template> <xsl:template match="response" mode="classList"> <xsl:value-of select="firstLevel" /> <xsl:for-each select="key('class', firstLevel)"> <xsl:value-of select="secondLevel" /> <xsl:value-of select="thirdLevel" /> </xsl:for-each> but I don't know how to get the 2nd grouping working. Creating a key element for <secondLevel> and calling the template inside of the first template seems not to work. Any ideas?? Cheers, -Michael XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|