source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/profile-docbook.xsl@ 15c7d39

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 15c7d39 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 19.9 KB
Line 
1<?xml version="1.0" encoding="ASCII"?>
2<!--This file was created automatically by html2xhtml-->
3<!--from the HTML stylesheets.-->
4<!--This file was created automatically by xsl2profile-->
5<!--from the DocBook XSL stylesheets.-->
6<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exsl="http://exslt.org/common" xmlns:exslt="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="db ng exsl exslt exslt" version="1.0">
7
8<xsl:output method="xml" encoding="UTF-8" indent="no" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
9
10<!-- ********************************************************************
11 $Id: docbook.xsl 9605 2012-09-18 10:48:54Z tom_schr $
12 ********************************************************************
13
14 This file is part of the XSL DocBook Stylesheet distribution.
15 See ../README or http://docbook.sf.net/release/xsl/current/ for
16 copyright and other information.
17
18 ******************************************************************** -->
19
20<!-- ==================================================================== -->
21
22<xsl:include href="../VERSION.xsl"/>
23<xsl:include href="param.xsl"/>
24<xsl:include href="../lib/lib.xsl"/>
25<xsl:include href="../common/l10n.xsl"/>
26<xsl:include href="../common/common.xsl"/>
27<xsl:include href="../common/utility.xsl"/>
28<xsl:include href="../common/labels.xsl"/>
29<xsl:include href="../common/titles.xsl"/>
30<xsl:include href="../common/subtitles.xsl"/>
31<xsl:include href="../common/gentext.xsl"/>
32<xsl:include href="../common/targets.xsl"/>
33<xsl:include href="../common/olink.xsl"/>
34<xsl:include href="../common/pi.xsl"/>
35<xsl:include href="autotoc.xsl"/>
36<xsl:include href="autoidx.xsl"/>
37<xsl:include href="lists.xsl"/>
38<xsl:include href="callout.xsl"/>
39<xsl:include href="verbatim.xsl"/>
40<xsl:include href="graphics.xsl"/>
41<xsl:include href="xref.xsl"/>
42<xsl:include href="formal.xsl"/>
43<xsl:include href="table.xsl"/>
44<xsl:include href="htmltbl.xsl"/>
45<xsl:include href="sections.xsl"/>
46<xsl:include href="inline.xsl"/>
47<xsl:include href="footnote.xsl"/>
48<xsl:include href="html.xsl"/>
49<xsl:include href="info.xsl"/>
50<xsl:include href="keywords.xsl"/>
51<xsl:include href="division.xsl"/>
52<xsl:include href="toc.xsl"/>
53<xsl:include href="index.xsl"/>
54<xsl:include href="refentry.xsl"/>
55<xsl:include href="math.xsl"/>
56<xsl:include href="admon.xsl"/>
57<xsl:include href="component.xsl"/>
58<xsl:include href="biblio.xsl"/>
59<xsl:include href="biblio-iso690.xsl"/>
60<xsl:include href="glossary.xsl"/>
61<xsl:include href="block.xsl"/>
62<xsl:include href="task.xsl"/>
63<xsl:include href="qandaset.xsl"/>
64<xsl:include href="synop.xsl"/>
65<xsl:include href="titlepage.xsl"/>
66<xsl:include href="titlepage.templates.xsl"/>
67<xsl:include href="pi.xsl"/>
68<xsl:include href="ebnf.xsl"/>
69<xsl:include href="chunker.xsl"/>
70<xsl:include href="html-rtf.xsl"/>
71<xsl:include href="annotations.xsl"/>
72<xsl:include href="../common/stripns.xsl"/>
73
74<xsl:param name="stylesheet.result.type" select="'xhtml'"/>
75<xsl:param name="htmlhelp.output" select="0"/>
76
77<!-- ==================================================================== -->
78
79<xsl:key name="id" match="*" use="@id|@xml:id"/>
80<xsl:key name="gid" match="*" use="generate-id()"/>
81
82<!-- ==================================================================== -->
83
84<xsl:template match="*">
85 <xsl:message>
86 <xsl:text>Element </xsl:text>
87 <xsl:value-of select="local-name(.)"/>
88 <xsl:text> in namespace '</xsl:text>
89 <xsl:value-of select="namespace-uri(.)"/>
90 <xsl:text>' encountered</xsl:text>
91 <xsl:if test="parent::*">
92 <xsl:text> in </xsl:text>
93 <xsl:value-of select="name(parent::*)"/>
94 </xsl:if>
95 <xsl:text>, but no template matches.</xsl:text>
96 </xsl:message>
97
98 <span style="color: red">
99 <xsl:text>&lt;</xsl:text>
100 <xsl:value-of select="name(.)"/>
101 <xsl:text>&gt;</xsl:text>
102 <xsl:apply-templates/>
103 <xsl:text>&lt;/</xsl:text>
104 <xsl:value-of select="name(.)"/>
105 <xsl:text>&gt;</xsl:text>
106 </span>
107</xsl:template>
108
109<xsl:template match="text()">
110 <xsl:value-of select="."/>
111</xsl:template>
112
113<xsl:template name="body.attributes"><xslo:if xmlns:xslo="http://www.w3.org/1999/XSL/Transform" test="starts-with($writing.mode, 'rl')"><xslo:attribute name="dir">rtl</xslo:attribute></xslo:if>
114<!-- no apply-templates; make it empty except for dir for rtl-->
115</xsl:template>
116
117<xsl:template name="head.content.base">
118 <xsl:param name="node" select="."/>
119 <base href="{$html.base}"/>
120</xsl:template>
121
122<xsl:template name="head.content.abstract">
123 <xsl:param name="node" select="."/>
124 <xsl:variable name="info" select="(articleinfo |bookinfo |prefaceinfo |chapterinfo |appendixinfo |sectioninfo |sect1info |sect2info |sect3info |sect4info |sect5info |referenceinfo |refentryinfo |partinfo |info |docinfo)[1]"/>
125 <xsl:if test="$info and $info/abstract">
126 <meta name="description">
127 <xsl:attribute name="content">
128 <xsl:for-each select="$info/abstract[1]/*">
129 <xsl:value-of select="normalize-space(.)"/>
130 <xsl:if test="position() &lt; last()">
131 <xsl:text> </xsl:text>
132 </xsl:if>
133 </xsl:for-each>
134 </xsl:attribute>
135 </meta>
136 </xsl:if>
137</xsl:template>
138
139<xsl:template name="head.content.link.made">
140 <xsl:param name="node" select="."/>
141
142 <link rev="made" href="{$link.mailto.url}"/>
143</xsl:template>
144
145<xsl:template name="head.content.generator">
146 <xsl:param name="node" select="."/>
147 <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
148</xsl:template>
149
150<xsl:template name="head.content.style">
151 <xsl:param name="node" select="."/>
152 <style type="text/css"><xsl:text>
153body { background-image: url('</xsl:text>
154<xsl:value-of select="$draft.watermark.image"/><xsl:text>');
155 background-repeat: no-repeat;
156 background-position: top left;
157 /* The following properties make the watermark "fixed" on the page. */
158 /* I think that's just a bit too distracting for the reader... */
159 /* background-attachment: fixed; */
160 /* background-position: center center; */
161 }</xsl:text>
162 </style>
163</xsl:template>
164
165<xsl:template name="head.content">
166 <xsl:param name="node" select="."/>
167 <xsl:param name="title">
168 <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
169 </xsl:param>
170
171 <xsl:call-template name="user.head.title">
172 <xsl:with-param name="title" select="$title"/>
173 <xsl:with-param name="node" select="$node"/>
174 </xsl:call-template>
175
176 <xsl:if test="$html.base != ''">
177 <xsl:call-template name="head.content.base">
178 <xsl:with-param name="node" select="$node"/>
179 </xsl:call-template>
180 </xsl:if>
181
182 <!-- Insert links to CSS files or insert literal style elements -->
183 <xsl:call-template name="generate.css"/>
184
185 <xsl:if test="$html.stylesheet != ''">
186 <xsl:call-template name="output.html.stylesheets">
187 <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
188 </xsl:call-template>
189 </xsl:if>
190
191 <xsl:if test="$html.script != ''">
192 <xsl:call-template name="output.html.scripts">
193 <xsl:with-param name="scripts" select="normalize-space($html.script)"/>
194 </xsl:call-template>
195 </xsl:if>
196
197 <xsl:if test="$link.mailto.url != ''">
198 <xsl:call-template name="head.content.link.made">
199 <xsl:with-param name="node" select="$node"/>
200 </xsl:call-template>
201 </xsl:if>
202
203 <xsl:call-template name="head.content.generator">
204 <xsl:with-param name="node" select="$node"/>
205 </xsl:call-template>
206
207 <xsl:if test="$generate.meta.abstract != 0">
208 <xsl:call-template name="head.content.abstract">
209 <xsl:with-param name="node" select="$node"/>
210 </xsl:call-template>
211 </xsl:if>
212
213 <xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''">
214 <xsl:call-template name="head.content.style">
215 <xsl:with-param name="node" select="$node"/>
216 </xsl:call-template>
217 </xsl:if>
218 <xsl:apply-templates select="." mode="head.keywords.content"/>
219</xsl:template>
220
221<xsl:template name="output.html.stylesheets">
222 <xsl:param name="stylesheets" select="''"/>
223
224 <xsl:choose>
225 <xsl:when test="contains($stylesheets, ' ')">
226 <xsl:variable name="css.filename" select="substring-before($stylesheets, ' ')"/>
227
228 <xsl:call-template name="make.css.link">
229 <xsl:with-param name="css.filename" select="$css.filename"/>
230 </xsl:call-template>
231
232 <xsl:call-template name="output.html.stylesheets">
233 <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
234 </xsl:call-template>
235 </xsl:when>
236 <xsl:when test="$stylesheets != ''">
237 <xsl:call-template name="make.css.link">
238 <xsl:with-param name="css.filename" select="$stylesheets"/>
239 </xsl:call-template>
240 </xsl:when>
241 </xsl:choose>
242</xsl:template>
243
244<xsl:template name="output.html.scripts">
245 <xsl:param name="scripts" select="''"/>
246
247 <xsl:choose>
248 <xsl:when test="contains($scripts, ' ')">
249 <xsl:variable name="script.filename" select="substring-before($scripts, ' ')"/>
250
251 <xsl:call-template name="make.script.link">
252 <xsl:with-param name="script.filename" select="$script.filename"/>
253 </xsl:call-template>
254
255 <xsl:call-template name="output.html.scripts">
256 <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
257 </xsl:call-template>
258 </xsl:when>
259 <xsl:when test="$scripts != ''">
260 <xsl:call-template name="make.script.link">
261 <xsl:with-param name="script.filename" select="$scripts"/>
262 </xsl:call-template>
263 </xsl:when>
264 </xsl:choose>
265</xsl:template>
266
267<!-- ============================================================ -->
268
269<xsl:template match="*" mode="head.keywords.content">
270 <xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
271 <xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
272 <xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
273 <xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
274 <xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
275 <xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
276 <xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
277 <xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
278 <xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
279 <xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
280 <xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
281 <xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
282 <xsl:apply-templates select="sectioninfo/keywordset" mode="html.header"/>
283 <xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
284 <xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
285 <xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
286 <xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
287 <xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
288 <xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
289 <xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
290 <xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
291 <xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
292 <xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
293 <xsl:apply-templates select="info/keywordset" mode="html.header"/>
294
295 <xsl:if test="$inherit.keywords != 0 and parent::*">
296 <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
297 </xsl:if>
298</xsl:template>
299
300<!-- ============================================================ -->
301
302<xsl:template name="system.head.content">
303 <xsl:param name="node" select="."/>
304
305 <!-- FIXME: When chunking, only the annotations actually used
306 in this chunk should be referenced. I don't think it
307 does any harm to reference them all, but it adds
308 unnecessary bloat to each chunk. -->
309 <xsl:if test="$annotation.support != 0 and //annotation">
310 <xsl:call-template name="add.annotation.links"/>
311 <script type="text/javascript">
312 <xsl:text>
313// Create PopupWindow objects</xsl:text>
314 <xsl:for-each select="//annotation">
315 <xsl:text>
316var popup_</xsl:text>
317 <xsl:value-of select="generate-id(.)"/>
318 <xsl:text> = new PopupWindow("popup-</xsl:text>
319 <xsl:value-of select="generate-id(.)"/>
320 <xsl:text>");
321</xsl:text>
322 <xsl:text>popup_</xsl:text>
323 <xsl:value-of select="generate-id(.)"/>
324 <xsl:text>.offsetY = 15;
325</xsl:text>
326 <xsl:text>popup_</xsl:text>
327 <xsl:value-of select="generate-id(.)"/>
328 <xsl:text>.autoHide();
329</xsl:text>
330 </xsl:for-each>
331 </script>
332
333 <style type="text/css">
334 <xsl:value-of select="$annotation.css"/>
335 </style>
336 </xsl:if>
337
338 <!-- system.head.content is like user.head.content, except that
339 it is called before head.content. This is important because it
340 means, for example, that <style> elements output by system.head.content
341 have a lower CSS precedence than the users stylesheet. -->
342</xsl:template>
343
344<!-- ============================================================ -->
345
346<xsl:template name="user.preroot">
347 <!-- Pre-root output, can be used to output comments and PIs. -->
348 <!-- This must not output any element content! -->
349</xsl:template>
350
351<xsl:template name="user.head.title">
352 <xsl:param name="node" select="."/>
353 <xsl:param name="title"/>
354
355 <title>
356 <xsl:copy-of select="$title"/>
357 </title>
358</xsl:template>
359
360<xsl:template name="user.head.content">
361 <xsl:param name="node" select="."/>
362</xsl:template>
363
364<xsl:template name="user.header.navigation">
365 <xsl:param name="node" select="."/>
366 <xsl:param name="prev" select="/foo"/>
367 <xsl:param name="next" select="/foo"/>
368 <xsl:param name="nav.context"/>
369</xsl:template>
370
371<xsl:template name="user.header.content">
372 <xsl:param name="node" select="."/>
373</xsl:template>
374
375<xsl:template name="user.footer.content">
376 <xsl:param name="node" select="."/>
377</xsl:template>
378
379<xsl:template name="user.footer.navigation">
380 <xsl:param name="node" select="."/>
381 <xsl:param name="prev" select="/foo"/>
382 <xsl:param name="next" select="/foo"/>
383 <xsl:param name="nav.context"/>
384</xsl:template>
385
386<!-- To use the same stripped nodeset everywhere, it should
387be created as a global variable here.
388Used by docbook.xsl, chunk-code.xsl and chunkfast.xsl -->
389<xsl:variable name="no.namespace">
390 <xsl:if test="$exsl.node.set.available != 0 and (*/self::ng:* or */self::db:*)">
391 <xsl:apply-templates select="/*" mode="stripNS"/>
392 </xsl:if>
393</xsl:variable>
394
395<xslo:include xmlns:xslo="http://www.w3.org/1999/XSL/Transform" href="../profiling/profile-mode.xsl"/><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content"><xslo:choose><xslo:when test="*/self::ng:* or */self::db:*"><xslo:message>Note: namesp. cut : stripped namespace before processing</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>Note: namesp. cut : processing stripped document</xslo:message><xslo:apply-templates select="exslt:node-set($stripped-content)" mode="profile"/></xslo:when><xslo:otherwise><xslo:apply-templates select="/" mode="profile"/></xslo:otherwise></xslo:choose></xslo:variable><xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" select="exslt:node-set($profiled-content)"/><xsl:template match="/">
396 <!-- * Get a title for current doc so that we let the user -->
397 <!-- * know what document we are processing at this point. -->
398 <xsl:variable name="doc.title">
399 <xsl:call-template name="get.doc.title"/>
400 </xsl:variable>
401 <xsl:choose>
402 <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
403 toss the namespace and continue. Use the docbook5 namespaced
404 stylesheets for DocBook5 if you don't want to use this feature.-->
405 <!-- include extra test for Xalan quirk -->
406 <xsl:when test="false()"/>
407 <!-- Can't process unless namespace removed -->
408 <xsl:when test="false()"/>
409 <xsl:otherwise>
410 <xsl:choose>
411 <xsl:when test="$rootid != ''">
412 <xsl:choose>
413 <xsl:when test="count($profiled-nodes//*[@id=$rootid or @xml:id=$rootid]) = 0">
414 <xsl:message terminate="yes">
415 <xsl:text>ID '</xsl:text>
416 <xsl:value-of select="$rootid"/>
417 <xsl:text>' not found in document.</xsl:text>
418 </xsl:message>
419 </xsl:when>
420 <xsl:otherwise>
421 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
422 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
423 </xsl:if>
424 <xsl:if test="$collect.xref.targets != 'only'">
425 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid or @xml:id=$rootid]" mode="process.root"/>
426 <xsl:if test="$tex.math.in.alt != ''">
427 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid or @xml:id=$rootid]" mode="collect.tex.math"/>
428 </xsl:if>
429 </xsl:if>
430 </xsl:otherwise>
431 </xsl:choose>
432 </xsl:when>
433 <xsl:otherwise>
434 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
435 <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
436 </xsl:if>
437 <xsl:if test="$collect.xref.targets != 'only'">
438 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
439 <xsl:if test="$tex.math.in.alt != ''">
440 <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
441 </xsl:if>
442 </xsl:if>
443 </xsl:otherwise>
444 </xsl:choose>
445 </xsl:otherwise>
446 </xsl:choose>
447</xsl:template>
448
449<xsl:template match="*" mode="process.root">
450 <xsl:variable name="doc" select="self::*"/>
451
452 <xsl:call-template name="user.preroot"/>
453 <xsl:call-template name="root.messages"/>
454
455 <html>
456 <xsl:call-template name="root.attributes"/>
457 <head>
458 <xsl:call-template name="system.head.content">
459 <xsl:with-param name="node" select="$doc"/>
460 </xsl:call-template>
461 <xsl:call-template name="head.content">
462 <xsl:with-param name="node" select="$doc"/>
463 </xsl:call-template>
464 <xsl:call-template name="user.head.content">
465 <xsl:with-param name="node" select="$doc"/>
466 </xsl:call-template>
467 </head>
468 <body>
469 <xsl:call-template name="body.attributes"/>
470 <xsl:call-template name="user.header.content">
471 <xsl:with-param name="node" select="$doc"/>
472 </xsl:call-template>
473 <xsl:apply-templates select="."/>
474 <xsl:call-template name="user.footer.content">
475 <xsl:with-param name="node" select="$doc"/>
476 </xsl:call-template>
477 </body>
478 </html>
479 <xsl:value-of select="$html.append"/>
480
481 <!-- Generate any css files only once, not once per chunk -->
482 <xsl:call-template name="generate.css.files"/>
483</xsl:template>
484
485<xsl:template name="root.attributes">
486 <!-- customize to add attributes to <html> element -->
487</xsl:template>
488
489<xsl:template name="root.messages">
490 <!-- redefine this any way you'd like to output messages -->
491 <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
492</xsl:template>
493
494<!-- ==================================================================== -->
495
496<xsl:template name="chunk">
497 <xsl:param name="node" select="."/>
498
499 <!-- The default is that we are not chunking... -->
500 <xsl:text>0</xsl:text>
501</xsl:template>
502
503</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.