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:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" xmlns:exsl="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="db ng exsl" version="1.0">
6 <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"/>
8 <!-- ********************************************************************
10 ********************************************************************
12 This file is part of the XSL DocBook Stylesheet distribution.
13 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
14 and other information.
16 ******************************************************************** -->
18 <!-- ==================================================================== -->
20 <xsl:include href="../VERSION"/>
21 <xsl:include href="param.xsl"/>
22 <xsl:include href="../lib/lib.xsl"/>
23 <xsl:include href="../common/l10n.xsl"/>
24 <xsl:include href="../common/common.xsl"/>
25 <xsl:include href="../common/labels.xsl"/>
26 <xsl:include href="../common/titles.xsl"/>
27 <xsl:include href="../common/subtitles.xsl"/>
28 <xsl:include href="../common/gentext.xsl"/>
29 <xsl:include href="../common/targets.xsl"/>
30 <xsl:include href="../common/olink.xsl"/>
31 <xsl:include href="../common/pi.xsl"/>
32 <xsl:include href="autotoc.xsl"/>
33 <xsl:include href="autoidx.xsl"/>
34 <xsl:include href="lists.xsl"/>
35 <xsl:include href="callout.xsl"/>
36 <xsl:include href="verbatim.xsl"/>
37 <xsl:include href="graphics.xsl"/>
38 <xsl:include href="xref.xsl"/>
39 <xsl:include href="formal.xsl"/>
40 <xsl:include href="table.xsl"/>
41 <xsl:include href="htmltbl.xsl"/>
42 <xsl:include href="sections.xsl"/>
43 <xsl:include href="inline.xsl"/>
44 <xsl:include href="footnote.xsl"/>
45 <xsl:include href="html.xsl"/>
46 <xsl:include href="info.xsl"/>
47 <xsl:include href="keywords.xsl"/>
48 <xsl:include href="division.xsl"/>
49 <xsl:include href="toc.xsl"/>
50 <xsl:include href="index.xsl"/>
51 <xsl:include href="refentry.xsl"/>
52 <xsl:include href="math.xsl"/>
53 <xsl:include href="admon.xsl"/>
54 <xsl:include href="component.xsl"/>
55 <xsl:include href="biblio.xsl"/>
56 <xsl:include href="glossary.xsl"/>
57 <xsl:include href="block.xsl"/>
58 <xsl:include href="task.xsl"/>
59 <xsl:include href="qandaset.xsl"/>
60 <xsl:include href="synop.xsl"/>
61 <xsl:include href="titlepage.xsl"/>
62 <xsl:include href="titlepage.templates.xsl"/>
63 <xsl:include href="pi.xsl"/>
64 <xsl:include href="ebnf.xsl"/>
65 <xsl:include href="chunker.xsl"/>
66 <xsl:include href="html-rtf.xsl"/>
67 <xsl:include href="docbookng.xsl"/>
68 <xsl:include href="annotations.xsl"/>
70 <xsl:param name="stylesheet.result.type" select="'xhtml'"/>
71 <xsl:param name="htmlhelp.output" select="0"/>
73 <!-- ==================================================================== -->
75 <xsl:key name="id" match="*" use="@id|@xml:id"/>
76 <xsl:key name="gid" match="*" use="generate-id()"/>
78 <!-- ==================================================================== -->
80 <xsl:template match="*">
82 <xsl:text>No template matches </xsl:text>
83 <xsl:value-of select="name(.)"/>
84 <xsl:if test="parent::*">
85 <xsl:text> in </xsl:text>
86 <xsl:value-of select="name(parent::*)"/>
88 <xsl:text>.</xsl:text>
92 <xsl:text><</xsl:text>
93 <xsl:value-of select="name(.)"/>
94 <xsl:text>></xsl:text>
95 <xsl:apply-templates/>
96 <xsl:text></</xsl:text>
97 <xsl:value-of select="name(.)"/>
98 <xsl:text>></xsl:text>
102 <xsl:template match="text()">
103 <xsl:value-of select="."/>
106 <xsl:template name="body.attributes">
107 <!-- no apply-templates; make it empty -->
110 <xsl:template name="head.content">
111 <xsl:param name="node" select="."/>
112 <xsl:param name="title">
113 <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
117 <xsl:copy-of select="$title"/>
120 <xsl:if test="$html.stylesheet != ''">
121 <xsl:call-template name="output.html.stylesheets">
122 <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
126 <xsl:if test="$link.mailto.url != ''">
127 <link rev="made" href="{$link.mailto.url}"/>
130 <xsl:if test="$html.base != ''">
131 <base href="{$html.base}"/>
134 <meta name="generator" content="DocBook XSL Stylesheets V{$VERSION}"/>
136 <xsl:if test="$generate.meta.abstract != 0">
137 <xsl:variable name="info" select="(articleinfo |bookinfo |prefaceinfo |chapterinfo |appendixinfo |sectioninfo |sect1info |sect2info |sect3info |sect4info |sect5info |referenceinfo |refentryinfo |partinfo |info |docinfo)[1]"/>
138 <xsl:if test="$info and $info/abstract">
139 <meta name="description">
140 <xsl:attribute name="content">
141 <xsl:for-each select="$info/abstract[1]/*">
142 <xsl:value-of select="."/>
143 <xsl:if test="position() < last()">
144 <xsl:text> </xsl:text>
152 <xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''">
153 <style type="text/css"><xsl:text>
154 body { background-image: url('</xsl:text>
155 <xsl:value-of select="$draft.watermark.image"/><xsl:text>');
156 background-repeat: no-repeat;
157 background-position: top left;
158 /* The following properties make the watermark "fixed" on the page. */
159 /* I think that's just a bit too distracting for the reader... */
160 /* background-attachment: fixed; */
161 /* background-position: center center; */
165 <xsl:apply-templates select="." mode="head.keywords.content"/>
168 <xsl:template name="output.html.stylesheets">
169 <xsl:param name="stylesheets" select="''"/>
172 <xsl:when test="contains($stylesheets, ' ')">
173 <link rel="stylesheet" href="{substring-before($stylesheets, ' ')}">
174 <xsl:if test="$html.stylesheet.type != ''">
175 <xsl:attribute name="type">
176 <xsl:value-of select="$html.stylesheet.type"/>
180 <xsl:call-template name="output.html.stylesheets">
181 <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
184 <xsl:when test="$stylesheets != ''">
185 <link rel="stylesheet" href="{$stylesheets}">
186 <xsl:if test="$html.stylesheet.type != ''">
187 <xsl:attribute name="type">
188 <xsl:value-of select="$html.stylesheet.type"/>
196 <!-- ============================================================ -->
198 <xsl:template match="*" mode="head.keywords.content">
199 <xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
200 <xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
201 <xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
202 <xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
203 <xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
204 <xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
205 <xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
206 <xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
207 <xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
208 <xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
209 <xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
210 <xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
211 <xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
212 <xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
213 <xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
214 <xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
215 <xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
216 <xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
217 <xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
218 <xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
219 <xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
220 <xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
221 <xsl:apply-templates select="info/keywordset" mode="html.header"/>
223 <xsl:if test="$inherit.keywords != 0 and parent::*">
224 <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
228 <!-- ============================================================ -->
230 <xsl:template name="system.head.content">
231 <xsl:param name="node" select="."/>
233 <!-- FIXME: When chunking, only the annotations actually used
234 in this chunk should be referenced. I don't think it
235 does any harm to reference them all, but it adds
236 unnecessary bloat to each chunk. -->
237 <xsl:if test="$annotation.support != 0 and //annotation">
238 <xsl:call-template name="add.annotation.links"/>
239 <script type="text/javascript">
241 // Create PopupWindow objects</xsl:text>
242 <xsl:for-each select="//annotation">
244 var popup_</xsl:text>
245 <xsl:value-of select="generate-id(.)"/>
246 <xsl:text> = new PopupWindow("popup-</xsl:text>
247 <xsl:value-of select="generate-id(.)"/>
250 <xsl:text>popup_</xsl:text>
251 <xsl:value-of select="generate-id(.)"/>
252 <xsl:text>.offsetY = 15;
254 <xsl:text>popup_</xsl:text>
255 <xsl:value-of select="generate-id(.)"/>
256 <xsl:text>.autoHide();
261 <style type="text/css">
262 <xsl:value-of select="$annotation.css"/>
266 <!-- system.head.content is like user.head.content, except that
267 it is called before head.content. This is important because it
268 means, for example, that <style> elements output by system.head.content
269 have a lower CSS precedence than the users stylesheet. -->
272 <!-- ============================================================ -->
274 <xsl:template name="user.preroot">
275 <!-- Pre-root output, can be used to output comments and PIs. -->
276 <!-- This must not output any element content! -->
279 <xsl:template name="user.head.content">
280 <xsl:param name="node" select="."/>
283 <xsl:template name="user.header.navigation">
284 <xsl:param name="node" select="."/>
287 <xsl:template name="user.header.content">
288 <xsl:param name="node" select="."/>
291 <xsl:template name="user.footer.content">
292 <xsl:param name="node" select="."/>
295 <xsl:template name="user.footer.navigation">
296 <xsl:param name="node" select="."/>
299 <xsl:template match="/">
301 <xsl:when test="function-available('exsl:node-set') and (*/self::ng:* or */self::db:*)">
302 <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
303 toss the namespace and continue. Someday we'll reverse this logic
304 and add the namespace to documents that don't have one.
305 But not before the whole stylesheet has been converted to use
306 namespaces. i.e., don't hold your breath -->
307 <xsl:message>Stripping NS from DocBook 5/NG document.</xsl:message>
308 <xsl:variable name="nons">
309 <xsl:apply-templates mode="stripNS"/>
311 <xsl:message>Processing stripped document.</xsl:message>
312 <xsl:apply-templates select="exsl:node-set($nons)"/>
316 <xsl:when test="$rootid != ''">
318 <xsl:when test="count(key('id',$rootid)) = 0">
319 <xsl:message terminate="yes">
320 <xsl:text>ID '</xsl:text>
321 <xsl:value-of select="$rootid"/>
322 <xsl:text>' not found in document.</xsl:text>
326 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
327 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
329 <xsl:if test="$collect.xref.targets != 'only'">
330 <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
331 <xsl:if test="$tex.math.in.alt != ''">
332 <xsl:apply-templates select="key('id',$rootid)" mode="collect.tex.math"/>
339 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
340 <xsl:apply-templates select="/" mode="collect.targets"/>
342 <xsl:if test="$collect.xref.targets != 'only'">
343 <xsl:apply-templates select="/" mode="process.root"/>
344 <xsl:if test="$tex.math.in.alt != ''">
345 <xsl:apply-templates select="/" mode="collect.tex.math"/>
354 <xsl:template match="*" mode="process.root">
355 <xsl:variable name="doc" select="self::*"/>
357 <xsl:call-template name="user.preroot"/>
358 <xsl:call-template name="root.messages"/>
362 <xsl:call-template name="system.head.content">
363 <xsl:with-param name="node" select="$doc"/>
365 <xsl:call-template name="head.content">
366 <xsl:with-param name="node" select="$doc"/>
368 <xsl:call-template name="user.head.content">
369 <xsl:with-param name="node" select="$doc"/>
373 <xsl:call-template name="body.attributes"/>
374 <xsl:call-template name="user.header.content">
375 <xsl:with-param name="node" select="$doc"/>
377 <xsl:apply-templates select="."/>
378 <xsl:call-template name="user.footer.content">
379 <xsl:with-param name="node" select="$doc"/>
385 <xsl:template name="root.messages">
386 <!-- redefine this any way you'd like to output messages -->
387 <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
390 <!-- ==================================================================== -->
392 <xsl:template name="chunk">
393 <xsl:param name="node" select="."/>
395 <!-- The default is that we are not chunking... -->
396 <xsl:text>0</xsl:text>
399 <!-- ==================================================================== -->
401 <xsl:template match="*" mode="stripNS">
403 <xsl:when test="self::ng:* or self::db:*">
404 <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
405 <xsl:copy-of select="@*"/>
406 <xsl:apply-templates mode="stripNS"/>
411 <xsl:copy-of select="@*"/>
412 <xsl:apply-templates mode="stripNS"/>
418 <xsl:template match="ng:link|db:link" mode="stripNS">
419 <xsl:variable xmlns:xlink="http://www.w3.org/1999/xlink" name="href" select="@xlink:href|@href"/>
421 <xsl:when test="$href != '' and not(starts-with($href,'#'))">
422 <ulink url="{$href}">
423 <xsl:for-each select="@*">
424 <xsl:if test="local-name(.) != 'href'">
428 <xsl:apply-templates mode="stripNS"/>
431 <xsl:when test="$href != '' and starts-with($href,'#')">
432 <link linkend="{substring-after($href,'#')}">
433 <xsl:for-each select="@*">
434 <xsl:if test="local-name(.) != 'href'">
438 <xsl:apply-templates mode="stripNS"/>
443 <xsl:copy-of select="@*"/>
444 <xsl:apply-templates mode="stripNS"/>
450 <xsl:template match="comment()|processing-instruction()|text()" mode="stripNS">
454 <!-- ==================================================================== -->