<xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
<div id="{$id}" class="{name(.)}">
- <xsl:call-template name="bibliography.titlepage"/>
- <dl>
- <xsl:apply-templates/>
- </dl>
+ <xsl:call-template name="glossary.titlepage"/>
+
+ <xsl:choose>
+ <xsl:when test="glossdiv">
+ <xsl:apply-templates select="(glossdiv[1]/preceding-sibling::*)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="glossdiv">
+ <xsl:apply-templates select="glossdiv"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <dl>
+ <xsl:apply-templates select="glossentry"/>
+ </dl>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="glossdiv">
+ <xsl:apply-templates select="(glossdiv[1]/following-sibling::*)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="(glossentry[1]/following-sibling::*)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
<xsl:call-template name="process.footnotes"/>
</div>
</xsl:template>
<xsl:template match="glossdiv">
<div class="{name(.)}">
- <xsl:apply-templates/>
+ <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
+
+ <dl>
+ <xsl:apply-templates select="glossentry"/>
+ </dl>
</div>
</xsl:template>
</xsl:template>
<xsl:template match="glossentry/glossdef">
- <dd><xsl:apply-templates/></dd>
+ <dd>
+ <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
+ <xsl:if test="glossseealso">
+ <p>
+ <xsl:call-template name="gentext.template">
+ <xsl:with-param name="context" select="'glossary'"/>
+ <xsl:with-param name="name" select="'seealso'"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="glossseealso"/>
+ </p>
+ </xsl:if>
+ </dd>
</xsl:template>
<xsl:template match="glossseealso">
<xsl:variable name="otherterm" select="@otherterm"/>
<xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
<xsl:variable name="target" select="$targets[1]"/>
- <p>
- <xsl:call-template name="gentext.template">
- <xsl:with-param name="context" select="'glossary'"/>
- <xsl:with-param name="name" select="'seealso'"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="@otherterm">
- <a href="#{@otherterm}">
- <xsl:apply-templates select="$target" mode="xref"/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>.</xsl:text>
- </p>
+
+ <xsl:choose>
+ <xsl:when test="@otherterm">
+ <a href="#{@otherterm}">
+ <xsl:apply-templates select="$target" mode="xref"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="position() = last()">
+ <xsl:text>.</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>, </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- ==================================================================== -->