numbering - counting - grouping

Subject: numbering - counting - grouping
From: "Sellmer-Brüls, Barbara" <B.Sellmer-Bruels@xxxxxxxxxxx>
Date: Wed, 8 Nov 2000 14:52:36 +0100

I've got a problem with numbering (or counting ? or grouping?), and I don't
know how to solve it with a (for some reasons given) stylesheet structure. 
The XML is as follows: 
- contains different books
- each book can have different  contributors
- each contributor has a type

My stylesheet applies templates for <book>. 
Within <book> it applies templates to contributors depending on their type.
   <xsl:apply-templates select="contributor [type='AU']">
       some sorting of all contributors = AU based on an element I have not
listed here
   <xsl:apply-templates select="contributor [type='ED']">
       some sorting of all contributors = ED based on an element I have not
listed here

The contributor template states that 
- some output is generated only for the first occurance of a set of
'AUcontributors' or 'ED contributors', and
- then that all names from the selected contributors nodes are to be listed:

<xsl:template match="contributor">
   <xsl:if test="position()='1'">
	 <xsl:value-of select="type"/><xsl:text>:</xsl:text><br/>
   <xsl:value-of select="name"/><br/>

What I need to add to the output a numbering of the contributors 'header'
data, so that the output looks like:
book 1
1. type is AU
2. type is ED

1. type is AU
2. type is CON

I tried it with variables and parameters but it does not work.
Has anybody any Idea? 

This is the XML document:

<?xml version="1.0" encoding="ISO-8859-1"?>

Sorry for this lengthy email - but thanks in advance!
Barbara Sellmer-Bruels

 XSL-List info and archive:

Current Thread