Oxygen XML Editor
 
[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('&#xa;', ., ' - ', count(current-group()))"/>
 </xsl:for-each-group>

Nice solution.


Except, if we change slightly the concat to following (please note a
starting '/'):
concat('&#xa;', '/', ., ' - ', count(current-group()))

We'll get exactly what the OP wants.

--
Regards,
Mukul Gandhi


Current Thread
 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor