xsl-list
[Top] [All Lists]

Re: [xsl] Subject: Counting Path Occurrences

2007-04-01 08:33:26
On 3/30/07, Andrew Welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> 
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>