<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:import href="readinglist.xsl" />

  <xsl:template match="/">
    <html>
      <head>
	<title>Jessica Perry Hekman: Readings Reviews</title>
      </head>
      <body background="../images/chalk.jpg" link="005500" vlink="000088"
	alink="000000">
	<center>
	  <h1><a href='../'>Jessica Perry Hekman</a>: Readings Reviews</h1>
	</center>
        <p>Most recently-read items are listed first. See also my <a href="readinglist.html">list of books I've read</a>.</p>
	<xsl:apply-templates
          select="/readinglist/readings/*[review][position()=last()]" />
      </body>
    </html>

  </xsl:template>

  <xsl:template match="readings/book|readings/play|readings/graphic-novel|readings/comic-compilation|readings/journal">
    <p><a>
    <xsl:attribute name="name">
      <xsl:text>r</xsl:text>
      <xsl:value-of select="count(preceding::book|play|graphic-novel|comic-compilation|journal) + 1" />
    </xsl:attribute>
    <xsl:apply-templates select="title" />
    <xsl:text>&#x20;</xsl:text>
    <xsl:apply-templates select="author[1]" mode="dont-skip"/>:
    <xsl:apply-templates select="review" />
  </a></p>
  <xsl:apply-templates select="preceding::*[review][1]" />
  </xsl:template>

  <xsl:template match="review">
    <xsl:apply-templates />
  </xsl:template>

</xsl:stylesheet>