1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
7 $Id: refentry.xsl 9962 2015-04-30 17:35:04Z bobstayton $
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <xsl:template match="reference">
19 <xsl:call-template name="id.warning"/>
22 <xsl:call-template name="common.html.attributes">
23 <xsl:with-param name="inherit" select="1"/>
25 <xsl:call-template name="id.attribute">
26 <xsl:with-param name="conditional" select="0"/>
29 <xsl:call-template name="reference.titlepage"/>
31 <xsl:variable name="toc.params">
32 <xsl:call-template name="find.path.params">
33 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
37 <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
38 <xsl:call-template name="division.toc"/>
40 <xsl:apply-templates/>
44 <xsl:template match="reference" mode="division.number">
45 <xsl:number from="book" count="reference" format="I."/>
48 <xsl:template match="reference/docinfo"/>
49 <xsl:template match="reference/referenceinfo"/>
50 <xsl:template match="reference/title"/>
51 <xsl:template match="reference/subtitle"/>
52 <xsl:template match="reference/titleabbrev"/>
54 <!-- ==================================================================== -->
56 <xsl:template name="refentry.title">
57 <xsl:param name="node" select="."/>
58 <xsl:variable name="refmeta" select="$node//refmeta"/>
59 <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
60 <xsl:variable name="refnamediv" select="$node//refnamediv"/>
61 <xsl:variable name="refname" select="$refnamediv//refname"/>
62 <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
63 <xsl:variable name="title">
65 <xsl:when test="$refentrytitle">
66 <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
68 <xsl:when test="$refdesc">
69 <xsl:apply-templates select="$refdesc[1]" mode="title"/>
71 <xsl:when test="$refname">
72 <xsl:apply-templates select="$refname[1]" mode="title"/>
79 <xsl:copy-of select="$title"/>
83 <xsl:template match="refentry">
84 <xsl:call-template name="id.warning"/>
87 <xsl:call-template name="common.html.attributes">
88 <xsl:with-param name="inherit" select="1"/>
90 <xsl:call-template name="id.attribute">
91 <xsl:with-param name="conditional" select="0"/>
93 <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
94 <div class="refentry.separator">
98 <xsl:call-template name="anchor">
99 <xsl:with-param name="conditional" select="0"/>
101 <xsl:call-template name="refentry.titlepage"/>
102 <xsl:apply-templates/>
103 <xsl:call-template name="process.footnotes"/>
107 <xsl:template match="refentry/docinfo|refentry/refentryinfo"/>
108 <xsl:template match="refentry/info"/>
110 <xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
111 <xsl:apply-templates/>
114 <xsl:template match="refmeta">
117 <xsl:template match="manvolnum">
118 <xsl:if test="$refentry.xref.manvolnum != 0">
119 <xsl:text>(</xsl:text>
120 <xsl:apply-templates/>
121 <xsl:text>)</xsl:text>
125 <xsl:template match="refmiscinfo">
128 <xsl:template match="refentrytitle">
129 <xsl:call-template name="inline.charseq"/>
132 <xsl:template match="refnamediv">
134 <xsl:call-template name="common.html.attributes">
135 <xsl:with-param name="inherit" select="1"/>
137 <xsl:call-template name="id.attribute"/>
138 <xsl:call-template name="anchor"/>
141 <xsl:when test="preceding-sibling::refnamediv">
142 <!-- no title on secondary refnamedivs! -->
144 <xsl:when test="$refentry.generate.name != 0">
146 <xsl:call-template name="gentext">
147 <xsl:with-param name="key" select="'RefName'"/>
151 <xsl:when test="$refentry.generate.title != 0">
154 <xsl:when test="../refmeta/refentrytitle">
155 <xsl:apply-templates select="../refmeta/refentrytitle"/>
158 <xsl:apply-templates select="refname[1]"/>
166 <xsl:apply-templates/>
171 <xsl:template match="refname">
172 <xsl:if test="not(preceding-sibling::refdescriptor)">
173 <xsl:apply-templates/>
174 <xsl:if test="following-sibling::refname">
175 <xsl:text>, </xsl:text>
180 <xsl:template match="refpurpose">
181 <xsl:if test="node()">
182 <xsl:text> </xsl:text>
183 <xsl:call-template name="dingbat">
184 <xsl:with-param name="dingbat">em-dash</xsl:with-param>
186 <xsl:text> </xsl:text>
187 <xsl:apply-templates/>
191 <!-- This handles repurpose in TOC line to turn off any nested links -->
192 <xsl:template match="refpurpose" mode="no.anchor.mode">
193 <xsl:if test="node()">
194 <xsl:text> </xsl:text>
195 <xsl:call-template name="dingbat">
196 <xsl:with-param name="dingbat">em-dash</xsl:with-param>
198 <xsl:text> </xsl:text>
199 <xsl:apply-templates mode="no.anchor.mode"/>
203 <xsl:template match="refdescriptor">
204 <xsl:apply-templates/>
207 <xsl:template match="refclass">
208 <xsl:if test="$refclass.suppress = 0">
209 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
210 <xsl:if test="@role">
211 <xsl:value-of select="@role"/>
212 <xsl:text>: </xsl:text>
214 <xsl:apply-templates/>
219 <xsl:template match="refsynopsisdiv">
221 <xsl:call-template name="common.html.attributes">
222 <xsl:with-param name="inherit" select="1"/>
224 <xsl:call-template name="id.attribute"/>
225 <xsl:call-template name="anchor"/>
228 <xsl:when test="refsynopsisdiv/title|title">
229 <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]" mode="titlepage.mode"/>
232 <xsl:call-template name="gentext">
233 <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
238 <xsl:apply-templates/>
242 <xsl:template match="refsynopsisdivinfo"/>
244 <xsl:template match="refsynopsisdiv/title">
247 <xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
248 <xsl:apply-templates/>
251 <xsl:template match="refsection|refsect1|refsect2|refsect3">
253 <xsl:call-template name="common.html.attributes">
254 <xsl:with-param name="inherit" select="1"/>
256 <xsl:call-template name="id.attribute">
257 <xsl:with-param name="conditional" select="0"/>
259 <xsl:call-template name="anchor">
260 <xsl:with-param name="conditional" select="0"/>
262 <!-- pick up info title -->
263 <xsl:apply-templates select="(title|info/title)[1]"/>
264 <xsl:apply-templates select="node()[not(self::title) and not(self::info)]"/>
268 <xsl:template match="refsection/title|refsection/info/title">
269 <!-- the ID is output in the block.object call for refsect1 -->
270 <xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
271 <xsl:variable name="refsynopsisdiv">
272 <xsl:text>0</xsl:text>
273 <xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
275 <xsl:variable name="hlevel">
277 <xsl:when test="$level+$refsynopsisdiv > 5">6</xsl:when>
279 <xsl:value-of select="$level+1+$refsynopsisdiv"/>
283 <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
284 <xsl:apply-templates/>
288 <xsl:template match="refsect1/title|refsect1/info/title">
289 <!-- the ID is output in the block.object call for refsect1 -->
291 <xsl:apply-templates/>
295 <xsl:template match="refsect2/title|refsect2/info/title">
296 <!-- the ID is output in the block.object call for refsect2 -->
298 <xsl:apply-templates/>
302 <xsl:template match="refsect3/title|refsect3/info/title">
303 <!-- the ID is output in the block.object call for refsect3 -->
305 <xsl:apply-templates/>
309 <xsl:template match="refsectioninfo|refsection/info"/>
310 <xsl:template match="refsect1info|refsect1/info"/>
311 <xsl:template match="refsect2info|refsect2/info"/>
312 <xsl:template match="refsect3info|refsect3/info"/>
315 <!-- ==================================================================== -->