<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns="http://xml.amazon.com/AWSECommerceService/2004-08-01" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
  <xsl:output method="html"/>

  <xsl:template match="/">
    <xsl:apply-templates select="ProductInfo/Details"/>
  </xsl:template>
  
  <xsl:template match="Details">
    <div style="clear:left; width: 300px; padding:5px; 
      margin:5px; background:#ddd;">
    <a href="{@url}"><image src="{ImageUrlSmall}" 
      alt="{ProductName}" align="left"/></a>

    <b><xsl:value-of select="ProductName"/></b><br/>
    <xsl:apply-templates select="Authors"/><br/>
    Amazon.com Price: $<xsl:value-of 
      select="substring(OurPrice, 2)"/><br/>
    </div>    
  </xsl:template>

  <xsl:template match="Authors">
    By 
    <xsl:for-each select="Author">
      <xsl:choose>

        <xsl:when test="not(position() = 1)">
          <xsl:text> and </xsl:text>
        </xsl:when>
      </xsl:choose>
      <xsl:value-of select="."/>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

