Whamcloud - gitweb
LUDOC-531 mdt: Added more info on DoM EOF
[doc/manual.git] / webhelp / xhtml / refentry.xsl
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">
5
6 <!-- ********************************************************************
7      $Id: refentry.xsl 9962 2015-04-30 17:35:04Z bobstayton $
8      ********************************************************************
9
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.
13
14      ******************************************************************** -->
15
16 <!-- ==================================================================== -->
17
18 <xsl:template match="reference">
19   <xsl:call-template name="id.warning"/>
20
21   <div>
22     <xsl:call-template name="common.html.attributes">
23       <xsl:with-param name="inherit" select="1"/>
24     </xsl:call-template>
25     <xsl:call-template name="id.attribute">
26       <xsl:with-param name="conditional" select="0"/>
27     </xsl:call-template>
28
29     <xsl:call-template name="reference.titlepage"/>
30
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)"/>
34       </xsl:call-template>
35     </xsl:variable>
36
37     <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
38       <xsl:call-template name="division.toc"/>
39     </xsl:if>
40     <xsl:apply-templates/>
41   </div>
42 </xsl:template>
43
44 <xsl:template match="reference" mode="division.number">
45   <xsl:number from="book" count="reference" format="I."/>
46 </xsl:template>
47
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"/>
53
54 <!-- ==================================================================== -->
55
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">
64     <xsl:choose>
65       <xsl:when test="$refentrytitle">
66         <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
67       </xsl:when>
68       <xsl:when test="$refdesc">
69         <xsl:apply-templates select="$refdesc[1]" mode="title"/>
70       </xsl:when>
71       <xsl:when test="$refname">
72         <xsl:apply-templates select="$refname[1]" mode="title"/>
73       </xsl:when>
74       <xsl:otherwise/>
75     </xsl:choose>
76   </xsl:variable>
77
78   <h1 class="title">
79     <xsl:copy-of select="$title"/>
80   </h1>
81 </xsl:template>
82
83 <xsl:template match="refentry">
84   <xsl:call-template name="id.warning"/>
85
86   <div>
87     <xsl:call-template name="common.html.attributes">
88       <xsl:with-param name="inherit" select="1"/>
89     </xsl:call-template>
90     <xsl:call-template name="id.attribute">
91       <xsl:with-param name="conditional" select="0"/>
92     </xsl:call-template>
93     <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
94       <div class="refentry.separator">
95         <hr/>
96       </div>
97     </xsl:if>
98     <xsl:call-template name="anchor">
99       <xsl:with-param name="conditional" select="0"/>
100     </xsl:call-template>
101     <xsl:call-template name="refentry.titlepage"/>
102     <xsl:apply-templates/>
103     <xsl:call-template name="process.footnotes"/>
104   </div>
105 </xsl:template>
106
107 <xsl:template match="refentry/docinfo|refentry/refentryinfo"/>
108 <xsl:template match="refentry/info"/>
109
110 <xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
111   <xsl:apply-templates/>
112 </xsl:template>
113
114 <xsl:template match="refmeta">
115 </xsl:template>
116
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>
122   </xsl:if>
123 </xsl:template>
124
125 <xsl:template match="refmiscinfo">
126 </xsl:template>
127
128 <xsl:template match="refentrytitle">
129   <xsl:call-template name="inline.charseq"/>
130 </xsl:template>
131
132 <xsl:template match="refnamediv">
133   <div>
134     <xsl:call-template name="common.html.attributes">
135       <xsl:with-param name="inherit" select="1"/>
136     </xsl:call-template>
137     <xsl:call-template name="id.attribute"/>
138     <xsl:call-template name="anchor"/>
139
140     <xsl:choose>
141       <xsl:when test="preceding-sibling::refnamediv">
142         <!-- no title on secondary refnamedivs! -->
143       </xsl:when>
144       <xsl:when test="$refentry.generate.name != 0">
145         <h2>
146           <xsl:call-template name="gentext">
147             <xsl:with-param name="key" select="'RefName'"/>
148           </xsl:call-template>
149         </h2>
150       </xsl:when>
151       <xsl:when test="$refentry.generate.title != 0">
152         <h2>
153           <xsl:choose>
154             <xsl:when test="../refmeta/refentrytitle">
155               <xsl:apply-templates select="../refmeta/refentrytitle"/>
156             </xsl:when>
157             <xsl:otherwise>
158               <xsl:apply-templates select="refname[1]"/>
159             </xsl:otherwise>
160           </xsl:choose>
161         </h2>
162       </xsl:when>
163     </xsl:choose>
164
165     <p>
166       <xsl:apply-templates/>
167     </p>
168   </div>
169 </xsl:template>
170
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>
176     </xsl:if>
177   </xsl:if>
178 </xsl:template>
179
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>
185     </xsl:call-template>
186     <xsl:text> </xsl:text>
187     <xsl:apply-templates/>
188   </xsl:if>
189 </xsl:template>
190
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>
197     </xsl:call-template>
198     <xsl:text> </xsl:text>
199     <xsl:apply-templates mode="no.anchor.mode"/>
200   </xsl:if>
201 </xsl:template>
202
203 <xsl:template match="refdescriptor">
204   <xsl:apply-templates/>
205 </xsl:template>
206
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>
213     </xsl:if>
214     <xsl:apply-templates/>
215   </strong>
216   </xsl:if>
217 </xsl:template>
218
219 <xsl:template match="refsynopsisdiv">
220   <div>
221     <xsl:call-template name="common.html.attributes">
222       <xsl:with-param name="inherit" select="1"/>
223     </xsl:call-template>
224     <xsl:call-template name="id.attribute"/>
225     <xsl:call-template name="anchor"/>
226     <h2>
227       <xsl:choose>
228         <xsl:when test="refsynopsisdiv/title|title">
229           <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]" mode="titlepage.mode"/>
230         </xsl:when>
231         <xsl:otherwise>
232           <xsl:call-template name="gentext">
233             <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
234           </xsl:call-template>
235         </xsl:otherwise>
236       </xsl:choose>
237     </h2>
238     <xsl:apply-templates/>
239   </div>
240 </xsl:template>
241
242 <xsl:template match="refsynopsisdivinfo"/>
243
244 <xsl:template match="refsynopsisdiv/title">
245 </xsl:template>
246
247 <xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
248   <xsl:apply-templates/>
249 </xsl:template>
250
251 <xsl:template match="refsection|refsect1|refsect2|refsect3">
252   <div>
253     <xsl:call-template name="common.html.attributes">
254       <xsl:with-param name="inherit" select="1"/>
255     </xsl:call-template>
256     <xsl:call-template name="id.attribute">
257       <xsl:with-param name="conditional" select="0"/>
258     </xsl:call-template>
259     <xsl:call-template name="anchor">
260       <xsl:with-param name="conditional" select="0"/>
261     </xsl:call-template>
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)]"/>
265   </div>
266 </xsl:template>
267
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>
274   </xsl:variable>
275   <xsl:variable name="hlevel">
276     <xsl:choose>
277       <xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
278       <xsl:otherwise>
279         <xsl:value-of select="$level+1+$refsynopsisdiv"/>
280       </xsl:otherwise>
281     </xsl:choose>
282   </xsl:variable>
283   <xsl:element name="h{$hlevel}" namespace="http://www.w3.org/1999/xhtml">
284     <xsl:apply-templates/>
285   </xsl:element>
286 </xsl:template>
287
288 <xsl:template match="refsect1/title|refsect1/info/title">
289   <!-- the ID is output in the block.object call for refsect1 -->
290   <h2>
291     <xsl:apply-templates/>
292   </h2>
293 </xsl:template>
294
295 <xsl:template match="refsect2/title|refsect2/info/title">
296   <!-- the ID is output in the block.object call for refsect2 -->
297   <h3>
298     <xsl:apply-templates/>
299   </h3>
300 </xsl:template>
301
302 <xsl:template match="refsect3/title|refsect3/info/title">
303   <!-- the ID is output in the block.object call for refsect3 -->
304   <h4>
305     <xsl:apply-templates/>
306   </h4>
307 </xsl:template>
308
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"/>
313
314
315 <!-- ==================================================================== -->
316
317 </xsl:stylesheet>