Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - [xsl] Subject: Counting Path Occurrences [Thread Next] Re: [xsl] Subject: Counting Path OccurrencesTo: Date: 4/1/2007 3:33:00 PM 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
