<?xml version="1.0" encoding="utf8"?>
<!--
  Converts a recipe in DESSERT format to HTML
  Author: Ruth Bergman
  Contact: ruth@alum.mit.edu
  History: written 12/20/00

$Id: dessert.xsl,v 1.4 2006/07/11 02:59:54 jmates Exp $

Imported to sial.org by Jeremy Mates, modified for use on said site.

-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:import href="../shared.xsl"/>
  <xsl:template match="recipe">
    <html>
      <head>
        <title>
          <xsl:value-of select="head/title"/>
        </title>
        <xsl:element name="link">
          <xsl:attribute name="rel">stylesheet</xsl:attribute>
          <xsl:attribute name="type">text/css</xsl:attribute>
          <xsl:attribute name="href">
            <xsl:text>/_xs/eolas/default.css</xsl:text>
          </xsl:attribute>
        </xsl:element>
      </head>
      <body>
        <xsl:apply-templates/>
        <xsl:call-template name="page-footer"/>
      </body>
    </html>
  </xsl:template>
  <xsl:template match="title">
    <div class="header">
      <h1>
        <xsl:apply-templates/>
      </h1>
    </div>
  </xsl:template>
<!--  <xsl:template match="subtitle">
      <H2>aka <xsl:apply-templates/></H2>
  </xsl:template> -->
  <xsl:template match="categories">
  </xsl:template>
  <xsl:template match="version">
  </xsl:template>
  <xsl:template match="preptime">
  </xsl:template>
  <xsl:template match="yield">
  </xsl:template>
  <xsl:template match="source">
    <p>Adapted from
      <xsl:apply-templates/>
    </p>
  </xsl:template>
  <xsl:template match="description">
    <p>
      <xsl:apply-templates/>
    </p>
  </xsl:template>
  <xsl:template match="version">
  </xsl:template>
  <xsl:template match="ingredients">
    <ul>
      <xsl:apply-templates select="ing"/>
    </ul>
  </xsl:template>
  <xsl:template match="ing">
    <li>
      <xsl:apply-templates/>
    </li>
  </xsl:template>
  <xsl:template match="directions">
    <ol>
      <xsl:apply-templates select="step"/>
    </ol>
  </xsl:template>
  <xsl:template match="step">
    <li>
      <p>
        <xsl:apply-templates/>
      </p>
    </li>
  </xsl:template>
  <xsl:template name="page-footer">
    <div class="footer">
      <img style="float: left; margin-top: 1em; margin-right: 1em; margin-bottom: 5em" src="/sial.icon2.gif" width="64" height="64"/>
      <xsl:text>Format: </xsl:text>
      <xsl:call-template name="style-choice">
        <xsl:with-param name="style-file">xml</xsl:with-param>
        <xsl:with-param name="style-title">Original XML</xsl:with-param>
      </xsl:call-template>
      <p>
        <a href="/contact/">Questions or comments about this page?</a>
      </p>
    </div>
  </xsl:template>
  <xsl:template name="style-choice">
    <xsl:param name="style-file"/>
    <xsl:param name="style-title"/>
    <xsl:element name="a">
      <xsl:attribute name="href">
<!--        <xsl:value-of select="$default.uri"/> -->
        <xsl:text>?style=</xsl:text>
        <xsl:value-of select="$style-file"/>
      </xsl:attribute>
      <xsl:value-of select="$style-title"/>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>
