xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[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
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor