[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How to group a list twice

Subject: How to group a list twice
From: "Michael Bauerfeld" <michael@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 May 2001 18:29:32 +1000
calling template twice in xsl
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.