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]

RE: grouping (was: if or template?)


> I want to then display the Tracker_ID if it is unique followed by all the
data for
> the specific tracker. 

A FAQ: use something like
<xsl:for-each select="//tracker-id[not(.=preceding::tracker-id)]">

This is the traditional solution; Steve Muench has just told me about a
brilliant alternative using keys:

<xsl:key name="tid" use="tracker-id" select="."/>

<xsl:for-each
select="//tracker-id[generate-id(.)=generate-id(key('tid',.)[1])]">

I hope Steve will forgive me for announcing this discovery before he does,
I'm quite excited by it because it gives much better performance.

Mike Kay


 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]