2 <!DOCTYPE xsl:stylesheet [
<!ENTITY % xsldoc.ent SYSTEM
"./xsldoc.ent"> %xsldoc.ent; ]
>
3 <!--#############################################################################
4 | $Id: refentry.mod.xsl,v 1.7 2004/01/14 14:54:32 j-devenish Exp $
5 |- #############################################################################
6 | $Author: j-devenish $
7 + ############################################################################## -->
10 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
11 xmlns:
doc=
"http://nwalsh.com/xsl/documentation/1.0"
12 exclude-result-prefixes=
"doc" version='
1.0'
>
14 <doc:reference id=
"refentry" xmlns=
"">
16 <releaseinfo role=
"meta">
17 $Id: refentry.mod.xsl,v
1.7 2004/
01/
14 14:
54:
32 j-devenish Exp $
24 <year>2000</year><year>2001</year><year>2002</year><year>2003</year>
25 <holder>Ramon Casellas
</holder>
28 <doc:revision rcasver=
"1.5">&rev_2003_05;</doc:revision>
31 <title>References and Entries
<filename>refentry.mod.xsl
</filename></title>
33 <para>The file
<filename>refentry.mod.xsl
</filename> contains
34 XSL templates for
<doc:db basename=
"reference">references
</doc:db>.
</para>
38 <doc:template xmlns=
"">
39 <refpurpose>Process
<doc:db>reference
</doc:db> elements
</refpurpose>
42 Invokes the mapping templates and applies content templates.
50 <listitem><simpara>&mapping;</simpara></listitem>
51 <listitem><simpara><xref linkend=
"template.content-templates"/></simpara></listitem>
55 <xsl:template match=
"reference">
56 <xsl:call-template name=
"map.begin"/>
57 <xsl:call-template name=
"content-templates"/>
58 <xsl:call-template name=
"map.end"/>
61 <doc:template xmlns=
"">
62 <refpurpose>Process
<doc:db>refentry
</doc:db> elements
</refpurpose>
65 Invokes the mapping templates and applies content templates.
73 <listitem><simpara>&mapping;</simpara></listitem>
74 <listitem><simpara><xref linkend=
"template.content-templates"/></simpara></listitem>
78 <xsl:template match=
"refentry">
79 <xsl:variable name=
"refmeta" select=
".//refmeta"/>
80 <xsl:variable name=
"refentrytitle" select=
"$refmeta//refentrytitle"/>
81 <xsl:variable name=
"refnamediv" select=
".//refnamediv"/>
82 <xsl:variable name=
"refname" select=
"$refnamediv//refname"/>
83 <xsl:variable name=
"title">
85 <xsl:when test=
"$refentrytitle">
86 <xsl:apply-templates select=
"$refentrytitle[1]"/>
88 <xsl:when test=
"$refname">
89 <xsl:apply-templates select=
"$refname[1]"/>
90 <xsl:apply-templates select=
"$refnamediv//refpurpose"/>
94 <xsl:call-template name=
"map.begin">
95 <xsl:with-param name=
"string" select=
"$title"/>
97 <xsl:call-template name=
"content-templates"/>
98 <xsl:call-template name=
"map.end">
99 <xsl:with-param name=
"string" select=
"$title"/>
103 <doc:template xmlns=
"">
104 <refpurpose>Process
<doc:db>refentry
</doc:db> elements
</refpurpose>
107 Suppresses
<doc:db basename=
"refentry">refentries
</doc:db>.
114 <xsl:template match=
"refmeta"/>
116 <doc:template xmlns=
"">
117 <refpurpose>Process
<doc:db>refentrytitle
</doc:db> elements
</refpurpose>
120 Format a reference entry title.
128 This template uses
<literal>inline.charseq
</literal>,
129 though I'm not sure if this should be changed to
130 a single
<literal>apply-templates
</literal>.
135 <listitem><simpara><xref linkend=
"template.inline.charseq"/></simpara></listitem>
139 <xsl:template match=
"refentrytitle">
140 <xsl:call-template name=
"inline.charseq"/>
144 <xsl:template match="refnamediv">
145 <xsl:call-template name="block.object"/>
149 <doc:template xmlns=
"">
150 <refpurpose>Process
<doc:db>manvolnum
</doc:db> elements
</refpurpose>
153 Format a reference volume number.
158 <listitem><simpara><xref linkend=
"param.refentry.xref.manvolnum"/></simpara></listitem>
163 If
<xref linkend=
"param.refentry.xref.manvolnum"/> is set,
164 this template will apply templates. Otherwise, no output
169 <xsl:template match=
"manvolnum">
170 <xsl:if test=
"$refentry.xref.manvolnum != 0">
171 <xsl:text>(
</xsl:text>
172 <xsl:apply-templates/>
173 <xsl:text>)
</xsl:text>
177 <doc:template xmlns=
"">
178 <refpurpose>Process
<doc:db>refnamediv
</doc:db> elements
</refpurpose>
181 Format a reference header.
189 Calls
<xref linkend=
"template.block.object"/>.
194 <listitem><simpara><xref linkend=
"template.block.object"/></simpara></listitem>
198 <xsl:template match=
"refnamediv">
199 <xsl:call-template name=
"block.object"/>
202 <doc:template xmlns=
"">
203 <refpurpose>Process
<doc:db>refname
</doc:db> elements
</refpurpose>
206 Formats a
<doc:db>refname
</doc:db> as a start-of-section
207 for a
<doc:db>refentry
</doc:db>.
212 <listitem><simpara><xref linkend=
"param.refentry.generate.name"/></simpara></listitem>
216 <para>Will commence a
&LaTeX; <function
217 condition=
"latex">section
</function> if necessary.
</para>
218 <para>Designed to accommodate multiple
<doc:db>refname
</doc:db>s in
219 a single
<doc:db>refentry
</doc:db>.
</para>
220 <para>The use of a comma between multiple
<doc:db>refname
</doc:db>s
221 should probably be localised.
</para>
225 <listitem><simpara>&mapping;</simpara></listitem>
229 <xsl:template match=
"refname">
230 <xsl:if test=
"not (preceding-sibling::refname)">
231 <xsl:text> \section*{
</xsl:text>
232 <xsl:if test=
"$refentry.generate.name != 0">
233 <xsl:call-template name=
"gentext.element.name"/>
235 <xsl:text>}
</xsl:text>
237 <xsl:apply-templates/>
238 <xsl:if test=
"following-sibling::refname">
239 <xsl:text>,
</xsl:text>
243 <doc:template xmlns=
"">
244 <refpurpose>Process
<doc:db>refpurpose
</doc:db> elements
</refpurpose>
247 Formats a
<doc:db>refpurpose
</doc:db>.
254 <para>Outputs an em dash and then applies templates.
</para>
257 <xsl:template match=
"refpurpose">
258 <xsl:text> ---
</xsl:text>
259 <xsl:apply-templates/>
262 <doc:template xmlns=
"">
263 <refpurpose>Process
<doc:db>refdescriptor
</doc:db> elements
</refpurpose>
266 Formats a
<doc:db>refdescriptor
</doc:db>.
273 <para>Suppressed.
</para>
276 <xsl:template match=
"refdescriptor">
277 <!-- todo: finish this -->
280 <doc:template xmlns=
"">
281 <refpurpose>Process
<doc:db>refclass
</doc:db> elements
</refpurpose>
284 Formats a
<doc:db>refclass
</doc:db>.
291 <para>Applies templates. If the role attribute is not empty,
292 it will be output prior to content, separated by a colon.
</para>
295 <xsl:template match=
"refclass">
296 <xsl:if test=
"@role!=''">
297 <xsl:value-of select=
"@role"/>
298 <xsl:text>:
</xsl:text>
300 <xsl:apply-templates/>
303 <doc:template xmlns=
"">
304 <refpurpose>Process
<doc:db>refsynopsisdiv
</doc:db> elements
</refpurpose>
307 Formats a
<doc:db>refsynopsisdiv
</doc:db> as an unnumbered subsection.
314 <xsl:template match=
"refsynopsisdiv">
315 <xsl:call-template name=
"label.id"/>
316 <xsl:text> \subsection*{Synopsis}
</xsl:text>
317 <xsl:call-template name=
"content-templates"/>
320 <doc:template xmlns=
"">
321 <refpurpose>Process
<sgmltag>refsect
</sgmltag> elements
</refpurpose>
324 Invokes the mapping templates and applies content templates.
332 <listitem><simpara>&mapping;</simpara></listitem>
333 <listitem><simpara><xref linkend=
"template.content-templates"/></simpara></listitem>
337 <xsl:template match=
"refsect1|refsect2|refsect3">
338 <xsl:call-template name=
"map.begin"/>
339 <xsl:call-template name=
"content-templates"/>
340 <xsl:call-template name=
"map.end"/>