|
Subject: [xsl] How to group a list twice From: "Michael Bauerfeld" <michael@xxxxxxxxxxxxxxxxxxx> Date: Mon, 28 May 2001 18:29:32 +1000 |
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Test of Subscription: Please , dpenton | Thread | Re: [xsl] How to group a list twice, Jeni Tennison |
| Re: [xsl] MathML, Goetz Bock | Date | RE: [xsl] Re:Re:How to simplify the, Yang |
| Month |