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: component.xsl 9500 2012-07-15 23:24:21Z 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 <!-- Set to 2 for backwards compatibility -->
19 <xsl:param name="component.heading.level" select="2"/>
21 <xsl:template name="component.title">
22 <xsl:param name="node" select="."/>
24 <!-- This handles the case where a component (bibliography, for example)
25 occurs inside a section; will we need parameters for this? -->
27 <!-- This "level" is a section level. To compute <h> level, add 1. -->
28 <xsl:variable name="level">
30 <!-- chapters and other book children should get <h1> -->
31 <xsl:when test="$node/parent::book">0</xsl:when>
32 <xsl:when test="ancestor::section">
33 <xsl:value-of select="count(ancestor::section)+1"/>
35 <xsl:when test="ancestor::sect5">6</xsl:when>
36 <xsl:when test="ancestor::sect4">5</xsl:when>
37 <xsl:when test="ancestor::sect3">4</xsl:when>
38 <xsl:when test="ancestor::sect2">3</xsl:when>
39 <xsl:when test="ancestor::sect1">2</xsl:when>
40 <xsl:otherwise>1</xsl:otherwise>
44 <xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml">
45 <xsl:attribute name="class">title</xsl:attribute>
46 <xsl:call-template name="anchor">
47 <xsl:with-param name="node" select="$node"/>
48 <xsl:with-param name="conditional" select="0"/>
50 <xsl:apply-templates select="$node" mode="object.title.markup">
51 <xsl:with-param name="allow-anchors" select="1"/>
52 </xsl:apply-templates>
56 <xsl:template name="component.subtitle">
57 <xsl:param name="node" select="."/>
58 <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]"/>
60 <xsl:if test="$subtitle">
62 <xsl:call-template name="id.attribute"/>
63 <em xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
64 <xsl:apply-templates select="$node" mode="object.subtitle.markup"/>
70 <xsl:template name="component.separator">
73 <!-- ==================================================================== -->
75 <xsl:template match="dedication" mode="dedication">
76 <xsl:call-template name="id.warning"/>
79 <xsl:call-template name="common.html.attributes">
80 <xsl:with-param name="inherit" select="1"/>
82 <xsl:call-template name="id.attribute">
83 <xsl:with-param name="conditional" select="0"/>
85 <xsl:call-template name="dedication.titlepage"/>
86 <xsl:apply-templates/>
87 <xsl:call-template name="process.footnotes"/>
91 <xsl:template match="dedication/title|dedication/info/title" mode="titlepage.mode" priority="2">
92 <xsl:call-template name="component.title">
93 <xsl:with-param name="node" select="ancestor::dedication[1]"/>
97 <xsl:template match="dedication/subtitle|dedication/info/subtitle" mode="titlepage.mode" priority="2">
98 <xsl:call-template name="component.subtitle">
99 <xsl:with-param name="node" select="ancestor::dedication[1]"/>
103 <xsl:template match="dedication"/> <!-- see mode="dedication" -->
104 <xsl:template match="dedication/title"/>
105 <xsl:template match="dedication/subtitle"/>
106 <xsl:template match="dedication/titleabbrev"/>
108 <!-- ==================================================================== -->
110 <xsl:template match="acknowledgements" mode="acknowledgements">
111 <xsl:call-template name="id.warning"/>
114 <xsl:call-template name="common.html.attributes">
115 <xsl:with-param name="inherit" select="1"/>
117 <xsl:call-template name="id.attribute">
118 <xsl:with-param name="conditional" select="0"/>
120 <xsl:call-template name="acknowledgements.titlepage"/>
121 <xsl:apply-templates/>
122 <xsl:call-template name="process.footnotes"/>
126 <xsl:template match="acknowledgements/title|acknowledgements/info/title" mode="titlepage.mode" priority="2">
127 <xsl:call-template name="component.title">
128 <xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
132 <xsl:template match="acknowledgements/subtitle|acknowledgements/info/subtitle" mode="titlepage.mode" priority="2">
133 <xsl:call-template name="component.subtitle">
134 <xsl:with-param name="node" select="ancestor::acknowledgements[1]"/>
138 <xsl:template match="acknowledgements"/> <!-- see mode="acknowledgements" -->
139 <xsl:template match="acknowledgements/title"/>
140 <xsl:template match="acknowledgements/subtitle"/>
141 <xsl:template match="acknowledgements/titleabbrev"/>
143 <!-- ==================================================================== -->
145 <xsl:template match="colophon">
146 <xsl:call-template name="id.warning"/>
149 <xsl:call-template name="common.html.attributes">
150 <xsl:with-param name="inherit" select="1"/>
152 <xsl:call-template name="id.attribute">
153 <xsl:with-param name="conditional" select="0"/>
156 <xsl:call-template name="component.separator"/>
157 <xsl:call-template name="component.title"/>
158 <xsl:call-template name="component.subtitle"/>
160 <xsl:apply-templates/>
161 <xsl:call-template name="process.footnotes"/>
165 <xsl:template match="colophon/title"/>
166 <xsl:template match="colophon/subtitle"/>
167 <xsl:template match="colophon/titleabbrev"/>
169 <!-- ==================================================================== -->
171 <xsl:template match="preface">
172 <xsl:call-template name="id.warning"/>
174 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
175 <xsl:call-template name="common.html.attributes">
176 <xsl:with-param name="inherit" select="1"/>
178 <xsl:call-template name="id.attribute">
179 <xsl:with-param name="conditional" select="0"/>
182 <xsl:call-template name="component.separator"/>
183 <xsl:call-template name="preface.titlepage"/>
185 <xsl:variable name="toc.params">
186 <xsl:call-template name="find.path.params">
187 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
191 <xsl:if test="contains($toc.params, 'toc')">
192 <xsl:call-template name="component.toc">
193 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
195 <xsl:call-template name="component.toc.separator"/>
197 <xsl:apply-templates/>
198 <xsl:call-template name="process.footnotes"/>
202 <xsl:template match="preface/title" mode="titlepage.mode" priority="2">
203 <xsl:call-template name="component.title">
204 <xsl:with-param name="node" select="ancestor::preface[1]"/>
208 <xsl:template match="preface/subtitle |preface/prefaceinfo/subtitle |preface/info/subtitle |preface/docinfo/subtitle" mode="titlepage.mode" priority="2">
209 <xsl:call-template name="component.subtitle">
210 <xsl:with-param name="node" select="ancestor::preface[1]"/>
214 <xsl:template match="preface/docinfo|prefaceinfo"/>
215 <xsl:template match="preface/info"/>
216 <xsl:template match="preface/title"/>
217 <xsl:template match="preface/titleabbrev"/>
218 <xsl:template match="preface/subtitle"/>
220 <!-- ==================================================================== -->
222 <xsl:template match="chapter">
223 <xsl:call-template name="id.warning"/>
225 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
226 <xsl:call-template name="common.html.attributes">
227 <xsl:with-param name="inherit" select="1"/>
229 <xsl:call-template name="id.attribute">
230 <xsl:with-param name="conditional" select="0"/>
233 <xsl:call-template name="component.separator"/>
234 <xsl:call-template name="chapter.titlepage"/>
236 <xsl:variable name="toc.params">
237 <xsl:call-template name="find.path.params">
238 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
241 <xsl:if test="contains($toc.params, 'toc')">
242 <xsl:call-template name="component.toc">
243 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
245 <xsl:call-template name="component.toc.separator"/>
247 <xsl:apply-templates/>
248 <xsl:call-template name="process.footnotes"/>
252 <xsl:template match="chapter/title|chapter/chapterinfo/title|chapter/info/title" mode="titlepage.mode" priority="2">
253 <xsl:call-template name="component.title">
254 <xsl:with-param name="node" select="ancestor::chapter[1]"/>
258 <xsl:template match="chapter/subtitle |chapter/chapterinfo/subtitle |chapter/info/subtitle |chapter/docinfo/subtitle" mode="titlepage.mode" priority="2">
259 <xsl:call-template name="component.subtitle">
260 <xsl:with-param name="node" select="ancestor::chapter[1]"/>
264 <xsl:template match="chapter/docinfo|chapterinfo"/>
265 <xsl:template match="chapter/info"/>
266 <xsl:template match="chapter/title"/>
267 <xsl:template match="chapter/titleabbrev"/>
268 <xsl:template match="chapter/subtitle"/>
270 <!-- ==================================================================== -->
272 <xsl:template match="appendix">
273 <xsl:variable name="ischunk">
274 <xsl:call-template name="chunk"/>
277 <xsl:call-template name="id.warning"/>
279 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
280 <xsl:call-template name="common.html.attributes">
281 <xsl:with-param name="inherit" select="1"/>
283 <xsl:call-template name="id.attribute">
284 <xsl:with-param name="conditional" select="0"/>
288 <xsl:when test="parent::article and $ischunk = 0">
289 <xsl:call-template name="section.heading">
290 <xsl:with-param name="level" select="1"/>
291 <xsl:with-param name="title">
292 <xsl:apply-templates select="." mode="object.title.markup"/>
297 <xsl:call-template name="component.separator"/>
298 <xsl:call-template name="appendix.titlepage"/>
302 <xsl:variable name="toc.params">
303 <xsl:call-template name="find.path.params">
304 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
308 <xsl:if test="contains($toc.params, 'toc')">
309 <xsl:call-template name="component.toc">
310 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
312 <xsl:call-template name="component.toc.separator"/>
315 <xsl:apply-templates/>
317 <xsl:if test="not(parent::article) or $ischunk != 0">
318 <xsl:call-template name="process.footnotes"/>
323 <xsl:template match="appendix/title|appendix/appendixinfo/title" mode="titlepage.mode" priority="2">
324 <xsl:call-template name="component.title">
325 <xsl:with-param name="node" select="ancestor::appendix[1]"/>
329 <xsl:template match="appendix/subtitle |appendix/appendixinfo/subtitle |appendix/info/subtitle |appendix/docinfo/subtitle" mode="titlepage.mode" priority="2">
330 <xsl:call-template name="component.subtitle">
331 <xsl:with-param name="node" select="ancestor::appendix[1]"/>
335 <xsl:template match="appendix/docinfo|appendixinfo"/>
336 <xsl:template match="appendix/info"/>
337 <xsl:template match="appendix/title"/>
338 <xsl:template match="appendix/titleabbrev"/>
339 <xsl:template match="appendix/subtitle"/>
341 <!-- ==================================================================== -->
343 <xsl:template match="article">
344 <xsl:call-template name="id.warning"/>
346 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
347 <xsl:call-template name="common.html.attributes">
348 <xsl:with-param name="inherit" select="1"/>
350 <xsl:call-template name="id.attribute">
351 <xsl:with-param name="conditional" select="0"/>
354 <xsl:call-template name="article.titlepage"/>
356 <xsl:variable name="toc.params">
357 <xsl:call-template name="find.path.params">
358 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
362 <xsl:call-template name="make.lots">
363 <xsl:with-param name="toc.params" select="$toc.params"/>
364 <xsl:with-param name="toc">
365 <xsl:call-template name="component.toc">
366 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
371 <xsl:apply-templates/>
372 <xsl:call-template name="process.footnotes"/>
376 <xsl:template match="article/title|article/articleinfo/title" mode="titlepage.mode" priority="2">
377 <xsl:call-template name="component.title">
378 <xsl:with-param name="node" select="ancestor::article[1]"/>
382 <xsl:template match="article/subtitle |article/articleinfo/subtitle |article/info/subtitle |article/artheader/subtitle" mode="titlepage.mode" priority="2">
383 <xsl:call-template name="component.subtitle">
384 <xsl:with-param name="node" select="ancestor::article[1]"/>
388 <xsl:template match="article/artheader|article/articleinfo"/>
389 <xsl:template match="article/info"/>
390 <xsl:template match="article/title"/>
391 <xsl:template match="article/titleabbrev"/>
392 <xsl:template match="article/subtitle"/>
394 <!-- ==================================================================== -->
396 <xsl:template match="topic">
397 <xsl:call-template name="id.warning"/>
399 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
400 <xsl:call-template name="common.html.attributes">
401 <xsl:with-param name="inherit" select="1"/>
403 <xsl:call-template name="id.attribute">
404 <xsl:with-param name="conditional" select="0"/>
407 <xsl:call-template name="topic.titlepage"/>
409 <xsl:variable name="toc.params">
410 <xsl:call-template name="find.path.params">
411 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
415 <xsl:apply-templates/>
417 <xsl:call-template name="process.footnotes"/>
421 <xsl:template match="topic/title|topic/info/title" mode="titlepage.mode" priority="2">
422 <xsl:call-template name="component.title">
423 <xsl:with-param name="node" select="ancestor::topic[1]"/>
427 <xsl:template match="topic/subtitle |topic/info/subtitle" mode="titlepage.mode" priority="2">
428 <xsl:call-template name="component.subtitle">
429 <xsl:with-param name="node" select="ancestor::topic[1]"/>
433 <xsl:template match="topic/info"/>
434 <xsl:template match="topic/title"/>
435 <xsl:template match="topic/titleabbrev"/>
436 <xsl:template match="topic/subtitle"/>