[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: sort | uniq via keys
Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|