|
Subject: sorting and grouping From: "m.vanrootseler" <m.vanrootseler@xxxxxxxxx> Date: Fri, 2 Jul 2004 14:40:15 +0200 |
I've got a sorting problem. My XML is as follows:
<person>
<name>Kermit</name>
<birthday>3</birthday>
<birthmonth>January</birthmonth>
</person>
etc.
XSLT:
<xsl:for-each select="person[birthmonth='January']">
<xsl:sort select="birthday" data-type="number"/>
<xsl:sort select="name"/>
<xsl:value-of select="birthday"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="name"/>
<br/>
</xsl:for-each>
With the above code, each birthday number is repeated. What I would like is
to have the birthday number appear only once followed by the names of people
whose birthday that is. I suspect it can be done by testing if the birthday
value is the same as the preceding sibling, but I can't get it right. Does
anyone have any idea how to solve this?
Mick
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] june archives, Mulberry Technologie | Thread | RE: [xsl] sorting and grouping, Michael Kay |
| june archives, Susan Campbell | Date | chunking a very large xml document, Munna D |
| Month |