<?xml version="1.0" encoding="utf-16" ?>
<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" doctype-system="DTD/xhtml1-strict.dtd"/>

  <xsl:param name="Here">.\</xsl:param>
  <xsl:param name="Path">..\cse775\</xsl:param>
  <xsl:param name="CTPath">..\CoreTechnologies\</xsl:param>
  <xsl:param name="HomePath">.\</xsl:param>
  <xsl:param name="home">FawcettHome.xml</xsl:param>
  <xsl:param name="coretech">Coretechnologies.xml</xsl:param>
  <xsl:param name="officehours">OfficeHours.xml</xsl:param>
  <xsl:param name="resources">CSE775-Resources.xml</xsl:param>
  <xsl:param name="lectures">..\cse775\lectures\cse775codeL1.xml</xsl:param>
  <xsl:param name="notices">Notices.xml</xsl:param>

  <xsl:param name="CSE681">CSE681.xml</xsl:param>
  <xsl:param name="CSE686">CSE686.xml</xsl:param>
  <xsl:param name="CSE687">CSE687.xml</xsl:param>
  <xsl:param name="CSE775">CSE775.xml</xsl:param>
  <xsl:param name="CSE776">CSE776.xml</xsl:param>
  <xsl:param name="CSE778">CSE778.xml</xsl:param>
  <xsl:param name="CSE784">CSE784.xml</xsl:param>

  <xsl:template match="/">
    <!-- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> -->
    <html>
      <head>
        <title><xsl:apply-templates select="root/titlebar"/></title>
        <xsl:apply-templates select="root/theme"/>
        <script type="text/JavaScript" src="WebTools.js"></script>
      </head>
      <body>
        <xsl:apply-templates select="root/visible" />
      </body>
    </html>
  </xsl:template>

  <!-- theme: Define theme's Cascading Style Sheet file -->
  <xsl:template match="theme">
    <xsl:element name="link">
      <xsl:attribute name="rel">stylesheet</xsl:attribute>
      <xsl:attribute name="href">
        <xsl:value-of select="@src"/>
      </xsl:attribute>
      <xsl:attribute name="type">text/css</xsl:attribute>
    </xsl:element>
  </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 small">
      <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="contentbox">
    <div class="contentbox">
      <xsl:apply-templates />
    </div>
  </xsl:template>

  <xsl:template match="tablebox">
    <div class="tablebox">
      <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></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></br>
  </xsl:template>

  <!-- ilink: Define a link element -->
  <xsl:template match="ilink">
    <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="."/> </xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element>
  </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></br>
  </xsl:template>

  <!-- ifile: Define a link to a file reference -->
  <xsl:template match="ifile">
    <xsl:param name="lpath" select="." />
    <a href="{concat($Path,$lpath)}">
      <xsl:value-of select="@title"/>
    </a>
  </xsl:template>

  <!-- ctfile: 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></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></br>
  </xsl:template>

  <xsl:template match="p">
    <p />
  </xsl:template>

  <xsl:template match="br">
    <br></br>
  </xsl:template>

  <xsl:template match="ol">
    <ol>
      <xsl:apply-templates/>
    </ol>
  </xsl:template>

  <xsl:template match="ul">
    <ul>
      <xsl:apply-templates/>
    </ul>
  </xsl:template>

  <xsl:template match="li">
    <li>
      <xsl:apply-templates/>
    </li>
  </xsl:template>

  <xsl:template match="table">
    <table>
      <xsl:apply-templates />
    </table>
    <br />
  </xsl:template>

  <xsl:template match="th">
    <th>
      <xsl:apply-templates />
    </th>
  </xsl:template>

  <xsl:template match="tr">
    <tr>
      <xsl:apply-templates />
    </tr>
  </xsl:template>

  <xsl:template match="td">
    <td class="tdbox">
      <xsl:apply-templates />
    </td>
  </xsl:template>

  <xsl:template match="ed">
    <td class="emp">
      <xsl:apply-templates />
    </td>
  </xsl:template>

  <!-- cnav: course level navigation bar -->
  <xsl:template match="cnav">
    <div class="topbox navbar">
      <a class="navlink" href="{concat($HomePath,$home)}">Home</a>
      <a class="navlink" href="http://www.ecs.syr.edu/faculty/fawcett/handouts">Handouts</a>
      <a class="navlink" href="{concat($HomePath,$coretech)}">CoreTech</a>
      <a class="navlink" href="{concat($HomePath,$officehours)}">OfficeHours</a>
      <a class="navlink" href="{concat($HomePath,$notices)}">Notices</a>
      <a class="navlink" href="{concat($HomePath,$lectures)}">Lectures</a>
      <a class="navlink" href="{concat($Here,$resources)}">Resources</a>
      <a class="navlink" href="#Content">Contents</a>
      <br />
      <a class="navlink" href="{concat($HomePath,$CSE681)}">CSE681-SWMAA</a>
      <a class="navlink" href="{concat($HomePath,$CSE686)}">CSE686-IP</a>
      <a class="navlink" href="{concat($HomePath,$CSE687)}">CSE687-OOD</a>
      <a class="navlink" href="{concat($HomePath,$CSE775)}">CSE775-DO</a>
      <a class="navlink" href="{concat($HomePath,$CSE776)}">CSE776-DP</a>
      <a class="navlink" href="{concat($HomePath,$CSE778)}">CSE778-AWP</a>
      <a class="navlink" href="{concat($HomePath,$CSE784)}">CSE784-SWS</a>
      <br />
    </div>
  </xsl:template>

  <!-- image: Display image below title -->
  <xsl:template match="image">
    <center>
      <div class="imagebox">
      <xsl:element name="img">
        <xsl:attribute name="src">
          <xsl:value-of select="@src"/>
        </xsl:attribute>
        <xsl:attribute name="width">
          <xsl:value-of select="@width"/>
        </xsl:attribute>
        <xsl:attribute name="alt">image not found</xsl:attribute>
      </xsl:element>
      </div>
    </center>
  </xsl:template>

  <!-- caption: display caption below image(s) -->
  <xsl:template match="caption">
    <center>
      <xsl:apply-templates/>
    </center>
    <hr/>
  </xsl:template>

  <xsl:template match="content">
    <span id="#Content"></span>
  </xsl:template>
  
  <!-- html: Define a block of html tags -->
  <!-- Passes HTML tags directly on to the browser -->
  <xsl:template match="html">
    <xsl:copy-of select="node()"/>
  </xsl:template>

</xsl:stylesheet>
