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">
8 <xsl:output method="xml" encoding="UTF-8" indent="no" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
10 <!-- ********************************************************************
11 $Id: docbook.xsl 8399 2009-04-08 07:37:42Z bobstayton $
12 ********************************************************************
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.
18 ******************************************************************** -->
20 <!-- ==================================================================== -->
22 <xsl:include href="../VERSION"/>
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"/>
74 <xsl:param name="stylesheet.result.type" select="'xhtml'"/>
75 <xsl:param name="htmlhelp.output" select="0"/>
77 <!-- ==================================================================== -->
79 <xsl:key name="id" match="*" use="@id|@xml:id"/>
80 <xsl:key name="gid" match="*" use="generate-id()"/>
82 <!-- ==================================================================== -->
84 <xsl:template match="*">
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::*)"/>
95 <xsl:text>, but no template matches.</xsl:text>
98 <span style="color: red">
99 <xsl:text><</xsl:text>
100 <xsl:value-of select="name(.)"/>
101 <xsl:text>></xsl:text>
102 <xsl:apply-templates/>
103 <xsl:text></</xsl:text>
104 <xsl:value-of select="name(.)"/>
105 <xsl:text>></xsl:text>
109 <xsl:template match="text()">
110 <xsl:value-of select="."/>
113 <xsl:template name="body.attributes">
114 <!-- no apply-templates; make it empty -->
117 <xsl:template name="head.content">
118 <xsl:param name="node" select="."/>
119 <xsl:param name="title">
120 <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
124 <xsl:copy-of select="$title"/>
127 <xsl:if test="$html.stylesheet != ''">
128 <xsl:call-template name="output.html.stylesheets">
129 <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
133 <xsl:if test="$link.mailto.url != ''">
134 <link rev="made" href="{$link.mailto.url}"/>
137 <xsl:if test="$html.base != ''">
138 <base href="{$html.base}"/>
141 <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
143 <xsl:if test="$generate.meta.abstract != 0">
144 <xsl:variable name="info" select="(articleinfo |bookinfo |prefaceinfo |chapterinfo |appendixinfo |sectioninfo |sect1info |sect2info |sect3info |sect4info |sect5info |referenceinfo |refentryinfo |partinfo |info |docinfo)[1]"/>
145 <xsl:if test="$info and $info/abstract">
146 <meta name="description">
147 <xsl:attribute name="content">
148 <xsl:for-each select="$info/abstract[1]/*">
149 <xsl:value-of select="normalize-space(.)"/>
150 <xsl:if test="position() < last()">
151 <xsl:text> </xsl:text>
159 <xsl:if test="($draft.mode = 'yes' or ($draft.mode = 'maybe' and ancestor-or-self::*[@status][1]/@status = 'draft')) and $draft.watermark.image != ''">
160 <style type="text/css"><xsl:text>
161 body { background-image: url('</xsl:text>
162 <xsl:value-of select="$draft.watermark.image"/><xsl:text>');
163 background-repeat: no-repeat;
164 background-position: top left;
165 /* The following properties make the watermark "fixed" on the page. */
166 /* I think that's just a bit too distracting for the reader... */
167 /* background-attachment: fixed; */
168 /* background-position: center center; */
172 <xsl:apply-templates select="." mode="head.keywords.content"/>
175 <xsl:template name="output.html.stylesheets">
176 <xsl:param name="stylesheets" select="''"/>
179 <xsl:when test="contains($stylesheets, ' ')">
180 <link rel="stylesheet" href="{substring-before($stylesheets, ' ')}">
181 <xsl:if test="$html.stylesheet.type != ''">
182 <xsl:attribute name="type">
183 <xsl:value-of select="$html.stylesheet.type"/>
187 <xsl:call-template name="output.html.stylesheets">
188 <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
191 <xsl:when test="$stylesheets != ''">
192 <link rel="stylesheet" href="{$stylesheets}">
193 <xsl:if test="$html.stylesheet.type != ''">
194 <xsl:attribute name="type">
195 <xsl:value-of select="$html.stylesheet.type"/>
203 <!-- ============================================================ -->
205 <xsl:template match="*" mode="head.keywords.content">
206 <xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
207 <xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
208 <xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
209 <xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
210 <xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
211 <xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
212 <xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
213 <xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
214 <xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
215 <xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
216 <xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
217 <xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
218 <xsl:apply-templates select="sectioninfo/keywordset" mode="html.header"/>
219 <xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
220 <xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
221 <xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
222 <xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
223 <xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
224 <xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
225 <xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
226 <xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
227 <xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
228 <xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
229 <xsl:apply-templates select="info/keywordset" mode="html.header"/>
231 <xsl:if test="$inherit.keywords != 0 and parent::*">
232 <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
236 <!-- ============================================================ -->
238 <xsl:template name="system.head.content">
239 <xsl:param name="node" select="."/>
241 <!-- FIXME: When chunking, only the annotations actually used
242 in this chunk should be referenced. I don't think it
243 does any harm to reference them all, but it adds
244 unnecessary bloat to each chunk. -->
245 <xsl:if test="$annotation.support != 0 and //annotation">
246 <xsl:call-template name="add.annotation.links"/>
247 <script type="text/javascript">
249 // Create PopupWindow objects</xsl:text>
250 <xsl:for-each select="//annotation">
252 var popup_</xsl:text>
253 <xsl:value-of select="generate-id(.)"/>
254 <xsl:text> = new PopupWindow("popup-</xsl:text>
255 <xsl:value-of select="generate-id(.)"/>
258 <xsl:text>popup_</xsl:text>
259 <xsl:value-of select="generate-id(.)"/>
260 <xsl:text>.offsetY = 15;
262 <xsl:text>popup_</xsl:text>
263 <xsl:value-of select="generate-id(.)"/>
264 <xsl:text>.autoHide();
269 <style type="text/css">
270 <xsl:value-of select="$annotation.css"/>
274 <!-- system.head.content is like user.head.content, except that
275 it is called before head.content. This is important because it
276 means, for example, that <style> elements output by system.head.content
277 have a lower CSS precedence than the users stylesheet. -->
280 <!-- ============================================================ -->
282 <xsl:template name="user.preroot">
283 <!-- Pre-root output, can be used to output comments and PIs. -->
284 <!-- This must not output any element content! -->
287 <xsl:template name="user.head.content">
288 <xsl:param name="node" select="."/>
291 <xsl:template name="user.header.navigation">
292 <xsl:param name="node" select="."/>
295 <xsl:template name="user.header.content">
296 <xsl:param name="node" select="."/>
299 <xsl:template name="user.footer.content">
300 <xsl:param name="node" select="."/>
303 <xsl:template name="user.footer.navigation">
304 <xsl:param name="node" select="."/>
307 <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="/">
308 <!-- * Get a title for current doc so that we let the user -->
309 <!-- * know what document we are processing at this point. -->
310 <xsl:variable name="doc.title">
311 <xsl:call-template name="get.doc.title"/>
314 <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
315 toss the namespace and continue. Use the docbook5 namespaced
316 stylesheets for DocBook5 if you don't want to use this feature.-->
317 <!-- include extra test for Xalan quirk -->
318 <xsl:when test="false()"/>
319 <!-- Can't process unless namespace removed -->
320 <xsl:when test="false()"/>
323 <xsl:when test="$rootid != ''">
325 <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
326 <xsl:message terminate="yes">
327 <xsl:text>ID '</xsl:text>
328 <xsl:value-of select="$rootid"/>
329 <xsl:text>' not found in document.</xsl:text>
333 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
334 <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
336 <xsl:if test="$collect.xref.targets != 'only'">
337 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
338 <xsl:if test="$tex.math.in.alt != ''">
339 <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
346 <xsl:if test="$collect.xref.targets = 'yes' or $collect.xref.targets = 'only'">
347 <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
349 <xsl:if test="$collect.xref.targets != 'only'">
350 <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
351 <xsl:if test="$tex.math.in.alt != ''">
352 <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
361 <xsl:template match="*" mode="process.root">
362 <xsl:variable name="doc" select="self::*"/>
364 <xsl:call-template name="user.preroot"/>
365 <xsl:call-template name="root.messages"/>
369 <xsl:call-template name="system.head.content">
370 <xsl:with-param name="node" select="$doc"/>
372 <xsl:call-template name="head.content">
373 <xsl:with-param name="node" select="$doc"/>
375 <xsl:call-template name="user.head.content">
376 <xsl:with-param name="node" select="$doc"/>
380 <xsl:call-template name="body.attributes"/>
381 <xsl:call-template name="user.header.content">
382 <xsl:with-param name="node" select="$doc"/>
384 <xsl:apply-templates select="."/>
385 <xsl:call-template name="user.footer.content">
386 <xsl:with-param name="node" select="$doc"/>
390 <xsl:value-of select="$html.append"/>
393 <xsl:template name="root.messages">
394 <!-- redefine this any way you'd like to output messages -->
395 <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
398 <!-- ==================================================================== -->
400 <xsl:template name="chunk">
401 <xsl:param name="node" select="."/>
403 <!-- The default is that we are not chunking... -->
404 <xsl:text>0</xsl:text>
407 <!-- ==================================================================== -->