~todd-deshane/openstack-manuals/working

« back to all changes in this revision

Viewing changes to doc/build/docbook-xsl-1.76.1/xhtml/docbook.xsl

  • Committer: Anne Gentle
  • Date: 2011-04-04 17:54:52 UTC
  • Revision ID: anne@openstack.org-20110404175452-gtth3hfrniqhpp5o
Switching from Ant builds to Maven, still working out kinks but should be functional

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="ASCII"?>
2
 
<!--This file was created automatically by html2xhtml-->
3
 
<!--from the HTML stylesheets.-->
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:exslt="http://exslt.org/common" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="db ng exsl exslt" version="1.0">
5
 
 
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"/>
7
 
 
8
 
<!-- ********************************************************************
9
 
     $Id: docbook.xsl 8783 2010-07-28 10:59:39Z mzjn $
10
 
     ********************************************************************
11
 
 
12
 
     This file is part of the XSL DocBook Stylesheet distribution.
13
 
     See ../README or http://docbook.sf.net/release/xsl/current/ for
14
 
     copyright and other information.
15
 
 
16
 
     ******************************************************************** -->
17
 
 
18
 
<!-- ==================================================================== -->
19
 
 
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/utility.xsl"/>
26
 
<xsl:include href="../common/labels.xsl"/>
27
 
<xsl:include href="../common/titles.xsl"/>
28
 
<xsl:include href="../common/subtitles.xsl"/>
29
 
<xsl:include href="../common/gentext.xsl"/>
30
 
<xsl:include href="../common/targets.xsl"/>
31
 
<xsl:include href="../common/olink.xsl"/>
32
 
<xsl:include href="../common/pi.xsl"/>
33
 
<xsl:include href="autotoc.xsl"/>
34
 
<xsl:include href="autoidx.xsl"/>
35
 
<xsl:include href="lists.xsl"/>
36
 
<xsl:include href="callout.xsl"/>
37
 
<xsl:include href="verbatim.xsl"/>
38
 
<xsl:include href="graphics.xsl"/>
39
 
<xsl:include href="xref.xsl"/>
40
 
<xsl:include href="formal.xsl"/>
41
 
<xsl:include href="table.xsl"/>
42
 
<xsl:include href="htmltbl.xsl"/>
43
 
<xsl:include href="sections.xsl"/>
44
 
<xsl:include href="inline.xsl"/>
45
 
<xsl:include href="footnote.xsl"/>
46
 
<xsl:include href="html.xsl"/>
47
 
<xsl:include href="info.xsl"/>
48
 
<xsl:include href="keywords.xsl"/>
49
 
<xsl:include href="division.xsl"/>
50
 
<xsl:include href="toc.xsl"/>
51
 
<xsl:include href="index.xsl"/>
52
 
<xsl:include href="refentry.xsl"/>
53
 
<xsl:include href="math.xsl"/>
54
 
<xsl:include href="admon.xsl"/>
55
 
<xsl:include href="component.xsl"/>
56
 
<xsl:include href="biblio.xsl"/>
57
 
<xsl:include href="biblio-iso690.xsl"/>
58
 
<xsl:include href="glossary.xsl"/>
59
 
<xsl:include href="block.xsl"/>
60
 
<xsl:include href="task.xsl"/>
61
 
<xsl:include href="qandaset.xsl"/>
62
 
<xsl:include href="synop.xsl"/>
63
 
<xsl:include href="titlepage.xsl"/>
64
 
<xsl:include href="titlepage.templates.xsl"/>
65
 
<xsl:include href="pi.xsl"/>
66
 
<xsl:include href="ebnf.xsl"/>
67
 
<xsl:include href="chunker.xsl"/>
68
 
<xsl:include href="html-rtf.xsl"/>
69
 
<xsl:include href="annotations.xsl"/>
70
 
<xsl:include href="../common/stripns.xsl"/>
71
 
 
72
 
<xsl:param name="stylesheet.result.type" select="'xhtml'"/>
73
 
<xsl:param name="htmlhelp.output" select="0"/>
74
 
 
75
 
<!-- ==================================================================== -->
76
 
 
77
 
<xsl:key name="id" match="*" use="@id|@xml:id"/>
78
 
<xsl:key name="gid" match="*" use="generate-id()"/>
79
 
 
80
 
<!-- ==================================================================== -->
81
 
 
82
 
<xsl:template match="*">
83
 
  <xsl:message>
84
 
    <xsl:text>Element </xsl:text>
85
 
    <xsl:value-of select="local-name(.)"/>
86
 
    <xsl:text> in namespace '</xsl:text>
87
 
    <xsl:value-of select="namespace-uri(.)"/>
88
 
    <xsl:text>' encountered</xsl:text>
89
 
    <xsl:if test="parent::*">
90
 
      <xsl:text> in </xsl:text>
91
 
      <xsl:value-of select="name(parent::*)"/>
92
 
    </xsl:if>
93
 
    <xsl:text>, but no template matches.</xsl:text>
94
 
  </xsl:message>
95
 
 
96
 
  <span style="color: red">
97
 
    <xsl:text>&lt;</xsl:text>
98
 
    <xsl:value-of select="name(.)"/>
99
 
    <xsl:text>&gt;</xsl:text>
100
 
    <xsl:apply-templates/>
101
 
    <xsl:text>&lt;/</xsl:text>
102
 
    <xsl:value-of select="name(.)"/>
103
 
    <xsl:text>&gt;</xsl:text>
104
 
  </span>
105
 
</xsl:template>
106
 
 
107
 
<xsl:template match="text()">
108
 
  <xsl:value-of select="."/>
109
 
</xsl:template>
110
 
 
111
 
<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>
112
 
<!-- no apply-templates; make it empty except for dir for rtl-->
113
 
</xsl:template>
114
 
 
115
 
<xsl:template name="head.content">
116
 
  <xsl:param name="node" select="."/>
117
 
  <xsl:param name="title">
118
 
    <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/>
119
 
  </xsl:param>
120
 
 
121
 
  <title>
122
 
    <xsl:copy-of select="$title"/>
123
 
  </title>
124
 
 
125
 
  <xsl:if test="$html.base != ''">
126
 
    <base href="{$html.base}"/>
127
 
  </xsl:if>
128
 
 
129
 
  <!-- Insert links to CSS files or insert literal style elements -->
130
 
  <xsl:call-template name="generate.css"/>
131
 
 
132
 
  <xsl:if test="$html.stylesheet != ''">
133
 
    <xsl:call-template name="output.html.stylesheets">
134
 
      <xsl:with-param name="stylesheets" select="normalize-space($html.stylesheet)"/>
135
 
    </xsl:call-template>
136
 
  </xsl:if>
137
 
 
138
 
  <xsl:if test="$link.mailto.url != ''">
139
 
    <link rev="made" href="{$link.mailto.url}"/>
140
 
  </xsl:if>
141
 
 
142
 
  <meta name="generator" content="DocBook {$DistroTitle} V{$VERSION}"/>
143
 
 
144
 
  <xsl:if test="$generate.meta.abstract != 0">
145
 
    <xsl:variable name="info" select="(articleinfo                                       |bookinfo                                       |prefaceinfo                                       |chapterinfo                                       |appendixinfo                                       |sectioninfo                                       |sect1info                                       |sect2info                                       |sect3info                                       |sect4info                                       |sect5info                                       |referenceinfo                                       |refentryinfo                                       |partinfo                                       |info                                       |docinfo)[1]"/>
146
 
    <xsl:if test="$info and $info/abstract">
147
 
      <meta name="description">
148
 
        <xsl:attribute name="content">
149
 
          <xsl:for-each select="$info/abstract[1]/*">
150
 
            <xsl:value-of select="normalize-space(.)"/>
151
 
            <xsl:if test="position() &lt; last()">
152
 
              <xsl:text> </xsl:text>
153
 
            </xsl:if>
154
 
          </xsl:for-each>
155
 
        </xsl:attribute>
156
 
      </meta>
157
 
    </xsl:if>
158
 
  </xsl:if>
159
 
 
160
 
  <xsl:if test="($draft.mode = 'yes' or                 ($draft.mode = 'maybe' and                 ancestor-or-self::*[@status][1]/@status = 'draft'))                 and $draft.watermark.image != ''">
161
 
    <style type="text/css"><xsl:text>
162
 
body { background-image: url('</xsl:text>
163
 
<xsl:value-of select="$draft.watermark.image"/><xsl:text>');
164
 
       background-repeat: no-repeat;
165
 
       background-position: top left;
166
 
       /* The following properties make the watermark "fixed" on the page. */
167
 
       /* I think that's just a bit too distracting for the reader... */
168
 
       /* background-attachment: fixed; */
169
 
       /* background-position: center center; */
170
 
     }</xsl:text>
171
 
    </style>
172
 
  </xsl:if>
173
 
  <xsl:apply-templates select="." mode="head.keywords.content"/>
174
 
</xsl:template>
175
 
 
176
 
<xsl:template name="output.html.stylesheets">
177
 
  <xsl:param name="stylesheets" select="''"/>
178
 
 
179
 
  <xsl:choose>
180
 
    <xsl:when test="contains($stylesheets, ' ')">
181
 
      <xsl:variable name="css.filename" select="substring-before($stylesheets, ' ')"/>
182
 
 
183
 
      <xsl:call-template name="make.css.link">
184
 
        <xsl:with-param name="css.filename" select="$css.filename"/>
185
 
      </xsl:call-template>
186
 
 
187
 
      <xsl:call-template name="output.html.stylesheets">
188
 
        <xsl:with-param name="stylesheets" select="substring-after($stylesheets, ' ')"/>
189
 
      </xsl:call-template>
190
 
    </xsl:when>
191
 
    <xsl:when test="$stylesheets != ''">
192
 
      <xsl:call-template name="make.css.link">
193
 
        <xsl:with-param name="css.filename" select="$stylesheets"/>
194
 
      </xsl:call-template>
195
 
    </xsl:when>
196
 
  </xsl:choose>
197
 
</xsl:template>
198
 
 
199
 
<!-- ============================================================ -->
200
 
 
201
 
<xsl:template match="*" mode="head.keywords.content">
202
 
  <xsl:apply-templates select="chapterinfo/keywordset" mode="html.header"/>
203
 
  <xsl:apply-templates select="appendixinfo/keywordset" mode="html.header"/>
204
 
  <xsl:apply-templates select="prefaceinfo/keywordset" mode="html.header"/>
205
 
  <xsl:apply-templates select="bookinfo/keywordset" mode="html.header"/>
206
 
  <xsl:apply-templates select="setinfo/keywordset" mode="html.header"/>
207
 
  <xsl:apply-templates select="articleinfo/keywordset" mode="html.header"/>
208
 
  <xsl:apply-templates select="artheader/keywordset" mode="html.header"/>
209
 
  <xsl:apply-templates select="sect1info/keywordset" mode="html.header"/>
210
 
  <xsl:apply-templates select="sect2info/keywordset" mode="html.header"/>
211
 
  <xsl:apply-templates select="sect3info/keywordset" mode="html.header"/>
212
 
  <xsl:apply-templates select="sect4info/keywordset" mode="html.header"/>
213
 
  <xsl:apply-templates select="sect5info/keywordset" mode="html.header"/>
214
 
  <xsl:apply-templates select="sectioninfo/keywordset" mode="html.header"/>
215
 
  <xsl:apply-templates select="refsect1info/keywordset" mode="html.header"/>
216
 
  <xsl:apply-templates select="refsect2info/keywordset" mode="html.header"/>
217
 
  <xsl:apply-templates select="refsect3info/keywordset" mode="html.header"/>
218
 
  <xsl:apply-templates select="bibliographyinfo/keywordset" mode="html.header"/>
219
 
  <xsl:apply-templates select="glossaryinfo/keywordset" mode="html.header"/>
220
 
  <xsl:apply-templates select="indexinfo/keywordset" mode="html.header"/>
221
 
  <xsl:apply-templates select="refentryinfo/keywordset" mode="html.header"/>
222
 
  <xsl:apply-templates select="partinfo/keywordset" mode="html.header"/>
223
 
  <xsl:apply-templates select="referenceinfo/keywordset" mode="html.header"/>
224
 
  <xsl:apply-templates select="docinfo/keywordset" mode="html.header"/>
225
 
  <xsl:apply-templates select="info/keywordset" mode="html.header"/>
226
 
 
227
 
  <xsl:if test="$inherit.keywords != 0                 and parent::*">
228
 
    <xsl:apply-templates select="parent::*" mode="head.keywords.content"/>
229
 
  </xsl:if>
230
 
</xsl:template>
231
 
 
232
 
<!-- ============================================================ -->
233
 
 
234
 
<xsl:template name="system.head.content">
235
 
  <xsl:param name="node" select="."/>
236
 
 
237
 
  <!-- FIXME: When chunking, only the annotations actually used
238
 
              in this chunk should be referenced. I don't think it
239
 
              does any harm to reference them all, but it adds
240
 
              unnecessary bloat to each chunk. -->
241
 
  <xsl:if test="$annotation.support != 0 and //annotation">
242
 
    <xsl:call-template name="add.annotation.links"/>
243
 
    <script type="text/javascript">
244
 
      <xsl:text>
245
 
// Create PopupWindow objects</xsl:text>
246
 
      <xsl:for-each select="//annotation">
247
 
        <xsl:text>
248
 
var popup_</xsl:text>
249
 
        <xsl:value-of select="generate-id(.)"/>
250
 
        <xsl:text> = new PopupWindow("popup-</xsl:text>
251
 
        <xsl:value-of select="generate-id(.)"/>
252
 
        <xsl:text>");
253
 
</xsl:text>
254
 
        <xsl:text>popup_</xsl:text>
255
 
        <xsl:value-of select="generate-id(.)"/>
256
 
        <xsl:text>.offsetY = 15;
257
 
</xsl:text>
258
 
        <xsl:text>popup_</xsl:text>
259
 
        <xsl:value-of select="generate-id(.)"/>
260
 
        <xsl:text>.autoHide();
261
 
</xsl:text>
262
 
      </xsl:for-each>
263
 
    </script>
264
 
 
265
 
    <style type="text/css">
266
 
      <xsl:value-of select="$annotation.css"/>
267
 
    </style>
268
 
  </xsl:if>
269
 
 
270
 
  <!-- system.head.content is like user.head.content, except that
271
 
       it is called before head.content. This is important because it
272
 
       means, for example, that <style> elements output by system.head.content
273
 
       have a lower CSS precedence than the users stylesheet. -->
274
 
</xsl:template>
275
 
 
276
 
<!-- ============================================================ -->
277
 
 
278
 
<xsl:template name="user.preroot">
279
 
  <!-- Pre-root output, can be used to output comments and PIs. -->
280
 
  <!-- This must not output any element content! -->
281
 
</xsl:template>
282
 
 
283
 
<xsl:template name="user.head.content">
284
 
  <xsl:param name="node" select="."/>
285
 
</xsl:template>
286
 
 
287
 
<xsl:template name="user.header.navigation">
288
 
  <xsl:param name="node" select="."/>
289
 
</xsl:template>
290
 
 
291
 
<xsl:template name="user.header.content">
292
 
  <xsl:param name="node" select="."/>
293
 
</xsl:template>
294
 
 
295
 
<xsl:template name="user.footer.content">
296
 
  <xsl:param name="node" select="."/>
297
 
</xsl:template>
298
 
 
299
 
<xsl:template name="user.footer.navigation">
300
 
  <xsl:param name="node" select="."/>
301
 
</xsl:template>
302
 
 
303
 
<xsl:template match="/">
304
 
  <!-- * Get a title for current doc so that we let the user -->
305
 
  <!-- * know what document we are processing at this point. -->
306
 
  <xsl:variable name="doc.title">
307
 
    <xsl:call-template name="get.doc.title"/>
308
 
  </xsl:variable>
309
 
  <xsl:choose>
310
 
    <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
311
 
         toss the namespace and continue.  Use the docbook5 namespaced
312
 
         stylesheets for DocBook5 if you don't want to use this feature.-->
313
 
    <!-- include extra test for Xalan quirk -->
314
 
    <xsl:when test="$exsl.node.set.available != 0                     and (*/self::ng:* or */self::db:*)">
315
 
      <xsl:call-template name="log.message">
316
 
        <xsl:with-param name="level">Note</xsl:with-param>
317
 
        <xsl:with-param name="source" select="$doc.title"/>
318
 
        <xsl:with-param name="context-desc">
319
 
          <xsl:text>namesp. cut</xsl:text>
320
 
        </xsl:with-param>
321
 
        <xsl:with-param name="message">
322
 
          <xsl:text>stripped namespace before processing</xsl:text>
323
 
        </xsl:with-param>
324
 
      </xsl:call-template>
325
 
      <xsl:variable name="nons">
326
 
        <xsl:apply-templates mode="stripNS"/>
327
 
      </xsl:variable>
328
 
      <!--
329
 
      <xsl:message>Saving stripped document.</xsl:message>
330
 
      <xsl:call-template name="write.chunk">
331
 
        <xsl:with-param name="filename" select="'/tmp/stripped.xml'"/>
332
 
        <xsl:with-param name="method" select="'xml'"/>
333
 
        <xsl:with-param name="content">
334
 
          <xsl:copy-of select="exsl:node-set($nons)"/>
335
 
        </xsl:with-param>
336
 
      </xsl:call-template>
337
 
      -->
338
 
      <xsl:call-template name="log.message">
339
 
        <xsl:with-param name="level">Note</xsl:with-param>
340
 
        <xsl:with-param name="source" select="$doc.title"/>
341
 
        <xsl:with-param name="context-desc">
342
 
          <xsl:text>namesp. cut</xsl:text>
343
 
        </xsl:with-param>
344
 
        <xsl:with-param name="message">
345
 
          <xsl:text>processing stripped document</xsl:text>
346
 
        </xsl:with-param>
347
 
      </xsl:call-template>
348
 
      <xsl:apply-templates select="exsl:node-set($nons)"/>
349
 
    </xsl:when>
350
 
    <!-- Can't process unless namespace removed -->
351
 
    <xsl:when test="*/self::ng:* or */self::db:*">
352
 
      <xsl:message terminate="yes">
353
 
        <xsl:text>Unable to strip the namespace from DB5 document,</xsl:text>
354
 
        <xsl:text> cannot proceed.</xsl:text>
355
 
      </xsl:message>
356
 
    </xsl:when>
357
 
    <xsl:otherwise>
358
 
      <xsl:choose>
359
 
        <xsl:when test="$rootid != ''">
360
 
          <xsl:choose>
361
 
            <xsl:when test="count(key('id',$rootid)) = 0">
362
 
              <xsl:message terminate="yes">
363
 
                <xsl:text>ID '</xsl:text>
364
 
                <xsl:value-of select="$rootid"/>
365
 
                <xsl:text>' not found in document.</xsl:text>
366
 
              </xsl:message>
367
 
            </xsl:when>
368
 
            <xsl:otherwise>
369
 
              <xsl:if test="$collect.xref.targets = 'yes' or                             $collect.xref.targets = 'only'">
370
 
                <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
371
 
              </xsl:if>
372
 
              <xsl:if test="$collect.xref.targets != 'only'">
373
 
                <xsl:apply-templates select="key('id',$rootid)" mode="process.root"/>
374
 
                <xsl:if test="$tex.math.in.alt != ''">
375
 
                  <xsl:apply-templates select="key('id',$rootid)" mode="collect.tex.math"/>
376
 
                </xsl:if>
377
 
              </xsl:if>
378
 
            </xsl:otherwise>
379
 
          </xsl:choose>
380
 
        </xsl:when>
381
 
        <xsl:otherwise>
382
 
          <xsl:if test="$collect.xref.targets = 'yes' or                         $collect.xref.targets = 'only'">
383
 
            <xsl:apply-templates select="/" mode="collect.targets"/>
384
 
          </xsl:if>
385
 
          <xsl:if test="$collect.xref.targets != 'only'">
386
 
            <xsl:apply-templates select="/" mode="process.root"/>
387
 
            <xsl:if test="$tex.math.in.alt != ''">
388
 
              <xsl:apply-templates select="/" mode="collect.tex.math"/>
389
 
            </xsl:if>
390
 
          </xsl:if>
391
 
        </xsl:otherwise>
392
 
      </xsl:choose>
393
 
    </xsl:otherwise>
394
 
  </xsl:choose>
395
 
</xsl:template>
396
 
 
397
 
<xsl:template match="*" mode="process.root">
398
 
  <xsl:variable name="doc" select="self::*"/>
399
 
 
400
 
  <xsl:call-template name="user.preroot"/>
401
 
  <xsl:call-template name="root.messages"/>
402
 
 
403
 
  <html>
404
 
    <head>
405
 
      <xsl:call-template name="system.head.content">
406
 
        <xsl:with-param name="node" select="$doc"/>
407
 
      </xsl:call-template>
408
 
      <xsl:call-template name="head.content">
409
 
        <xsl:with-param name="node" select="$doc"/>
410
 
      </xsl:call-template>
411
 
      <xsl:call-template name="user.head.content">
412
 
        <xsl:with-param name="node" select="$doc"/>
413
 
      </xsl:call-template>
414
 
    </head>
415
 
    <body>
416
 
      <xsl:call-template name="body.attributes"/>
417
 
      <xsl:call-template name="user.header.content">
418
 
        <xsl:with-param name="node" select="$doc"/>
419
 
      </xsl:call-template>
420
 
      <xsl:apply-templates select="."/>
421
 
      <xsl:call-template name="user.footer.content">
422
 
        <xsl:with-param name="node" select="$doc"/>
423
 
      </xsl:call-template>
424
 
    </body>
425
 
  </html>
426
 
  <xsl:value-of select="$html.append"/>
427
 
  
428
 
  <!-- Generate any css files only once, not once per chunk -->
429
 
  <xsl:call-template name="generate.css.files"/>
430
 
</xsl:template>
431
 
 
432
 
<xsl:template name="root.messages">
433
 
  <!-- redefine this any way you'd like to output messages -->
434
 
  <!-- DO NOT OUTPUT ANYTHING FROM THIS TEMPLATE -->
435
 
</xsl:template>
436
 
 
437
 
<!-- ==================================================================== -->
438
 
 
439
 
<xsl:template name="chunk">
440
 
  <xsl:param name="node" select="."/>
441
 
 
442
 
  <!-- The default is that we are not chunking... -->
443
 
  <xsl:text>0</xsl:text>
444
 
</xsl:template>
445
 
 
446
 
</xsl:stylesheet>