Christian Ludwig <> wrote:
> How can I add (e.g.) extra space, when a new year starts: If I have 10
> Books in the year 1990 and 5 books in the year 1991, I want to place a
> special element in the output between the last book of 1990 and the
> first book of 1991 in order to have a group per year.
<xsl:template match="/">
<!-- consider all years, one by one, sorted, no double -->
<xsl:for-each select="/bib/bibentry/year
[not(../preceding-sibling::bibentry/year = .)]">
<xsl:sort/>
<xsl:call-template name="handle-year">
<xsl:with-param name="year" select="."/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!-- display all bibentries for a give year -->
<xsl:template name="handle-year">
<xsl

aram name="year"/>
<xsl:variable name="bibentries" select="/bib/bibentry[year = $year]"/>
<H1>
Year <xsl:value-of select="$year"/> starts here,
it contains <xsl:value-of select="count($bibentries)"/> books.
</H1>
<xsl:for-each select="$bibentries">
<xsl:value-of select="title"/>
<br/>
</xsl:for-each>
<H1>
Year <xsl:value-of select="$year"/> ends here.
</H1>
</xsl:template>
--
David