]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/styleguide/docbook-xsl-1.75.2/xhtml/refentry.xsl
stylesheet changes.
[working/Evergreen.git] / stylesheets / styleguide / docbook-xsl-1.75.2 / 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 8421 2009-05-04 07:49:49Z 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:if test="$generate.id.attributes != 0">
26       <xsl:attribute name="id">
27         <xsl:call-template name="object.id"/>
28       </xsl:attribute>
29     </xsl:if>
30
31     <xsl:call-template name="reference.titlepage"/>
32
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)"/>
36       </xsl:call-template>
37     </xsl:variable>
38
39     <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
40       <xsl:call-template name="division.toc"/>
41     </xsl:if>
42     <xsl:apply-templates/>
43   </div>
44 </xsl:template>
45
46 <xsl:template match="reference" mode="division.number">
47   <xsl:number from="book" count="reference" format="I."/>
48 </xsl:template>
49
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"/>
55
56 <!-- ==================================================================== -->
57
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">
66     <xsl:choose>
67       <xsl:when test="$refentrytitle">
68         <xsl:apply-templates select="$refentrytitle[1]" mode="title"/>
69       </xsl:when>
70       <xsl:when test="$refdesc">
71         <xsl:apply-templates select="$refdesc[1]" mode="title"/>
72       </xsl:when>
73       <xsl:when test="$refname">
74         <xsl:apply-templates select="$refname[1]" mode="title"/>
75       </xsl:when>
76       <xsl:otherwise/>
77     </xsl:choose>
78   </xsl:variable>
79
80   <h1 class="title">
81     <xsl:copy-of select="$title"/>
82   </h1>
83 </xsl:template>
84
85 <xsl:template match="refentry">
86   <xsl:call-template name="id.warning"/>
87
88   <div>
89     <xsl:call-template name="common.html.attributes">
90       <xsl:with-param name="inherit" select="1"/>
91     </xsl:call-template>
92     <xsl:if test="$refentry.separator != 0 and preceding-sibling::refentry">
93       <div class="refentry.separator">
94         <hr/>
95       </div>
96     </xsl:if>
97     <xsl:call-template name="anchor">
98       <xsl:with-param name="conditional" select="0"/>
99     </xsl:call-template>
100     <xsl:call-template name="refentry.titlepage"/>
101     <xsl:apply-templates/>
102     <xsl:call-template name="process.footnotes"/>
103   </div>
104 </xsl:template>
105
106 <xsl:template match="refentry/docinfo|refentry/refentryinfo"/>
107 <xsl:template match="refentry/info"/>
108
109 <xsl:template match="refentrytitle|refname|refdescriptor" mode="title">
110   <xsl:apply-templates/>
111 </xsl:template>
112
113 <xsl:template match="refmeta">
114 </xsl:template>
115
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>
121   </xsl:if>
122 </xsl:template>
123
124 <xsl:template match="refmiscinfo">
125 </xsl:template>
126
127 <xsl:template match="refentrytitle">
128   <xsl:call-template name="inline.charseq"/>
129 </xsl:template>
130
131 <xsl:template match="refnamediv">
132   <div>
133     <xsl:call-template name="common.html.attributes">
134       <xsl:with-param name="inherit" select="1"/>
135     </xsl:call-template>
136     <xsl:call-template name="anchor"/>
137
138     <xsl:choose>
139       <xsl:when test="preceding-sibling::refnamediv">
140         <!-- no title on secondary refnamedivs! -->
141       </xsl:when>
142       <xsl:when test="$refentry.generate.name != 0">
143         <h2>
144           <xsl:call-template name="gentext">
145             <xsl:with-param name="key" select="'RefName'"/>
146           </xsl:call-template>
147         </h2>
148       </xsl:when>
149       <xsl:when test="$refentry.generate.title != 0">
150         <h2>
151           <xsl:choose>
152             <xsl:when test="../refmeta/refentrytitle">
153               <xsl:apply-templates select="../refmeta/refentrytitle"/>
154             </xsl:when>
155             <xsl:otherwise>
156               <xsl:apply-templates select="refname[1]"/>
157             </xsl:otherwise>
158           </xsl:choose>
159         </h2>
160       </xsl:when>
161     </xsl:choose>
162
163     <p>
164       <xsl:apply-templates/>
165     </p>
166   </div>
167 </xsl:template>
168
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>
174     </xsl:if>
175   </xsl:if>
176 </xsl:template>
177
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>
183     </xsl:call-template>
184     <xsl:text> </xsl:text>
185     <xsl:apply-templates/>
186   </xsl:if>
187 </xsl:template>
188
189 <xsl:template match="refdescriptor">
190   <xsl:apply-templates/>
191 </xsl:template>
192
193 <xsl:template match="refclass">
194   <xsl:if test="$refclass.suppress = 0">
195   <b>
196     <xsl:if test="@role">
197       <xsl:value-of select="@role"/>
198       <xsl:text>: </xsl:text>
199     </xsl:if>
200     <xsl:apply-templates/>
201   </b>
202   </xsl:if>
203 </xsl:template>
204
205 <xsl:template match="refsynopsisdiv">
206   <div>
207     <xsl:call-template name="common.html.attributes">
208       <xsl:with-param name="inherit" select="1"/>
209     </xsl:call-template>
210     <xsl:call-template name="anchor"/>
211     <h2>
212       <xsl:choose>
213         <xsl:when test="refsynopsisdiv/title|title">
214           <xsl:apply-templates select="(refsynopsisdiv/title|title)[1]" 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"/>
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}" namespace="http://www.w3.org/1999/xhtml">
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"/>
292 <xsl:template match="refsect1info|refsect1/info"/>
293 <xsl:template match="refsect2info|refsect2/info"/>
294 <xsl:template match="refsect3info|refsect3/info"/>
295
296
297 <!-- ==================================================================== -->
298
299 </xsl:stylesheet>