<?xml version="1.0" encoding="iso-8859-1"?>
<!--
  XSLT for XML trading card lesson
  Deborah Kaplan, July 2006
  Copyright 2006 Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License
 -->

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

<xsl:output
     method="html"
     encoding="ISO-8859-1"
     doctype-public= "-//W3C//DTD XHTML 1.0 Strict//EN"
     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />

<xsl:template match="card">

   <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <head>
     <title><xsl:value-of select="title" /></title>
     <link rel="stylesheet"
       href="http://suberic.net/~deborah/work/card.css" media="all"
       type="text/css" />
   </head>
   <body>
     <div id="card" style="background-color:{./@color}">
     <h1><xsl:value-of select="title" /></h1>
     <img alt="[{./title} image]"
       style="border-color:{./@color}"
       src="{./image}" />
     <ul>
        <xsl:apply-templates select="//type" />
     </ul>
     <xsl:apply-templates select="//description" />
     </div>
   </body>
   </html>
</xsl:template>

<xsl:template match="type">
   <li><xsl:value-of select="." /></li>
</xsl:template>

<xsl:template match="description">
     <p style="background-color:{./@color}">
        <xsl:value-of select="." /></p>
</xsl:template>

</xsl:stylesheet>
