1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 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:call-template name="anchor">
41 <xsl:with-param name="node" select="$node"/>
42 <xsl:with-param name="conditional" select="0"/>
44 <xsl:apply-templates select="$node" mode="object.title.markup">
45 <xsl:with-param name="allow-anchors" select="1"/>
46 </xsl:apply-templates>
50 <xsl:template name="component.subtitle">
51 <xsl:param name="node" select="."/>
52 <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]"/>
54 <xsl:if test="$subtitle">
57 <xsl:apply-templates select="$node" mode="object.subtitle.markup"/>
63 <xsl:template name="component.separator">
66 <!-- ==================================================================== -->
68 <xsl:template match="dedication" mode="dedication">
69 <div class="{name(.)}">
70 <xsl:call-template name="language.attribute"/>
71 <xsl:call-template name="dedication.titlepage"/>
72 <xsl:apply-templates/>
73 <xsl:call-template name="process.footnotes"/>
77 <xsl:template match="dedication/title" mode="titlepage.mode" priority="2">
78 <xsl:call-template name="component.title">
79 <xsl:with-param name="node" select="ancestor::dedication[1]"/>
83 <xsl:template match="dedication/subtitle" mode="titlepage.mode" priority="2">
84 <xsl:call-template name="component.subtitle">
85 <xsl:with-param name="node" select="ancestor::dedication[1]"/>
89 <xsl:template match="dedication"/> <!-- see mode="dedication" -->
90 <xsl:template match="dedication/title"/>
91 <xsl:template match="dedication/subtitle"/>
92 <xsl:template match="dedication/titleabbrev"/>
94 <!-- ==================================================================== -->
96 <xsl:template match="colophon">
97 <div class="{name(.)}">
98 <xsl:call-template name="language.attribute"/>
99 <xsl:if test="$generate.id.attributes != 0">
100 <xsl:attribute name="id">
101 <xsl:call-template name="object.id"/>
105 <xsl:call-template name="component.separator"/>
106 <xsl:call-template name="component.title"/>
107 <xsl:call-template name="component.subtitle"/>
109 <xsl:apply-templates/>
110 <xsl:call-template name="process.footnotes"/>
114 <xsl:template match="colophon/title"/>
115 <xsl:template match="colophon/subtitle"/>
116 <xsl:template match="colophon/titleabbrev"/>
118 <!-- ==================================================================== -->
120 <xsl:template match="preface">
121 <div class="{name(.)}">
122 <xsl:call-template name="language.attribute"/>
123 <xsl:if test="$generate.id.attributes != 0">
124 <xsl:attribute name="id">
125 <xsl:call-template name="object.id"/>
129 <xsl:call-template name="component.separator"/>
130 <xsl:call-template name="preface.titlepage"/>
132 <xsl:variable name="toc.params">
133 <xsl:call-template name="find.path.params">
134 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
138 <xsl:if test="contains($toc.params, 'toc')">
139 <xsl:call-template name="component.toc">
140 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
142 <xsl:call-template name="component.toc.separator"/>
144 <xsl:apply-templates/>
145 <xsl:call-template name="process.footnotes"/>
149 <xsl:template match="preface/title" mode="titlepage.mode" priority="2">
150 <xsl:call-template name="component.title">
151 <xsl:with-param name="node" select="ancestor::preface[1]"/>
155 <xsl:template match="preface/subtitle |preface/prefaceinfo/subtitle |preface/info/subtitle |preface/docinfo/subtitle" mode="titlepage.mode" priority="2">
156 <xsl:call-template name="component.subtitle">
157 <xsl:with-param name="node" select="ancestor::preface[1]"/>
161 <xsl:template match="preface/docinfo|prefaceinfo"/>
162 <xsl:template match="preface/title"/>
163 <xsl:template match="preface/titleabbrev"/>
164 <xsl:template match="preface/subtitle"/>
166 <!-- ==================================================================== -->
168 <xsl:template match="chapter">
169 <div class="{name(.)}">
170 <xsl:call-template name="language.attribute"/>
171 <xsl:if test="$generate.id.attributes != 0">
172 <xsl:attribute name="id">
173 <xsl:call-template name="object.id"/>
177 <xsl:call-template name="component.separator"/>
178 <xsl:call-template name="chapter.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)"/>
185 <xsl:if test="contains($toc.params, 'toc')">
186 <xsl:call-template name="component.toc">
187 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
189 <xsl:call-template name="component.toc.separator"/>
191 <xsl:apply-templates/>
192 <xsl:call-template name="process.footnotes"/>
196 <xsl:template match="chapter/title" mode="titlepage.mode" priority="2">
197 <xsl:call-template name="component.title">
198 <xsl:with-param name="node" select="ancestor::chapter[1]"/>
202 <xsl:template match="chapter/subtitle |chapter/chapterinfo/subtitle |chapter/info/subtitle |chapter/docinfo/subtitle" mode="titlepage.mode" priority="2">
203 <xsl:call-template name="component.subtitle">
204 <xsl:with-param name="node" select="ancestor::chapter[1]"/>
208 <xsl:template match="chapter/docinfo|chapterinfo"/>
209 <xsl:template match="chapter/title"/>
210 <xsl:template match="chapter/titleabbrev"/>
211 <xsl:template match="chapter/subtitle"/>
213 <!-- ==================================================================== -->
215 <xsl:template match="appendix">
216 <xsl:variable name="ischunk">
217 <xsl:call-template name="chunk"/>
220 <div class="{name(.)}">
221 <xsl:call-template name="language.attribute"/>
222 <xsl:if test="$generate.id.attributes != 0">
223 <xsl:attribute name="id">
224 <xsl:call-template name="object.id"/>
229 <xsl:when test="parent::article and $ischunk = 0">
230 <xsl:call-template name="section.heading">
231 <xsl:with-param name="level" select="1"/>
232 <xsl:with-param name="title">
233 <xsl:apply-templates select="." mode="object.title.markup"/>
238 <xsl:call-template name="component.separator"/>
239 <xsl:call-template name="appendix.titlepage"/>
243 <xsl:variable name="toc.params">
244 <xsl:call-template name="find.path.params">
245 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
249 <xsl:if test="contains($toc.params, 'toc')">
250 <xsl:call-template name="component.toc">
251 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
253 <xsl:call-template name="component.toc.separator"/>
256 <xsl:apply-templates/>
258 <xsl:if test="not(parent::article) or $ischunk != 0">
259 <xsl:call-template name="process.footnotes"/>
264 <xsl:template match="appendix/title" mode="titlepage.mode" priority="2">
265 <xsl:call-template name="component.title">
266 <xsl:with-param name="node" select="ancestor::appendix[1]"/>
270 <xsl:template match="appendix/subtitle |appendix/appendixinfo/subtitle |appendix/info/subtitle |appendix/docinfo/subtitle" mode="titlepage.mode" priority="2">
271 <xsl:call-template name="component.subtitle">
272 <xsl:with-param name="node" select="ancestor::appendix[1]"/>
276 <xsl:template match="appendix/docinfo|appendixinfo"/>
277 <xsl:template match="appendix/title"/>
278 <xsl:template match="appendix/titleabbrev"/>
279 <xsl:template match="appendix/subtitle"/>
281 <!-- ==================================================================== -->
283 <xsl:template match="article">
284 <div class="{name(.)}">
285 <xsl:call-template name="language.attribute"/>
286 <xsl:if test="$generate.id.attributes != 0">
287 <xsl:attribute name="id">
288 <xsl:call-template name="object.id"/>
292 <xsl:call-template name="article.titlepage"/>
294 <xsl:variable name="toc.params">
295 <xsl:call-template name="find.path.params">
296 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
300 <xsl:call-template name="make.lots">
301 <xsl:with-param name="toc.params" select="$toc.params"/>
302 <xsl:with-param name="toc">
303 <xsl:call-template name="component.toc">
304 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
309 <xsl:apply-templates/>
310 <xsl:call-template name="process.footnotes"/>
314 <xsl:template match="article/title" mode="titlepage.mode" priority="2">
315 <xsl:call-template name="component.title">
316 <xsl:with-param name="node" select="ancestor::article[1]"/>
320 <xsl:template match="article/subtitle |article/articleinfo/subtitle |article/info/subtitle |article/artheader/subtitle" mode="titlepage.mode" priority="2">
321 <xsl:call-template name="component.subtitle">
322 <xsl:with-param name="node" select="ancestor::article[1]"/>
326 <xsl:template match="article/artheader|article/articleinfo"/>
327 <xsl:template match="article/title"/>
328 <xsl:template match="article/titleabbrev"/>
329 <xsl:template match="article/subtitle"/>
331 <!-- ==================================================================== -->