1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <xsl:template match="glossary">
19 <div class="{name(.)}">
20 <xsl:if test="$generate.id.attributes != 0">
21 <xsl:attribute name="id">
22 <xsl:call-template name="object.id"/>
26 <xsl:call-template name="glossary.titlepage"/>
29 <xsl:when test="glossdiv">
30 <xsl:apply-templates select="(glossdiv[1]/preceding-sibling::*)"/>
33 <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
38 <xsl:when test="glossdiv">
39 <xsl:apply-templates select="glossdiv"/>
43 <xsl:apply-templates select="glossentry"/>
48 <xsl:if test="not(parent::article)">
49 <xsl:call-template name="process.footnotes"/>
54 <xsl:template match="glossary/glossaryinfo"/>
55 <xsl:template match="glossary/title"/>
56 <xsl:template match="glossary/subtitle"/>
57 <xsl:template match="glossary/titleabbrev"/>
59 <!-- ==================================================================== -->
61 <xsl:template match="glosslist">
62 <div class="{name(.)}">
63 <xsl:call-template name="anchor"/>
64 <xsl:if test="blockinfo/title|title">
65 <xsl:call-template name="formal.object.heading"/>
68 <xsl:apply-templates select="glossentry"/>
73 <!-- ==================================================================== -->
75 <xsl:template match="glossdiv">
76 <div class="{name(.)}">
77 <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
80 <xsl:apply-templates select="glossentry"/>
85 <xsl:template match="glossdiv/title">
86 <h3 class="{name(.)}">
87 <xsl:apply-templates/>
91 <!-- ==================================================================== -->
95 GlossTerm, Acronym?, Abbrev?,
98 (GlossSee | GlossDef+)
101 <xsl:template match="glossentry">
103 <xsl:when test="$glossentry.show.acronym = 'primary'">
105 <xsl:call-template name="anchor">
106 <xsl:with-param name="conditional">
108 <xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
109 <xsl:otherwise>1</xsl:otherwise>
115 <xsl:when test="acronym|abbrev">
116 <xsl:apply-templates select="acronym|abbrev"/>
117 <xsl:text> (</xsl:text>
118 <xsl:apply-templates select="glossterm"/>
119 <xsl:text>)</xsl:text>
122 <xsl:apply-templates select="glossterm"/>
127 <xsl:when test="$glossentry.show.acronym = 'yes'">
129 <xsl:call-template name="anchor">
130 <xsl:with-param name="conditional">
132 <xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
133 <xsl:otherwise>1</xsl:otherwise>
138 <xsl:apply-templates select="glossterm"/>
140 <xsl:if test="acronym|abbrev">
141 <xsl:text> (</xsl:text>
142 <xsl:apply-templates select="acronym|abbrev"/>
143 <xsl:text>)</xsl:text>
149 <xsl:call-template name="anchor">
150 <xsl:with-param name="conditional">
152 <xsl:when test="$glossterm.auto.link != 0">0</xsl:when>
153 <xsl:otherwise>1</xsl:otherwise>
158 <xsl:apply-templates select="glossterm"/>
163 <xsl:apply-templates select="indexterm|revhistory|glosssee|glossdef"/>
166 <xsl:template match="glossentry/glossterm">
167 <xsl:apply-templates/>
168 <xsl:if test="following-sibling::glossterm">, </xsl:if>
171 <xsl:template match="glossentry/acronym">
172 <xsl:apply-templates/>
173 <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
176 <xsl:template match="glossentry/abbrev">
177 <xsl:apply-templates/>
178 <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
181 <xsl:template match="glossentry/revhistory">
184 <xsl:template match="glossentry/glosssee">
185 <xsl:variable name="otherterm" select="@otherterm"/>
186 <xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
187 <xsl:variable name="target" select="$targets[1]"/>
191 <xsl:variable name="template">
192 <xsl:call-template name="gentext.template">
193 <xsl:with-param name="context" select="'glossary'"/>
194 <xsl:with-param name="name" select="'see'"/>
198 <xsl:variable name="title">
200 <xsl:when test="$target">
202 <xsl:attribute name="href">
203 <xsl:call-template name="href.target">
204 <xsl:with-param name="object" select="$target"/>
207 <xsl:apply-templates select="$target" mode="xref-to"/>
210 <xsl:when test="$otherterm != '' and not($target)">
212 <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
213 <xsl:value-of select="$otherterm"/>
215 <xsl:apply-templates/>
218 <xsl:apply-templates/>
223 <xsl:call-template name="substitute-markup">
224 <xsl:with-param name="template" select="$template"/>
225 <xsl:with-param name="title" select="$title"/>
227 <xsl:text>.</xsl:text>
232 <xsl:template match="glossentry/glossdef">
234 <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
235 <xsl:if test="glossseealso">
237 <xsl:variable name="template">
238 <xsl:call-template name="gentext.template">
239 <xsl:with-param name="context" select="'glossary'"/>
240 <xsl:with-param name="name" select="'seealso'"/>
243 <xsl:variable name="title">
244 <xsl:apply-templates select="glossseealso"/>
246 <xsl:call-template name="substitute-markup">
247 <xsl:with-param name="template" select="$template"/>
248 <xsl:with-param name="title" select="$title"/>
255 <xsl:template match="glossseealso">
256 <xsl:variable name="otherterm" select="@otherterm"/>
257 <xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
258 <xsl:variable name="target" select="$targets[1]"/>
261 <xsl:when test="$target">
263 <xsl:attribute name="href">
264 <xsl:call-template name="href.target">
265 <xsl:with-param name="object" select="$target"/>
268 <xsl:apply-templates select="$target" mode="xref-to"/>
271 <xsl:when test="$otherterm != '' and not($target)">
273 <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
274 <xsl:value-of select="$otherterm"/>
276 <xsl:apply-templates/>
279 <xsl:apply-templates/>
284 <xsl:when test="position() = last()">
285 <xsl:text>.</xsl:text>
288 <xsl:text>, </xsl:text>
293 <!-- ==================================================================== -->
295 <!-- Glossary collection -->
297 <xsl:template match="glossary[@role='auto']" priority="2">
298 <xsl:variable name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/>
299 <xsl:variable name="collection" select="document($glossary.collection, .)"/>
301 <xsl:if test="$glossary.collection = ''">
303 <xsl:text>Warning: processing automatic glossary </xsl:text>
304 <xsl:text>without a glossary.collection file.</xsl:text>
308 <xsl:if test="not($collection) and $glossary.collection != ''">
310 <xsl:text>Warning: processing automatic glossary but unable to </xsl:text>
311 <xsl:text>open glossary.collection file '</xsl:text>
312 <xsl:value-of select="$glossary.collection"/>
313 <xsl:text>'</xsl:text>
317 <div class="{name(.)}">
318 <xsl:if test="$generate.id.attributes != 0">
319 <xsl:attribute name="id">
320 <xsl:call-template name="object.id"/>
324 <xsl:call-template name="glossary.titlepage"/>
327 <xsl:when test="glossdiv and $collection//glossdiv">
328 <xsl:for-each select="$collection//glossdiv">
329 <!-- first see if there are any in this div -->
330 <xsl:variable name="exist.test">
331 <xsl:for-each select="glossentry">
332 <xsl:variable name="cterm" select="glossterm"/>
333 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
334 <xsl:value-of select="glossterm"/>
339 <xsl:if test="$exist.test != ''">
340 <xsl:apply-templates select="." mode="auto-glossary">
341 <xsl:with-param name="terms" select="$terms"/>
342 </xsl:apply-templates>
348 <xsl:for-each select="$collection//glossentry">
349 <xsl:variable name="cterm" select="glossterm"/>
350 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
351 <xsl:apply-templates select="." mode="auto-glossary"/>
358 <xsl:if test="not(parent::article)">
359 <xsl:call-template name="process.footnotes"/>
364 <xsl:template match="*" mode="auto-glossary">
365 <!-- pop back out to the default mode for most elements -->
366 <xsl:apply-templates select="."/>
369 <xsl:template match="glossdiv" mode="auto-glossary">
370 <xsl:param name="terms" select="."/>
372 <div class="{name(.)}">
373 <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
376 <xsl:for-each select="glossentry">
377 <xsl:variable name="cterm" select="glossterm"/>
378 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
379 <xsl:apply-templates select="." mode="auto-glossary"/>
386 <!-- ==================================================================== -->