1 <?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="d" version="1.0">
3 <!-- ********************************************************************
5 This file is part of the XSL DocBook Stylesheet distribution.
6 See ../README or http://cdn.docbook.org/release/xsl/current/ for
7 copyright and other information.
9 ******************************************************************** -->
11 <!-- ==================================================================== -->
13 <!-- Set to 2 for backwards compatibility -->
14 <xsl:param name="component.heading.level" select="2"/>
16 <xsl:template name="component.title">
17 <xsl:param name="node" select="."/>
19 <!-- This handles the case where a component (bibliography, for example)
20 occurs inside a section; will we need parameters for this? -->
22 <!-- This "level" is a section level. To compute <h> level, add 1. -->
23 <xsl:variable name="level">
25 <!-- chapters and other book children should get <h1> -->
26 <xsl:when test="$node/parent::d:book">0</xsl:when>
27 <xsl:when test="ancestor::d:section">
28 <xsl:value-of select="count(ancestor::d:section)+1"/>
30 <xsl:when test="ancestor::d:sect5">6</xsl:when>
31 <xsl:when test="ancestor::d:sect4">5</xsl:when>
32 <xsl:when test="ancestor::d:sect3">4</xsl:when>
33 <xsl:when test="ancestor::d:sect2">3</xsl:when>
34 <xsl:when test="ancestor::d:sect1">2</xsl:when>
35 <xsl:otherwise>1</xsl:otherwise>
39 <xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml">
40 <xsl:attribute name="class">title</xsl:attribute>
41 <xsl:call-template name="anchor">
42 <xsl:with-param name="node" select="$node"/>
43 <xsl:with-param name="conditional" select="0"/>
45 <xsl:apply-templates select="$node" mode="object.title.markup">
46 <xsl:with-param name="allow-anchors" select="1"/>
47 </xsl:apply-templates>
51 <xsl:template name="component.subtitle">
52 <xsl:param name="node" select="."/>
53 <xsl:variable name="subtitle" select="($node/d:docinfo/d:subtitle |$node/d:info/d:subtitle |$node/d:prefaceinfo/d:subtitle |$node/d:chapterinfo/d:subtitle |$node/d:appendixinfo/d:subtitle |$node/d:articleinfo/d:subtitle |$node/d:artheader/d:subtitle |$node/d:subtitle)[1]"/>
55 <xsl:if test="$subtitle">
57 <xsl:call-template name="id.attribute"/>
59 <xsl:apply-templates select="$node" mode="object.subtitle.markup"/>
65 <xsl:template name="component.separator">
68 <!-- ==================================================================== -->
70 <xsl:template match="d:dedication" mode="dedication">
71 <xsl:call-template name="id.warning"/>
74 <xsl:call-template name="common.html.attributes">
75 <xsl:with-param name="inherit" select="1"/>
77 <xsl:call-template name="id.attribute">
78 <xsl:with-param name="conditional" select="0"/>
80 <xsl:call-template name="dedication.titlepage"/>
81 <xsl:apply-templates/>
82 <xsl:call-template name="process.footnotes"/>
86 <xsl:template match="d:dedication/d:title|d:dedication/d:info/d:title" mode="titlepage.mode" priority="2">
87 <xsl:call-template name="component.title">
88 <xsl:with-param name="node" select="ancestor::d:dedication[1]"/>
92 <xsl:template match="d:dedication/d:subtitle|d:dedication/d:info/d:subtitle" mode="titlepage.mode" priority="2">
93 <xsl:call-template name="component.subtitle">
94 <xsl:with-param name="node" select="ancestor::d:dedication[1]"/>
98 <xsl:template match="d:dedication"/> <!-- see mode="dedication" -->
99 <xsl:template match="d:dedication/d:title"/>
100 <xsl:template match="d:dedication/d:subtitle"/>
101 <xsl:template match="d:dedication/d:titleabbrev"/>
103 <!-- ==================================================================== -->
105 <xsl:template match="d:acknowledgements" mode="acknowledgements">
106 <xsl:call-template name="id.warning"/>
109 <xsl:call-template name="common.html.attributes">
110 <xsl:with-param name="inherit" select="1"/>
112 <xsl:call-template name="id.attribute">
113 <xsl:with-param name="conditional" select="0"/>
115 <xsl:call-template name="acknowledgements.titlepage"/>
116 <xsl:apply-templates/>
117 <xsl:call-template name="process.footnotes"/>
121 <xsl:template match="d:acknowledgements/d:title|d:acknowledgements/d:info/d:title" mode="titlepage.mode" priority="2">
122 <xsl:call-template name="component.title">
123 <xsl:with-param name="node" select="ancestor::d:acknowledgements[1]"/>
127 <xsl:template match="d:acknowledgements/d:subtitle|d:acknowledgements/d:info/d:subtitle" mode="titlepage.mode" priority="2">
128 <xsl:call-template name="component.subtitle">
129 <xsl:with-param name="node" select="ancestor::d:acknowledgements[1]"/>
133 <xsl:template match="d:acknowledgements"/> <!-- see mode="acknowledgements" -->
134 <xsl:template match="d:acknowledgements/d:title"/>
135 <xsl:template match="d:acknowledgements/d:subtitle"/>
136 <xsl:template match="d:acknowledgements/d:titleabbrev"/>
138 <!-- ==================================================================== -->
140 <xsl:template match="d:colophon">
141 <xsl:call-template name="id.warning"/>
144 <xsl:call-template name="common.html.attributes">
145 <xsl:with-param name="inherit" select="1"/>
147 <xsl:call-template name="id.attribute">
148 <xsl:with-param name="conditional" select="0"/>
151 <xsl:call-template name="component.separator"/>
152 <xsl:call-template name="component.title"/>
153 <xsl:call-template name="component.subtitle"/>
155 <xsl:apply-templates/>
156 <xsl:call-template name="process.footnotes"/>
160 <xsl:template match="d:colophon/d:title"/>
161 <xsl:template match="d:colophon/d:subtitle"/>
162 <xsl:template match="d:colophon/d:titleabbrev"/>
164 <!-- ==================================================================== -->
166 <xsl:template match="d:preface">
167 <xsl:call-template name="id.warning"/>
169 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
170 <xsl:call-template name="common.html.attributes">
171 <xsl:with-param name="inherit" select="1"/>
173 <xsl:call-template name="id.attribute">
174 <xsl:with-param name="conditional" select="0"/>
177 <xsl:call-template name="component.separator"/>
178 <xsl:call-template name="preface.titlepage"/>
180 <xsl:variable name="toc.params">
181 <xsl:call-template name="find.path.params">
182 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
186 <xsl:if test="contains($toc.params, 'toc')">
187 <xsl:call-template name="component.toc">
188 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
190 <xsl:call-template name="component.toc.separator"/>
192 <xsl:apply-templates/>
193 <xsl:call-template name="process.footnotes"/>
197 <xsl:template match="d:preface/d:title" mode="titlepage.mode" priority="2">
198 <xsl:call-template name="component.title">
199 <xsl:with-param name="node" select="ancestor::d:preface[1]"/>
203 <xsl:template match="d:preface/d:subtitle |d:preface/d:prefaceinfo/d:subtitle |d:preface/d:info/d:subtitle |d:preface/d:docinfo/d:subtitle" mode="titlepage.mode" priority="2">
204 <xsl:call-template name="component.subtitle">
205 <xsl:with-param name="node" select="ancestor::d:preface[1]"/>
209 <xsl:template match="d:preface/d:docinfo|d:prefaceinfo"/>
210 <xsl:template match="d:preface/d:info"/>
211 <xsl:template match="d:preface/d:title"/>
212 <xsl:template match="d:preface/d:titleabbrev"/>
213 <xsl:template match="d:preface/d:subtitle"/>
215 <!-- ==================================================================== -->
217 <xsl:template match="d:chapter">
218 <xsl:call-template name="id.warning"/>
220 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
221 <xsl:call-template name="common.html.attributes">
222 <xsl:with-param name="inherit" select="1"/>
224 <xsl:call-template name="id.attribute">
225 <xsl:with-param name="conditional" select="0"/>
228 <xsl:call-template name="component.separator"/>
229 <xsl:call-template name="chapter.titlepage"/>
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)"/>
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')"/>
240 <xsl:call-template name="component.toc.separator"/>
242 <xsl:apply-templates/>
243 <xsl:call-template name="process.footnotes"/>
247 <xsl:template match="d:chapter/d:title|d:chapter/d:chapterinfo/d:title|d:chapter/d:info/d:title" mode="titlepage.mode" priority="2">
248 <xsl:call-template name="component.title">
249 <xsl:with-param name="node" select="ancestor::d:chapter[1]"/>
253 <xsl:template match="d:chapter/d:subtitle |d:chapter/d:chapterinfo/d:subtitle |d:chapter/d:info/d:subtitle |d:chapter/d:docinfo/d:subtitle" mode="titlepage.mode" priority="2">
254 <xsl:call-template name="component.subtitle">
255 <xsl:with-param name="node" select="ancestor::d:chapter[1]"/>
259 <xsl:template match="d:chapter/d:docinfo|d:chapterinfo"/>
260 <xsl:template match="d:chapter/d:info"/>
261 <xsl:template match="d:chapter/d:title"/>
262 <xsl:template match="d:chapter/d:titleabbrev"/>
263 <xsl:template match="d:chapter/d:subtitle"/>
265 <!-- ==================================================================== -->
267 <xsl:template match="d:appendix">
268 <xsl:variable name="ischunk">
269 <xsl:call-template name="chunk"/>
272 <xsl:call-template name="id.warning"/>
274 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
275 <xsl:call-template name="common.html.attributes">
276 <xsl:with-param name="inherit" select="1"/>
278 <xsl:call-template name="id.attribute">
279 <xsl:with-param name="conditional" select="0"/>
283 <xsl:when test="parent::d:article and $ischunk = 0">
284 <xsl:call-template name="section.heading">
285 <xsl:with-param name="level" select="1"/>
286 <xsl:with-param name="title">
287 <xsl:apply-templates select="." mode="object.title.markup"/>
292 <xsl:call-template name="component.separator"/>
293 <xsl:call-template name="appendix.titlepage"/>
297 <xsl:variable name="toc.params">
298 <xsl:call-template name="find.path.params">
299 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
303 <xsl:if test="contains($toc.params, 'toc')">
304 <xsl:call-template name="component.toc">
305 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
307 <xsl:call-template name="component.toc.separator"/>
310 <xsl:apply-templates/>
312 <xsl:if test="not(parent::d:article) or $ischunk != 0">
313 <xsl:call-template name="process.footnotes"/>
318 <xsl:template match="d:appendix/d:title|d:appendix/d:appendixinfo/d:title" mode="titlepage.mode" priority="2">
319 <xsl:call-template name="component.title">
320 <xsl:with-param name="node" select="ancestor::d:appendix[1]"/>
324 <xsl:template match="d:appendix/d:subtitle |d:appendix/d:appendixinfo/d:subtitle |d:appendix/d:info/d:subtitle |d:appendix/d:docinfo/d:subtitle" mode="titlepage.mode" priority="2">
325 <xsl:call-template name="component.subtitle">
326 <xsl:with-param name="node" select="ancestor::d:appendix[1]"/>
330 <xsl:template match="d:appendix/d:docinfo|d:appendixinfo"/>
331 <xsl:template match="d:appendix/d:info"/>
332 <xsl:template match="d:appendix/d:title"/>
333 <xsl:template match="d:appendix/d:titleabbrev"/>
334 <xsl:template match="d:appendix/d:subtitle"/>
336 <!-- ==================================================================== -->
338 <xsl:template match="d:article">
339 <xsl:call-template name="id.warning"/>
341 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
342 <xsl:call-template name="common.html.attributes">
343 <xsl:with-param name="inherit" select="1"/>
345 <xsl:call-template name="id.attribute">
346 <xsl:with-param name="conditional" select="0"/>
349 <xsl:call-template name="article.titlepage"/>
351 <xsl:variable name="toc.params">
352 <xsl:call-template name="find.path.params">
353 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
357 <xsl:call-template name="make.lots">
358 <xsl:with-param name="toc.params" select="$toc.params"/>
359 <xsl:with-param name="toc">
360 <xsl:call-template name="component.toc">
361 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
366 <xsl:apply-templates/>
367 <xsl:call-template name="process.footnotes"/>
371 <xsl:template match="d:article/d:title|d:article/d:articleinfo/d:title" mode="titlepage.mode" priority="2">
372 <xsl:call-template name="component.title">
373 <xsl:with-param name="node" select="ancestor::d:article[1]"/>
377 <xsl:template match="d:article/d:subtitle |d:article/d:articleinfo/d:subtitle |d:article/d:info/d:subtitle |d:article/d:artheader/d:subtitle" mode="titlepage.mode" priority="2">
378 <xsl:call-template name="component.subtitle">
379 <xsl:with-param name="node" select="ancestor::d:article[1]"/>
383 <xsl:template match="d:article/d:artheader|d:article/d:articleinfo"/>
384 <xsl:template match="d:article/d:info"/>
385 <xsl:template match="d:article/d:title"/>
386 <xsl:template match="d:article/d:titleabbrev"/>
387 <xsl:template match="d:article/d:subtitle"/>
389 <!-- ==================================================================== -->
391 <xsl:template match="d:topic">
392 <xsl:call-template name="id.warning"/>
394 <xsl:element name="{$div.element}" namespace="http://www.w3.org/1999/xhtml">
395 <xsl:call-template name="common.html.attributes">
396 <xsl:with-param name="inherit" select="1"/>
398 <xsl:call-template name="id.attribute">
399 <xsl:with-param name="conditional" select="0"/>
402 <xsl:call-template name="topic.titlepage"/>
404 <xsl:variable name="toc.params">
405 <xsl:call-template name="find.path.params">
406 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
410 <xsl:apply-templates/>
412 <xsl:call-template name="process.footnotes"/>
416 <xsl:template match="d:topic/d:title|d:topic/d:info/d:title" mode="titlepage.mode" priority="2">
417 <xsl:call-template name="component.title">
418 <xsl:with-param name="node" select="ancestor::d:topic[1]"/>
422 <xsl:template match="d:topic/d:subtitle |d:topic/d:info/d:subtitle" mode="titlepage.mode" priority="2">
423 <xsl:call-template name="component.subtitle">
424 <xsl:with-param name="node" select="ancestor::d:topic[1]"/>
428 <xsl:template match="d:topic/d:info"/>
429 <xsl:template match="d:topic/d:title"/>
430 <xsl:template match="d:topic/d:titleabbrev"/>
431 <xsl:template match="d:topic/d:subtitle"/>