Re: [xsl] Finding the first among equals using XPath

Subject: Re: [xsl] Finding the first among equals using XPath
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 22 Jun 2006 12:27:58 -0400
At 11:58 AM 6/22/2006, David wrote:
xslt2's for-each-group makes it easier (or at least easier to read) but
any xslt 1 grouping construct would work here. Muenchian grouping (ie
using keys) is the usual approach, but making the keys unique in
subtrees rooted at each W is a bit tiresome, so unless you have 100's of
X below each W I'd just write it directly in XPath

something like

<xsl:for-each select="W">
  <xsl:for-each select="X[not(@Y=../following-sibling::X/@Y)]">
    something

I'd prefer this approach if you know all the X elements will be siblings.


Cheers,
Wendell

Current Thread