]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/styleguide/docbook-xsl-1.75.2/xhtml-1_1/component.xsl
stylesheet changes.
[working/Evergreen.git] / stylesheets / styleguide / docbook-xsl-1.75.2 / xhtml-1_1 / component.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: component.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 name="component.title">
19   <xsl:param name="node" select="."/>
20
21   <xsl:variable name="level">
22     <xsl:choose>
23       <xsl:when test="ancestor::section">
24         <xsl:value-of select="count(ancestor::section)+1"/>
25       </xsl:when>
26       <xsl:when test="ancestor::sect5">6</xsl:when>
27       <xsl:when test="ancestor::sect4">5</xsl:when>
28       <xsl:when test="ancestor::sect3">4</xsl:when>
29       <xsl:when test="ancestor::sect2">3</xsl:when>
30       <xsl:when test="ancestor::sect1">2</xsl:when>
31       <xsl:otherwise>1</xsl:otherwise>
32     </xsl:choose>
33   </xsl:variable>
34
35   <!-- Let's handle the case where a component (bibliography, for example)
36        occurs inside a section; will we need parameters for this? -->
37
38   <xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml">
39     <xsl:attribute name="class">title</xsl:attribute>
40     <xsl:if test="$generate.id.attributes = 0">
41       <xsl:call-template name="anchor">
42         <xsl:with-param name="node" select="$node"/>
43         <xsl:with-param name="conditional" select="0"/>
44       </xsl:call-template>
45     </xsl:if>
46       <xsl:apply-templates select="$node" mode="object.title.markup">
47       <xsl:with-param name="allow-anchors" select="1"/>
48     </xsl:apply-templates>
49   </xsl:element>
50 </xsl:template>
51
52 <xsl:template name="component.subtitle">
53   <xsl:param name="node" select="."/>
54   <xsl:variable name="subtitle" select="($node/docinfo/subtitle                         |$node/info/subtitle                         |$node/prefaceinfo/subtitle                         |$node/chapterinfo/subtitle                         |$node/appendixinfo/subtitle                         |$node/articleinfo/subtitle                         |$node/artheader/subtitle                         |$node/subtitle)[1]"/>
55
56   <xsl:if test="$subtitle">
57     <h3 class="subtitle">
58       <i>
59         <xsl:apply-templates select="$node" mode="object.subtitle.markup"/>
60       </i>
61     </h3>
62   </xsl:if>
63 </xsl:template>
64
65 <xsl:template name="component.separator">
66 </xsl:template>
67
68 <!-- ==================================================================== -->
69
70 <xsl:template match="dedication" mode="dedication">
71   <xsl:call-template name="id.warning"/>
72
73   <div>
74     <xsl:call-template name="common.html.attributes">
75       <xsl:with-param name="inherit" select="1"/>
76     </xsl:call-template>
77     <xsl:call-template name="dedication.titlepage"/>
78     <xsl:apply-templates/>
79     <xsl:call-template name="process.footnotes"/>
80   </div>
81 </xsl:template>
82
83 <xsl:template match="dedication/title|dedication/info/title" mode="titlepage.mode" priority="2">
84   <xsl:call-template name="component.title">
85     <xsl:with-param name="node" select="ancestor::dedication[1]"/>
86   </xsl:call-template>
87 </xsl:template>
88
89 <xsl:template match="dedication/subtitle|dedication/info/subtitle" mode="titlepage.mode" priority="2">
90   <xsl:call-template name="component.subtitle">
91     <xsl:with-param name="node" select="ancestor::dedication[1]"/>
92   </xsl:call-template>
93 </xsl:template>
94
95 <xsl:template match="dedication"/> <!-- see mode="dedication" -->
96 <xsl:template match="dedication/title"/>
97 <xsl:template match="dedication/subtitle"/>
98 <xsl:template match="dedication/titleabbrev"/>
99
100 <!-- ==================================================================== -->
101
102 <xsl:template match="acknowledgements" mode="acknowledgements">
103   <xsl:call-template name="id.warning"/>
104
105   <div>
106     <xsl:call-template name="common.html.attributes">
107       <xsl:with-param name="inherit" select="1"/>
108     </xsl:call-template>
109     <xsl:call-template name="acknowledgements.titlepage"/>
110     <xsl:apply-templates/>
111     <xsl:call-template name="process.footnotes"/>
112   </div>
113 </xsl:template>
114
115 <xsl:template match="acknowledgements/title|acknowledgements/info/title" mode="titlepage.mode" priority="2">
116   <xsl:call-template name="component.title">
117     <xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
118   </xsl:call-template>
119 </xsl:template>
120
121 <xsl:template match="acknowledgements/subtitle|acknowledgements/info/subtitle" mode="titlepage.mode" priority="2">
122   <xsl:call-template name="component.subtitle">
123     <xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
124   </xsl:call-template>
125 </xsl:template>
126
127 <xsl:template match="acknowledgements"/> <!-- see mode="acknowledgements" -->
128 <xsl:template match="acknowledgements/title"/>
129 <xsl:template match="acknowledgements/subtitle"/>
130 <xsl:template match="acknowledgements/titleabbrev"/>
131
132 <!-- ==================================================================== -->
133
134 <xsl:template match="colophon">
135   <xsl:call-template name="id.warning"/>
136
137   <div>
138     <xsl:call-template name="common.html.attributes">
139       <xsl:with-param name="inherit" select="1"/>
140     </xsl:call-template>
141     <xsl:if test="$generate.id.attributes != 0">
142       <xsl:attribute name="id">
143         <xsl:call-template name="object.id"/>
144       </xsl:attribute>
145     </xsl:if>
146
147     <xsl:call-template name="component.separator"/>
148     <xsl:call-template name="component.title"/>
149     <xsl:call-template name="component.subtitle"/>
150
151     <xsl:apply-templates/>
152     <xsl:call-template name="process.footnotes"/>
153   </div>
154 </xsl:template>
155
156 <xsl:template match="colophon/title"/>
157 <xsl:template match="colophon/subtitle"/>
158 <xsl:template match="colophon/titleabbrev"/>
159
160 <!-- ==================================================================== -->
161
162 <xsl:template match="preface">
163   <xsl:call-template name="id.warning"/>
164
165   <div>
166     <xsl:call-template name="common.html.attributes">
167       <xsl:with-param name="inherit" select="1"/>
168     </xsl:call-template>
169     <xsl:if test="$generate.id.attributes != 0">
170       <xsl:attribute name="id">
171         <xsl:call-template name="object.id"/>
172       </xsl:attribute>
173     </xsl:if>
174
175     <xsl:call-template name="component.separator"/>
176     <xsl:call-template name="preface.titlepage"/>
177
178     <xsl:variable name="toc.params">
179       <xsl:call-template name="find.path.params">
180         <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
181       </xsl:call-template>
182     </xsl:variable>
183
184     <xsl:if test="contains($toc.params, 'toc')">
185       <xsl:call-template name="component.toc">
186         <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
187       </xsl:call-template>
188       <xsl:call-template name="component.toc.separator"/>
189     </xsl:if>
190     <xsl:apply-templates/>
191     <xsl:call-template name="process.footnotes"/>
192   </div>
193 </xsl:template>
194
195 <xsl:template match="preface/title" mode="titlepage.mode" priority="2">
196   <xsl:call-template name="component.title">
197     <xsl:with-param name="node" select="ancestor::preface[1]"/>
198   </xsl:call-template>
199 </xsl:template>
200
201 <xsl:template match="preface/subtitle                      |preface/prefaceinfo/subtitle                      |preface/info/subtitle                      |preface/docinfo/subtitle" mode="titlepage.mode" priority="2">
202   <xsl:call-template name="component.subtitle">
203     <xsl:with-param name="node" select="ancestor::preface[1]"/>
204   </xsl:call-template>
205 </xsl:template>
206
207 <xsl:template match="preface/docinfo|prefaceinfo"/>
208 <xsl:template match="preface/info"/>
209 <xsl:template match="preface/title"/>
210 <xsl:template match="preface/titleabbrev"/>
211 <xsl:template match="preface/subtitle"/>
212
213 <!-- ==================================================================== -->
214
215 <xsl:template match="chapter">
216   <xsl:call-template name="id.warning"/>
217
218   <div>
219     <xsl:call-template name="common.html.attributes">
220       <xsl:with-param name="inherit" select="1"/>
221     </xsl:call-template>
222     <xsl:if test="$generate.id.attributes != 0">
223       <xsl:attribute name="id">
224         <xsl:call-template name="object.id"/>
225       </xsl:attribute>
226     </xsl:if>
227
228     <xsl:call-template name="component.separator"/>
229     <xsl:call-template name="chapter.titlepage"/>
230
231     <xsl:variable name="toc.params">
232       <xsl:call-template name="find.path.params">
233         <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
234       </xsl:call-template>
235     </xsl:variable>
236     <xsl:if test="contains($toc.params, 'toc')">
237       <xsl:call-template name="component.toc">
238         <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
239       </xsl:call-template>
240       <xsl:call-template name="component.toc.separator"/>
241     </xsl:if>
242     <xsl:apply-templates/>
243     <xsl:call-template name="process.footnotes"/>
244   </div>
245 </xsl:template>
246
247 <xsl:template match="chapter/title|chapter/chapterinfo/title" mode="titlepage.mode" priority="2">
248   <xsl:call-template name="component.title">
249     <xsl:with-param name="node" select="ancestor::chapter[1]"/>
250   </xsl:call-template>
251 </xsl:template>
252
253 <xsl:template match="chapter/subtitle                      |chapter/chapterinfo/subtitle                      |chapter/info/subtitle                      |chapter/docinfo/subtitle" mode="titlepage.mode" priority="2">
254   <xsl:call-template name="component.subtitle">
255     <xsl:with-param name="node" select="ancestor::chapter[1]"/>
256   </xsl:call-template>
257 </xsl:template>
258
259 <xsl:template match="chapter/docinfo|chapterinfo"/>
260 <xsl:template match="chapter/info"/>
261 <xsl:template match="chapter/title"/>
262 <xsl:template match="chapter/titleabbrev"/>
263 <xsl:template match="chapter/subtitle"/>
264
265 <!-- ==================================================================== -->
266
267 <xsl:template match="appendix">
268   <xsl:variable name="ischunk">
269     <xsl:call-template name="chunk"/>
270   </xsl:variable>
271
272   <xsl:call-template name="id.warning"/>
273
274   <div>
275     <xsl:call-template name="common.html.attributes">
276       <xsl:with-param name="inherit" select="1"/>
277     </xsl:call-template>
278     <xsl:if test="$generate.id.attributes != 0">
279       <xsl:attribute name="id">
280         <xsl:call-template name="object.id"/>
281       </xsl:attribute>
282     </xsl:if>
283
284     <xsl:choose>
285       <xsl:when test="parent::article and $ischunk = 0">
286         <xsl:call-template name="section.heading">
287           <xsl:with-param name="level" select="1"/>
288           <xsl:with-param name="title">
289             <xsl:apply-templates select="." mode="object.title.markup"/>
290           </xsl:with-param>
291         </xsl:call-template>
292       </xsl:when>
293       <xsl:otherwise>
294         <xsl:call-template name="component.separator"/>
295         <xsl:call-template name="appendix.titlepage"/>
296       </xsl:otherwise>
297     </xsl:choose>
298
299     <xsl:variable name="toc.params">
300       <xsl:call-template name="find.path.params">
301         <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
302       </xsl:call-template>
303     </xsl:variable>
304
305     <xsl:if test="contains($toc.params, 'toc')">
306       <xsl:call-template name="component.toc">
307         <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
308       </xsl:call-template>
309       <xsl:call-template name="component.toc.separator"/>
310     </xsl:if>
311
312     <xsl:apply-templates/>
313
314     <xsl:if test="not(parent::article) or $ischunk != 0">
315       <xsl:call-template name="process.footnotes"/>
316     </xsl:if>
317   </div>
318 </xsl:template>
319
320 <xsl:template match="appendix/title|appendix/appendixinfo/title" mode="titlepage.mode" priority="2">
321   <xsl:call-template name="component.title">
322     <xsl:with-param name="node" select="ancestor::appendix[1]"/>
323   </xsl:call-template>
324 </xsl:template>
325
326 <xsl:template match="appendix/subtitle                      |appendix/appendixinfo/subtitle                      |appendix/info/subtitle                      |appendix/docinfo/subtitle" mode="titlepage.mode" priority="2">
327   <xsl:call-template name="component.subtitle">
328     <xsl:with-param name="node" select="ancestor::appendix[1]"/>
329   </xsl:call-template>
330 </xsl:template>
331
332 <xsl:template match="appendix/docinfo|appendixinfo"/>
333 <xsl:template match="appendix/info"/>
334 <xsl:template match="appendix/title"/>
335 <xsl:template match="appendix/titleabbrev"/>
336 <xsl:template match="appendix/subtitle"/>
337
338 <!-- ==================================================================== -->
339
340 <xsl:template match="article">
341   <xsl:call-template name="id.warning"/>
342
343   <div>
344     <xsl:call-template name="common.html.attributes">
345       <xsl:with-param name="inherit" select="1"/>
346     </xsl:call-template>
347     <xsl:if test="$generate.id.attributes != 0">
348       <xsl:attribute name="id">
349         <xsl:call-template name="object.id"/>
350       </xsl:attribute>
351     </xsl:if>
352
353     <xsl:call-template name="article.titlepage"/>
354
355     <xsl:variable name="toc.params">
356       <xsl:call-template name="find.path.params">
357         <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
358       </xsl:call-template>
359     </xsl:variable>
360
361     <xsl:call-template name="make.lots">
362       <xsl:with-param name="toc.params" select="$toc.params"/>
363       <xsl:with-param name="toc">
364         <xsl:call-template name="component.toc">
365           <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
366         </xsl:call-template>
367       </xsl:with-param>
368     </xsl:call-template>
369
370     <xsl:apply-templates/>
371     <xsl:call-template name="process.footnotes"/>
372   </div>
373 </xsl:template>
374
375 <xsl:template match="article/title|article/articleinfo/title" mode="titlepage.mode" priority="2">
376   <xsl:call-template name="component.title">
377     <xsl:with-param name="node" select="ancestor::article[1]"/>
378   </xsl:call-template>
379 </xsl:template>
380
381 <xsl:template match="article/subtitle                      |article/articleinfo/subtitle                      |article/info/subtitle                      |article/artheader/subtitle" mode="titlepage.mode" priority="2">
382   <xsl:call-template name="component.subtitle">
383     <xsl:with-param name="node" select="ancestor::article[1]"/>
384   </xsl:call-template>
385 </xsl:template>
386
387 <xsl:template match="article/artheader|article/articleinfo"/>
388 <xsl:template match="article/info"/>
389 <xsl:template match="article/title"/>
390 <xsl:template match="article/titleabbrev"/>
391 <xsl:template match="article/subtitle"/>
392
393 <!-- ==================================================================== -->
394
395 </xsl:stylesheet>