<?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="/course"> <html> <head> <title> <xsl:value-of select="@designator"/> Standardized Course Description </title> </head> <body> <h2> <xsl:value-of select="@designator"/> Standardized Course Description </h2> <hr/> <h4>Owner</h4> <table border="0"> <xsl:for-each select="owner"> <xsl:call-template name="person-row"/> </xsl:for-each> </table> <h4>Subscribers</h4> <table border="0"> <xsl:for-each select="subscriber"> <xsl:call-template name="person-row"/> </xsl:for-each> </table> <a> <xsl:attribute name="href"> mailto:<xsl:for-each select="//e-mail"><xsl:value-of select="."/>;</xsl:for-each> </xsl:attribute> e-mail to all of the above </a> <h4>Pending Change Proposals</h4> <a href="form.html">Make a change proposal</a> <xsl:if test="change"> <ul> <xsl:apply-templates select="change"/> </ul> </xsl:if> <h4>Course Description</h4> <table border="0" width="600"> <tr><td> <p><xsl:copy-of select="calendar-description"/></p> <p><xsl:copy-of select="additional-description"/></p> </td></tr> </table> <xsl:if test="prereq"> <h4>Prerequisistes</h4> <ul> <xsl:apply-templates select="prereq"/> </ul> </xsl:if> <xsl:if test="coreq"> <h4>Corequisistes</h4> <ul> <xsl:apply-templates select="coreq"/> </ul> </xsl:if> <h4>Topics</h4> <xsl:call-template name="handle-topics"/> <h4>Texts</h4> <ol> <xsl:apply-templates select="text"/> </ol> <xsl:if test="tech"> <h4>Technology</h4> <xsl:call-template name="handle-tech"/> </xsl:if> <xsl:if test="eval"> <h4>Evaluation</h4> <xsl:call-template name="handle-evals"/> </xsl:if> </body> </html> </xsl:template> <xsl:template name="handle-topics"> <xsl:if test="topic"> <ul> <xsl:for-each select="topic"> <li> <xsl:call-template name="write-optional"/> <xsl:if test="@hours">(<xsl:value-of select="@hours"/> hr.)</xsl:if> <xsl:call-template name="handle-topics"/> </li> </xsl:for-each> </ul> </xsl:if> </xsl:template> <xsl:template match="prereq | coreq"> <li> <xsl:value-of select="text()"/> <xsl:if test="reason"> <ul> <xsl:for-each select="reason"> <li> <xsl:value-of select="."/> </li> </xsl:for-each> </ul> </xsl:if> </li> </xsl:template> <xsl:template match="text"> <li> <pre> <xsl:choose><xsl:when test="@type"> <b><xsl:value-of select="translate(@type,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/></b><br/> </xsl:when><xsl:otherwise> <b>REQUIRED</b> </xsl:otherwise></xsl:choose> <br/> <xsl:value-of select="title"/> <xsl:if test="edition"> (<xsl:value-of select="edition"/> edition)</xsl:if><br/> <xsl:value-of select="author"/>, <xsl:value-of select="publisher"/>, <xsl:value-of select="year"/> <xsl:if test="ISBN"><br/>ISBN <xsl:value-of select="ISBN"/></xsl:if><br/> </pre> </li> </xsl:template> <xsl:template name="handle-tech"> <ul> <xsl:for-each select="tech"> <li> <xsl:call-template name="write-optional"/> </li> </xsl:for-each> </ul> </xsl:template> <xsl:template name="handle-evals"> <table border="1" width="600"> <thead><tr><th>type</th><th>weight</th><th>description</th></tr></thead> <tbody> <xsl:for-each select="eval"> <tr> <td><xsl:value-of select="@type"/></td> <td><xsl:value-of select="@weight"/></td> <td><xsl:value-of select="."/></td> </tr> </xsl:for-each> </tbody> </table> </xsl:template> <xsl:template name="write-optional"> <xsl:choose><xsl:when test="@type='optional'"> (OPTIONAL) <i><xsl:value-of select="text()"/></i> </xsl:when><xsl:otherwise> <xsl:value-of select="text()"/> </xsl:otherwise></xsl:choose> </xsl:template> <xsl:template name="person-row"> <tr> <td><xsl:value-of select="text()"/></td> <td> <a> <xsl:attribute name="href"> mailto:<xsl:value-of select="e-mail"/> </xsl:attribute> <xsl:value-of select="e-mail"/> </a> </td> </tr> </xsl:template> <xsl:template match="change"> <li> (<xsl:value-of select="date"/> - <xsl:value-of select="who"/>) <xsl:value-of select="text()"/> <br/><a href="form.html">Make an objection to this change proposal</a> <xsl:if test="objection"> <br/><b>Objections so far:</b> <ul> <xsl:for-each select="objection"> <li> (<xsl:value-of select="date"/> - <xsl:value-of select="who"/>) <xsl:value-of select="text()"/> </li> </xsl:for-each> </ul> </xsl:if> </li> </xsl:template> </xsl:stylesheet>