]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/html/refentry.xsl
Evergreen Version Fix to reflect the new EG releases 2.0.10 and 1.6.1.9
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / html / refentry.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 version='1.0'>
4
5 <!-- ********************************************************************
6      $Id: refentry.xsl 8421 2009-05-04 07:49:49Z bobstayton $
7      ********************************************************************
8
9      This file is part of the XSL DocBook Stylesheet distribution.
10      See ../README or http://docbook.sf.net/release/xsl/current/ for
11      copyright and other information.
12
13      ******************************************************************** -->
14
15 <!-- ==================================================================== -->
16
17 <xsl:template match="reference">
18   <xsl:call-template name="id.warning"/>
19
20   <div>
21     <xsl:call-template name="common.html.attributes">
22       <xsl:with-param name="inherit" select="1"/>
23     </xsl:call-template>
24     <xsl:if test="$generate.id.attributes != 0">
25       <xsl:attribute name="id">
26         <xsl:call-template name="object.id"/>
27       </xsl:attribute>
28     </xsl:if>
29
30     <xsl:call-template name="reference.titlepage"/>
31
32     <xsl:variable name="toc.params">
33       <xsl:call-template name="find.path.params">
34         <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
35       </xsl:call-template>
36     </xsl:variable>
37
38     <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
39       <xsl:call-template name="division.toc"/>
40     </xsl:if>
41     <xsl:apply-templates/>
42   </div>
43 </xsl:template>
44
45 <xsl:template match="reference" mode="division.number">
46   <xsl:number from="book" count="reference" format="I."/>
47 </xsl:template>
48
49 <xsl:template match="reference/docinfo"></xsl:template>
50 <xsl:template match="reference/referenceinfo"></xsl:template>
51 <xsl:template match="reference/title"></xsl:template>
52 <xsl:template match="reference/subtitle"></xsl:template>
53 <xsl:template match="reference/titleabbrev"></xsl:template>
54
55 <!-- ==================================================================== -->
56
57 <xsl:template name="refentry.title">
58   <xsl:param name="node" select="."/>
59   <xsl:variable name="refmeta" select="$node//refmeta"/>
60   <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/>
61   <xsl:variable name="refnamediv" select="$node//refnamediv"/>
62   <xsl:variable name="refname" select="$refnamediv//refname"/>
63   <xsl:variable name="refdesc" select="$refnamediv//refdescriptor"/>
64   <xsl:variable name="title">
65     <xsl:choose>
66       <xsl:when test="$refentrytitle">
67         <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
68       </xsl:when>
69       <xsl:when test="$refdesc">
70         <xsl:apply-templates select="$refdesc[1]" mode="title"/>
71       </xsl:when>
72       <xsl:when test="$refname">
73         <xsl:apply-templates select="$refname[1]" mode="title"/>
74       </xsl:when>
75       <xsl:otherwise></xsl:otherwise>
76     </xsl:choose>
77   </xsl:variable>
78
79   <h1 class="title">
80     <xsl:copy-of select="$title"/>
81   </h1>
82 </xsl:template>
83
84 <xsl:template match="refentry">
85   <xsl:call-template name="id.warning"/>
86
87   <div>
88     <xsl:call-template name="common.html.attributes">
89       <xsl:with-param name="inherit" select="1"/>
90     </xsl:call-template>
91     <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
92       <div class="refentry.separator">
93         <hr/>
94       </div>
95     </xsl:if>
96     <xsl:call-template name="anchor">
97       <xsl:with-param name="conditional" select="0"/>
98     </xsl:call-template>
99     <xsl:call-template name="refentry.titlepage"/>
100     <xsl:apply-templates/>
101     <xsl:call-template name="process.footnotes"/>
102   </div>
103 </xsl:template>
104
105 <xsl:template match="refentry/docinfo|refentry/refentryinfo"></xsl:template>
106 <xsl:template match="refentry/info"></xsl:template>
107
108 <xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
109   <xsl:apply-templates/>
110 </xsl:template>
111
112 <xsl:template match="refmeta">
113 </xsl:template>
114
115 <xsl:template match="manvolnum">
116   <xsl:if test="$refentry.xref.manvolnum != 0">
117     <xsl:text>(</xsl:text>
118     <xsl:apply-templates/>
119     <xsl:text>)</xsl:text>
120   </xsl:if>
121 </xsl:template>
122
123 <xsl:template match="refmiscinfo">
124 </xsl:template>
125
126 <xsl:template match="refentrytitle">
127   <xsl:call-template name="inline.charseq"/>
128 </xsl:template>
129
130 <xsl:template match="refnamediv">
131   <div>
132     <xsl:call-template name="common.html.attributes">
133       <xsl:with-param name="inherit" select="1"/>
134     </xsl:call-template>
135     <xsl:call-template name="anchor"/>
136
137     <xsl:choose>
138       <xsl:when test="preceding-sibling::refnamediv">
139         <!-- no title on secondary refnamedivs! -->
140       </xsl:when>
141       <xsl:when test="$refentry.generate.name != 0">
142         <h2>
143           <xsl:call-template name="gentext">
144             <xsl:with-param name="key" select="'RefName'"/>
145           </xsl:call-template>
146         </h2>
147       </xsl:when>
148       <xsl:when test="$refentry.generate.title != 0">
149         <h2>
150           <xsl:choose>
151             <xsl:when test="../refmeta/refentrytitle">
152               <xsl:apply-templates select="../refmeta/refentrytitle"/>
153             </xsl:when>
154             <xsl:otherwise>
155               <xsl:apply-templates select="refname[1]"/>
156             </xsl:otherwise>
157           </xsl:choose>
158         </h2>
159       </xsl:when>
160     </xsl:choose>
161
162     <p>
163       <xsl:apply-templates/>
164     </p>
165   </div>
166 </xsl:template>
167
168 <xsl:template match="refname">
169   <xsl:if test="not(preceding-sibling::refdescriptor)">
170     <xsl:apply-templates/>
171     <xsl:if test="following-sibling::refname">
172       <xsl:text>, </xsl:text>
173     </xsl:if>
174   </xsl:if>
175 </xsl:template>
176
177 <xsl:template match="refpurpose">
178   <xsl:if test="node()">
179     <xsl:text> </xsl:text>
180     <xsl:call-template name="dingbat">
181       <xsl:with-param name="dingbat">em-dash</xsl:with-param>
182     </xsl:call-template>
183     <xsl:text> </xsl:text>
184     <xsl:apply-templates/>
185   </xsl:if>
186 </xsl:template>
187
188 <xsl:template match="refdescriptor">
189   <xsl:apply-templates/>
190 </xsl:template>
191
192 <xsl:template match="refclass">
193   <xsl:if test="$refclass.suppress = 0">
194   <b>
195     <xsl:if test="@role">
196       <xsl:value-of select="@role"/>
197       <xsl:text>: </xsl:text>
198     </xsl:if>
199     <xsl:apply-templates/>
200   </b>
201   </xsl:if>
202 </xsl:template>
203
204 <xsl:template match="refsynopsisdiv">
205   <div>
206     <xsl:call-template name="common.html.attributes">
207       <xsl:with-param name="inherit" select="1"/>
208     </xsl:call-template>
209     <xsl:call-template name="anchor"/>
210     <h2>
211       <xsl:choose>
212         <xsl:when test="refsynopsisdiv/title|title">
213           <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]"
214                                mode="titlepage.mode"/>
215         </xsl:when>
216         <xsl:otherwise>
217           <xsl:call-template name="gentext">
218             <xsl:with-param name="key" select="'RefSynopsisDiv'"/>
219           </xsl:call-template>
220         </xsl:otherwise>
221       </xsl:choose>
222     </h2>
223     <xsl:apply-templates/>
224   </div>
225 </xsl:template>
226
227 <xsl:template match="refsynopsisdivinfo"></xsl:template>
228
229 <xsl:template match="refsynopsisdiv/title">
230 </xsl:template>
231
232 <xsl:template match="refsynopsisdiv/title" mode="titlepage.mode">
233   <xsl:apply-templates/>
234 </xsl:template>
235
236 <xsl:template match="refsection|refsect1|refsect2|refsect3">
237   <div>
238     <xsl:call-template name="common.html.attributes">
239       <xsl:with-param name="inherit" select="1"/>
240     </xsl:call-template>
241     <xsl:call-template name="anchor">
242       <xsl:with-param name="conditional" select="0"/>
243     </xsl:call-template>
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)]"/>
247   </div>
248 </xsl:template>
249
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>
256   </xsl:variable>
257   <xsl:variable name="hlevel">
258     <xsl:choose>
259       <xsl:when test="$level+$refsynopsisdiv &gt; 5">6</xsl:when>
260       <xsl:otherwise>
261         <xsl:value-of select="$level+1+$refsynopsisdiv"/>
262       </xsl:otherwise>
263     </xsl:choose>
264   </xsl:variable>
265   <xsl:element name="h{$hlevel}">
266     <xsl:apply-templates/>
267   </xsl:element>
268 </xsl:template>
269
270 <xsl:template match="refsect1/title|refsect1/info/title">
271   <!-- the ID is output in the block.object call for refsect1 -->
272   <h2>
273     <xsl:apply-templates/>
274   </h2>
275 </xsl:template>
276
277 <xsl:template match="refsect2/title|refsect2/info/title">
278   <!-- the ID is output in the block.object call for refsect2 -->
279   <h3>
280     <xsl:apply-templates/>
281   </h3>
282 </xsl:template>
283
284 <xsl:template match="refsect3/title|refsect3/info/title">
285   <!-- the ID is output in the block.object call for refsect3 -->
286   <h4>
287     <xsl:apply-templates/>
288   </h4>
289 </xsl:template>
290
291 <xsl:template match="refsectioninfo|refsection/info"></xsl:template>
292 <xsl:template match="refsect1info|refsect1/info"></xsl:template>
293 <xsl:template match="refsect2info|refsect2/info"></xsl:template>
294 <xsl:template match="refsect3info|refsect3/info"></xsl:template>
295
296
297 <!-- ==================================================================== -->
298
299 </xsl:stylesheet>