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 8421 2009-05-04 07:49:49Z 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:if test="$generate.id.attributes != 0">
26 <xsl:attribute name="id">
27 <xsl:call-template name="object.id"/>
31 <xsl:call-template name="reference.titlepage"/>
33 <xsl:variable name="toc.params">
34 <xsl:call-template name="find.path.params">
35 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
39 <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
40 <xsl:call-template name="division.toc"/>
42 <xsl:apply-templates/>
46 <xsl:template match="reference" mode="division.number">
47 <xsl:number from="book" count="reference" format="I."/>
50 <xsl:template match="reference/docinfo"/>
51 <xsl:template match="reference/referenceinfo"/>
52 <xsl:template match="reference/title"/>
53 <xsl:template match="reference/subtitle"/>
54 <xsl:template match="reference/titleabbrev"/>
56 <!-- ==================================================================== -->
58 <xsl:template name="refentry.title">
59 <xsl:param name="node" select="."/>
60 <xsl:variable name="refmeta" select="$node//refmeta"/>
61 <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
62 <xsl:variable name="refnamediv" select="$node//refnamediv"/>
63 <xsl:variable name="refname" select="$refnamediv//refname"/>
64 <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
65 <xsl:variable name="title">
67 <xsl:when test="$refentrytitle">
68 <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
70 <xsl:when test="$refdesc">
71 <xsl:apply-templates select="$refdesc[1]" mode="title"/>
73 <xsl:when test="$refname">
74 <xsl:apply-templates select="$refname[1]" mode="title"/>
81 <xsl:copy-of select="$title"/>
85 <xsl:template match="refentry">
86 <xsl:call-template name="id.warning"/>
89 <xsl:call-template name="common.html.attributes">
90 <xsl:with-param name="inherit" select="1"/>
92 <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
93 <div class="refentry.separator">
97 <xsl:call-template name="anchor">
98 <xsl:with-param name="conditional" select="0"/>
100 <xsl:call-template name="refentry.titlepage"/>
101 <xsl:apply-templates/>
102 <xsl:call-template name="process.footnotes"/>
106 <xsl:template match="refentry/docinfo|refentry/refentryinfo"/>
107 <xsl:template match="refentry/info"/>
109 <xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
110 <xsl:apply-templates/>
113 <xsl:template match="refmeta">
116 <xsl:template match="manvolnum">
117 <xsl:if test="$refentry.xref.manvolnum != 0">
118 <xsl:text>(</xsl:text>
119 <xsl:apply-templates/>
120 <xsl:text>)</xsl:text>
124 <xsl:template match="refmiscinfo">
127 <xsl:template match="refentrytitle">
128 <xsl:call-template name="inline.charseq"/>
131 <xsl:template match="refnamediv">
133 <xsl:call-template name="common.html.attributes">
134 <xsl:with-param name="inherit" select="1"/>
136 <xsl:call-template name="anchor"/>
139 <xsl:when test="preceding-sibling::refnamediv">
140 <!-- no title on secondary refnamedivs! -->
142 <xsl:when test="$refentry.generate.name != 0">
144 <xsl:call-template name="gentext">
145 <xsl:with-param name="key" select="'RefName'"/>
149 <xsl:when test="$refentry.generate.title != 0">
152 <xsl:when test="../refmeta/refentrytitle">
153 <xsl:apply-templates select="../refmeta/refentrytitle"/>
156 <xsl:apply-templates select="refname[1]"/>
164 <xsl:apply-templates/>
169 <xsl:template match="refname">
170 <xsl:if test="not(preceding-sibling::refdescriptor)">
171 <xsl:apply-templates/>
172 <xsl:if test="following-sibling::refname">
173 <xsl:text>, </xsl:text>
178 <xsl:template match="refpurpose">
179 <xsl:if test="node()">
180 <xsl:text> </xsl:text>
181 <xsl:call-template name="dingbat">
182 <xsl:with-param name="dingbat">em-dash</xsl:with-param>
184 <xsl:text> </xsl:text>
185 <xsl:apply-templates/>
189 <xsl:template match="refdescriptor">
190 <xsl:apply-templates/>
193 <xsl:template match="refclass">
194 <xsl:if test="$refclass.suppress = 0">
195 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
196 <xsl:if test="@role">
197 <xsl:value-of select="@role"/>
198 <xsl:text>: </xsl:text>
200 <xsl:apply-templates/>
205 <xsl:template match="refsynopsisdiv">
207 <xsl:call-template name="common.html.attributes">
208 <xsl:with-param name="inherit" select="1"/>
210 <xsl:call-template name="anchor"/>
213 <xsl:when test="refsynopsisdiv/title|title">
214 <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]" mode="titlepage.mode"/>
217 <xsl:call-template name="gentext">
218 <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
223 <xsl:apply-templates/>
227 <xsl:template match="refsynopsisdivinfo"/>
229 <xsl:template match="refsynopsisdiv/title">
232 <xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
233 <xsl:apply-templates/>
236 <xsl:template match="refsection|refsect1|refsect2|refsect3">
238 <xsl:call-template name="common.html.attributes">
239 <xsl:with-param name="inherit" select="1"/>
241 <xsl:call-template name="anchor">
242 <xsl:with-param name="conditional" select="0"/>
244 <!-- pick up info title -->
245 <xsl:apply-templates select="(title|info/title)[1]"/>
246 <xsl:apply-templates select="node()[not(self::title) and not(self::info)]"/>
250 <xsl:template match="refsection/title|refsection/info/title">
251 <!-- the ID is output in the block.object call for refsect1 -->
252 <xsl:variable name="level" select="count(ancestor-or-self::refsection)"/>
253 <xsl:variable name="refsynopsisdiv">
254 <xsl:text>0</xsl:text>
255 <xsl:if test="ancestor::refsynopsisdiv">1</xsl:if>
257 <xsl:variable name="hlevel">
259 <xsl:when test="$level+$refsynopsisdiv > 5">6</xsl:when>
261 <xsl:value-of select="$level+1+$refsynopsisdiv"/>
265 <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
266 <xsl:apply-templates/>
270 <xsl:template match="refsect1/title|refsect1/info/title">
271 <!-- the ID is output in the block.object call for refsect1 -->
273 <xsl:apply-templates/>
277 <xsl:template match="refsect2/title|refsect2/info/title">
278 <!-- the ID is output in the block.object call for refsect2 -->
280 <xsl:apply-templates/>
284 <xsl:template match="refsect3/title|refsect3/info/title">
285 <!-- the ID is output in the block.object call for refsect3 -->
287 <xsl:apply-templates/>
291 <xsl:template match="refsectioninfo|refsection/info"/>
292 <xsl:template match="refsect1info|refsect1/info"/>
293 <xsl:template match="refsect2info|refsect2/info"/>
294 <xsl:template match="refsect3info|refsect3/info"/>
297 <!-- ==================================================================== -->