<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <head>
    <title>My Book Collection</title>
    <style type="text/css">
      h1 {
        margin-left: 20px;
        color: #6FD4E6;
        font-size: 30px;
      }

      h2 {
        margin-left: 20px;
        color: #999;
        font-size: 18px;
      }

      body {
        font-family: Arial, Verdana, sans-serif;
        font-size: 10px;
      }

      .BookItem {
        height: 150px;
        width: 350px;
        float: left;
        margin: 10px 20px 30px 20px;
        padding: 20px;
        border: 10px solid #EEE;
        background-color: #F9F9F9;
      }

      .BookCover {
        float: left;
        padding-right: 20px;
      }

      a.ToAmazon {
        text-decoration: none;
        border-bottom: 1px dotted #999;
        color: #999;
      }

    </style>
  </head>
  <body>
    <h1>My Book Collection</h1>
    <xsl:apply-templates select="workbook/sheet"/>
  </body>
  </html>
</xsl:template>

<xsl:template match="sheet">
  <h2 style="clear:both"><xsl:value-of select="@name" /></h2>
  <xsl:apply-templates select="row[@row > 0]"/>
</xsl:template>

<xsl:template match="row">
  <div class="BookItem">
    <xsl:variable name="isbn" select="cell[@col = 1]"/>
    <xsl:variable name="stars" select="cell[@col = 2]"/>
    <img class="BookCover" src="http://images.amazon.com/images/P/{$isbn}.01._SCMZZZZZZZ_.jpg" alt="" />
    <h3 class="BookTitle"><xsl:value-of select="cell[@col = 0]"/></h3>
    <div><img src="http://ec3.images-amazon.com/images/G/01/x-locale/common/customer-reviews/stars-{$stars}-0.gif" /></div>
    <p class="ToAmazon"><a class="ToAmazon" href="http://www.amazon.com/o/asin/{$isbn}/mockerybird/ref=nosim">See this at Amazon.com</a></p>
  </div>
</xsl:template>

</xsl:stylesheet>