1 <?xml version="1.0" encoding="US-ASCII"?><!--This file was created automatically by xsl2profile--><!--from the DocBook XSL stylesheets.--><!--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:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" xmlns:exslt="http://exslt.org/common" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="exsl d exslt" version="1.0">
3 <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"/>
5 <!-- ********************************************************************
7 This file is part of the XSL DocBook Stylesheet distribution.
8 See ../README or http://cdn.docbook.org/release/xsl/current/ for
9 copyright and other information.
11 ******************************************************************** -->
13 <!-- ==================================================================== -->
15 <xsl:include href="../VERSION.xsl"/>
16 <xsl:include href="param.xsl"/>
17 <xsl:include href="../lib/lib.xsl"/>
18 <xsl:include href="../common/l10n.xsl"/>
19 <xsl:include href="../common/common.xsl"/>
20 <xsl:include href="../common/utility.xsl"/>
21 <xsl:include href="../common/labels.xsl"/>
22 <xsl:include href="../common/titles.xsl"/>
23 <xsl:include href="../common/subtitles.xsl"/>
24 <xsl:include href="../common/gentext.xsl"/>
25 <xsl:include href="../common/targets.xsl"/>
26 <xsl:include href="../common/olink.xsl"/>
27 <xsl:include href="../common/pi.xsl"/>
28 <xsl:include href="autotoc.xsl"/>
29 <xsl:include href="autoidx.xsl"/>
30 <xsl:include href="lists.xsl"/>
31 <xsl:include href="callout.xsl"/>
32 <xsl:include href="verbatim.xsl"/>
33 <xsl:include href="graphics.xsl"/>
34 <xsl:include href="xref.xsl"/>
35 <xsl:include href="formal.xsl"/>
36 <xsl:include href="table.xsl"/>
37 <xsl:include href="htmltbl.xsl"/>
38 <xsl:include href="sections.xsl"/>
39 <xsl:include href="inline.xsl"/>
40 <xsl:include href="footnote.xsl"/>
41 <xsl:include href="html.xsl"/>
42 <xsl:include href="its.xsl"/>
43 <xsl:include href="info.xsl"/>
44 <xsl:include href="keywords.xsl"/>
45 <xsl:include href="division.xsl"/>
46 <xsl:include href="toc.xsl"/>
47 <xsl:include href="index.xsl"/>
48 <xsl:include href="refentry.xsl"/>
49 <xsl:include href="math.xsl"/>
50 <xsl:include href="admon.xsl"/>
51 <xsl:include href="component.xsl"/>
52 <xsl:include href="biblio.xsl"/>
53 <xsl:include href="biblio-iso690.xsl"/>
54 <xsl:include href="glossary.xsl"/>
55 <xsl:include href="block.xsl"/>
56 <xsl:include href="task.xsl"/>
57 <xsl:include href="qandaset.xsl"/>
58 <xsl:include href="synop.xsl"/>
59 <xsl:include href="titlepage.xsl"/>
60 <xsl:include href="titlepage.templates.xsl"/>
61 <xsl:include href="pi.xsl"/>
62 <xsl:include href="ebnf.xsl"/>
63 <xsl:include href="chunker.xsl"/>
64 <xsl:include href="html-rtf.xsl"/>
65 <xsl:include href="annotations.xsl"/>
66 <xsl:include href="../common/addns.xsl"/>
67 <xsl:include href="publishers.xsl"/>
69 <xsl:param name="stylesheet.result.type" select="'xhtml'"/>
70 <xsl:param name="htmlhelp.output" select="0"/>
72 <!-- ==================================================================== -->
74 <xsl:key name="id" match="*" use="@id|@xml:id"/>
75 <xsl:key name="gid" match="*" use="generate-id()"/>
77 <!-- ==================================================================== -->
79 <xsl:template match="*">
81 <xsl:text>Element </xsl:text>
82 <xsl:value-of select="local-name(.)"/>
83 <xsl:text> in namespace '</xsl:text>
84 <xsl:value-of select="namespace-uri(.)"/>
85 <xsl:text>' encountered</xsl:text>
86 <xsl:if test="parent::*">
87 <xsl:text> in </xsl:text>
88 <xsl:value-of select="name(parent::*)"/>
90 <xsl:text>, but no template matches.</xsl:text>
93 <span style="color: red">
94 <xsl:text><</xsl:text>
95 <xsl:value-of select="name(.)"/>
96 <xsl:text>></xsl:text>
97 <xsl:apply-templates/>
98 <xsl:text></</xsl:text>
99 <xsl:value-of select="name(.)"/>
100 <xsl:text>></xsl:text>
104 <xsl:template match="text()">
105 <xsl:value-of select="."/>
108 <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>
109 <!-- no apply-templates; make it empty except for dir for rtl-->
112 <xsl:template name="head.content.base">
113 <xsl:param name="node" select="."/>
114 <base href="{$html.base}"/>
117 <xsl:template name="head.content.abstract">
118 <xsl:param name="node" select="."/>
119 <xsl:variable name="info" select="(d:articleinfo |d:bookinfo |d:prefaceinfo |d:chapterinfo |d:appendixinfo |d:sectioninfo |d:sect1info |d:sect2info |d:sect3info |d:sect4info |d:sect5info |d:referenceinfo |d:refentryinfo |d:partinfo |d:info |d:docinfo)[1]"/>
120 <xsl:if test="$info and $info/d:abstract">
121 <meta name="description">
122 <xsl:attribute name="content">
123 <xsl:for-each select="$info/d:abstract[1]/*">
124 <xsl:value-of select="normalize-space(.)"/>
125 <xsl:if test="position() < last()">
126 <xsl:text> </xsl:text>
134 <xsl:template name="head.content.link.made">
135 <xsl:param name="node" select="."/>
137 <link rev="made" href="{$link.mailto.url}"/>
140 <xsl:template name="head.content.generator">
141 <xsl:param name="node" select="."/>
142 <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
145 <xsl:template name="head.content.style">
146 <xsl:param name="node" select="."/>
147 <style type="text/css"><xsl:text>
148 body { background-image: url('</xsl:text>
149 <xsl:value-of select="$draft.watermark.image"/><xsl:text>');
150 background-repeat: no-repeat;
151 background-position: top left;
152 /* The following properties make the watermark "fixed" on the page. */
153 /* I think that's just a bit too distracting for the reader... */
154 /* background-attachment: fixed; */
155 /* background-position: center center; */
160 <xsl:template name="head.content">
161 <xsl:param name="node" select="."/>
162 <xsl:param name="title">
163 <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
166 <xsl:call-template name="user.head.title">
167 <xsl:with-param name="title" select="$title"/>
168 <xsl:with-param name="node" select="$node"/>
171 <xsl:if test="$html.base != ''">
172 <xsl:call-template name="head.content.base">
173 <xsl:with-param name="node" select="$node"/>
177 <!-- Insert links to CSS files or insert literal style elements -->
178 <xsl:call-template name="generate.css"/>
180 <xsl:if test="$html.stylesheet != ''">
181 <xsl:call-template name="output.html.stylesheets">
182 <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
186 <xsl:if test="$html.script != ''">
187 <xsl:call-template name="output.html.scripts">
188 <xsl:with-param name="scripts" select="normalize-space($html.script)"/>
192 <xsl:if test="$link.mailto.url != ''">
193 <xsl:call-template name="head.content.link.made">
194 <xsl:with-param name="node" select="$node"/>
198 <xsl:call-template name="head.content.generator">
199 <xsl:with-param name="node" select="$node"/>
202 <xsl:if test="$generate.meta.abstract != 0">
203 <xsl:call-template name="head.content.abstract">
204 <xsl:with-param name="node" select="$node"/>
208 <xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''">
209 <xsl:call-template name="head.content.style">
210 <xsl:with-param name="node" select="$node"/>
213 <xsl:apply-templates select="." mode="head.keywords.content"/>
216 <xsl:template name="output.html.stylesheets">
217 <xsl:param name="stylesheets" select="''"/>
220 <xsl:when test="contains($stylesheets, ' ')">
221 <xsl:variable name="css.filename" select="substring-before($stylesheets, ' ')"/>
223 <xsl:call-template name="make.css.link">
224 <xsl:with-param name="css.filename" select="$css.filename"/>
227 <xsl:call-template name="output.html.stylesheets">
228 <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
231 <xsl:when test="$stylesheets != ''">
232 <xsl:call-template name="make.css.link">
233 <xsl:with-param name="css.filename" select="$stylesheets"/>
239 <xsl:template name="output.html.scripts">
240 <xsl:param name="scripts" select="''"/>
243 <xsl:when test="contains($scripts, ' ')">
244 <xsl:variable name="script.filename" select="substring-before($scripts, ' ')"/>
246 <xsl:call-template name="make.script.link">
247 <xsl:with-param name="script.filename" select="$script.filename"/>
250 <xsl:call-template name="output.html.scripts">
251 <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
254 <xsl:when test="$scripts != ''">
255 <xsl:call-template name="make.script.link">
256 <xsl:with-param name="script.filename" select="$scripts"/>
262 <!-- ============================================================ -->
264 <xsl:template match="*" mode="head.keywords.content">
265 <xsl:apply-templates select="d:chapterinfo/d:keywordset" mode="html.header"/>
266 <xsl:apply-templates select="d:appendixinfo/d:keywordset" mode="html.header"/>
267 <xsl:apply-templates select="d:prefaceinfo/d:keywordset" mode="html.header"/>
268 <xsl:apply-templates select="d:bookinfo/d:keywordset" mode="html.header"/>
269 <xsl:apply-templates select="d:setinfo/d:keywordset" mode="html.header"/>
270 <xsl:apply-templates select="d:articleinfo/d:keywordset" mode="html.header"/>
271 <xsl:apply-templates select="d:artheader/d:keywordset" mode="html.header"/>
272 <xsl:apply-templates select="d:sect1info/d:keywordset" mode="html.header"/>
273 <xsl:apply-templates select="d:sect2info/d:keywordset" mode="html.header"/>
274 <xsl:apply-templates select="d:sect3info/d:keywordset" mode="html.header"/>
275 <xsl:apply-templates select="d:sect4info/d:keywordset" mode="html.header"/>
276 <xsl:apply-templates select="d:sect5info/d:keywordset" mode="html.header"/>
277 <xsl:apply-templates select="d:sectioninfo/d:keywordset" mode="html.header"/>
278 <xsl:apply-templates select="d:refsect1info/d:keywordset" mode="html.header"/>
279 <xsl:apply-templates select="d:refsect2info/d:keywordset" mode="html.header"/>
280 <xsl:apply-templates select="d:refsect3info/d:keywordset" mode="html.header"/>
281 <xsl:apply-templates select="d:bibliographyinfo/d:keywordset" mode="html.header"/>
282 <xsl:apply-templates select="d:glossaryinfo/d:keywordset" mode="html.header"/>
283 <xsl:apply-templates select="d:indexinfo/d:keywordset" mode="html.header"/>
284 <xsl:apply-templates select="d:refentryinfo/d:keywordset" mode="html.header"/>
285 <xsl:apply-templates select="d:partinfo/d:keywordset" mode="html.header"/>
286 <xsl:apply-templates select="d:referenceinfo/d:keywordset" mode="html.header"/>
287 <xsl:apply-templates select="d:docinfo/d:keywordset" mode="html.header"/>
288 <xsl:apply-templates select="d:info/d:keywordset" mode="html.header"/>
290 <xsl:if test="$inherit.keywords != 0 and parent::*">
291 <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
295 <!-- ============================================================ -->
297 <xsl:template name="system.head.content">
298 <xsl:param name="node" select="."/>
300 <!-- FIXME: When chunking, only the annotations actually used
301 in this chunk should be referenced. I don't think it
302 does any harm to reference them all, but it adds
303 unnecessary bloat to each chunk. -->
304 <xsl:if test="$annotation.support != 0 and //d:annotation">
305 <xsl:call-template name="add.annotation.links"/>
306 <script type="text/javascript">
308 // Create PopupWindow objects</xsl:text>
309 <xsl:for-each select="//d:annotation">
311 var popup_</xsl:text>
312 <xsl:value-of select="generate-id(.)"/>
313 <xsl:text> = new PopupWindow("popup-</xsl:text>
314 <xsl:value-of select="generate-id(.)"/>
317 <xsl:text>popup_</xsl:text>
318 <xsl:value-of select="generate-id(.)"/>
319 <xsl:text>.offsetY = 15;
321 <xsl:text>popup_</xsl:text>
322 <xsl:value-of select="generate-id(.)"/>
323 <xsl:text>.autoHide();
328 <style type="text/css">
329 <xsl:value-of select="$annotation.css"/>
333 <!-- system.head.content is like user.head.content, except that
334 it is called before head.content. This is important because it
335 means, for example, that <style> elements output by system.head.content
336 have a lower CSS precedence than the users stylesheet. -->
339 <!-- ============================================================ -->
341 <xsl:template name="user.preroot">
342 <!-- Pre-root output, can be used to output comments and PIs. -->
343 <!-- This must not output any element content! -->
346 <xsl:template name="user.head.title">
347 <xsl:param name="node" select="."/>
348 <xsl:param name="title"/>
351 <xsl:copy-of select="$title"/>
355 <xsl:template name="user.head.content">
356 <xsl:param name="node" select="."/>
359 <xsl:template name="user.header.navigation">
360 <xsl:param name="node" select="."/>
361 <xsl:param name="prev" select="/d:foo"/>
362 <xsl:param name="next" select="/d:foo"/>
363 <xsl:param name="nav.context"/>
366 <xsl:template name="user.header.content">
367 <xsl:param name="node" select="."/>
370 <xsl:template name="user.footer.content">
371 <xsl:param name="node" select="."/>
374 <xsl:template name="user.footer.navigation">
375 <xsl:param name="node" select="."/>
376 <xsl:param name="prev" select="/d:foo"/>
377 <xsl:param name="next" select="/d:foo"/>
378 <xsl:param name="nav.context"/>
381 <!-- To use the same namespace-adjusted nodeset everywhere, it should
382 be created as a global variable here.
383 Used by docbook.xsl, chunk-common.xsl, chunktoc.xsl, and
384 chunk-code.xsl; and in $chunk.hierarchy used in chunkfast.xsl -->
385 <xsl:variable name="with.namespace">
386 <xsl:if test="$exsl.node.set.available != 0 and namespace-uri(/*) != 'http://docbook.org/ns/docbook'">
387 <xsl:apply-templates select="/*" mode="addNS"/>
391 <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="$exsl.node.set.available != 0 and namespace-uri(/*) != 'http://docbook.org/ns/docbook'"><xslo:variable name="with.namespace"><xslo:apply-templates select="/*" mode="addNS"/></xslo:variable><xslo:call-template name="log.message"><xslo:with-param name="level">Note</xslo:with-param><xslo:with-param name="source"><xslo:call-template name="get.doc.title"/></xslo:with-param><xslo:with-param name="context-desc"><xslo:text>namesp. add</xslo:text></xslo:with-param><xslo:with-param name="message"><xslo:text>added namespace before processing</xslo:text></xslo:with-param></xslo:call-template><xslo:apply-templates select="exslt:node-set($with.namespace)" 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="/">
392 <!-- * Get a title for current doc so that we let the user -->
393 <!-- * know what document we are processing at this point. -->
394 <xsl:variable name="doc.title">
395 <xsl:call-template name="get.doc.title"/>
398 <!-- fix namespace if necessary -->
399 <xsl:when test="false()"/>
400 <!-- Can't process unless namespace fixed with exsl node-set()-->
401 <xsl:when test="false()"/>
404 <xsl:when test="$rootid != ''">
406 <xsl:when test="count($profiled-nodes//*[@id=$rootid or @xml:id=$rootid]) = 0">
407 <xsl:message terminate="yes">
408 <xsl:text>ID '</xsl:text>
409 <xsl:value-of select="$rootid"/>
410 <xsl:text>' not found in document.</xsl:text>
414 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
415 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
417 <xsl:if test="$collect.xref.targets != 'only'">
418 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid or @xml:id=$rootid]" mode="process.root"/>
419 <xsl:if test="$tex.math.in.alt != ''">
420 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid or @xml:id=$rootid]" mode="collect.tex.math"/>
427 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
428 <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
430 <xsl:if test="$collect.xref.targets != 'only'">
431 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
432 <xsl:if test="$tex.math.in.alt != ''">
433 <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
442 <xsl:template match="*" mode="process.root">
443 <xsl:variable name="doc" select="self::*"/>
445 <xsl:call-template name="user.preroot"/>
446 <xsl:call-template name="root.messages"/>
449 <xsl:call-template name="root.attributes"/>
451 <xsl:call-template name="system.head.content">
452 <xsl:with-param name="node" select="$doc"/>
454 <xsl:call-template name="head.content">
455 <xsl:with-param name="node" select="$doc"/>
457 <xsl:call-template name="user.head.content">
458 <xsl:with-param name="node" select="$doc"/>
462 <xsl:call-template name="body.attributes"/>
463 <xsl:call-template name="user.header.content">
464 <xsl:with-param name="node" select="$doc"/>
466 <xsl:apply-templates select="."/>
467 <xsl:call-template name="user.footer.content">
468 <xsl:with-param name="node" select="$doc"/>
472 <xsl:value-of select="$html.append"/>
474 <!-- Generate any css files only once, not once per chunk -->
475 <xsl:call-template name="generate.css.files"/>
478 <xsl:template name="root.attributes">
479 <!-- customize to add attributes to <html> element -->
482 <xsl:template name="root.messages">
483 <!-- redefine this any way you'd like to output messages -->
484 <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
487 <!-- ==================================================================== -->
489 <xsl:template name="chunk">
490 <xsl:param name="node" select="."/>
492 <!-- The default is that we are not chunking... -->
493 <xsl:text>0</xsl:text>