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 8568 2010-01-11 03:16:56Z 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 <xsl:template name="component.title">
19 <xsl:param name="node" select="."/>
21 <xsl:variable name="level">
23 <xsl:when test="ancestor::section">
24 <xsl:value-of select="count(ancestor::section)+1"/>
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>
35 <!-- Let's handle the case where a component (bibliography, for example)
36 occurs inside a section; will we need parameters for this? -->
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"/>
46 <xsl:apply-templates select="$node" mode="object.title.markup">
47 <xsl:with-param name="allow-anchors" select="1"/>
48 </xsl:apply-templates>
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]"/>
56 <xsl:if test="$subtitle">
58 <em xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
59 <xsl:apply-templates select="$node" mode="object.subtitle.markup"/>
65 <xsl:template name="component.separator">
68 <!-- ==================================================================== -->
70 <xsl:template match="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="dedication.titlepage"/>
78 <xsl:apply-templates/>
79 <xsl:call-template name="process.footnotes"/>
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]"/>
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]"/>
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"/>
100 <!-- ==================================================================== -->
102 <xsl:template match="acknowledgements" mode="acknowledgements">
103 <xsl:call-template name="id.warning"/>
106 <xsl:call-template name="common.html.attributes">
107 <xsl:with-param name="inherit" select="1"/>
109 <xsl:call-template name="acknowledgements.titlepage"/>
110 <xsl:apply-templates/>
111 <xsl:call-template name="process.footnotes"/>
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]"/>
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]"/>
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"/>
132 <!-- ==================================================================== -->
134 <xsl:template match="colophon">
135 <xsl:call-template name="id.warning"/>
138 <xsl:call-template name="common.html.attributes">
139 <xsl:with-param name="inherit" select="1"/>
141 <xsl:if test="$generate.id.attributes != 0">
142 <xsl:attribute name="id">
143 <xsl:call-template name="object.id"/>
147 <xsl:call-template name="component.separator"/>
148 <xsl:call-template name="component.title"/>
149 <xsl:call-template name="component.subtitle"/>
151 <xsl:apply-templates/>
152 <xsl:call-template name="process.footnotes"/>
156 <xsl:template match="colophon/title"/>
157 <xsl:template match="colophon/subtitle"/>
158 <xsl:template match="colophon/titleabbrev"/>
160 <!-- ==================================================================== -->
162 <xsl:template match="preface">
163 <xsl:call-template name="id.warning"/>
166 <xsl:call-template name="common.html.attributes">
167 <xsl:with-param name="inherit" select="1"/>
169 <xsl:if test="$generate.id.attributes != 0">
170 <xsl:attribute name="id">
171 <xsl:call-template name="object.id"/>
175 <xsl:call-template name="component.separator"/>
176 <xsl:call-template name="preface.titlepage"/>
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)"/>
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')"/>
188 <xsl:call-template name="component.toc.separator"/>
190 <xsl:apply-templates/>
191 <xsl:call-template name="process.footnotes"/>
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]"/>
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]"/>
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"/>
213 <!-- ==================================================================== -->
215 <xsl:template match="chapter">
216 <xsl:call-template name="id.warning"/>
219 <xsl:call-template name="common.html.attributes">
220 <xsl:with-param name="inherit" select="1"/>
222 <xsl:if test="$generate.id.attributes != 0">
223 <xsl:attribute name="id">
224 <xsl:call-template name="object.id"/>
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="chapter/title|chapter/chapterinfo/title|chapter/info/title" mode="titlepage.mode" priority="2">
248 <xsl:call-template name="component.title">
249 <xsl:with-param name="node" select="ancestor::chapter[1]"/>
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]"/>
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"/>
265 <!-- ==================================================================== -->
267 <xsl:template match="appendix">
268 <xsl:variable name="ischunk">
269 <xsl:call-template name="chunk"/>
272 <xsl:call-template name="id.warning"/>
275 <xsl:call-template name="common.html.attributes">
276 <xsl:with-param name="inherit" select="1"/>
278 <xsl:if test="$generate.id.attributes != 0">
279 <xsl:attribute name="id">
280 <xsl:call-template name="object.id"/>
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"/>
294 <xsl:call-template name="component.separator"/>
295 <xsl:call-template name="appendix.titlepage"/>
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)"/>
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')"/>
309 <xsl:call-template name="component.toc.separator"/>
312 <xsl:apply-templates/>
314 <xsl:if test="not(parent::article) or $ischunk != 0">
315 <xsl:call-template name="process.footnotes"/>
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]"/>
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]"/>
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"/>
338 <!-- ==================================================================== -->
340 <xsl:template match="article">
341 <xsl:call-template name="id.warning"/>
344 <xsl:call-template name="common.html.attributes">
345 <xsl:with-param name="inherit" select="1"/>
347 <xsl:if test="$generate.id.attributes != 0">
348 <xsl:attribute name="id">
349 <xsl:call-template name="object.id"/>
353 <xsl:call-template name="article.titlepage"/>
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)"/>
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')"/>
370 <xsl:apply-templates/>
371 <xsl:call-template name="process.footnotes"/>
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]"/>
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]"/>
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"/>
393 <!-- ==================================================================== -->