• Added support for question sets to (X)HTML as well (oops).
1 parent 71eb2a5 commit 8733b0da66368bf6fc8d527f1c46b1f6d02f84e9
Nigel Stanger authored on 19 Jul 2016
Showing 1 changed file
View
12
modules/titling.xml
<!--
For the HTML title, strip out any markup (e.g., emphasis), as this is not interpreted within the <title> 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="index-of(('tutorial', 'laboratory', 'assignment', 'project'), /document/@class)">
<xsl:if test="index-of(('tutorial', 'laboratory', 'assignment', 'project', 'question set'), /document/@class)">
<xsl:if test="$showanswers='yes'">
<xsl:choose>
<xsl:when test="index-of(('tutorial', 'laboratory'), /document/@class)">
<xsl:text>Selected Answers for </xsl:text>
</xsl:when>
<xsl:when test="index-of(('assignment', 'project'), /document/@class)">
<xsl:when test="index-of(('assignment', 'project', 'question set'), /document/@class)">
<xsl:text>Sample Solution for </xsl:text>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:value-of select="infosci:title-case(/document/@class)" />
<xsl:text> </xsl:text>
<xsl:value-of select="/document/@sequence-number" />
<!-- If the title's empty, there's no point in including the ": ". -->
<xsl:if test="node()">
<xsl:if test="node() and (/document/@class != 'question set')">
<xsl:text>: </xsl:text>
</xsl:if>
</xsl:if>
<xsl:apply-templates mode="strip" />
-->
<template name="document-title-title" match="document/title" mode="title">
<common formats="/html/xhtml/">
<h1>
<xsl:if test="index-of(('tutorial', 'laboratory', 'assignment', 'project'), /document/@class)">
<xsl:if test="index-of(('tutorial', 'laboratory', 'assignment', 'project', 'question set'), /document/@class)">
<xsl:if test="$showanswers='yes'">
<xsl:choose>
<xsl:when test="index-of(('tutorial', 'laboratory'), /document/@class)">
<xsl:text>Selected Answers for </xsl:text>
</xsl:when>
<xsl:when test="index-of(('assignment', 'project'), /document/@class)">
<xsl:when test="index-of(('assignment', 'project', 'question set'), /document/@class)">
<xsl:text>Sample Solution for </xsl:text>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:value-of select="infosci:title-case(/document/@class)" />
<xsl:text> </xsl:text>
<xsl:value-of select="/document/@sequence-number" />
<!-- If the title's empty, there's no point in including the ": ". -->
<xsl:if test="node()">
<xsl:if test="node() and (/document/@class != 'question set')">
<xsl:text>: </xsl:text>
</xsl:if>
</xsl:if>
<xsl:apply-templates />