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"
7 xmlns:d="http://docbook.org/ns/docbook"
8 xmlns:ng="http://docbook.org/docbook-ng"
9 xmlns:db="http://docbook.org/ns/docbook"
10 xmlns:exsl="http://exslt.org/common"
11 xmlns:exslt="http://exslt.org/common"
12 xmlns="http://www.w3.org/1999/xhtml"
16 extension-element-prefixes="exslt"
17 exclude-result-prefixes="db ng exsl exslt exslt d"
20 <xsl:output method="xml" encoding="UTF-8" indent="no"/>
22 <!-- ********************************************************************
24 This file is part of the XSL DocBook Stylesheet distribution.
25 See ../README or http://cdn.docbook.org/release/xsl/current/ for
26 copyright and other information.
28 ******************************************************************** -->
30 <!-- ==================================================================== -->
32 <xsl:include href="../VERSION.xsl"/>
33 <xsl:include href="../xhtml/param.xsl"/>
34 <xsl:include href="../lib/lib.xsl"/>
35 <xsl:include href="../common/l10n.xsl"/>
36 <xsl:include href="../common/common.xsl"/>
37 <xsl:include href="../common/utility.xsl"/>
38 <xsl:include href="../common/labels.xsl"/>
39 <xsl:include href="../common/titles.xsl"/>
40 <xsl:include href="../common/subtitles.xsl"/>
41 <xsl:include href="../common/gentext.xsl"/>
42 <xsl:include href="../common/targets.xsl"/>
43 <xsl:include href="../common/olink.xsl"/>
44 <xsl:include href="../common/pi.xsl"/>
45 <xsl:include href="../xhtml/autotoc.xsl"/>
46 <xsl:include href="../xhtml/autoidx.xsl"/>
47 <xsl:include href="../xhtml/lists.xsl"/>
48 <xsl:include href="../xhtml/callout.xsl"/>
49 <xsl:include href="../xhtml/verbatim.xsl"/>
50 <xsl:include href="../xhtml/graphics.xsl"/>
51 <xsl:include href="../xhtml/xref.xsl"/>
52 <xsl:include href="../xhtml/formal.xsl"/>
53 <xsl:include href="../xhtml/table.xsl"/>
54 <xsl:include href="../xhtml/htmltbl.xsl"/>
55 <xsl:include href="../xhtml/sections.xsl"/>
56 <xsl:include href="../xhtml/inline.xsl"/>
57 <xsl:include href="../xhtml/footnote.xsl"/>
58 <xsl:include href="../xhtml/html.xsl"/>
59 <xsl:include href="../xhtml/info.xsl"/>
60 <xsl:include href="../xhtml/keywords.xsl"/>
61 <xsl:include href="../xhtml/division.xsl"/>
62 <xsl:include href="../xhtml/toc.xsl"/>
63 <xsl:include href="../xhtml/index.xsl"/>
64 <xsl:include href="../xhtml/refentry.xsl"/>
65 <xsl:include href="../xhtml/math.xsl"/>
66 <xsl:include href="../xhtml/admon.xsl"/>
67 <xsl:include href="../xhtml/component.xsl"/>
68 <xsl:include href="../xhtml/biblio.xsl"/>
69 <xsl:include href="../xhtml/biblio-iso690.xsl"/>
70 <xsl:include href="../xhtml/glossary.xsl"/>
71 <xsl:include href="../xhtml/block.xsl"/>
72 <xsl:include href="../xhtml/task.xsl"/>
73 <xsl:include href="../xhtml/qandaset.xsl"/>
74 <xsl:include href="../xhtml/synop.xsl"/>
75 <xsl:include href="../xhtml/titlepage.xsl"/>
76 <xsl:include href="../xhtml/titlepage.templates.xsl"/>
77 <xsl:include href="../xhtml/pi.xsl"/>
78 <xsl:include href="../xhtml/ebnf.xsl"/>
79 <xsl:include href="../xhtml/chunker.xsl"/>
80 <xsl:include href="../xhtml/html-rtf.xsl"/>
81 <xsl:include href="../xhtml/annotations.xsl"/>
82 <xsl:include href="../common/addns.xsl"/>
84 <xsl:param name="stylesheet.result.type" select="'xhtml'"/>
85 <xsl:param name="htmlhelp.output" select="0"/>
87 <!-- ==================================================================== -->
89 <xsl:key name="id" match="*" use="@id|@xml:id"/>
90 <xsl:key name="gid" match="*" use="generate-id()"/>
92 <!-- ==================================================================== -->
94 <xsl:template match="*">
96 <xsl:text>Element </xsl:text>
97 <xsl:value-of select="local-name(.)"/>
98 <xsl:text> in namespace '</xsl:text>
99 <xsl:value-of select="namespace-uri(.)"/>
100 <xsl:text>' encountered</xsl:text>
101 <xsl:if test="parent::*">
102 <xsl:text> in </xsl:text>
103 <xsl:value-of select="name(parent::*)"/>
105 <xsl:text>, but no template matches.</xsl:text>
108 <span style="color: red">
109 <xsl:text><</xsl:text>
110 <xsl:value-of select="name(.)"/>
111 <xsl:text>></xsl:text>
112 <xsl:apply-templates/>
113 <xsl:text></</xsl:text>
114 <xsl:value-of select="name(.)"/>
115 <xsl:text>></xsl:text>
119 <xsl:template match="text()">
120 <xsl:value-of select="."/>
123 <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>
124 <!-- no apply-templates; make it empty except for dir for rtl-->
127 <xsl:template name="head.content">
128 <xsl:param name="node" select="."/>
129 <xsl:param name="title">
130 <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
134 <xsl:copy-of select="$title"/>
137 <xsl:if test="$html.base != ''">
138 <base href="{$html.base}"/>
141 <!-- Insert links to CSS files or insert literal style elements -->
142 <xsl:call-template name="generate.css"/>
144 <xsl:if test="$html.stylesheet != ''">
145 <xsl:call-template name="output.html.stylesheets">
146 <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
150 <xsl:if test="$link.mailto.url != ''">
151 <link rev="made" href="{$link.mailto.url}"/>
154 <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
156 <xsl:if test="$generate.meta.abstract != 0">
157 <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]"/>
158 <xsl:if test="$info and $info/d:abstract">
159 <meta name="description">
160 <xsl:attribute name="content">
161 <xsl:for-each select="$info/d:abstract[1]/*">
162 <xsl:value-of select="normalize-space(.)"/>
163 <xsl:if test="position() < last()">
164 <xsl:text> </xsl:text>
172 <xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''">
173 <style type="text/css"><xsl:text>
174 body { background-image: url('</xsl:text>
175 <xsl:value-of select="$draft.watermark.image"/><xsl:text>');
176 background-repeat: no-repeat;
177 background-position: top left;
178 /* The following properties make the watermark "fixed" on the page. */
179 /* I think that's just a bit too distracting for the reader... */
180 /* background-attachment: fixed; */
181 /* background-position: center center; */
185 <xsl:apply-templates select="." mode="head.keywords.content"/>
188 <xsl:template name="output.html.stylesheets">
189 <xsl:param name="stylesheets" select="''"/>
192 <xsl:when test="contains($stylesheets, ' ')">
193 <xsl:variable name="css.filename" select="substring-before($stylesheets, ' ')"/>
195 <xsl:call-template name="make.css.link">
196 <xsl:with-param name="css.filename" select="$css.filename"/>
199 <xsl:call-template name="output.html.stylesheets">
200 <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
203 <xsl:when test="$stylesheets != ''">
204 <xsl:call-template name="make.css.link">
205 <xsl:with-param name="css.filename" select="$stylesheets"/>
211 <!-- ============================================================ -->
213 <xsl:template match="*" mode="head.keywords.content">
214 <xsl:apply-templates select="d:chapterinfo/d:keywordset" mode="html.header"/>
215 <xsl:apply-templates select="d:appendixinfo/d:keywordset" mode="html.header"/>
216 <xsl:apply-templates select="d:prefaceinfo/d:keywordset" mode="html.header"/>
217 <xsl:apply-templates select="d:bookinfo/d:keywordset" mode="html.header"/>
218 <xsl:apply-templates select="d:setinfo/d:keywordset" mode="html.header"/>
219 <xsl:apply-templates select="d:articleinfo/d:keywordset" mode="html.header"/>
220 <xsl:apply-templates select="d:artheader/d:keywordset" mode="html.header"/>
221 <xsl:apply-templates select="d:sect1info/d:keywordset" mode="html.header"/>
222 <xsl:apply-templates select="d:sect2info/d:keywordset" mode="html.header"/>
223 <xsl:apply-templates select="d:sect3info/d:keywordset" mode="html.header"/>
224 <xsl:apply-templates select="d:sect4info/d:keywordset" mode="html.header"/>
225 <xsl:apply-templates select="d:sect5info/d:keywordset" mode="html.header"/>
226 <xsl:apply-templates select="d:sectioninfo/d:keywordset" mode="html.header"/>
227 <xsl:apply-templates select="d:refsect1info/d:keywordset" mode="html.header"/>
228 <xsl:apply-templates select="d:refsect2info/d:keywordset" mode="html.header"/>
229 <xsl:apply-templates select="d:refsect3info/d:keywordset" mode="html.header"/>
230 <xsl:apply-templates select="d:bibliographyinfo/d:keywordset" mode="html.header"/>
231 <xsl:apply-templates select="d:glossaryinfo/d:keywordset" mode="html.header"/>
232 <xsl:apply-templates select="d:indexinfo/d:keywordset" mode="html.header"/>
233 <xsl:apply-templates select="d:refentryinfo/d:keywordset" mode="html.header"/>
234 <xsl:apply-templates select="d:partinfo/d:keywordset" mode="html.header"/>
235 <xsl:apply-templates select="d:referenceinfo/d:keywordset" mode="html.header"/>
236 <xsl:apply-templates select="d:docinfo/d:keywordset" mode="html.header"/>
237 <xsl:apply-templates select="d:info/d:keywordset" mode="html.header"/>
239 <xsl:if test="$inherit.keywords != 0 and parent::*">
240 <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
244 <!-- ============================================================ -->
246 <xsl:template name="system.head.content">
247 <xsl:param name="node" select="."/>
249 <!-- FIXME: When chunking, only the annotations actually used
250 in this chunk should be referenced. I don't think it
251 does any harm to reference them all, but it adds
252 unnecessary bloat to each chunk. -->
253 <xsl:if test="$annotation.support != 0 and //d:annotation">
254 <xsl:call-template name="add.annotation.links"/>
255 <script type="text/javascript">
257 // Create PopupWindow objects</xsl:text>
258 <xsl:for-each select="//d:annotation">
260 var popup_</xsl:text>
261 <xsl:value-of select="generate-id(.)"/>
262 <xsl:text> = new PopupWindow("popup-</xsl:text>
263 <xsl:value-of select="generate-id(.)"/>
266 <xsl:text>popup_</xsl:text>
267 <xsl:value-of select="generate-id(.)"/>
268 <xsl:text>.offsetY = 15;
270 <xsl:text>popup_</xsl:text>
271 <xsl:value-of select="generate-id(.)"/>
272 <xsl:text>.autoHide();
277 <style type="text/css">
278 <xsl:value-of select="$annotation.css"/>
282 <!-- system.head.content is like user.head.content, except that
283 it is called before head.content. This is important because it
284 means, for example, that <style> elements output by system.head.content
285 have a lower CSS precedence than the users stylesheet. -->
288 <!-- ============================================================ -->
290 <xsl:template name="user.preroot">
291 <!-- Pre-root output, can be used to output comments and PIs. -->
292 <!-- This must not output any element content! -->
295 <xsl:template name="user.head.content">
296 <xsl:param name="node" select="."/>
299 <xsl:template name="user.header.navigation">
300 <xsl:param name="node" select="."/>
303 <xsl:template name="user.header.content">
304 <xsl:param name="node" select="."/>
307 <xsl:template name="user.footer.content">
308 <xsl:param name="node" select="."/>
311 <xsl:template name="user.footer.navigation">
312 <xsl:param name="node" select="."/>
315 <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. add : added namespace before processing</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="addNS"/></xslo:variable><xslo:message>Note: namesp. add : 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="/">
316 <!-- * Get a title for current doc so that we let the user -->
317 <!-- * know what document we are processing at this point. -->
318 <xsl:variable name="doc.title">
319 <xsl:call-template name="get.doc.title"/>
322 <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
323 toss the namespace and continue. Use the docbook5 namespaced
324 stylesheets for DocBook5 if you don't want to use this feature.-->
325 <!-- include extra test for Xalan quirk -->
326 <xsl:when test="false()"/>
327 <!-- Can't process unless namespace removed -->
328 <xsl:when test="false()"/>
331 <xsl:when test="$rootid != ''">
333 <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
334 <xsl:message terminate="yes">
335 <xsl:text>ID '</xsl:text>
336 <xsl:value-of select="$rootid"/>
337 <xsl:text>' not found in document.</xsl:text>
341 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
342 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
344 <xsl:if test="$collect.xref.targets != 'only'">
345 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
346 <xsl:if test="$tex.math.in.alt != ''">
347 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
354 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
355 <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
357 <xsl:if test="$collect.xref.targets != 'only'">
358 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
359 <xsl:if test="$tex.math.in.alt != ''">
360 <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
369 <xsl:template match="*" mode="process.root">
370 <xsl:variable name="doc" select="self::*"/>
372 <xsl:call-template name="user.preroot"/>
373 <xsl:call-template name="root.messages"/>
377 <xsl:call-template name="system.head.content">
378 <xsl:with-param name="node" select="$doc"/>
380 <xsl:call-template name="head.content">
381 <xsl:with-param name="node" select="$doc"/>
383 <xsl:call-template name="user.head.content">
384 <xsl:with-param name="node" select="$doc"/>
388 <xsl:call-template name="body.attributes"/>
389 <xsl:call-template name="user.header.content">
390 <xsl:with-param name="node" select="$doc"/>
392 <xsl:apply-templates select="."/>
393 <xsl:call-template name="user.footer.content">
394 <xsl:with-param name="node" select="$doc"/>
398 <xsl:value-of select="$html.append"/>
400 <!-- Generate any css files only once, not once per chunk -->
401 <xsl:call-template name="generate.css.files"/>
404 <xsl:template name="root.messages">
405 <!-- redefine this any way you'd like to output messages -->
406 <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
409 <!-- ==================================================================== -->
411 <xsl:template name="chunk">
412 <xsl:param name="node" select="."/>
414 <!-- The default is that we are not chunking... -->
415 <xsl:text>0</xsl:text>