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: Grouping and Sorting on value inside group


>>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


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