Hello,
I have the following problem. Suppose you habe an XML File (containing
Bibliography-Data) of the form:
<bib>
<bibentry>
<title>Booktitle 1</title>
<year>1990</year>
<!-- some more elements -->
</bibentry>
<bibentry>
<title>Booktitle 2</title>
<year>1991</year>
<!-- more elements -->
</bibentry>
<!-- etc. -->
</bib>
Now, if I want to show all entries sorted by year, I do something like:
<xsl:for-each select="bib/bibentry">
<xsl:sort select="year" data-type="number" order="ascending" />
<p><xsl:value-of select="year"/>: <xsl:value-of select="title"/></p>
</xsl:for-each>
Now the problem:
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.
To put it in a more abstract form:
How to implement decisions (conditionals) in the xsl-File, where the
condition depends not only on the current node, but also on the last node?
Can anybody help?
C. Ludwig