[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
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 |
- RE: [xsl] Grouping and Sorting on value inside group, (continued)
- TSchutzerWeissmann - Tue, 11 Jun 2002 10:30:00 +0100
- Hunsberger, Peter - Tue, 11 Jun 2002 11:55:34 -0500
- Hunsberger, Peter - Tue, 11 Jun 2002 15:40:12 -0500
- Wendell Piez - Tue, 11 Jun 2002 17:48:40 -0400
- Hunsberger, Peter - Tue, 11 Jun 2002 17:13:18 -0500 <=
- Wendell Piez - Tue, 11 Jun 2002 18:57:43 -0400
- TSchutzerWeissmann - Wed, 12 Jun 2002 10:00:58 +0100
- TSchutzerWeissmann - Wed, 12 Jun 2002 11:16:48 +0100
- Hunsberger, Peter - Wed, 12 Jun 2002 08:36:01 -0500
|