source: BOOK/stylesheets/lfs-xsl/docbook-xsl-snapshot/xhtml/component.xsl@ 834692e

clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 834692e was f8c4e94, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added LFS XSL Stylesheets.

  • Property mode set to 100644
File size: 13.6 KB
Line 
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$
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:apply-templates select="." mode="class.attribute"/>
75 <xsl:call-template name="dir">
76 <xsl:with-param name="inherit" select="1"/>
77 </xsl:call-template>
78 <xsl:call-template name="language.attribute"/>
79 <xsl:call-template name="dedication.titlepage"/>
80 <xsl:apply-templates/>
81 <xsl:call-template name="process.footnotes"/>
82 </div>
83</xsl:template>
84
85<xsl:template match="dedication/title|dedication/info/title" mode="titlepage.mode" priority="2">
86 <xsl:call-template name="component.title">
87 <xsl:with-param name="node" select="ancestor::dedication[1]"/>
88 </xsl:call-template>
89</xsl:template>
90
91<xsl:template match="dedication/subtitle|dedication/info/subtitle" mode="titlepage.mode" priority="2">
92 <xsl:call-template name="component.subtitle">
93 <xsl:with-param name="node" select="ancestor::dedication[1]"/>
94 </xsl:call-template>
95</xsl:template>
96
97<xsl:template match="dedication"/> <!-- see mode="dedication" -->
98<xsl:template match="dedication/title"/>
99<xsl:template match="dedication/subtitle"/>
100<xsl:template match="dedication/titleabbrev"/>
101
102<!-- ==================================================================== -->
103
104<xsl:template match="colophon">
105 <xsl:call-template name="id.warning"/>
106
107 <div>
108 <xsl:apply-templates select="." mode="class.attribute"/>
109 <xsl:call-template name="dir">
110 <xsl:with-param name="inherit" select="1"/>
111 </xsl:call-template>
112 <xsl:call-template name="language.attribute"/>
113 <xsl:if test="$generate.id.attributes != 0">
114 <xsl:attribute name="id">
115 <xsl:call-template name="object.id"/>
116 </xsl:attribute>
117 </xsl:if>
118
119 <xsl:call-template name="component.separator"/>
120 <xsl:call-template name="component.title"/>
121 <xsl:call-template name="component.subtitle"/>
122
123 <xsl:apply-templates/>
124 <xsl:call-template name="process.footnotes"/>
125 </div>
126</xsl:template>
127
128<xsl:template match="colophon/title"/>
129<xsl:template match="colophon/subtitle"/>
130<xsl:template match="colophon/titleabbrev"/>
131
132<!-- ==================================================================== -->
133
134<xsl:template match="preface">
135 <xsl:call-template name="id.warning"/>
136
137 <div>
138 <xsl:apply-templates select="." mode="class.attribute"/>
139 <xsl:call-template name="dir">
140 <xsl:with-param name="inherit" select="1"/>
141 </xsl:call-template>
142 <xsl:call-template name="language.attribute"/>
143 <xsl:if test="$generate.id.attributes != 0">
144 <xsl:attribute name="id">
145 <xsl:call-template name="object.id"/>
146 </xsl:attribute>
147 </xsl:if>
148
149 <xsl:call-template name="component.separator"/>
150 <xsl:call-template name="preface.titlepage"/>
151
152 <xsl:variable name="toc.params">
153 <xsl:call-template name="find.path.params">
154 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
155 </xsl:call-template>
156 </xsl:variable>
157
158 <xsl:if test="contains($toc.params, 'toc')">
159 <xsl:call-template name="component.toc">
160 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
161 </xsl:call-template>
162 <xsl:call-template name="component.toc.separator"/>
163 </xsl:if>
164 <xsl:apply-templates/>
165 <xsl:call-template name="process.footnotes"/>
166 </div>
167</xsl:template>
168
169<xsl:template match="preface/title" mode="titlepage.mode" priority="2">
170 <xsl:call-template name="component.title">
171 <xsl:with-param name="node" select="ancestor::preface[1]"/>
172 </xsl:call-template>
173</xsl:template>
174
175<xsl:template match="preface/subtitle |preface/prefaceinfo/subtitle |preface/info/subtitle |preface/docinfo/subtitle" mode="titlepage.mode" priority="2">
176 <xsl:call-template name="component.subtitle">
177 <xsl:with-param name="node" select="ancestor::preface[1]"/>
178 </xsl:call-template>
179</xsl:template>
180
181<xsl:template match="preface/docinfo|prefaceinfo"/>
182<xsl:template match="preface/info"/>
183<xsl:template match="preface/title"/>
184<xsl:template match="preface/titleabbrev"/>
185<xsl:template match="preface/subtitle"/>
186
187<!-- ==================================================================== -->
188
189<xsl:template match="chapter">
190 <xsl:call-template name="id.warning"/>
191
192 <div>
193 <xsl:apply-templates select="." mode="class.attribute"/>
194 <xsl:call-template name="dir">
195 <xsl:with-param name="inherit" select="1"/>
196 </xsl:call-template>
197 <xsl:call-template name="language.attribute"/>
198 <xsl:if test="$generate.id.attributes != 0">
199 <xsl:attribute name="id">
200 <xsl:call-template name="object.id"/>
201 </xsl:attribute>
202 </xsl:if>
203
204 <xsl:call-template name="component.separator"/>
205 <xsl:call-template name="chapter.titlepage"/>
206
207 <xsl:variable name="toc.params">
208 <xsl:call-template name="find.path.params">
209 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
210 </xsl:call-template>
211 </xsl:variable>
212 <xsl:if test="contains($toc.params, 'toc')">
213 <xsl:call-template name="component.toc">
214 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
215 </xsl:call-template>
216 <xsl:call-template name="component.toc.separator"/>
217 </xsl:if>
218 <xsl:apply-templates/>
219 <xsl:call-template name="process.footnotes"/>
220 </div>
221</xsl:template>
222
223<xsl:template match="chapter/title" mode="titlepage.mode" priority="2">
224 <xsl:call-template name="component.title">
225 <xsl:with-param name="node" select="ancestor::chapter[1]"/>
226 </xsl:call-template>
227</xsl:template>
228
229<xsl:template match="chapter/subtitle |chapter/chapterinfo/subtitle |chapter/info/subtitle |chapter/docinfo/subtitle" mode="titlepage.mode" priority="2">
230 <xsl:call-template name="component.subtitle">
231 <xsl:with-param name="node" select="ancestor::chapter[1]"/>
232 </xsl:call-template>
233</xsl:template>
234
235<xsl:template match="chapter/docinfo|chapterinfo"/>
236<xsl:template match="chapter/info"/>
237<xsl:template match="chapter/title"/>
238<xsl:template match="chapter/titleabbrev"/>
239<xsl:template match="chapter/subtitle"/>
240
241<!-- ==================================================================== -->
242
243<xsl:template match="appendix">
244 <xsl:variable name="ischunk">
245 <xsl:call-template name="chunk"/>
246 </xsl:variable>
247
248 <xsl:call-template name="id.warning"/>
249
250 <div>
251 <xsl:apply-templates select="." mode="class.attribute"/>
252 <xsl:call-template name="dir">
253 <xsl:with-param name="inherit" select="1"/>
254 </xsl:call-template>
255 <xsl:call-template name="language.attribute"/>
256 <xsl:if test="$generate.id.attributes != 0">
257 <xsl:attribute name="id">
258 <xsl:call-template name="object.id"/>
259 </xsl:attribute>
260 </xsl:if>
261
262 <xsl:choose>
263 <xsl:when test="parent::article and $ischunk = 0">
264 <xsl:call-template name="section.heading">
265 <xsl:with-param name="level" select="1"/>
266 <xsl:with-param name="title">
267 <xsl:apply-templates select="." mode="object.title.markup"/>
268 </xsl:with-param>
269 </xsl:call-template>
270 </xsl:when>
271 <xsl:otherwise>
272 <xsl:call-template name="component.separator"/>
273 <xsl:call-template name="appendix.titlepage"/>
274 </xsl:otherwise>
275 </xsl:choose>
276
277 <xsl:variable name="toc.params">
278 <xsl:call-template name="find.path.params">
279 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
280 </xsl:call-template>
281 </xsl:variable>
282
283 <xsl:if test="contains($toc.params, 'toc')">
284 <xsl:call-template name="component.toc">
285 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
286 </xsl:call-template>
287 <xsl:call-template name="component.toc.separator"/>
288 </xsl:if>
289
290 <xsl:apply-templates/>
291
292 <xsl:if test="not(parent::article) or $ischunk != 0">
293 <xsl:call-template name="process.footnotes"/>
294 </xsl:if>
295 </div>
296</xsl:template>
297
298<xsl:template match="appendix/title" mode="titlepage.mode" priority="2">
299 <xsl:call-template name="component.title">
300 <xsl:with-param name="node" select="ancestor::appendix[1]"/>
301 </xsl:call-template>
302</xsl:template>
303
304<xsl:template match="appendix/subtitle |appendix/appendixinfo/subtitle |appendix/info/subtitle |appendix/docinfo/subtitle" mode="titlepage.mode" priority="2">
305 <xsl:call-template name="component.subtitle">
306 <xsl:with-param name="node" select="ancestor::appendix[1]"/>
307 </xsl:call-template>
308</xsl:template>
309
310<xsl:template match="appendix/docinfo|appendixinfo"/>
311<xsl:template match="appendix/info"/>
312<xsl:template match="appendix/title"/>
313<xsl:template match="appendix/titleabbrev"/>
314<xsl:template match="appendix/subtitle"/>
315
316<!-- ==================================================================== -->
317
318<xsl:template match="article">
319 <xsl:call-template name="id.warning"/>
320
321 <div>
322 <xsl:apply-templates select="." mode="class.attribute"/>
323 <xsl:call-template name="dir">
324 <xsl:with-param name="inherit" select="1"/>
325 </xsl:call-template>
326 <xsl:call-template name="language.attribute"/>
327 <xsl:if test="$generate.id.attributes != 0">
328 <xsl:attribute name="id">
329 <xsl:call-template name="object.id"/>
330 </xsl:attribute>
331 </xsl:if>
332
333 <xsl:call-template name="article.titlepage"/>
334
335 <xsl:variable name="toc.params">
336 <xsl:call-template name="find.path.params">
337 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
338 </xsl:call-template>
339 </xsl:variable>
340
341 <xsl:call-template name="make.lots">
342 <xsl:with-param name="toc.params" select="$toc.params"/>
343 <xsl:with-param name="toc">
344 <xsl:call-template name="component.toc">
345 <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
346 </xsl:call-template>
347 </xsl:with-param>
348 </xsl:call-template>
349
350 <xsl:apply-templates/>
351 <xsl:call-template name="process.footnotes"/>
352 </div>
353</xsl:template>
354
355<xsl:template match="article/title|article/articleinfo/title" mode="titlepage.mode" priority="2">
356 <xsl:call-template name="component.title">
357 <xsl:with-param name="node" select="ancestor::article[1]"/>
358 </xsl:call-template>
359</xsl:template>
360
361<xsl:template match="article/subtitle |article/articleinfo/subtitle |article/info/subtitle |article/artheader/subtitle" mode="titlepage.mode" priority="2">
362 <xsl:call-template name="component.subtitle">
363 <xsl:with-param name="node" select="ancestor::article[1]"/>
364 </xsl:call-template>
365</xsl:template>
366
367<xsl:template match="article/artheader|article/articleinfo"/>
368<xsl:template match="article/info"/>
369<xsl:template match="article/title"/>
370<xsl:template match="article/titleabbrev"/>
371<xsl:template match="article/subtitle"/>
372
373<!-- ==================================================================== -->
374
375</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.