2 <!DOCTYPE xsl:stylesheet [
3 <!ENTITY % common.entities SYSTEM "../common/entities.ent">
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7 xmlns:fo="http://www.w3.org/1999/XSL/Format"
8 xmlns:xlink='http://www.w3.org/1999/xlink'
9 exclude-result-prefixes="xlink"
12 <!-- ********************************************************************
13 $Id: glossary.xsl 8591 2010-02-27 20:42:27Z bobstayton $
14 ********************************************************************
16 This file is part of the XSL DocBook Stylesheet distribution.
17 See ../README or http://docbook.sf.net/release/xsl/current/ for
18 copyright and other information.
20 ******************************************************************** -->
22 <!-- ==================================================================== -->
24 <xsl:template match="glossary">
25 <xsl:call-template name="make-glossary"/>
28 <xsl:template match="glossdiv/title"/>
29 <xsl:template match="glossdiv/subtitle"/>
30 <xsl:template match="glossdiv/titleabbrev"/>
32 <!-- ==================================================================== -->
34 <xsl:template name="make-glossary">
35 <xsl:param name="divs" select="glossdiv"/>
36 <xsl:param name="entries" select="glossentry"/>
37 <xsl:param name="preamble" select="*[not(self::title
40 or self::glossentry)]"/>
42 &setup-language-variable;
44 <xsl:variable name="id">
45 <xsl:call-template name="object.id"/>
48 <xsl:variable name="presentation">
49 <xsl:call-template name="pi.dbfo_glossary-presentation"/>
52 <xsl:variable name="term-width">
53 <xsl:call-template name="pi.dbfo_glossterm-width"/>
56 <xsl:variable name="width">
58 <xsl:when test="$term-width = ''">
59 <xsl:value-of select="$glossterm.width"/>
62 <xsl:value-of select="$term-width"/>
68 <xsl:call-template name="glossary.titlepage"/>
71 <xsl:if test="$preamble">
72 <xsl:apply-templates select="$preamble"/>
76 <xsl:when test="$presentation = 'list'">
77 <xsl:apply-templates select="$divs" mode="glossary.as.list">
78 <xsl:with-param name="width" select="$width"/>
79 </xsl:apply-templates>
80 <xsl:if test="$entries">
81 <fo:list-block provisional-distance-between-starts="{$width}"
82 provisional-label-separation="{$glossterm.separation}"
83 xsl:use-attribute-sets="normal.para.spacing">
85 <xsl:when test="$glossary.sort != 0">
86 <xsl:apply-templates select="$entries" mode="glossary.as.list">
87 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
88 </xsl:apply-templates>
91 <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
97 <xsl:when test="$presentation = 'blocks'">
98 <xsl:apply-templates select="$divs" mode="glossary.as.blocks"/>
100 <xsl:when test="$glossary.sort != 0">
101 <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
102 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
103 </xsl:apply-templates>
106 <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
110 <xsl:when test="$glossary.as.blocks != 0">
111 <xsl:apply-templates select="$divs" mode="glossary.as.blocks"/>
113 <xsl:when test="$glossary.sort != 0">
114 <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
115 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
116 </xsl:apply-templates>
119 <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
124 <xsl:apply-templates select="$divs" mode="glossary.as.list">
125 <xsl:with-param name="width" select="$width"/>
126 </xsl:apply-templates>
127 <xsl:if test="$entries">
128 <fo:list-block provisional-distance-between-starts="{$width}"
129 provisional-label-separation="{$glossterm.separation}"
130 xsl:use-attribute-sets="normal.para.spacing">
132 <xsl:when test="$glossary.sort != 0">
133 <xsl:apply-templates select="$entries" mode="glossary.as.list">
134 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
135 </xsl:apply-templates>
138 <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
147 <xsl:template match="book/glossary|part/glossary|/glossary" priority="2">
148 <xsl:variable name="id">
149 <xsl:call-template name="object.id"/>
152 <xsl:variable name="master-reference">
153 <xsl:call-template name="select.pagemaster"/>
156 <fo:page-sequence hyphenate="{$hyphenate}"
157 master-reference="{$master-reference}">
158 <xsl:attribute name="language">
159 <xsl:call-template name="l10n.language"/>
162 <xsl:attribute name="format">
163 <xsl:call-template name="page.number.format">
164 <xsl:with-param name="master-reference" select="$master-reference"/>
168 <xsl:attribute name="initial-page-number">
169 <xsl:call-template name="initial.page.number">
170 <xsl:with-param name="master-reference" select="$master-reference"/>
174 <xsl:attribute name="force-page-count">
175 <xsl:call-template name="force.page.count">
176 <xsl:with-param name="master-reference" select="$master-reference"/>
180 <xsl:attribute name="hyphenation-character">
181 <xsl:call-template name="gentext">
182 <xsl:with-param name="key" select="'hyphenation-character'"/>
185 <xsl:attribute name="hyphenation-push-character-count">
186 <xsl:call-template name="gentext">
187 <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
190 <xsl:attribute name="hyphenation-remain-character-count">
191 <xsl:call-template name="gentext">
192 <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
196 <xsl:apply-templates select="." mode="running.head.mode">
197 <xsl:with-param name="master-reference" select="$master-reference"/>
198 </xsl:apply-templates>
199 <xsl:apply-templates select="." mode="running.foot.mode">
200 <xsl:with-param name="master-reference" select="$master-reference"/>
201 </xsl:apply-templates>
203 <fo:flow flow-name="xsl-region-body">
204 <xsl:call-template name="set.flow.properties">
205 <xsl:with-param name="element" select="local-name(.)"/>
206 <xsl:with-param name="master-reference" select="$master-reference"/>
209 <xsl:call-template name="make-glossary"/>
214 <xsl:template match="glossary/glossaryinfo"></xsl:template>
215 <xsl:template match="glossary/info"></xsl:template>
216 <xsl:template match="glossary/title"></xsl:template>
217 <xsl:template match="glossary/subtitle"></xsl:template>
218 <xsl:template match="glossary/titleabbrev"></xsl:template>
220 <!-- ==================================================================== -->
222 <xsl:template match="glosslist">
223 &setup-language-variable;
225 <xsl:variable name="presentation">
226 <xsl:call-template name="pi.dbfo_glosslist-presentation"/>
229 <xsl:variable name="term-width">
230 <xsl:call-template name="pi.dbfo_glossterm-width"/>
233 <xsl:variable name="width">
235 <xsl:when test="$term-width = ''">
236 <xsl:value-of select="$glossterm.width"/>
239 <xsl:value-of select="$term-width"/>
244 <xsl:if test="title or info/title">
245 <xsl:apply-templates select="(title|info/title)[1]" mode="list.title.mode"/>
249 <xsl:when test="$presentation = 'list'">
250 <fo:list-block provisional-distance-between-starts="{$width}"
251 provisional-label-separation="{$glossterm.separation}"
252 xsl:use-attribute-sets="normal.para.spacing">
254 <xsl:when test="$glossary.sort != 0">
255 <xsl:apply-templates select="glossentry" mode="glossary.as.list">
256 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
257 </xsl:apply-templates>
260 <xsl:apply-templates select="glossentry" mode="glossary.as.list"/>
265 <xsl:when test="$presentation = 'blocks'">
267 <xsl:when test="$glossary.sort != 0">
268 <xsl:apply-templates select="glossentry" mode="glossary.as.blocks">
269 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
270 </xsl:apply-templates>
273 <xsl:apply-templates select="glossentry" mode="glossary.as.blocks"/>
277 <xsl:when test="$glosslist.as.blocks != 0">
279 <xsl:when test="$glossary.sort != 0">
280 <xsl:apply-templates select="glossentry" mode="glossary.as.blocks">
281 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
282 </xsl:apply-templates>
285 <xsl:apply-templates select="glossentry" mode="glossary.as.blocks"/>
290 <fo:list-block provisional-distance-between-starts="{$width}"
291 provisional-label-separation="{$glossterm.separation}"
292 xsl:use-attribute-sets="normal.para.spacing">
294 <xsl:when test="$glossary.sort != 0">
295 <xsl:apply-templates select="glossentry" mode="glossary.as.list">
296 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
297 </xsl:apply-templates>
300 <xsl:apply-templates select="glossentry" mode="glossary.as.list"/>
308 <!-- ==================================================================== -->
309 <!-- Glossary collection -->
311 <xsl:template match="glossary[@role='auto']" priority="2">
312 <xsl:variable name="collection" select="document($glossary.collection, .)"/>
313 <xsl:if test="$glossary.collection = ''">
315 <xsl:text>Warning: processing automatic glossary </xsl:text>
316 <xsl:text>without a glossary.collection file.</xsl:text>
320 <xsl:if test="not($collection) and $glossary.collection != ''">
322 <xsl:text>Warning: processing automatic glossary but unable to </xsl:text>
323 <xsl:text>open glossary.collection file '</xsl:text>
324 <xsl:value-of select="$glossary.collection"/>
325 <xsl:text>'</xsl:text>
329 <xsl:call-template name="make-auto-glossary"/>
332 <xsl:template name="make-auto-glossary">
333 <xsl:param name="collection" select="document($glossary.collection, .)"/>
334 <xsl:param name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/>
335 <xsl:param name="preamble" select="*[not(self::title
338 or self::glossentry)]"/>
340 &setup-language-variable;
342 <xsl:variable name="id">
343 <xsl:call-template name="object.id"/>
346 <xsl:variable name="presentation">
347 <xsl:call-template name="pi.dbfo_glossary-presentation"/>
350 <xsl:variable name="term-width">
351 <xsl:call-template name="pi.dbfo_glossterm-width"/>
354 <xsl:variable name="width">
356 <xsl:when test="$term-width = ''">
357 <xsl:value-of select="$glossterm.width"/>
360 <xsl:value-of select="$term-width"/>
365 <xsl:if test="$glossary.collection = ''">
367 <xsl:text>Warning: processing automatic glossary </xsl:text>
368 <xsl:text>without a glossary.collection file.</xsl:text>
372 <fo:block id="{$id}">
373 <xsl:call-template name="glossary.titlepage"/>
376 <xsl:if test="$preamble">
377 <xsl:apply-templates select="$preamble"/>
381 <xsl:when test="glossdiv and $collection//glossdiv">
382 <xsl:for-each select="$collection//glossdiv">
383 <!-- first see if there are any in this div -->
384 <xsl:variable name="exist.test">
385 <xsl:for-each select="glossentry">
386 <xsl:variable name="cterm" select="glossterm"/>
387 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
388 <xsl:value-of select="glossterm"/>
393 <xsl:if test="$exist.test != ''">
395 <xsl:when test="$presentation = 'list'">
396 <xsl:apply-templates select="." mode="auto-glossary-as-list">
397 <xsl:with-param name="width" select="$width"/>
398 <xsl:with-param name="terms" select="$terms"/>
399 </xsl:apply-templates>
401 <xsl:when test="$presentation = 'blocks'">
402 <xsl:apply-templates select="." mode="auto-glossary-as-blocks">
403 <xsl:with-param name="terms" select="$terms"/>
404 </xsl:apply-templates>
406 <xsl:when test="$glossary.as.blocks != 0">
407 <xsl:apply-templates select="." mode="auto-glossary-as-blocks">
408 <xsl:with-param name="terms" select="$terms"/>
409 </xsl:apply-templates>
412 <xsl:apply-templates select="." mode="auto-glossary-as-list">
413 <xsl:with-param name="width" select="$width"/>
414 <xsl:with-param name="terms" select="$terms"/>
415 </xsl:apply-templates>
423 <xsl:when test="$presentation = 'list'">
424 <fo:list-block provisional-distance-between-starts="{$width}"
425 provisional-label-separation="{$glossterm.separation}"
426 xsl:use-attribute-sets="normal.para.spacing">
428 <xsl:when test="$glossary.sort != 0">
429 <xsl:for-each select="$collection//glossentry">
430 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
431 <xsl:variable name="cterm" select="glossterm"/>
432 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
433 <xsl:apply-templates select="."
434 mode="auto-glossary-as-list"/>
439 <xsl:for-each select="$collection//glossentry">
440 <xsl:variable name="cterm" select="glossterm"/>
441 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
442 <xsl:apply-templates select="."
443 mode="auto-glossary-as-list"/>
450 <xsl:when test="$presentation = 'blocks' or
451 $glossary.as.blocks != 0">
453 <xsl:when test="$glossary.sort != 0">
454 <xsl:for-each select="$collection//glossentry">
455 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
456 <xsl:variable name="cterm" select="glossterm"/>
457 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
458 <xsl:apply-templates select="."
459 mode="auto-glossary-as-blocks"/>
464 <xsl:for-each select="$collection//glossentry">
465 <xsl:variable name="cterm" select="glossterm"/>
466 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
467 <xsl:apply-templates select="."
468 mode="auto-glossary-as-blocks"/>
475 <fo:list-block provisional-distance-between-starts="{$width}"
476 provisional-label-separation="{$glossterm.separation}"
477 xsl:use-attribute-sets="normal.para.spacing">
479 <xsl:when test="$glossary.sort != 0">
480 <xsl:for-each select="$collection//glossentry">
482 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
483 <xsl:variable name="cterm" select="glossterm"/>
484 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
485 <xsl:apply-templates select="."
486 mode="auto-glossary-as-list"/>
491 <xsl:for-each select="$collection//glossentry">
492 <xsl:variable name="cterm" select="glossterm"/>
493 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
494 <xsl:apply-templates select="."
495 mode="auto-glossary-as-list"/>
507 <xsl:template match="book/glossary[@role='auto']|
508 part/glossary[@role='auto']|
509 /glossary[@role='auto']" priority="2.5">
510 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
512 <xsl:variable name="master-reference">
513 <xsl:call-template name="select.pagemaster"/>
516 <xsl:if test="$glossary.collection = ''">
518 <xsl:text>Warning: processing automatic glossary </xsl:text>
519 <xsl:text>without a glossary.collection file.</xsl:text>
523 <fo:page-sequence hyphenate="{$hyphenate}"
524 master-reference="{$master-reference}">
525 <xsl:attribute name="language">
526 <xsl:call-template name="l10n.language"/>
528 <xsl:attribute name="format">
529 <xsl:call-template name="page.number.format">
530 <xsl:with-param name="master-reference" select="$master-reference"/>
534 <xsl:attribute name="initial-page-number">
535 <xsl:call-template name="initial.page.number">
536 <xsl:with-param name="master-reference" select="$master-reference"/>
540 <xsl:attribute name="force-page-count">
541 <xsl:call-template name="force.page.count">
542 <xsl:with-param name="master-reference" select="$master-reference"/>
546 <xsl:attribute name="hyphenation-character">
547 <xsl:call-template name="gentext">
548 <xsl:with-param name="key" select="'hyphenation-character'"/>
551 <xsl:attribute name="hyphenation-push-character-count">
552 <xsl:call-template name="gentext">
553 <xsl:with-param name="key" select="'hyphenation-push-character-count'"/>
556 <xsl:attribute name="hyphenation-remain-character-count">
557 <xsl:call-template name="gentext">
558 <xsl:with-param name="key" select="'hyphenation-remain-character-count'"/>
562 <xsl:apply-templates select="." mode="running.head.mode">
563 <xsl:with-param name="master-reference" select="$master-reference"/>
564 </xsl:apply-templates>
565 <xsl:apply-templates select="." mode="running.foot.mode">
566 <xsl:with-param name="master-reference" select="$master-reference"/>
567 </xsl:apply-templates>
569 <fo:flow flow-name="xsl-region-body">
570 <xsl:call-template name="set.flow.properties">
571 <xsl:with-param name="element" select="local-name(.)"/>
572 <xsl:with-param name="master-reference" select="$master-reference"/>
575 <xsl:call-template name="make-auto-glossary"/>
580 <xsl:template match="glossdiv" mode="auto-glossary-as-list">
581 <xsl:param name="width" select="$glossterm.width"/>
582 <xsl:param name="terms" select="."/>
584 &setup-language-variable;
586 <xsl:variable name="id">
587 <xsl:call-template name="object.id"/>
590 <xsl:variable name="preamble"
591 select="*[not(self::title
593 or self::glossentry)]"/>
595 <fo:block id="{$id}">
596 <xsl:call-template name="glossdiv.titlepage"/>
599 <xsl:apply-templates select="$preamble"/>
601 <fo:list-block provisional-distance-between-starts="{$width}"
602 provisional-label-separation="{$glossterm.separation}"
603 xsl:use-attribute-sets="normal.para.spacing">
605 <xsl:when test="$glossary.sort != 0">
606 <xsl:for-each select="glossentry">
607 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
608 <xsl:variable name="cterm" select="glossterm"/>
609 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
610 <xsl:apply-templates select="." mode="auto-glossary-as-list"/>
615 <xsl:for-each select="glossentry">
616 <xsl:variable name="cterm" select="glossterm"/>
617 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
618 <xsl:apply-templates select="." mode="auto-glossary-as-list"/>
626 <xsl:template match="glossentry" mode="auto-glossary-as-list">
627 <xsl:apply-templates select="." mode="glossary.as.list"/>
630 <xsl:template match="glossdiv" mode="auto-glossary-as-blocks">
631 <xsl:param name="terms" select="."/>
633 &setup-language-variable;
635 <xsl:variable name="id">
636 <xsl:call-template name="object.id"/>
639 <xsl:variable name="preamble"
640 select="*[not(self::title
642 or self::glossentry)]"/>
644 <fo:block id="{$id}">
645 <xsl:call-template name="glossdiv.titlepage"/>
648 <xsl:apply-templates select="$preamble"/>
651 <xsl:when test="$glossary.sort != 0">
652 <xsl:for-each select="glossentry">
653 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
654 <xsl:variable name="cterm" select="glossterm"/>
655 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
656 <xsl:apply-templates select="." mode="auto-glossary-as-blocks"/>
661 <xsl:for-each select="glossentry">
662 <xsl:variable name="cterm" select="glossterm"/>
663 <xsl:if test="$terms[@baseform = $cterm or . = $cterm]">
664 <xsl:apply-templates select="." mode="auto-glossary-as-blocks"/>
672 <xsl:template match="glossentry" mode="auto-glossary-as-blocks">
673 <xsl:apply-templates select="." mode="glossary.as.blocks"/>
676 <!-- ==================================================================== -->
677 <!-- Format glossary as a list -->
679 <xsl:template match="glossdiv" mode="glossary.as.list">
680 <xsl:param name="width" select="$glossterm.width"/>
682 &setup-language-variable;
684 <xsl:variable name="id">
685 <xsl:call-template name="object.id"/>
688 <xsl:variable name="entries" select="glossentry"/>
690 <xsl:variable name="preamble"
691 select="*[not(self::title
693 or self::glossentry)]"/>
695 <fo:block id="{$id}">
696 <xsl:call-template name="glossdiv.titlepage"/>
699 <xsl:apply-templates select="$preamble"/>
701 <fo:list-block provisional-distance-between-starts="{$width}"
702 provisional-label-separation="{$glossterm.separation}"
703 xsl:use-attribute-sets="normal.para.spacing">
705 <xsl:when test="$glossary.sort != 0">
706 <xsl:apply-templates select="$entries" mode="glossary.as.list">
707 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
708 </xsl:apply-templates>
711 <xsl:apply-templates select="$entries" mode="glossary.as.list"/>
719 GlossTerm, Acronym?, Abbrev?,
722 (GlossSee | GlossDef+)
725 <xsl:template match="glossentry" mode="glossary.as.list">
726 <xsl:variable name="id">
727 <xsl:call-template name="object.id"/>
730 <fo:list-item xsl:use-attribute-sets="glossentry.list.item.properties">
731 <xsl:call-template name="anchor">
732 <xsl:with-param name="conditional">
734 <xsl:when test="$glossterm.auto.link != 0
735 or $glossary.collection != ''">0</xsl:when>
736 <xsl:otherwise>1</xsl:otherwise>
741 <fo:list-item-label end-indent="label-end()">
742 <fo:block xsl:use-attribute-sets="glossterm.list.properties">
744 <xsl:when test="$glossentry.show.acronym = 'primary'">
746 <xsl:when test="acronym|abbrev">
747 <xsl:apply-templates select="acronym|abbrev"
748 mode="glossary.as.list"/>
749 <xsl:text> (</xsl:text>
750 <xsl:apply-templates select="glossterm"
751 mode="glossary.as.list"/>
752 <xsl:text>)</xsl:text>
755 <xsl:apply-templates select="glossterm"
756 mode="glossary.as.list"/>
761 <xsl:when test="$glossentry.show.acronym = 'yes'">
762 <xsl:apply-templates select="glossterm" mode="glossary.as.list"/>
764 <xsl:if test="acronym|abbrev">
765 <xsl:text> (</xsl:text>
766 <xsl:apply-templates select="acronym|abbrev"
767 mode="glossary.as.list"/>
768 <xsl:text>)</xsl:text>
773 <xsl:apply-templates select="glossterm" mode="glossary.as.list"/>
776 <xsl:apply-templates select="indexterm"/>
778 </fo:list-item-label>
780 <fo:list-item-body start-indent="body-start()">
781 <fo:block xsl:use-attribute-sets="glossdef.list.properties">
782 <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.list"/>
788 <xsl:template match="glossentry/glossterm" mode="glossary.as.list">
789 <xsl:variable name="id">
790 <xsl:call-template name="object.id"/>
792 <fo:inline id="{$id}">
793 <xsl:apply-templates/>
795 <xsl:if test="following-sibling::glossterm">, </xsl:if>
798 <xsl:template match="glossentry/acronym" mode="glossary.as.list">
799 <xsl:apply-templates/>
800 <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
803 <xsl:template match="glossentry/abbrev" mode="glossary.as.list">
804 <xsl:apply-templates/>
805 <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
808 <xsl:template match="glossentry/revhistory" mode="glossary.as.list">
811 <xsl:template match="glossentry/glosssee" mode="glossary.as.list">
812 <xsl:variable name="otherterm" select="@otherterm"/>
813 <xsl:variable name="targets" select="key('id', $otherterm)"/>
814 <xsl:variable name="target" select="$targets[1]"/>
815 <xsl:variable name="xlink" select="@xlink:href"/>
818 <xsl:variable name="template">
819 <xsl:call-template name="gentext.template">
820 <xsl:with-param name="context" select="'glossary'"/>
821 <xsl:with-param name="name" select="'see'"/>
824 <xsl:variable name="title">
826 <xsl:when test="$target">
827 <fo:basic-link internal-destination="{$otherterm}"
828 xsl:use-attribute-sets="xref.properties">
829 <xsl:apply-templates select="$target" mode="xref-to"/>
832 <xsl:when test="$xlink">
833 <xsl:call-template name="simple.xlink">
834 <xsl:with-param name="content">
835 <xsl:apply-templates/>
839 <xsl:when test="$otherterm != '' and not($target)">
841 <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
842 <xsl:value-of select="$otherterm"/>
844 <xsl:apply-templates mode="glossary.as.list"/>
847 <xsl:apply-templates mode="glossary.as.list"/>
851 <xsl:call-template name="substitute-markup">
852 <xsl:with-param name="template" select="$template"/>
853 <xsl:with-param name="title" select="$title"/>
858 <xsl:template match="glossentry/glossdef" mode="glossary.as.list">
859 <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/>
860 <xsl:if test="glossseealso">
862 <xsl:variable name="template">
863 <xsl:call-template name="gentext.template">
864 <xsl:with-param name="context" select="'glossary'"/>
865 <xsl:with-param name="name" select="'seealso'"/>
868 <xsl:variable name="title">
869 <xsl:apply-templates select="glossseealso" mode="glossary.as.list"/>
871 <xsl:call-template name="substitute-markup">
872 <xsl:with-param name="template" select="$template"/>
873 <xsl:with-param name="title" select="$title"/>
879 <xsl:template match="glossentry/glossdef/para[1]|glossentry/glossdef/simpara[1]"
880 mode="glossary.as.list">
882 <xsl:apply-templates/>
886 <xsl:template match="glossseealso" mode="glossary.as.list">
887 <xsl:variable name="otherterm" select="@otherterm"/>
888 <xsl:variable name="targets" select="key('id', $otherterm)"/>
889 <xsl:variable name="target" select="$targets[1]"/>
890 <xsl:variable name="xlink" select="@xlink:href"/>
893 <xsl:when test="$target">
894 <fo:basic-link internal-destination="{$otherterm}"
895 xsl:use-attribute-sets="xref.properties">
896 <xsl:apply-templates select="$target" mode="xref-to"/>
899 <xsl:when test="$xlink">
900 <xsl:call-template name="simple.xlink">
901 <xsl:with-param name="content">
902 <xsl:apply-templates/>
906 <xsl:when test="$otherterm != '' and not($target)">
908 <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
909 <xsl:value-of select="$otherterm"/>
911 <xsl:apply-templates mode="glossary.as.list"/>
914 <xsl:apply-templates mode="glossary.as.list"/>
919 <xsl:when test="position() = last()"/>
921 <xsl:call-template name="gentext.template">
922 <xsl:with-param name="context" select="'glossary'"/>
923 <xsl:with-param name="name" select="'seealso-separator'"/>
929 <!-- ==================================================================== -->
930 <!-- Format glossary blocks -->
932 <xsl:template match="glossdiv" mode="glossary.as.blocks">
933 &setup-language-variable;
935 <xsl:variable name="id">
936 <xsl:call-template name="object.id"/>
939 <xsl:variable name="entries" select="glossentry"/>
940 <xsl:variable name="preamble"
941 select="*[not(self::title
943 or self::glossentry)]"/>
945 <fo:block id="{$id}">
946 <xsl:call-template name="glossdiv.titlepage"/>
949 <xsl:apply-templates select="$preamble"/>
952 <xsl:when test="$glossary.sort != 0">
953 <xsl:apply-templates select="$entries" mode="glossary.as.blocks">
954 <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), &lowercase;, &uppercase;))"/>
955 </xsl:apply-templates>
958 <xsl:apply-templates select="$entries" mode="glossary.as.blocks"/>
965 GlossTerm, Acronym?, Abbrev?,
968 (GlossSee | GlossDef+)
971 <xsl:template match="glossentry" mode="glossary.as.blocks">
972 <xsl:variable name="id">
973 <xsl:call-template name="object.id"/>
976 <fo:block xsl:use-attribute-sets="glossterm.block.properties">
977 <xsl:call-template name="anchor">
978 <xsl:with-param name="conditional">
980 <xsl:when test="$glossterm.auto.link != 0
981 or $glossary.collection != ''">0</xsl:when>
982 <xsl:otherwise>1</xsl:otherwise>
988 <xsl:when test="$glossentry.show.acronym = 'primary'">
990 <xsl:when test="acronym|abbrev">
991 <xsl:apply-templates select="acronym|abbrev" mode="glossary.as.blocks"/>
992 <xsl:text> (</xsl:text>
993 <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
994 <xsl:text>)</xsl:text>
997 <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
1002 <xsl:when test="$glossentry.show.acronym = 'yes'">
1003 <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
1005 <xsl:if test="acronym|abbrev">
1006 <xsl:text> (</xsl:text>
1007 <xsl:apply-templates select="acronym|abbrev" mode="glossary.as.blocks"/>
1008 <xsl:text>)</xsl:text>
1013 <xsl:apply-templates select="glossterm" mode="glossary.as.blocks"/>
1017 <xsl:apply-templates select="indexterm"/>
1020 <fo:block xsl:use-attribute-sets="glossdef.block.properties">
1021 <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.blocks"/>
1025 <xsl:template match="glossentry/glossterm" mode="glossary.as.blocks">
1026 <xsl:variable name="id">
1027 <xsl:call-template name="object.id"/>
1029 <fo:inline id="{$id}">
1030 <xsl:apply-templates/>
1032 <xsl:if test="following-sibling::glossterm">, </xsl:if>
1035 <xsl:template match="glossentry/acronym" mode="glossary.as.blocks">
1036 <xsl:apply-templates/>
1037 <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
1040 <xsl:template match="glossentry/abbrev" mode="glossary.as.blocks">
1041 <xsl:apply-templates/>
1042 <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if>
1045 <xsl:template match="glossentry/glosssee" mode="glossary.as.blocks">
1046 <xsl:variable name="otherterm" select="@otherterm"/>
1047 <xsl:variable name="targets" select="key('id', $otherterm)"/>
1048 <xsl:variable name="target" select="$targets[1]"/>
1049 <xsl:variable name="xlink" select="@xlink:href"/>
1051 <xsl:variable name="template">
1052 <xsl:call-template name="gentext.template">
1053 <xsl:with-param name="context" select="'glossary'"/>
1054 <xsl:with-param name="name" select="'see'"/>
1055 </xsl:call-template>
1057 <xsl:variable name="title">
1059 <xsl:when test="$target">
1060 <fo:basic-link internal-destination="{$otherterm}"
1061 xsl:use-attribute-sets="xref.properties">
1062 <xsl:apply-templates select="$target" mode="xref-to"/>
1065 <xsl:when test="$xlink">
1066 <xsl:call-template name="simple.xlink">
1067 <xsl:with-param name="content">
1068 <xsl:apply-templates/>
1070 </xsl:call-template>
1072 <xsl:when test="$otherterm != '' and not($target)">
1074 <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text>
1075 <xsl:value-of select="$otherterm"/>
1077 <xsl:apply-templates mode="glossary.as.blocks"/>
1080 <xsl:apply-templates mode="glossary.as.blocks"/>
1084 <xsl:call-template name="substitute-markup">
1085 <xsl:with-param name="template" select="$template"/>
1086 <xsl:with-param name="title" select="$title"/>
1087 </xsl:call-template>
1090 <xsl:template match="glossentry/glossdef" mode="glossary.as.blocks">
1091 <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"
1092 mode="glossary.as.blocks"/>
1093 <xsl:if test="glossseealso">
1095 <xsl:variable name="template">
1096 <xsl:call-template name="gentext.template">
1097 <xsl:with-param name="context" select="'glossary'"/>
1098 <xsl:with-param name="name" select="'seealso'"/>
1099 </xsl:call-template>
1101 <xsl:variable name="title">
1102 <xsl:apply-templates select="glossseealso" mode="glossary.as.blocks"/>
1104 <xsl:call-template name="substitute-markup">
1105 <xsl:with-param name="template" select="$template"/>
1106 <xsl:with-param name="title" select="$title"/>
1107 </xsl:call-template>
1112 <xsl:template match="glossentry/glossdef/para[1]|glossentry/glossdef/simpara[1]"
1113 mode="glossary.as.blocks">
1115 <xsl:apply-templates/>
1119 <!-- Handle any other glossdef content normally -->
1120 <xsl:template match="*" mode="glossary.as.blocks">
1121 <xsl:apply-templates select="." />
1124 <xsl:template match="glossseealso" mode="glossary.as.blocks">
1125 <xsl:variable name="otherterm" select="@otherterm"/>
1126 <xsl:variable name="targets" select="key('id', $otherterm)"/>
1127 <xsl:variable name="target" select="$targets[1]"/>
1128 <xsl:variable name="xlink" select="@xlink:href"/>
1131 <xsl:when test="$target">
1132 <fo:basic-link internal-destination="{$otherterm}"
1133 xsl:use-attribute-sets="xref.properties">
1134 <xsl:apply-templates select="$target" mode="xref-to"/>
1137 <xsl:when test="$xlink">
1138 <xsl:call-template name="simple.xlink">
1139 <xsl:with-param name="content">
1140 <xsl:apply-templates/>
1142 </xsl:call-template>
1144 <xsl:when test="$otherterm != '' and not($target)">
1146 <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text>
1147 <xsl:value-of select="$otherterm"/>
1149 <xsl:apply-templates mode="glossary.as.blocks"/>
1152 <xsl:apply-templates mode="glossary.as.blocks"/>
1157 <xsl:when test="position() = last()"/>
1159 <xsl:call-template name="gentext.template">
1160 <xsl:with-param name="context" select="'glossary'"/>
1161 <xsl:with-param name="name" select="'seealso-separator'"/>
1162 </xsl:call-template>
1167 <!-- ==================================================================== -->