<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html"/>
  <xsl:output doctype-public="'-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/1999/xhtml/DTD/xhtml1-strict.dtd'"/>

  <xsl:param name="Path">c:\su\cse775\</xsl:param>
  <xsl:param name="CTPath">c:\su\CoreTechnologies\</xsl:param>

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Test XSLT</title>
        <style type="text/css">@import url("IceBox.css");</style>
        <script type="text/JavaScript" src="WebTools.js"></script>
      </head>
      <body>
        <xsl:apply-templates select="root" />
      </body>
    </html>
  </xsl:template>

  <xsl:template match="topbox">
    <div class="topbox">
      <h1>
        <xsl:apply-templates />
      </h1>
    </div>
  </xsl:template>

  <xsl:template match="ctopbox">
    <div class="topbox centered">
      <h1>
        <xsl:apply-templates />
      </h1>
    </div>
  </xsl:template>

  <xsl:template match="seperatorbox">
    <div class="seperatorbox">
      <h1 class="nopad">
        <xsl:apply-templates />
      </h1>
    </div>
  </xsl:template>

  <xsl:template match="revised">
    <div class="centered">
      <script type="text/JavaScript">
        modified();
      </script>
    </div>
  </xsl:template>

  <xsl:template match="leftbox">
    <div class="leftbox">
      <xsl:apply-templates />
    </div>
  </xsl:template>

  <xsl:template match="centerbox">
    <div class="centerbox top">
      <xsl:apply-templates />
    </div>
  </xsl:template>

  <xsl:template match="rightbox">
    <div class="rightbox">
      <xsl:apply-templates />
    </div>
  </xsl:template>

  <xsl:template match="box">
    <div class="box">
      <xsl:apply-templates />
    </div>
  </xsl:template>

  <xsl:template match="title">
    <h2>
      <xsl:apply-templates />
    </h2>
  </xsl:template>

  <xsl:template match="section">
    <h3>
      <xsl:apply-templates />
    </h3>
  </xsl:template>

  <xsl:template match="item">
    <hr class="wide" />
    <b class="small"><xsl:apply-templates /></b>
    <br/>
  </xsl:template>

  <xsl:template match="spacer">
    <br class="spacer" />
    <br class="spacer" />
    <br class="spacer" />
  </xsl:template>

  <!-- link: Define a link element - ends with line break -->
  <xsl:template match="link">
    <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="."/> </xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element>
    <br/>
  </xsl:template>

  <!-- file: Define a link to a file reference - ends with line break -->
  <xsl:template match="file">
    <xsl:param name="lpath" select="." />
    <a href="{concat($Path,$lpath)}">
      <xsl:value-of select="@title"/>
    </a>
    <br/>
  </xsl:template>

  <!-- file: Define a link to a Core Technologies file reference -->
  <xsl:template match="ctfile">
    <xsl:param name="lpath" select="." />
    <a href="{concat($CTPath,$lpath)}">
      <xsl:value-of select="@title"/>
    </a>
    <br/>
  </xsl:template>

  <!-- file: Define a placeholder link that goes nowhere -->
  <xsl:template match="tfile">
    <xsl:param name="lpath" select="." />
    <a>
      <xsl:value-of select="@title"/>
    </a>
    <br/>
  </xsl:template>

  <xsl:template match="p">
    <p/>
  </xsl:template>

  <xsl:template match="br">
    <br/>
  </xsl:template>

</xsl:stylesheet>
