1193323Sed<?xml version="1.0" encoding="US-ASCII"?>
2193323Sed<!--This file was created automatically by xsl2profile-->
3193323Sed<!--from the DocBook XSL stylesheets. Do not edit this file.-->
4193323Sed<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" exslt:dummy="dummy" ng:dummy="dummy" db:dummy="dummy" extension-element-prefixes="exslt" exclude-result-prefixes="db ng exsl exslt" version="1.0">
5193323Sed
6193323Sed<xsl:output method="html" encoding="ISO-8859-1" indent="no"/>
7193323Sed
8193323Sed<!-- ********************************************************************
9193323Sed     $Id: docbook.xsl,v 1.41 2006/04/21 14:37:19 nwalsh Exp $
10193323Sed     ********************************************************************
11193323Sed
12193323Sed     This file is part of the XSL DocBook Stylesheet distribution.
13193323Sed     See ../README or http://nwalsh.com/docbook/xsl/ for copyright
14193323Sed     and other information.
15193323Sed
16193323Sed     ******************************************************************** -->
17193323Sed
18245431Sdim<!-- ==================================================================== -->
19245431Sdim
20245431Sdim<xsl:include href="../VERSION"/>
21193323Sed<xsl:include href="param.xsl"/>
22193323Sed<xsl:include href="../lib/lib.xsl"/>
23193323Sed<xsl:include href="../common/l10n.xsl"/>
24193323Sed<xsl:include href="../common/common.xsl"/>
25193323Sed<xsl:include href="../common/labels.xsl"/>
26193323Sed<xsl:include href="../common/titles.xsl"/>
27193323Sed<xsl:include href="../common/subtitles.xsl"/>
28193323Sed<xsl:include href="../common/gentext.xsl"/>
29193323Sed<xsl:include href="../common/targets.xsl"/>
30193323Sed<xsl:include href="../common/olink.xsl"/>
31193323Sed<xsl:include href="../common/pi.xsl"/>
32193323Sed<xsl:include href="autotoc.xsl"/>
33193323Sed<xsl:include href="autoidx.xsl"/>
34193323Sed<xsl:include href="lists.xsl"/>
35193323Sed<xsl:include href="callout.xsl"/>
36193323Sed<xsl:include href="verbatim.xsl"/>
37193323Sed<xsl:include href="graphics.xsl"/>
38193323Sed<xsl:include href="xref.xsl"/>
39193323Sed<xsl:include href="formal.xsl"/>
40193323Sed<xsl:include href="table.xsl"/>
41193323Sed<xsl:include href="htmltbl.xsl"/>
42193323Sed<xsl:include href="sections.xsl"/>
43193323Sed<xsl:include href="inline.xsl"/>
44193323Sed<xsl:include href="footnote.xsl"/>
45193323Sed<xsl:include href="html.xsl"/>
46193323Sed<xsl:include href="info.xsl"/>
47193323Sed<xsl:include href="keywords.xsl"/>
48193323Sed<xsl:include href="division.xsl"/>
49193323Sed<xsl:include href="toc.xsl"/>
50193323Sed<xsl:include href="index.xsl"/>
51193323Sed<xsl:include href="refentry.xsl"/>
52193323Sed<xsl:include href="math.xsl"/>
53218893Sdim<xsl:include href="admon.xsl"/>
54193323Sed<xsl:include href="component.xsl"/>
55193323Sed<xsl:include href="biblio.xsl"/>
56218893Sdim<xsl:include href="glossary.xsl"/>
57193323Sed<xsl:include href="block.xsl"/>
58245431Sdim<xsl:include href="task.xsl"/>
59193323Sed<xsl:include href="qandaset.xsl"/>
60252723Sdim<xsl:include href="synop.xsl"/>
61245431Sdim<xsl:include href="titlepage.xsl"/>
62245431Sdim<xsl:include href="titlepage.templates.xsl"/>
63245431Sdim<xsl:include href="pi.xsl"/>
64252723Sdim<xsl:include href="ebnf.xsl"/>
65245431Sdim<xsl:include href="chunker.xsl"/>
66245431Sdim<xsl:include href="html-rtf.xsl"/>
67245431Sdim<xsl:include href="docbookng.xsl"/>
68245431Sdim<xsl:include href="annotations.xsl"/>
69245431Sdim<xsl:include href="../common/stripns.xsl"/>
70245431Sdim
71245431Sdim<xsl:param name="stylesheet.result.type" select="'html'"/>
72245431Sdim<xsl:param name="htmlhelp.output" select="0"/>
73245431Sdim
74252723Sdim<!-- ==================================================================== -->
75252723Sdim
76252723Sdim<xsl:key name="id" match="*" use="@id|@xml:id"/>
77252723Sdim<xsl:key name="gid" match="*" use="generate-id()"/>
78252723Sdim
79245431Sdim<!-- ==================================================================== -->
80252723Sdim
81252723Sdim<xsl:template match="*">
82252723Sdim  <xsl:message>
83252723Sdim    <xsl:text>No template matches </xsl:text>
84245431Sdim    <xsl:value-of select="name(.)"/>
85252723Sdim    <xsl:if test="parent::*">
86252723Sdim      <xsl:text> in </xsl:text>
87252723Sdim      <xsl:value-of select="name(parent::*)"/>
88252723Sdim    </xsl:if>
89252723Sdim    <xsl:text>.</xsl:text>
90252723Sdim  </xsl:message>
91252723Sdim
92252723Sdim  <font color="red">
93252723Sdim    <xsl:text>&lt;</xsl:text>
94252723Sdim    <xsl:value-of select="name(.)"/>
95252723Sdim    <xsl:text>&gt;</xsl:text>
96252723Sdim    <xsl:apply-templates/>
97252723Sdim    <xsl:text>&lt;/</xsl:text>
98252723Sdim    <xsl:value-of select="name(.)"/>
99252723Sdim    <xsl:text>&gt;</xsl:text>
100252723Sdim  </font>
101245431Sdim</xsl:template>
102245431Sdim
103245431Sdim<xsl:template match="text()">
104245431Sdim  <xsl:value-of select="."/>
105252723Sdim</xsl:template>
106245431Sdim
107252723Sdim<xsl:template name="body.attributes">
108252723Sdim  <xsl:attribute name="bgcolor">white</xsl:attribute>
109252723Sdim  <xsl:attribute name="text">black</xsl:attribute>
110245431Sdim  <xsl:attribute name="link">#0000FF</xsl:attribute>
111245431Sdim  <xsl:attribute name="vlink">#840084</xsl:attribute>
112245431Sdim  <xsl:attribute name="alink">#0000FF</xsl:attribute>
113245431Sdim</xsl:template>
114252723Sdim
115252723Sdim<xsl:template name="head.content">
116252723Sdim  <xsl:param name="node" select="."/>
117252723Sdim  <xsl:param name="title">
118245431Sdim    <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
119252723Sdim  </xsl:param>
120252723Sdim
121252723Sdim  <title>
122252723Sdim    <xsl:copy-of select="$title"/>
123252723Sdim  </title>
124252723Sdim
125252723Sdim  <xsl:if test="$html.stylesheet != ''">
126252723Sdim    <xsl:call-template name="output.html.stylesheets">
127252723Sdim      <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
128252723Sdim    </xsl:call-template>
129252723Sdim  </xsl:if>
130252723Sdim
131252723Sdim  <xsl:if test="$link.mailto.url != ''">
132252723Sdim    <link rev="made" href="{$link.mailto.url}"/>
133252723Sdim  </xsl:if>
134252723Sdim
135252723Sdim  <xsl:if test="$html.base != ''">
136252723Sdim    <base href="{$html.base}"/>
137252723Sdim  </xsl:if>
138252723Sdim
139252723Sdim  <meta name="generator" content="DocBook XSL Stylesheets V{$VERSION}"/>
140252723Sdim
141252723Sdim  <xsl:if test="$generate.meta.abstract != 0">
142252723Sdim    <xsl:variable name="info" select="(articleinfo                                       |bookinfo                                       |prefaceinfo                                       |chapterinfo                                       |appendixinfo                                       |sectioninfo                                       |sect1info                                       |sect2info                                       |sect3info                                       |sect4info                                       |sect5info                                       |referenceinfo                                       |refentryinfo                                       |partinfo                                       |info                                       |docinfo)[1]"/>
143252723Sdim    <xsl:if test="$info and $info/abstract">
144252723Sdim      <meta name="description">
145252723Sdim        <xsl:attribute name="content">
146252723Sdim          <xsl:for-each select="$info/abstract[1]/*">
147252723Sdim            <xsl:value-of select="normalize-space(.)"/>
148252723Sdim            <xsl:if test="position() &lt; last()">
149252723Sdim              <xsl:text> </xsl:text>
150252723Sdim            </xsl:if>
151252723Sdim          </xsl:for-each>
152252723Sdim        </xsl:attribute>
153252723Sdim      </meta>
154252723Sdim    </xsl:if>
155245431Sdim  </xsl:if>
156252723Sdim
157252723Sdim  <xsl:if test="($draft.mode = 'yes' or                 ($draft.mode = 'maybe' and                 ancestor-or-self::*[@status][1]/@status = 'draft'))                 and $draft.watermark.image != ''">
158252723Sdim    <style type="text/css"><xsl:text>
159252723Sdimbody { background-image: url('</xsl:text>
160252723Sdim<xsl:value-of select="$draft.watermark.image"/><xsl:text>');
161252723Sdim       background-repeat: no-repeat;
162252723Sdim       background-position: top left;
163252723Sdim       /* The following properties make the watermark "fixed" on the page. */
164252723Sdim       /* I think that's just a bit too distracting for the reader... */
165252723Sdim       /* background-attachment: fixed; */
166245431Sdim       /* background-position: center center; */
167245431Sdim     }</xsl:text>
168245431Sdim    </style>
169245431Sdim  </xsl:if>
170252723Sdim  <xsl:apply-templates select="." mode="head.keywords.content"/>
171252723Sdim</xsl:template>
172252723Sdim
173252723Sdim<xsl:template name="output.html.stylesheets">
174252723Sdim  <xsl:param name="stylesheets" select="''"/>
175252723Sdim
176252723Sdim  <xsl:choose>
177252723Sdim    <xsl:when test="contains($stylesheets, ' ')">
178252723Sdim      <link rel="stylesheet" href="{substring-before($stylesheets, ' ')}">
179252723Sdim        <xsl:if test="$html.stylesheet.type != ''">
180252723Sdim          <xsl:attribute name="type">
181252723Sdim            <xsl:value-of select="$html.stylesheet.type"/>
182252723Sdim          </xsl:attribute>
183252723Sdim        </xsl:if>
184252723Sdim      </link>
185252723Sdim      <xsl:call-template name="output.html.stylesheets">
186252723Sdim        <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
187252723Sdim      </xsl:call-template>
188252723Sdim    </xsl:when>
189245431Sdim    <xsl:when test="$stylesheets != ''">
190245431Sdim      <link rel="stylesheet" href="{$stylesheets}">
191245431Sdim        <xsl:if test="$html.stylesheet.type != ''">
192245431Sdim          <xsl:attribute name="type">
193252723Sdim            <xsl:value-of select="$html.stylesheet.type"/>
194252723Sdim          </xsl:attribute>
195252723Sdim        </xsl:if>
196245431Sdim      </link>
197252723Sdim    </xsl:when>
198252723Sdim  </xsl:choose>
199252723Sdim</xsl:template>
200252723Sdim
201252723Sdim<!-- ============================================================ -->
202245431Sdim
203193323Sed<xsl:template match="*" mode="head.keywords.content">
204193323Sed  <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="refsect1info/keywordset" mode="html.header"/>
217  <xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
218  <xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
219  <xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
220  <xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
221  <xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
222  <xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
223  <xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
224  <xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
225  <xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
226  <xsl:apply-templates select="info/keywordset" mode="html.header"/>
227
228  <xsl:if test="$inherit.keywords != 0                 and parent::*">
229    <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
230  </xsl:if>
231</xsl:template>
232
233<!-- ============================================================ -->
234
235<xsl:template name="system.head.content">
236  <xsl:param name="node" select="."/>
237
238  <!-- FIXME: When chunking, only the annotations actually used
239              in this chunk should be referenced. I don't think it
240	      does any harm to reference them all, but it adds
241	      unnecessary bloat to each chunk. -->
242  <xsl:if test="$annotation.support != 0 and //annotation">
243    <xsl:call-template name="add.annotation.links"/>
244    <script type="text/javascript">
245      <xsl:text>
246// Create PopupWindow objects</xsl:text>
247      <xsl:for-each select="//annotation">
248	<xsl:text>
249var popup_</xsl:text>
250	<xsl:value-of select="generate-id(.)"/>
251	<xsl:text> = new PopupWindow("popup-</xsl:text>
252	<xsl:value-of select="generate-id(.)"/>
253	<xsl:text>");
254</xsl:text>
255	<xsl:text>popup_</xsl:text>
256	<xsl:value-of select="generate-id(.)"/>
257	<xsl:text>.offsetY = 15;
258</xsl:text>
259	<xsl:text>popup_</xsl:text>
260	<xsl:value-of select="generate-id(.)"/>
261	<xsl:text>.autoHide();
262</xsl:text>
263      </xsl:for-each>
264    </script>
265
266    <style type="text/css">
267      <xsl:value-of select="$annotation.css"/>
268    </style>
269  </xsl:if>
270
271  <!-- system.head.content is like user.head.content, except that
272       it is called before head.content. This is important because it
273       means, for example, that <style> elements output by system.head.content
274       have a lower CSS precedence than the users stylesheet. -->
275</xsl:template>
276
277<!-- ============================================================ -->
278
279<xsl:template name="user.preroot">
280  <!-- Pre-root output, can be used to output comments and PIs. -->
281  <!-- This must not output any element content! -->
282</xsl:template>
283
284<xsl:template name="user.head.content">
285  <xsl:param name="node" select="."/>
286</xsl:template>
287
288<xsl:template name="user.header.navigation">
289  <xsl:param name="node" select="."/>
290</xsl:template>
291
292<xsl:template name="user.header.content">
293  <xsl:param name="node" select="."/>
294</xsl:template>
295
296<xsl:template name="user.footer.content">
297  <xsl:param name="node" select="."/>
298</xsl:template>
299
300<xsl:template name="user.footer.navigation">
301  <xsl:param name="node" select="."/>
302</xsl:template>
303
304<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>Stripping NS from DocBook 5/NG document.</xslo:message><xslo:variable name="stripped-content"><xslo:apply-templates select="/" mode="stripNS"/></xslo:variable><xslo:message>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="/">
305  <xsl:choose>
306    <xsl:when test="false()"/>
307    <xsl:otherwise>
308      <xsl:choose>
309	<xsl:when test="$rootid != ''">
310	  <xsl:choose>
311	    <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
312	      <xsl:message terminate="yes">
313		<xsl:text>ID '</xsl:text>
314		<xsl:value-of select="$rootid"/>
315		<xsl:text>' not found in document.</xsl:text>
316	      </xsl:message>
317	    </xsl:when>
318	    <xsl:otherwise>
319	      <xsl:if test="$collect.xref.targets = 'yes' or               $collect.xref.targets = 'only'">
320		<xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
321	      </xsl:if>
322	      <xsl:if test="$collect.xref.targets != 'only'">
323		<xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
324		<xsl:if test="$tex.math.in.alt != ''">
325		  <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
326		</xsl:if>
327	      </xsl:if>
328	    </xsl:otherwise>
329	  </xsl:choose>
330	</xsl:when>
331	<xsl:otherwise>
332	  <xsl:if test="$collect.xref.targets = 'yes' or           $collect.xref.targets = 'only'">
333	    <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
334	  </xsl:if>
335	  <xsl:if test="$collect.xref.targets != 'only'">
336	    <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
337	    <xsl:if test="$tex.math.in.alt != ''">
338	      <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
339	    </xsl:if>
340	  </xsl:if>
341	</xsl:otherwise>
342      </xsl:choose>
343    </xsl:otherwise>
344  </xsl:choose>
345</xsl:template>
346
347<xsl:template match="*" mode="process.root">
348  <xsl:variable name="doc" select="self::*"/>
349
350  <xsl:call-template name="user.preroot"/>
351  <xsl:call-template name="root.messages"/>
352
353  <html>
354    <head>
355      <xsl:call-template name="system.head.content">
356        <xsl:with-param name="node" select="$doc"/>
357      </xsl:call-template>
358      <xsl:call-template name="head.content">
359        <xsl:with-param name="node" select="$doc"/>
360      </xsl:call-template>
361      <xsl:call-template name="user.head.content">
362        <xsl:with-param name="node" select="$doc"/>
363      </xsl:call-template>
364    </head>
365    <body>
366      <xsl:call-template name="body.attributes"/>
367      <xsl:call-template name="user.header.content">
368        <xsl:with-param name="node" select="$doc"/>
369      </xsl:call-template>
370      <xsl:apply-templates select="."/>
371      <xsl:call-template name="user.footer.content">
372        <xsl:with-param name="node" select="$doc"/>
373      </xsl:call-template>
374    </body>
375  </html>
376</xsl:template>
377
378<xsl:template name="root.messages">
379  <!-- redefine this any way you'd like to output messages -->
380  <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
381</xsl:template>
382
383<!-- ==================================================================== -->
384
385<xsl:template name="chunk">
386  <xsl:param name="node" select="."/>
387
388  <!-- The default is that we are not chunking... -->
389  <xsl:text>0</xsl:text>
390</xsl:template>
391
392<!-- ==================================================================== -->
393
394</xsl:stylesheet>
395