summaryrefslogtreecommitdiff
path: root/stylesheets/db2html-glossary.xsl
blob: 807e93441a400fb3244ac6733b483e2219d39c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?xml version='1.0'?><!-- -*- Mode: fundamental; tab-width: 3 -*- -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

<xsl:template match="glossdef">
	<dd>
		<xsl:apply-templates select="*[name(.) != 'glossseealso']"/>
		<xsl:if test="glossseealso">
			<p>
				<xsl:call-template name="gettext">
					<xsl:with-param name="key" select="'See Also'"/>
				</xsl:call-template>
				<xsl:text> </xsl:text>
				<xsl:for-each select="glossseealso">
					<xsl:apply-templates select="."/>
					<xsl:choose>
						<xsl:when test="position() = last()">
							<xsl:text>.</xsl:text>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text>, </xsl:text>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:for-each>
			</p>
		</xsl:if>
	</dd>
</xsl:template>

<xsl:template match="glossdiv">
	<div class="{name(.)}">
		<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
		<dl>
			<xsl:apply-templates select="glossentry"/>
		</dl>
	</div>
</xsl:template>

<xsl:template match="glossentry">
	<xsl:call-template name="block"/>
</xsl:template>

<xsl:template match="glosslist">
	<div class="{name(.)}">
		<xsl:call-template name="anchor"/>
		<dl>
			<xsl:apply-templates/>
		</dl>
	</div>
</xsl:template>

<xsl:template match="glosssee">
	<dd>
		<p>
			<xsl:call-template name="gettext">
				<xsl:with-param name="key" select="'See'"/>
			</xsl:call-template>
			<xsl:choose>
				<xsl:when test="@otherterm">
					<a href="#{@otherterm}">
						<xsl:call-template name="xref.content">
							<xsl:with-param name="linkend" select="@otherterm"/>
						</xsl:call-template>
					</a>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates/>
				</xsl:otherwise>
			</xsl:choose>
		</p>
	</dd>
</xsl:template>

<xsl:template match="glossseealso">
	<xsl:choose>
		<xsl:when test="@otherterm">
			<a href="#{@otherterm}">
				<xsl:call-template name="xref.content">
					<xsl:with-param name="linkend" select="@otherterm"/>
				</xsl:call-template>
			</a>
		</xsl:when>
		<xsl:otherwise>
			<xsl:apply-templates/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="glossterm">
	<dt>
		<xsl:apply-templates/>
	</dt>
</xsl:template>

</xsl:stylesheet>