2 <!--#############################################################################
3 |- #############################################################################
6 + ############################################################################## -->
9 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
11 exclude-result-prefixes="doc" version='1.0'>
15 <!--############################################################################# -->
16 <!-- DOCUMENTATION -->
17 <doc:reference id="glossary" xmlns="">
19 <releaseinfo role="meta">
22 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
23 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
26 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
27 <holder>Ramon Casellas</holder>
30 <title>Glossary <filename>glossary.mod.xsl</filename></title>
32 <section><title>Introduction</title>
33 <para>This reference applies to the glossary element name. Altough LaTeX
34 provides some glossary support, the better glossary management support
35 motivates the bypass of the LaTeX <literal>\makeglossary</literal>
40 <!--############################################################################# -->
43 <!--############################################################################# -->
44 <!-- DOCUMENTATION -->
45 <doc:template match="glossary" xmlns="">
46 <refpurpose> Glossary XSL template / entry point </refpurpose>
47 <refdescription><para>The <sgmltag>glossary</sgmltag> element is the entry point
48 to a docbook glossary. The DB2LaTeX processing of the element is quite straight-
49 forward. First thing is to check whether the document is a book or article. In
50 both cases two new LaTeX commands are defined. <literal>\dbglossary</literal>
51 and <literal>\dbglossdiv</literal>. In the former case, they are mapped to
52 <literal>\chapter*</literal> and <literal>\section*</literal>. In the second
53 case to <literal>\section*</literal> and <literal>\subsection*</literal>.</para>
56 <listitem><para>Call template map.begin.</para></listitem>
57 <listitem><para>Apply Templates for Preamble, GlossDivs and GlossEntries (serial).</para></listitem>
58 <listitem><para>Call template map.end.</para></listitem>
60 <formalpara><title>Remarks and Bugs</title>
62 <listitem><para>Template for glossary/glossaryinfo is EMPTY.</para></listitem>
63 <listitem><para>Template for glossary/title | glossary/subtitle is EMPTY.</para></listitem>
64 <listitem><para>Template for glossary/titleabbrev is EMPTY.</para></listitem>
68 <!--############################################################################# -->
70 <xsl:template match="glossary">
71 <xsl:variable name="divs" select="glossdiv"/>
72 <xsl:variable name="entries" select="glossentry"/>
73 <xsl:variable name="preamble" select="*[not(self::title or self::subtitle or self::glossdiv or self::glossentry)]"/>
75 <xsl:when test="local-name(..)='book' or local-name(..)='part'">
76 <xsl:text>\newcommand{\dbglossary}[1]{\chapter*{#1}}% </xsl:text>
77 <xsl:text>\newcommand{\dbglossdiv}[1]{\section*{#1}}% </xsl:text>
80 <xsl:text>\newcommand{\dbglossary}[1]{\section*{#1}}% </xsl:text>
81 <xsl:text>\newcommand{\dbglossdiv}[1]{\subsection*{#1}}% </xsl:text>
84 <xsl:call-template name="map.begin"/>
85 <xsl:if test="./subtitle"><xsl:apply-templates select="./subtitle" mode="component.title.mode"/> </xsl:if>
86 <xsl:if test="$preamble"> <xsl:apply-templates select="$preamble"/> </xsl:if>
87 <xsl:if test="$divs"> <xsl:apply-templates select="$divs"/> </xsl:if>
88 <xsl:if test="$entries"> <xsl:apply-templates select="$entries"/></xsl:if>
89 <xsl:call-template name="map.end"/>
92 <xsl:template match="glossary/glossaryinfo"/>
93 <xsl:template match="glossary/title"/>
94 <xsl:template match="glossary/subtitle"/>
95 <xsl:template match="glossary/titleabbrev"/>
96 <xsl:template match="glossary/title" mode="component.title.mode"> <xsl:apply-templates/> </xsl:template>
97 <xsl:template match="glossary/subtitle" mode="component.title.mode"> <xsl:apply-templates/> </xsl:template>
102 <!--############################################################################# -->
103 <!-- DOCUMENTATION -->
104 <doc:template match="glossdiv|glosslist" xmlns="">
105 <refpurpose> Glossary Division and Glossary Lists XSL templates. </refpurpose>
106 <refdescription><para>T.B.D</para>
109 <listitem><para>Call template map.begin.</para></listitem>
110 <listitem><para>Apply Templates.</para></listitem>
111 <listitem><para>Call template map.end.</para></listitem>
113 <formalpara><title>Remarks and Bugs</title>
115 <listitem><para>Template for glossdiv/glossaryinfo is EMPTY.</para></listitem>
119 <!--############################################################################# -->
120 <xsl:template match="glossdiv|glosslist">
121 <xsl:call-template name="map.begin"/>
122 <xsl:apply-templates/>
123 <xsl:call-template name="map.end"/>
126 <xsl:template match="glossdiv/title" />
131 <!--############################################################################# -->
132 <!-- DOCUMENTATION -->
133 <doc:template match="glossentry" xmlns="">
134 <refpurpose> Glossary Entry XSL template / entry point </refpurpose>
139 <listitem><para>Apply Templates.</para></listitem>
141 <formalpara><title>Remarks and Bugs</title>
143 <listitem><para>Explicit Templates for <literal>glossentry/glossterm</literal></para></listitem>
144 <listitem><para>Explicit Templates for <literal>glossentry/acronym</literal></para></listitem>
145 <listitem><para>Explicit Templates for <literal>glossentry/abbrev</literal></para></listitem>
146 <listitem><para>Explicit Templates for <literal>glossentry/glossdef</literal></para></listitem>
147 <listitem><para>Explicit Templates for <literal>glossentry/glosssee</literal></para></listitem>
148 <listitem><para>Explicit Templates for <literal>glossentry/glossseealso</literal></para></listitem>
149 <listitem><para>Template for glossentry/revhistory is EMPTY.</para></listitem>
153 <!--############################################################################# -->
156 <xsl:template match="glossentry">
157 <xsl:apply-templates/>
158 <xsl:text> </xsl:text>
161 <xsl:template match="glossentry/glossterm">
162 <xsl:text>\item[</xsl:text>
163 <xsl:if test="../@id!=''">
164 <xsl:text>\hypertarget{</xsl:text>
165 <xsl:value-of select="../@id"/>
166 <xsl:text>}</xsl:text>
168 <xsl:text>{</xsl:text>
169 <xsl:call-template name="normalize-scape">
170 <xsl:with-param name="string" select="."/>
172 <xsl:text>}] </xsl:text>
175 <xsl:template match="glossentry/acronym">
176 <xsl:text> ( \texttt {</xsl:text> <xsl:apply-templates/> <xsl:text>} ) </xsl:text>
179 <xsl:template match="glossentry/abbrev">
180 <xsl:text> [ </xsl:text> <xsl:apply-templates/> <xsl:text> ] </xsl:text>
183 <xsl:template match="glossentry/revhistory"/>
185 <xsl:template match="glossentry/glossdef">
186 <xsl:text> </xsl:text>
187 <xsl:apply-templates/>
190 <xsl:template match="glossseealso|glossentry/glosssee">
191 <xsl:variable name="otherterm" select="@otherterm"/>
192 <xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
193 <xsl:variable name="target" select="$targets[1]"/>
194 <xsl:call-template name="gentext.element.name"/>
195 <xsl:call-template name="gentext.space"/>
196 <xsl:call-template name="gentext.startquote"/>
198 <xsl:when test="@otherterm">
199 <xsl:text>\hyperlink{</xsl:text><xsl:value-of select="@otherterm"/>
200 <xsl:text>}{</xsl:text><xsl:apply-templates select="$target" mode="xref"/><xsl:text>}</xsl:text>
203 <xsl:apply-templates/>
206 <xsl:call-template name="gentext.endquote"/>
207 <xsl:text>. </xsl:text>
210 <xsl:template match="glossentry" mode="xref">
211 <xsl:apply-templates select="./glossterm" mode="xref"/>
214 <xsl:template match="glossterm" mode="xref">
215 <xsl:apply-templates/>