[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: counting equal entries

Subject: RE: counting equal entries
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 29 Oct 2004 15:05:32 +0100
xsl equal
A classic grouping problem: see

http://www.jenitennison.com/xslt/grouping

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Ralf Heydenreich [mailto:rheydenr@xxxxxxx] 
> Sent: 29 October 2004 13:53
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  counting equal entries
> 
> Hi all,
> I try to create an index page from a document. The idea behind is to
> collect a certain word and list it with *all* occurences in the
> document, like
> 
> foo .... 12, 23, 45
> bar .... 2, 5, 88
> 
> and so on. I have a XML document which contains entries with different
> classes (Java classes).
> I have a XSL stylesheet which collects all entries in a sorted order.
> But there is one separate entry for each occurence:
> 
> foo ... 12
> foo ... 23
> foo ... 45
> bar ... 2
> 
> and so on.
> 
> Code follows:
> 
> <xsl:for-each select="key('index-key', $lower-alphabet)">
>  <xsl:sort select="@name" case-order="lower-first"/>
>  <xsl:call-template name="display-index-item">
>   <xsl:with-param name="item" select="." />
>  </xsl:call-template>
> </xsl:for-each>
> 
> The $lower-alphabet is only a variable containing all lower letters.
> How can I pass an indicator to the template "display-index-item" where
> I can decide if an entry has the same name as the previous one?
> 
> TIA,
> Ralf.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.