Re: [xsl] Use 'count' or xsl:variable?

Subject: Re: [xsl] Use 'count' or xsl:variable?
From: Markus Spath <mspath@xxxxxxxx>
Date: Sun, 23 Dec 2001 14:33:01 +0100
Hello,


> Jeni Tennison wrote:

> .... For example to
> count how many books there are with a last_name of 'Austen', you would
> use:
> 
>   count(/library/book[last_name = 'Austen'])
> 
> (although if you're doing this a lot you'll be better off with a key)


I have a similar (and follow up) problem like Marina, so I use her example:


Would there be any way to extract a summary containing the last name
of the authors and the number of books they have written?

like:

<executive_summary>
  <author last_name="Austen" nr_of_books="41" />
  <author last_name="..." nr_of_books="..." />
  ...
</executive_summary>


Whatever I was able to think of displayed multiple results for each
author.

So my problem is to call:

  count(/library/book[last_name = '$current_author_i_am_dealing_with'])

only the first time I encounter him.


Thanks on any suggestions,

Markus

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


Current Thread