diff --git a/modules/titling.xml b/modules/titling.xml index 8888a1d..502404a 100644 --- a/modules/titling.xml +++ b/modules/titling.xml @@ -16,10 +16,12 @@ - + Sample Solution for - Assignment + + + @@ -45,29 +47,19 @@ For the HTML title, strip out any markup (e.g., emphasis), as this is not interpreted within the tag, resulting in raw HTML markup in the window title. Ick. We do this by switching to "strip" mode. --> <common formats="/html/xhtml/"> - <xsl:if test="( /document/@class = 'tutorial' ) or ( /document/@class = 'laboratory' ) or ( /document/@class = 'assignment' )"> + <xsl:if test="( /document/@class = 'tutorial' ) or ( /document/@class = 'laboratory' ) or ( /document/@class = 'assignment' ) or ( /document/@class = 'project' )"> <xsl:if test="$showanswers='yes'"> <xsl:choose> <xsl:when test="( /document/@class = 'tutorial' ) or ( /document/@class = 'laboratory' )"> <xsl:text>Selected Answers for </xsl:text> </xsl:when> - <xsl:when test="/document/@class = 'assignment'"> + <xsl:when test="( /document/@class = 'assignment' ) or ( /document/@class = 'project' )"> <xsl:text>Sample Solution for </xsl:text> </xsl:when> </xsl:choose> </xsl:if> <xsl:call-template name="PaperCode" /> - <xsl:choose> - <xsl:when test="/document/@class = 'tutorial'"> - <xsl:text> Tutorial </xsl:text> - </xsl:when> - <xsl:when test="/document/@class = 'laboratory'"> - <xsl:text> Lab </xsl:text> - </xsl:when> - <xsl:when test="/document/@class = 'assignment'"> - <xsl:text> Assignment </xsl:text> - </xsl:when> - </xsl:choose> + <xsl:value-of select="concat( upper-case( substring( /document/@class, 1, 1 ) ), substring( /document/@class, 2 ) ) " /> <xsl:value-of select="/document/@sequence-number" /> <!-- If the title's empty, there's no point in including the ": ". --> <xsl:if test="node()"> @@ -104,8 +96,8 @@ <!-- Assignment due date. This only makes sense for assignments in LaTeX. --> <template name="preamble-due-date" match="document/due-date" mode="preamble"> <common formats="/latex/xelatex/"> - <xsl:if test="/document/@class != 'assignment'"> - <xsl:message terminate="yes">You can only use the due-date element if the document class is "assignment".</xsl:message> + <xsl:if test="( /document/@class != 'assignment' ) and ( /document/@class != 'project' )"> + <xsl:message terminate="yes">You can only use the due-date element if the document class is "assignment" or "project".</xsl:message> </xsl:if> <xsl:if test="/document/date"> <xsl:message terminate="yes">You can't include both a due-date and a date element in an assignment.</xsl:message> @@ -135,29 +127,19 @@ <template name="document-title-title" match="document/title" mode="title"> <common formats="/html/xhtml/"> <h1> - <xsl:if test="( /document/@class = 'tutorial' ) or ( /document/@class = 'laboratory' ) or ( /document/@class = 'assignment' )"> + <xsl:if test="( /document/@class = 'tutorial' ) or ( /document/@class = 'laboratory' ) or ( /document/@class = 'assignment' ) or ( /document/@class = 'project' )"> <xsl:if test="$showanswers='yes'"> <xsl:choose> <xsl:when test="( /document/@class = 'tutorial' ) or ( /document/@class = 'laboratory' )"> <xsl:text>Selected Answers for </xsl:text> </xsl:when> - <xsl:when test="/document/@class = 'assignment'"> + <xsl:when test="( /document/@class = 'assignment' ) or ( /document/@class = 'project' )"> <xsl:text>Sample Solution for </xsl:text> </xsl:when> </xsl:choose> </xsl:if> <xsl:call-template name="PaperCode" /> - <xsl:choose> - <xsl:when test="/document/@class = 'tutorial'"> - <xsl:text> Tutorial </xsl:text> - </xsl:when> - <xsl:when test="/document/@class = 'laboratory'"> - <xsl:text> Lab </xsl:text> - </xsl:when> - <xsl:when test="/document/@class = 'assignment'"> - <xsl:text> Assignment </xsl:text> - </xsl:when> - </xsl:choose> + <xsl:value-of select="concat( upper-case( substring( /document/@class, 1, 1 ) ), substring( /document/@class, 2 ) ) " /> <xsl:value-of select="/document/@sequence-number" /> <!-- If the title's empty, there's no point in including the ": ". --> <xsl:if test="node()"> @@ -205,8 +187,8 @@ --> <template name="document-due-date-title" match="document/due-date" mode="title"> <common formats="/html/xhtml/"> - <xsl:if test="/document/@class != 'assignment'"> - <xsl:message terminate="yes">You can only use the due-date element if the document class is "assignment".</xsl:message> + <xsl:if test="( /document/@class != 'assignment' ) and ( /document/@class != 'project' )"> + <xsl:message terminate="yes">You can only use the due-date element if the document class is "assignment" or "project".</xsl:message> </xsl:if> <p> <xsl:text>DUE DATE: </xsl:text> @@ -220,8 +202,8 @@ --> <template name="document-due-date-inline" match="document/due-date" mode="inline"> <common> - <xsl:if test="/document/@class != 'assignment'"> - <xsl:message terminate="yes">You can only use the due-date element if the document class is "assignment".</xsl:message> + <xsl:if test="( /document/@class != 'assignment' ) and ( /document/@class != 'project' )"> + <xsl:message terminate="yes">You can only use the due-date element if the document class is "assignment" or "project".</xsl:message> </xsl:if> <xsl:apply-templates /> </common>