This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sort | uniq via keys


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]