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"/>
9
10<!-- ********************************************************************
11     $Id: xhtml-profile-docbook.xsl,v 1.1 2011-09-16 21:44:00 bobs Exp $
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="../xhtml/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="../xhtml/autotoc.xsl"/>
36<xsl:include href="../xhtml/autoidx.xsl"/>
37<xsl:include href="../xhtml/lists.xsl"/>
38<xsl:include href="../xhtml/callout.xsl"/>
39<xsl:include href="../xhtml/verbatim.xsl"/>
40<xsl:include href="../xhtml/graphics.xsl"/>
41<xsl:include href="../xhtml/xref.xsl"/>
42<xsl:include href="../xhtml/formal.xsl"/>
43<xsl:include href="../xhtml/table.xsl"/>
44<xsl:include href="../xhtml/htmltbl.xsl"/>
45<xsl:include href="../xhtml/sections.xsl"/>
46<xsl:include href="../xhtml/inline.xsl"/>
47<xsl:include href="../xhtml/footnote.xsl"/>
48<xsl:include href="../xhtml/html.xsl"/>
49<xsl:include href="../xhtml/info.xsl"/>
50<xsl:include href="../xhtml/keywords.xsl"/>
51<xsl:include href="../xhtml/division.xsl"/>
52<xsl:include href="../xhtml/toc.xsl"/>
53<xsl:include href="../xhtml/index.xsl"/>
54<xsl:include href="../xhtml/refentry.xsl"/>
55<xsl:include href="../xhtml/math.xsl"/>
56<xsl:include href="../xhtml/admon.xsl"/>
57<xsl:include href="../xhtml/component.xsl"/>
58<xsl:include href="../xhtml/biblio.xsl"/>
59<xsl:include href="../xhtml/biblio-iso690.xsl"/>
60<xsl:include href="../xhtml/glossary.xsl"/>
61<xsl:include href="../xhtml/block.xsl"/>
62<xsl:include href="../xhtml/task.xsl"/>
63<xsl:include href="../xhtml/qandaset.xsl"/>
64<xsl:include href="../xhtml/synop.xsl"/>
65<xsl:include href="../xhtml/titlepage.xsl"/>
66<xsl:include href="../xhtml/titlepage.templates.xsl"/>
67<xsl:include href="../xhtml/pi.xsl"/>
68<xsl:include href="../xhtml/ebnf.xsl"/>
69<xsl:include href="../xhtml/chunker.xsl"/>
70<xsl:include href="../xhtml/html-rtf.xsl"/>
71<xsl:include href="../xhtml/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">
118  <xsl:param name="node" select="."/>
119  <xsl:param name="title">
120    <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
121  </xsl:param>
122
123  <title>
124    <xsl:copy-of select="$title"/>
125  </title>
126
127  <xsl:if test="$html.base != ''">
128    <base href="{$html.base}"/>
129  </xsl:if>
130
131  <!-- Insert links to CSS files or insert literal style elements -->
132  <xsl:call-template name="generate.css"/>
133
134  <xsl:if test="$html.stylesheet != ''">
135    <xsl:call-template name="output.html.stylesheets">
136      <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
137    </xsl:call-template>
138  </xsl:if>
139
140  <xsl:if test="$link.mailto.url != ''">
141    <link rev="made" href="{$link.mailto.url}"/>
142  </xsl:if>
143
144  <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
145
146  <xsl:if test="$generate.meta.abstract != 0">
147    <xsl:variable name="info" select="(articleinfo                                       |bookinfo                                       |prefaceinfo                                       |chapterinfo                                       |appendixinfo                                       |sectioninfo                                       |sect1info                                       |sect2info                                       |sect3info                                       |sect4info                                       |sect5info                                       |referenceinfo                                       |refentryinfo                                       |partinfo                                       |info                                       |docinfo)[1]"/>
148    <xsl:if test="$info and $info/abstract">
149      <meta name="description">
150        <xsl:attribute name="content">
151          <xsl:for-each select="$info/abstract[1]/*">
152            <xsl:value-of select="normalize-space(.)"/>
153            <xsl:if test="position() &lt; last()">
154              <xsl:text> </xsl:text>
155            </xsl:if>
156          </xsl:for-each>
157        </xsl:attribute>
158      </meta>
159    </xsl:if>
160  </xsl:if>
161
162  <xsl:if test="($draft.mode = 'yes' or                 ($draft.mode = 'maybe' and                 ancestor-or-self::*[@status][1]/@status = 'draft'))                 and $draft.watermark.image != ''">
163    <style type="text/css"><xsl:text>
164body { background-image: url('</xsl:text>
165<xsl:value-of select="$draft.watermark.image"/><xsl:text>');
166       background-repeat: no-repeat;
167       background-position: top left;
168       /* The following properties make the watermark "fixed" on the page. */
169       /* I think that's just a bit too distracting for the reader... */
170       /* background-attachment: fixed; */
171       /* background-position: center center; */
172     }</xsl:text>
173    </style>
174  </xsl:if>
175  <xsl:apply-templates select="." mode="head.keywords.content"/>
176</xsl:template>
177
178<xsl:template name="output.html.stylesheets">
179  <xsl:param name="stylesheets" select="''"/>
180
181  <xsl:choose>
182    <xsl:when test="contains($stylesheets, ' ')">
183      <xsl:variable name="css.filename" select="substring-before($stylesheets, ' ')"/>
184
185      <xsl:call-template name="make.css.link">
186        <xsl:with-param name="css.filename" select="$css.filename"/>
187      </xsl:call-template>
188
189      <xsl:call-template name="output.html.stylesheets">
190        <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
191      </xsl:call-template>
192    </xsl:when>
193    <xsl:when test="$stylesheets != ''">
194      <xsl:call-template name="make.css.link">
195        <xsl:with-param name="css.filename" select="$stylesheets"/>
196      </xsl:call-template>
197    </xsl:when>
198  </xsl:choose>
199</xsl:template>
200
201<!-- ============================================================ -->
202
203<xsl:template match="*" mode="head.keywords.content">
204  <xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
205  <xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
206  <xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
207  <xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
208  <xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
209  <xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
210  <xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
211  <xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
212  <xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
213  <xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
214  <xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
215  <xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
216  <xsl:apply-templates select="sectioninfo/keywordset" mode="html.header"/>
217  <xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
218  <xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
219  <xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
220  <xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
221  <xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
222  <xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
223  <xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
224  <xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
225  <xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
226  <xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
227  <xsl:apply-templates select="info/keywordset" mode="html.header"/>
228
229  <xsl:if test="$inherit.keywords != 0                 and parent::*">
230    <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
231  </xsl:if>
232</xsl:template>
233
234<!-- ============================================================ -->
235
236<xsl:template name="system.head.content">
237  <xsl:param name="node" select="."/>
238
239  <!-- FIXME: When chunking, only the annotations actually used
240              in this chunk should be referenced. I don't think it
241              does any harm to reference them all, but it adds
242              unnecessary bloat to each chunk. -->
243  <xsl:if test="$annotation.support != 0 and //annotation">
244    <xsl:call-template name="add.annotation.links"/>
245    <script type="text/javascript">
246      <xsl:text>
247// Create PopupWindow objects</xsl:text>
248      <xsl:for-each select="//annotation">
249        <xsl:text>
250var popup_</xsl:text>
251        <xsl:value-of select="generate-id(.)"/>
252        <xsl:text> = new PopupWindow("popup-</xsl:text>
253        <xsl:value-of select="generate-id(.)"/>
254        <xsl:text>");
255</xsl:text>
256        <xsl:text>popup_</xsl:text>
257        <xsl:value-of select="generate-id(.)"/>
258        <xsl:text>.offsetY = 15;
259</xsl:text>
260        <xsl:text>popup_</xsl:text>
261        <xsl:value-of select="generate-id(.)"/>
262        <xsl:text>.autoHide();
263</xsl:text>
264      </xsl:for-each>
265    </script>
266
267    <style type="text/css">
268      <xsl:value-of select="$annotation.css"/>
269    </style>
270  </xsl:if>
271
272  <!-- system.head.content is like user.head.content, except that
273       it is called before head.content. This is important because it
274       means, for example, that <style> elements output by system.head.content
275       have a lower CSS precedence than the users stylesheet. -->
276</xsl:template>
277
278<!-- ============================================================ -->
279
280<xsl:template name="user.preroot">
281  <!-- Pre-root output, can be used to output comments and PIs. -->
282  <!-- This must not output any element content! -->
283</xsl:template>
284
285<xsl:template name="user.head.content">
286  <xsl:param name="node" select="."/>
287</xsl:template>
288
289<xsl:template name="user.header.navigation">
290  <xsl:param name="node" select="."/>
291</xsl:template>
292
293<xsl:template name="user.header.content">
294  <xsl:param name="node" select="."/>
295</xsl:template>
296
297<xsl:template name="user.footer.content">
298  <xsl:param name="node" select="."/>
299</xsl:template>
300
301<xsl:template name="user.footer.navigation">
302  <xsl:param name="node" select="."/>
303</xsl:template>
304
305<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="/">
306  <!-- * Get a title for current doc so that we let the user -->
307  <!-- * know what document we are processing at this point. -->
308  <xsl:variable name="doc.title">
309    <xsl:call-template name="get.doc.title"/>
310  </xsl:variable>
311  <xsl:choose>
312    <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
313         toss the namespace and continue.  Use the docbook5 namespaced
314         stylesheets for DocBook5 if you don't want to use this feature.-->
315    <!-- include extra test for Xalan quirk -->
316    <xsl:when test="false()"/>
317    <!-- Can't process unless namespace removed -->
318    <xsl:when test="false()"/>
319    <xsl:otherwise>
320      <xsl:choose>
321        <xsl:when test="$rootid != ''">
322          <xsl:choose>
323            <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
324              <xsl:message terminate="yes">
325                <xsl:text>ID '</xsl:text>
326                <xsl:value-of select="$rootid"/>
327                <xsl:text>' not found in document.</xsl:text>
328              </xsl:message>
329            </xsl:when>
330            <xsl:otherwise>
331              <xsl:if test="$collect.xref.targets = 'yes' or                             $collect.xref.targets = 'only'">
332                <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
333              </xsl:if>
334              <xsl:if test="$collect.xref.targets != 'only'">
335                <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
336                <xsl:if test="$tex.math.in.alt != ''">
337                  <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
338                </xsl:if>
339              </xsl:if>
340            </xsl:otherwise>
341          </xsl:choose>
342        </xsl:when>
343        <xsl:otherwise>
344          <xsl:if test="$collect.xref.targets = 'yes' or                         $collect.xref.targets = 'only'">
345            <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
346          </xsl:if>
347          <xsl:if test="$collect.xref.targets != 'only'">
348            <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
349            <xsl:if test="$tex.math.in.alt != ''">
350              <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
351            </xsl:if>
352          </xsl:if>
353        </xsl:otherwise>
354      </xsl:choose>
355    </xsl:otherwise>
356  </xsl:choose>
357</xsl:template>
358
359<xsl:template match="*" mode="process.root">
360  <xsl:variable name="doc" select="self::*"/>
361
362  <xsl:call-template name="user.preroot"/>
363  <xsl:call-template name="root.messages"/>
364
365  <html>
366    <head>
367      <xsl:call-template name="system.head.content">
368        <xsl:with-param name="node" select="$doc"/>
369      </xsl:call-template>
370      <xsl:call-template name="head.content">
371        <xsl:with-param name="node" select="$doc"/>
372      </xsl:call-template>
373      <xsl:call-template name="user.head.content">
374        <xsl:with-param name="node" select="$doc"/>
375      </xsl:call-template>
376    </head>
377    <body>
378      <xsl:call-template name="body.attributes"/>
379      <xsl:call-template name="user.header.content">
380        <xsl:with-param name="node" select="$doc"/>
381      </xsl:call-template>
382      <xsl:apply-templates select="."/>
383      <xsl:call-template name="user.footer.content">
384        <xsl:with-param name="node" select="$doc"/>
385      </xsl:call-template>
386    </body>
387  </html>
388  <xsl:value-of select="$html.append"/>
389
390  <!-- Generate any css files only once, not once per chunk -->
391  <xsl:call-template name="generate.css.files"/>
392</xsl:template>
393
394<xsl:template name="root.messages">
395  <!-- redefine this any way you'd like to output messages -->
396  <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
397</xsl:template>
398
399<!-- ==================================================================== -->
400
401<xsl:template name="chunk">
402  <xsl:param name="node" select="."/>
403
404  <!-- The default is that we are not chunking... -->
405  <xsl:text>0</xsl:text>
406</xsl:template>
407
408</xsl:stylesheet>
409