RE: [xsl] Grouping and Sorting on value inside group

Subject: RE: [xsl] Grouping and Sorting on value inside group
From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx>
Date: Tue, 11 Jun 2002 17:13:18 -0500
>>I finally found the answer.  Your use of [@dataid = current()/@dataid]
>>provided the missing clue:
>>
>>       <xsl:for-each select="(//dataset/*/*[generate-id() =
>>generate-id(key('dataids', concat(local-name(..),@dataId)))])">
>>          <xsl:sort select="parent::node()/*[local-name() = $sortcol and
>>@dataId = current()/@dataId]/value"/>
>
>...
>
>The expression
>
> (//dataset/*/*[generate-id() =
>                generate-id(key('dataids',
concat(local-name(..),@dataId)))])
>
> would seem on the face of it to find the same node as
> 
> key('dataids', concat(local-name(..),@dataId))[1]
> 
> since the node inside any dataset that has the same generated ID as the 
> first node in the set returned by the key expression, is that node (or 
> nothing).

Yah, but since it's in a for-each I'm not just looking at the first node?

> What am I missing? (I admit I'm looking at this thread late.)

You might not be missing anything, but the code does what I expect, so I may
not be explaining everything properly...




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread