<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" 
     doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes" />
<!--
/////////////////////////////////////////////////////////////////////////////
//  courses.xsl - provides presentation formatting for XML-based           //
//                 course descriptions                                     //
//                                                                         //
//  ver 1.0 : 23 Dec 02                                                    //
//                                                                         //
//  Jim Fawcett, CST 2-187, Syracuse University, jfawcett@twcny.rr.com     //
/////////////////////////////////////////////////////////////////////////////
//
//  NOTE: !!!
//    If this stylesheet is used for viewing xml files then non-breaking spaces must be &nbsp;
//    Place in C:\su\webpages
//
//    If used for converting an xml file to html using convxml.exe then they must be <![CDATA[&nbsp;]]> 
//    place in C:\system, along with convxml.exe
//
//  This XSL stylesheet will format any xml file that contains a link to it
//  using IE6, e.g., if the xml file has a link to this stylesheet then
//  formating is all taken care of by IE when the xml page is loaded.
//
//  This works fine for IE6.  For IE version < 6 you will need to convert
//  your xml files using MSXSL.  You will want to use the sister version of
//  this program, convert.xsl, that uses .htm extensions in the navbars.
//
//  To convert to htm do the following:
//  - copy the xml pages you want to send to ecs.syr.edu/../handouts to 
//    c:\su\webpages\conv
//  - run convxml *.xml which uses c:\su\webpages\convert.xsl
//  - delete temp.tmp
//  - send the htm files to ecs.syr.edu/.. with ftp
//
-->

<!-- Establish document structure -->
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title><xsl:apply-templates select="courses/btitle"/></title>
        <xsl:apply-templates select="courses/theme"/>
        <meta name="description" content="Software Engineering course notes. Code Samples. Software Links"/>
        <meta name="keywords" content="Lecture, Notes, Code, Syracuse,University"/>
        <meta name="Author" content="Jim Fawcett"/>
        <meta name="Author" content="James Fawcett"/>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
      </head>
      <body>
        <xsl:apply-templates select="courses/visible"/>
      </body>
    </html>
  </xsl:template>

<!-- theme: Define theme's Cascading Style Sheet file -->
  <xsl:template match="theme">
    <link rel="stylesheet" href="{@src}" type="text/css" ></link>
  </xsl:template>

<!-- title: Display centered title -->
  <xsl:template match="title">
    <h1 class="center"><xsl:apply-templates/></h1>
  </xsl:template>

<!-- subtitle: display centered subtitle -->
  <xsl:template match="subtitle">
    <h1 class="subtitle center"><xsl:apply-templates/></h1>
  </xsl:template>

<!-- image: Display image below title -->
  <xsl:template match="image">
    <div class="center">
      <xsl:element name="img">
        <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
        <xsl:attribute name="alt">image file not found</xsl:attribute>
        <xsl:attribute name="height"><xsl:value-of select="@size"/></xsl:attribute>
        <xsl:attribute name="border"></xsl:attribute>
      </xsl:element>
    </div>
  </xsl:template>

<!-- images: Display an array of images below title -->  
  <xsl:template match="images">
    <div class="center">
      <xsl:apply-templates/>
    </div>
  </xsl:template>
  
<!-- imageItem: Place an image in array -->
  <xsl:template match="imageItem">
    <xsl:element name="img">
      <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
      <xsl:attribute name="alt">image file not found</xsl:attribute>
      <xsl:attribute name="height"><xsl:value-of select="@size"/></xsl:attribute>
      <xsl:attribute name="border"></xsl:attribute>
    </xsl:element>
  </xsl:template>

<!-- caption: display caption below image(s) -->  
  <xsl:template match="caption">
    <div class="center"><xsl:apply-templates/></div>
    <hr/>
  </xsl:template>

<!-- revised: display revision date -->  
  <xsl:template match="revised">
    <div class="center">
      Revised: <xsl:value-of select="." /><hr/>
    </div>
  </xsl:template>

<!-- quote: display quotation with author -->
  <xsl:template match="quote">
    <br/>
    <div class="center">
      &quot;<xsl:apply-templates/>&quot;
      <br/>
      - <xsl:value-of select="@source"/>
    </div>
    <br/><br/>
  </xsl:template>

<!-- lquote: display left-justified quotation with author -->
  <xsl:template match="lquote">
    <br/>
    &quot;<xsl:apply-templates/>&quot;<br/>
    - <xsl:value-of select="@source"/>
    <br/><br/>
  </xsl:template>

<!-- hnav: home level navigation bar -->
  <xsl:template match="hnav">
    <div class="hilight center">
      <a href="FawcettHome.xml">Home</a><![CDATA[&nbsp;]]> 
      <a href="Courses.xml">Courses</a><![CDATA[&nbsp;]]> 
      <a href="SoftwareTrack.xml">SWTrack</a><![CDATA[&nbsp;]]> 
      <a href="Code.xml">Code</a><![CDATA[&nbsp;]]> 
      <a href="http://www.ecs.syr.edu/faculty/fawcett/handouts">Handouts</a><![CDATA[&nbsp;]]> 
      <a href="StudentCultures.xml">StudCult</a><![CDATA[&nbsp;]]> 
      <a href="CoreTechnologies.xml">CoreTech</a><![CDATA[&nbsp;]]> 
      <a href="Books.xml">Books</a><![CDATA[&nbsp;]]> 
      <a href="Articles.xml">Articles</a><![CDATA[&nbsp;]]> 
      <a href="Mathematics.xml">Math</a><![CDATA[&nbsp;]]> 
      <a href="research.xml">Research</a><![CDATA[&nbsp;]]> 
      <a href="StudentProjects.xml">Student Projects</a><![CDATA[&nbsp;]]> 
      <a href="CaseProjects.xml">CASE Projects</a><![CDATA[&nbsp;]]> 
      <a href="Projects.xml">Project Topics</a><![CDATA[&nbsp;]]> 
      <a href="swdev.xml">SWDev</a><![CDATA[&nbsp;]]> 
      <a href="webdev.xml">WebDev</a><![CDATA[&nbsp;]]> 
      <a href="news.xml">News</a><![CDATA[&nbsp;]]> 
      <a href="OtherLinks.xml">OtherLinks</a><![CDATA[&nbsp;]]> 
      <a href="SiteDesign.xml">SiteDesign</a><![CDATA[&nbsp;]]> 
      <a href="graduates.xml">Graduates</a><![CDATA[&nbsp;]]> 
      <a href="AllPages.xml">AllPages</a><![CDATA[&nbsp;]]> 
      <a href="OfficeHours.xml">Office Hours</a><![CDATA[&nbsp;]]> 
      <a href="BrownBagSeminar.xml">Seminars</a><![CDATA[&nbsp;]]> 
      <a href="notices.xml"><span class="notice">Notices</span></a><![CDATA[&nbsp;]]> 
      <a href="#contents">contents</a><![CDATA[&nbsp;]]> 
    </div><hr/>
  </xsl:template>

<!-- cnav: course level navigation bar -->
  <xsl:template match="cnav">
    <div class="hilight center">
      <a href="CSE382.xml">CSE382-AADS</a><![CDATA[&nbsp;]]> 
      <a href="CSE681.xml">CSE681-SWMAA</a><![CDATA[&nbsp;]]> 
      <a href="CSE686.xml">CSE686-IP</a><![CDATA[&nbsp;]]> 
      <a href="CSE687.xml">CSE687-OOD</a><![CDATA[&nbsp;]]> 
      <a href="CSE775.xml">CSE775-DO</a><![CDATA[&nbsp;]]> 
      <a href="CSE776.xml">CSE776-DP</a><![CDATA[&nbsp;]]> 
      <a href="CSE778.xml">CSE778-AWP</a><![CDATA[&nbsp;]]> 
      <a href="CSE784.xml">CSE784-SWS</a><![CDATA[&nbsp;]]>
    </div><hr/>
  </xsl:template>

<!-- notice: vivid link -->
  <xsl:template match="notice">
    <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
      <span class="notice"><xsl:value-of select="@title"/></span>
    </xsl:element>
  </xsl:template>
  
<!-- note: use notice font for text -->
  <xsl:template match="note">
    <span class="note">
      <xsl:apply-templates/>
    </span>
  </xsl:template>

<!-- back: navigate to predecessor -->
  <xsl:template match="back">
      <xsl:element name="input">
        <xsl:attribute name="type">button</xsl:attribute>
        <xsl:attribute name="value">back</xsl:attribute>
        <xsl:attribute name="onclick">history.back()</xsl:attribute>
     <!--   <span class="notice"><xsl:value-of select="@title"/></span> -->
      </xsl:element>
  </xsl:template>

<!-- constr: page construction notice -->
  <xsl:template match="constr">
    <div class="center"><h1 class="atten">
      <br/>This Page is Under Construction!<br/><br/>
    </h1></div>
  </xsl:template>
  
<!-- sconstr: site construction notice -->
  <xsl:template match="sconstr">
    <div class="center"><h1 class="atten">
      <br/>This Site is Under Construction!<br/><br/>
    </h1></div>
  </xsl:template>
  
<!-- section: Display a Section label -->
  <xsl:template match="section">
    <h2><xsl:value-of select="@title"/></h2>
    <xsl:apply-templates/>
  </xsl:template>

<!-- isection: inline section label -->
  <xsl:template match="isection">
    <h2>
      <xsl:value-of select="@title"/>
      <span class="section">
        <xsl:apply-templates/>
      </span>
    </h2>
  </xsl:template>
  
<!-- p: insert paragraph break -->
  <xsl:template match="p">
    <p/>
  </xsl:template>

<!-- center: create centered section -->
  <xsl:template match="center">
    <div class="center"><xsl:apply-templates/></div>
  </xsl:template>

<!-- br: insert line break -->  
  <xsl:template match="br">
    <br/>
  </xsl:template>

<!-- i: italic font -->  
  <xsl:template match="i">
    <i><xsl:apply-templates/></i>
  </xsl:template>

<!-- b: bold font -->  
  <xsl:template match="b">
    <b><xsl:apply-templates/></b>
  </xsl:template>

<!-- u: underline font -->  
  <xsl:template match="u">
    <u><xsl:apply-templates/></u>
  </xsl:template>

<!-- hr: Horizontal Rule -->  
  <xsl:template match="hr">
    <hr />
  </xsl:template>

<!-- compress: compress text -->
  <xsl:template match="compress">
    <div style="padding-top:1 px; padding-bottom:1px">
      <xsl:apply-templates/>
    </div>
  </xsl:template>

<!-- olist: create ordered (numbered) list -->
  <xsl:template match="olist">
    <ol>
      <xsl:apply-templates/>
    </ol>
  </xsl:template>
  
<!-- colist: create compressed ordered (numbered) list -->
  <xsl:template match="colist">
    <ol style="list-style:inside; margin-top:0px; margin-left:10px; margin-bottom:0px;">
      <xsl:apply-templates/>
    </ol>
  </xsl:template>
  
<!-- ulist: create unordered (bulleted) list -->
  <xsl:template match="ulist">
    <ul>
      <xsl:apply-templates/>
    </ul>
  </xsl:template>
  
<!-- culist: create compressed unordered (bulleted) list -->
  <xsl:template match="culist">
    <ul style="list-style:inside; margin-top:0px; margin-left:10px; margin-bottom:0px;">
      <xsl:apply-templates/>
    </ul>
  </xsl:template>
  
<!-- litem: define list items for either order or unordered lists -->
  <xsl:template match="litem">
    <li><xsl:apply-templates/></li>
  </xsl:template>

<!-- clitem: define compressed list items for either order or unordered lists -->
  <xsl:template match="clitem">
    <li style="padding-top:1px; padding-bottom:1px"><xsl:apply-templates/></li>
  </xsl:template>

<!-- llitem: labeled list item -->
  <xsl:template match="llitem">
    <li>
      <i class="emph"><xsl:value-of select="@label"/></i><br/>
      <xsl:apply-templates/>
    </li>
  </xsl:template>

<!-- block: Start indented block with background color -->
  <xsl:template match="block">
    <div class="block"><xsl:apply-templates/></div>
  </xsl:template>

<!-- cblock: Start indented block with background color -->
  <xsl:template match="cblock">
    <div class="block"><xsl:apply-templates/></div>
  </xsl:template>

<!-- hilight: Start indented block with Hilight background color -->
  <xsl:template match="hilight">
    <div class="hilight center"><xsl:apply-templates/></div><hr/>
  </xsl:template>

<!-- lhilight: Start indented block with Hilight background color -->
  <xsl:template match="lhilight">
    <div class="hilight"><xsl:apply-templates/></div><hr/>
  </xsl:template>

<!-- ind: indent a block -->
  <xsl:template match="ind">
    <div class="indent"><xsl:apply-templates/></div>
  </xsl:template>
  
<!-- links: Create a block of links -->
  <xsl:template match="links">
    <blockquote class="info"><xsl:apply-templates/></blockquote>
  </xsl:template>

<!-- link: Define a link element - ends with line break -->
  <xsl:template match="link">
    <xsl:element name="a">
      <xsl:attribute name="href">http://<xsl:value-of select="."/></xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element><br/>
  </xsl:template>

<!-- sublink: Define an indented link element - ends with line break -->
  <xsl:template match="sublink">
    <![CDATA[&nbsp;]]><![CDATA[&nbsp;]]>
    <xsl:element name="a">
      <xsl:attribute name="href">http://<xsl:value-of select="."/></xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element><![CDATA[&nbsp;]]>
  </xsl:template>

<!-- ilink: Define an inline link element -->
  <xsl:template match="ilink">
    <xsl:element name="a">
      <xsl:attribute name="href">http://<xsl:value-of select="."/></xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element>
  </xsl:template>

<!-- file: Define a link to a file reference -->
  <xsl:template match="file">
    <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element><br/>
  </xsl:template>

<!-- subfile: Define a link to a file reference -->
  <xsl:template match="subfile">
    <![CDATA[&nbsp;]]><![CDATA[&nbsp;]]>
    <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element><![CDATA[&nbsp;]]>
  </xsl:template>

<!-- ifile: Define a link to an inline file reference -->
  <xsl:template match="ifile">
    <xsl:element name="a">
      <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
      <xsl:value-of select="@title"/>
    </xsl:element>
  </xsl:template>

<!-- syllabus: Create Syllabus table -->
  <xsl:template match="syllabus">
    <div class="block center">
      <table border="2">
        <xsl:apply-templates/>
      </table>
    </div>
  </xsl:template>

<!-- syllHeading: Define heading row for Syllabus -->  
  <xsl:template match="syllHeading">
    <tr class="heading">
      <xsl:apply-templates/>
    </tr>
  </xsl:template>
  
<!-- hd: Define heading element -->  
  <xsl:template match="hd">
    <td class="heading center"><xsl:apply-templates/></td>
  </xsl:template>
  
<!-- sd: Define a sized heading element -->
  <xsl:template match="sd">
    <td class="sized center"><xsl:apply-templates/></td>
  </xsl:template>

<!-- lecture: Define a Syllabus row, e.g., a lecture -->  
  <xsl:template match="lecture">
    <tr class="row">
      <xsl:apply-templates/>
    </tr>
  </xsl:template>
  
<!-- emlecture: Define an emphasized Syllabus row -->
  <xsl:template match="emlecture">
    <tr class="emphasis">
      <xsl:apply-templates/>
    </tr>
  </xsl:template>

<!-- ld: Define element of Syllabus -->  
  <xsl:template match="ld">
    <td>
      <xsl:apply-templates/>
    </td>
  </xsl:template>

<!-- ed: Define emphasized element for Syllabus -->
  <xsl:template match="ed">
    <td class="emphasis center">
      <xsl:apply-templates/>
    </td>
  </xsl:template>

<!-- cd: Define centered element for Syllabus -->
  <xsl:template match="cd">
    <td class="center">
      <xsl:apply-templates/>
    </td>
  </xsl:template>

<!-- table: Create table -->
  <xsl:template match="table">
    <div class="block center">
      <table>
        <xsl:apply-templates/>
      </table>
    </div>
  </xsl:template>

<!-- th: Define heading row -->  
  <xsl:template match="th">
    <tr class="heading">
      <xsl:apply-templates/>
    </tr>
  </xsl:template>
  
<!-- tr: Define a row -->  
  <xsl:template match="tr">
    <tr class="row">
      <xsl:apply-templates/>
    </tr>
  </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>

<!-- include: XML file -->
<!-- why doesn't this work???
  <xsl:template match="include">
    <xsl:apply-templates select="document(@src)"/>
  </xsl:template>
 -->
  <xsl:template match="include">
    <xsl:variable name="inc" select="document(@src)"/>
    <xsl:apply-templates select="$inc//hilight"/>
  </xsl:template>

  <xsl:template match="up2HomeNavBar">
    <div class="hilight center">
      <a href="../../WebPages/FawcettHome.xml">Home</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/Courses.xml">Courses</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/Code.xml">Code</a><![CDATA[&nbsp;]]> 
      <a href="http://www.ecs.syr.edu/faculty/fawcett/handouts">Handouts</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/Books.xml">Books</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/Mathematics.xml">Math</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/research.xml">Research</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/MastersProjects.xml">Masters Projects</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/swdev.xml">SWDev</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/webdev.xml">WebDev</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/news.xml">News</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/OtherLinks.xml">OtherLinks</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/SiteDesign.xml">SiteDesign</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/graduates.xml">Graduates</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/AllPages.xml">AllPages</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/OfficeHours.xml">Office Hours</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/notices.xml"><span class="notice">Notices</span></a><![CDATA[&nbsp;]]> 
      <a href="#contents">contents</a><![CDATA[&nbsp;]]> 
    </div>
    <hr/>
  </xsl:template>

  <xsl:template match="up2CoursesNavBar">
    <div class="hilight center">
      <a href="../../WebPages/CSE681.xml">CSE681-SWMAA</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/CSE686.xml">CSE686-IP</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/CSE687.xml">CSE687-OOD</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/CSE775.xml">CSE775-DO</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/CSE776.xml">CSE776-DP</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/CSE778.xml">CSE778-AWP</a><![CDATA[&nbsp;]]> 
      <a href="../../WebPages/CSE784.xml">CSE784-SWS</a><![CDATA[&nbsp;]]> 
    </div>
    <hr/>
  </xsl:template>

  <xsl:template match="lectures10NavBar">
    <div class="hilight center">
      <a href="../lectures/CSE681.xml">CSE681-SWMAA</a><![CDATA[&nbsp;]]> 
      <a href="CSE686.xml">CSE686-IP</a><![CDATA[&nbsp;]]> 
      <a href="CSE687.xml">CSE687-OOD</a><![CDATA[&nbsp;]]> 
      <a href="CSE775.xml">CSE775-DO</a><![CDATA[&nbsp;]]> 
      <a href="CSE776.xml">CSE776-DP</a><![CDATA[&nbsp;]]> 
      <a href="CSE778.xml">CSE778-AWP</a><![CDATA[&nbsp;]]> 
      <a href="CSE784.xml">CSE784-SWS</a><![CDATA[&nbsp;]]> 
    </div>
    <hr/>
  </xsl:template>

</xsl:stylesheet>
