[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Subject: Counting Path Occurrences
Subject: Re: [xsl] Subject: Counting Path Occurrences
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Sun, 1 Apr 2007 21:03:13 +0530
|
On 3/30/07, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
<xsl:for-each-group
select="//*/string-join(ancestor-or-self::*/name(), '/')"
group-by=".">
<xsl:sequence select="concat('
', ., ' - ', count(current-group()))"/>
</xsl:for-each-group>
Nice solution.
Except, if we change slightly the concat to following (please note a
starting '/'):
concat('
', '/', ., ' - ', count(current-group()))
We'll get exactly what the OP wants.
--
Regards,
Mukul Gandhi
|