This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: sort | uniq via keys
- From: Joerg Pietschmann <joerg dot pietschmann at zkb dot ch>
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 15 Feb 2002 09:45:49 +0100
- Subject: Re: [xsl] sort | uniq via keys
- Organization: ZKB
- Reply-to: xsl-list at lists dot mulberrytech dot com
Wendell Piez <wapiez@mulberrytech.com> wrote:
> [Saverio wrote:]
> >I'd like to extract
> >the names of elements residing at the same `level' in the input tree,
>
> There are (at least) two ways to approach this. One would be to declare
> different keys for different levels, such as
> <xsl:key name="features1" match="/*/*" use="name()"/>
The following key generalizes this:
<xsl:key name="features-level" match="*"
use="concat(count(ancestor::*)),'#',name())"/>
Us this for example as follows
<xsl:for-each select="/descendant::*[count(.|key('features-level',concat(count(ancestor::*)),'#',name())))=1]">
BTW: May i remind all posters (in particular those who recently
started to post) to trim unnecessary quotes? Those are really
messing up the digest.
Regards
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list