~ubuntu-branches/debian/experimental/yelp-xsl/experimental

« back to all changes in this revision

Viewing changes to xslt/docbook/html/db2html-block.xsl

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-03-17 15:12:22 UTC
  • mfrom: (1.1.16) (11.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120317151222-pnzcgh4actzfkwdb
Tags: 3.3.3-1
New upstream development release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
-->
18
18
 
19
19
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
20
                xmlns:db="http://docbook.org/ns/docbook"
 
21
                xmlns:msg="http://projects.gnome.org/yelp/gettext/"
20
22
                xmlns:set="http://exslt.org/sets"
21
 
                                                                xmlns:msg="http://projects.gnome.org/yelp/gettext/"
22
 
                                                                xmlns:db="http://docbook.org/ns/docbook"
23
23
                xmlns="http://www.w3.org/1999/xhtml"
24
24
                exclude-result-prefixes="db msg set"
25
25
                version="1.0">
26
26
 
27
27
<!--!!==========================================================================
28
28
DocBook to HTML - Block Elements
29
 
:Requires: db-common db-xref db2html-xref gettext
 
29
:Revision:version="3.4" date="2011-11-12" status="final"
30
30
 
31
 
This module handles most simple block-level elements, turning them into the
32
 
appropriate HTML tags.  It does not handle tables, lists, and various other
 
31
This stylesheet handles most simple block-level elements, turning them into
 
32
the appropriate HTML tags. It does not handle tables, lists, and various other
33
33
complex block-level elements.
34
34
-->
35
35
 
36
36
 
37
37
<!--**==========================================================================
38
38
db2html.block
39
 
Renders a block-level element to an HTML #{div} tag
40
 
$node: The block-level element to render
41
 
$class: An extra string to insert in the #{class} attribute
42
 
$indent: Whether this block should be indented
43
 
$verbatim: Whether to maintain whitespace as written
44
 
$formal: Whether this is a formal block element
45
 
$title: When ${formal} is true, an element to use for the title
46
 
$caption: When ${formal} is true, an element to use for the caption 
47
 
$lang: The locale of the text in ${node}
48
 
$dir: The text direction, either #{ltr} or #{rtl}
49
 
$ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
 
39
Output an HTML #{div} element for a block-level element.
 
40
:Revision:version="3.4" date="2011-11-12" status="final"
 
41
$node: The block-level element to render.
 
42
$class: The value of the HTML #{class} attribute.
50
43
 
51
44
This template creates an HTML #{div} element for the given DocBook element.
52
 
This template uses the parameters to construct the #{class} attribute, which
53
 
is then used by the CSS for styling.
 
45
If the ${class} parameter is not provided, it uses the local name of ${node}.
54
46
-->
55
47
<xsl:template name="db2html.block">
56
48
  <xsl:param name="node" select="."/>
57
 
  <xsl:param name="class" select="''"/>
58
 
        <xsl:param name="verbatim" select="$node[@xml:space = 'preserve']"/>
59
 
  <xsl:param name="formal" select="false()"/>
60
 
  <xsl:param name="title" select="$node/title | $node/db:title |
61
 
                                  $node/db:info/db:title"/>
 
49
  <xsl:param name="class" select="local-name($node)"/>
 
50
  <div class="{$class}">
 
51
    <xsl:call-template name="html.lang.attrs">
 
52
      <xsl:with-param name="node" select="$node"/>
 
53
    </xsl:call-template>
 
54
    <xsl:call-template name="db2html.anchor">
 
55
      <xsl:with-param name="node" select="$node"/>
 
56
    </xsl:call-template>
 
57
    <xsl:apply-templates select="$node/node()"/>
 
58
  </div>
 
59
</xsl:template>
 
60
 
 
61
 
 
62
<!--**==========================================================================
 
63
db2html.block.formal
 
64
Output HTML for a block-level element with an optional title and caption.
 
65
:Revision:version="3.4" date="2011-11-12" status="final"
 
66
$node: The block-level element to render.
 
67
$class: The value of the HTML #{class} attribute.
 
68
$title: An element to use for the title.
 
69
$caption: An element to use for the caption.
 
70
$titleattr: An optional value for the HTML #{title} attribute.
 
71
 
 
72
This template outputs HTML for a formal DocBook element, one that can have
 
73
a title or caption. If the ${class} parameter is not provided, it uses the
 
74
local name of ${node}. Even if ${title} and ${caption} are both empty, this
 
75
template still outputs the extra wrapper elements for formal elements. If
 
76
${titleattr} is provided, it is used for the value of the HTML #{title}
 
77
attribute on the outermost #{div} element.
 
78
-->
 
79
<xsl:template name="db2html.block.formal">
 
80
  <xsl:param name="node" select="."/>
 
81
  <xsl:param name="class" select="local-name($node)"/>
 
82
  <xsl:param name="title" select="$node/title | $node/blockinfo/title |
 
83
                                  $node/db:title | $node/db:info/db:title"/>
62
84
  <xsl:param name="caption" select="$node/caption | $node/db:caption"/>
63
 
        <xsl:param name="lang" select="$node/@lang|$node/@xml:lang"/>
64
 
  <xsl:param name="dir" select="false()"/>
65
 
  <xsl:param name="ltr" select="false()"/>
 
85
  <xsl:param name="titleattr" select="''"/>
66
86
 
67
 
  <div>
68
 
    <xsl:attribute name="class">
69
 
      <xsl:value-of select="concat($class, ' ', local-name($node))"/>
70
 
      <xsl:if test="$verbatim">
71
 
        <xsl:text> verbatim</xsl:text>
72
 
      </xsl:if>
73
 
    </xsl:attribute>
74
 
    <xsl:choose>
75
 
      <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
76
 
        <xsl:attribute name="dir">
77
 
          <xsl:value-of select="$dir"/>
78
 
        </xsl:attribute>
79
 
      </xsl:when>
80
 
      <xsl:when test="$lang">
81
 
        <xsl:attribute name="dir">
82
 
          <xsl:call-template name="l10n.direction">
83
 
            <xsl:with-param name="lang" select="$lang"/>
84
 
          </xsl:call-template>
85
 
        </xsl:attribute>
86
 
      </xsl:when>
87
 
      <xsl:when test="$ltr">
88
 
        <xsl:attribute name="dir">
89
 
          <xsl:text>ltr</xsl:text>
90
 
        </xsl:attribute>
91
 
      </xsl:when>
92
 
    </xsl:choose>
 
87
  <div class="{$class}">
 
88
    <xsl:if test="$titleattr != ''">
 
89
      <xsl:attribute name="title">
 
90
        <xsl:value-of select="$titleattr"/>
 
91
      </xsl:attribute>
 
92
    </xsl:if>
 
93
    <xsl:call-template name="html.lang.attrs">
 
94
      <xsl:with-param name="node" select="$node"/>
 
95
    </xsl:call-template>
93
96
    <xsl:call-template name="db2html.anchor">
94
97
      <xsl:with-param name="node" select="$node"/>
95
98
    </xsl:call-template>
96
 
    <xsl:choose>
97
 
      <xsl:when test="$formal">
98
 
        <div class="inner">
99
 
          <xsl:if test="$node/self::figure or $node/self::db:figure">
100
 
            <a href="#" class="zoom">
101
 
              <xsl:attribute name="data-zoom-in-title">
102
 
                <xsl:call-template name="l10n.gettext">
103
 
                  <xsl:with-param name="msgid" select="'View images at normal size'"/>
104
 
                </xsl:call-template>
105
 
              </xsl:attribute>
106
 
              <xsl:attribute name="data-zoom-out-title">
107
 
                <xsl:call-template name="l10n.gettext">
108
 
                  <xsl:with-param name="msgid" select="'Scale images down'"/>
109
 
                </xsl:call-template>
110
 
              </xsl:attribute>
111
 
            </a>
112
 
          </xsl:if>
113
 
          <xsl:if test="$title">
114
 
            <xsl:call-template name="db2html.block.title">
115
 
              <xsl:with-param name="node" select="$node"/>
116
 
              <xsl:with-param name="title" select="$title"/>
117
 
            </xsl:call-template>
118
 
          </xsl:if>
119
 
          <div class="contents">
120
 
            <xsl:apply-templates select="$node/node()[not(set:has-same-node(., $title | $caption))]"/>
121
 
          </div>
122
 
          <xsl:apply-templates select="$caption"/>
 
99
    <div class="inner">
 
100
      <xsl:if test="$node/self::figure or $node/self::db:figure">
 
101
        <a href="#" class="zoom">
 
102
          <xsl:attribute name="data-zoom-in-title">
 
103
            <xsl:call-template name="l10n.gettext">
 
104
              <xsl:with-param name="msgid" select="'View images at normal size'"/>
 
105
            </xsl:call-template>
 
106
          </xsl:attribute>
 
107
          <xsl:attribute name="data-zoom-out-title">
 
108
            <xsl:call-template name="l10n.gettext">
 
109
              <xsl:with-param name="msgid" select="'Scale images down'"/>
 
110
            </xsl:call-template>
 
111
          </xsl:attribute>
 
112
        </a>
 
113
      </xsl:if>
 
114
      <xsl:if test="$title">
 
115
        <xsl:call-template name="db2html.block.title">
 
116
          <xsl:with-param name="node" select="$node"/>
 
117
          <xsl:with-param name="title" select="$title"/>
 
118
        </xsl:call-template>
 
119
      </xsl:if>
 
120
      <div class="region">
 
121
        <div class="contents">
 
122
          <xsl:apply-templates select="$node/node()[not(set:has-same-node(., $title | $caption))]"/>
123
123
        </div>
124
 
      </xsl:when>
125
 
      <xsl:otherwise>
126
 
        <xsl:apply-templates select="$node/node()"/>
127
 
      </xsl:otherwise>
128
 
    </xsl:choose>
 
124
        <xsl:apply-templates select="$caption"/>
 
125
      </div>
 
126
    </div>
129
127
  </div>
130
128
</xsl:template>
131
129
 
132
130
 
133
131
<!--**==========================================================================
134
132
db2html.block.title
135
 
Renders a formal title for a block-level element
136
 
$node: The block-level element being processed
137
 
$title: The element containing the title
138
 
$lang: The locale of the text in ${title}
139
 
$dir: The text direction, either #{ltr} or #{rtl}
140
 
$ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
 
133
Output a formal title for a block-level element.
 
134
:Revision:version="3.4" date="2011-11-12" status="final"
 
135
$node: The block-level element being processed.
 
136
$title: The element containing the title.
141
137
 
142
138
This template formats the contents of ${title} as a title for a block-level
143
 
element.  It is called by *{db2html.block} for formal block elements.
 
139
element.  It is called by *{db2html.block.formal}.
144
140
-->
145
141
<xsl:template name="db2html.block.title">
146
142
  <xsl:param name="node" select="."/>
147
143
        <xsl:param name="title" select="$node/title | $node/db:title"/>
148
 
        <xsl:param name="lang" select="$title/@lang|$title/@xml:lang"/>
149
 
  <xsl:param name="dir" select="false()"/>
150
 
  <xsl:param name="ltr" select="false()"/>
151
144
  <xsl:variable name="depth">
152
145
    <xsl:call-template name="db.chunk.depth-in-chunk">
153
146
      <xsl:with-param name="node" select="$node"/>
163
156
      </xsl:otherwise>
164
157
    </xsl:choose>
165
158
  </xsl:variable>
166
 
 
167
 
  <div class="block title title-formal">
168
 
    <xsl:choose>
169
 
      <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
170
 
        <xsl:attribute name="dir">
171
 
          <xsl:value-of select="$dir"/>
172
 
        </xsl:attribute>
173
 
      </xsl:when>
174
 
      <xsl:when test="$lang">
175
 
        <xsl:attribute name="dir">
176
 
          <xsl:call-template name="l10n.direction">
177
 
            <xsl:with-param name="lang" select="$lang"/>
178
 
          </xsl:call-template>
179
 
        </xsl:attribute>
180
 
      </xsl:when>
181
 
      <xsl:when test="$ltr">
182
 
        <xsl:attribute name="dir">
183
 
          <xsl:text>ltr</xsl:text>
184
 
        </xsl:attribute>
185
 
      </xsl:when>
186
 
    </xsl:choose>
 
159
  <div class="title">
 
160
    <xsl:call-template name="html.lang.attrs">
 
161
      <xsl:with-param name="node" select="$title"/>
 
162
    </xsl:call-template>
187
163
    <xsl:call-template name="db2html.anchor">
188
164
      <xsl:with-param name="node" select="$title"/>
189
165
    </xsl:call-template>
198
174
 
199
175
<!--**==========================================================================
200
176
db2html.blockquote
201
 
Renders a #{blockquote} element to HTML
202
 
$node: The #{blockquote} element to render
203
 
$lang: The locale of the text in ${node}
204
 
$dir: The text direction, either #{ltr} or #{rtl}
205
 
$ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
 
177
Output an HTML #{blockquote} element.
 
178
:Revision:version="3.4" date="2011-11-12" status="final"
 
179
$node: The DocBook element ot render as a quote.
206
180
 
207
181
This template creates an HTML #{blockquote} element for the given DocBook
208
 
element.
 
182
element. It's used for the DocBook #{blockquote} and #{epigraph} elements.
209
183
-->
210
184
<xsl:template name="db2html.blockquote">
211
185
  <xsl:param name="node" select="."/>
212
 
        <xsl:param name="lang" select="$node/@lang|node/@xml:lang"/>
213
 
  <xsl:param name="dir" select="false()"/>
214
 
  <xsl:param name="ltr" select="false()"/>
215
 
 
216
186
  <div>
217
 
    <xsl:choose>
218
 
      <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
219
 
        <xsl:attribute name="dir">
220
 
          <xsl:value-of select="$dir"/>
221
 
        </xsl:attribute>
222
 
      </xsl:when>
223
 
      <xsl:when test="$lang">
224
 
        <xsl:attribute name="dir">
225
 
          <xsl:call-template name="l10n.direction">
226
 
            <xsl:with-param name="lang" select="$lang"/>
227
 
          </xsl:call-template>
228
 
        </xsl:attribute>
229
 
      </xsl:when>
230
 
      <xsl:when test="$ltr">
231
 
        <xsl:attribute name="dir">
232
 
          <xsl:text>ltr</xsl:text>
233
 
        </xsl:attribute>
234
 
      </xsl:when>
235
 
    </xsl:choose>
236
187
    <xsl:attribute name="class">
237
188
      <xsl:text>quote </xsl:text>
238
189
      <xsl:value-of select="local-name($node)"/>
239
190
    </xsl:attribute>
 
191
    <xsl:call-template name="html.lang.attrs">
 
192
      <xsl:with-param name="node" select="$node"/>
 
193
    </xsl:call-template>
240
194
    <xsl:call-template name="db2html.anchor">
241
195
      <xsl:with-param name="node" select="$node"/>
242
196
    </xsl:call-template>
243
197
    <div class="inner">
244
198
      <xsl:apply-templates select="$node/title | $node/db:title |
245
199
                                   $node/db:info/db:title"/>
246
 
      <blockquote class="{local-name($node)}">
247
 
        <xsl:apply-templates select="$node/node()[not(self::title) and not(self::attribution) and not(self::db:title) and not(self::db:attribution)]"/>
248
 
      </blockquote>
249
 
      <xsl:apply-templates select="$node/attribution | $node/db:attribution"/>
 
200
      <div class="region">
 
201
        <blockquote class="{local-name($node)}">
 
202
          <xsl:apply-templates select="$node/node()[not(self::title) and not(self::attribution) and
 
203
                                                    not(self::db:title) and not(self::db:attribution)]"/>
 
204
        </blockquote>
 
205
        <xsl:apply-templates select="$node/attribution | $node/db:attribution"/>
 
206
      </div>
250
207
    </div>
251
208
  </div>
252
209
</xsl:template>
254
211
 
255
212
<!--**==========================================================================
256
213
db2html.para
257
 
Renders a block-level element as an HTML #{p} element
258
 
$node: The block-level element to render
259
 
$lang: The locale of the text in ${node}
260
 
$dir: The text direction, either #{ltr} or #{rtl}
261
 
$ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
262
 
$class: The value of the generated class attribute
 
214
Output an HTML #{p} element for a block-level element.
 
215
:Revision:version="3.4" date="2011-11-12" status="final"
 
216
$node: The block-level element to render.
 
217
$class: The value of the HTML #{class} attribute.
263
218
 
264
219
This template creates an HTML #{p} element for the given DocBook element.
 
220
If the ${class} parameter is not provided, it uses the local name of ${node}.
265
221
-->
266
222
<xsl:template name="db2html.para">
267
223
  <xsl:param name="node" select="."/>
268
 
        <xsl:param name="lang" select="$node/@lang|$node/@xml:lang"/>
269
 
  <xsl:param name="dir" select="false()"/>
270
 
  <xsl:param name="ltr" select="false()"/>
271
224
  <xsl:param name="class" select="local-name($node)"/>
272
 
 
273
 
  <p>
274
 
    <xsl:attribute name="class">
275
 
      <xsl:value-of select="$class"/>
276
 
    </xsl:attribute>
277
 
    <xsl:choose>
278
 
      <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
279
 
        <xsl:attribute name="dir">
280
 
          <xsl:value-of select="$dir"/>
281
 
        </xsl:attribute>
282
 
      </xsl:when>
283
 
      <xsl:when test="$lang">
284
 
        <xsl:attribute name="dir">
285
 
          <xsl:call-template name="l10n.direction">
286
 
            <xsl:with-param name="lang" select="$lang"/>
287
 
          </xsl:call-template>
288
 
        </xsl:attribute>
289
 
      </xsl:when>
290
 
      <xsl:when test="$ltr">
291
 
        <xsl:attribute name="dir">
292
 
          <xsl:text>ltr</xsl:text>
293
 
        </xsl:attribute>
294
 
      </xsl:when>
295
 
    </xsl:choose>
 
225
  <p class="{$class}">
 
226
    <xsl:call-template name="html.lang.attrs">
 
227
      <xsl:with-param name="node" select="$node"/>
 
228
    </xsl:call-template>
296
229
    <xsl:call-template name="db2html.anchor">
297
230
      <xsl:with-param name="node" select="$node"/>
298
231
    </xsl:call-template>
303
236
 
304
237
<!--**==========================================================================
305
238
db2html.pre
306
 
Renders a block-level element as an HTML #{pre} element
307
 
$node: The block-level element to render
308
 
$class: An extra string to insert in the #{class} attribute
309
 
$children: The child elements to process
310
 
$lang: The locale of the text in ${node}
311
 
$dir: The text direction, either #{ltr} or #{rtl}
312
 
$ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
 
239
Output an HTML #{pre} element for a block-level element.
 
240
:Revision:version="3.4" date="2011-11-12" status="final"
 
241
$node: The block-level element to render.
 
242
$class: The value of the HTML #{class} attribute.
 
243
$children: The child elements to process.
313
244
 
314
245
This template creates an HTML #{pre} element for the given DocBook element.
315
 
This template uses the parameters to construct the #{class} attribute, which
316
 
is then used by the CSS for styling.
 
246
If the ${class} parameter is not provided, it uses the local name of ${node}.
317
247
 
318
248
If ${node} has the #{linenumbering} attribute set to #{"numbered"}, then this
319
249
template will create line numbers for each line, using the *{utils.linenumbering}
320
250
template.
 
251
 
 
252
By default, this template applies templates to all child nodes. Pass child
 
253
nodes in the ${children} parameter to override this behavior.
 
254
 
 
255
If @{html.syntax.highlight} is #{true}, this template automatically outputs
 
256
syntax highlighting support based on the #{language} attribute of ${node}.
321
257
-->
322
258
<xsl:template name="db2html.pre">
323
259
  <xsl:param name="node" select="."/>
324
 
  <xsl:param name="class" select="''"/>
 
260
  <xsl:param name="class" select="local-name($node)"/>
325
261
  <xsl:param name="children" select="$node/node()"/>
326
 
        <xsl:param name="lang" select="$node/@lang|$node/@xml:lang"/>
327
 
  <xsl:param name="dir" select="false()"/>
328
 
  <xsl:param name="ltr" select="true()"/>
329
 
 
330
 
  <div>
331
 
    <xsl:attribute name="class">
332
 
      <xsl:value-of select="concat($class, ' ', local-name($node))"/>
333
 
    </xsl:attribute>
334
 
    <xsl:choose>
335
 
      <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
336
 
        <xsl:attribute name="dir">
337
 
          <xsl:value-of select="$dir"/>
338
 
        </xsl:attribute>
339
 
      </xsl:when>
340
 
      <xsl:when test="$lang">
341
 
        <xsl:attribute name="dir">
342
 
          <xsl:call-template name="l10n.direction">
343
 
            <xsl:with-param name="lang" select="$lang"/>
344
 
          </xsl:call-template>
345
 
        </xsl:attribute>
346
 
      </xsl:when>
347
 
      <xsl:when test="$ltr">
348
 
        <xsl:attribute name="dir">
349
 
          <xsl:text>ltr</xsl:text>
350
 
        </xsl:attribute>
351
 
      </xsl:when>
352
 
    </xsl:choose>
 
262
  <div class="{$class}">
 
263
    <xsl:call-template name="html.lang.attrs">
 
264
      <xsl:with-param name="node" select="$node"/>
 
265
    </xsl:call-template>
353
266
    <xsl:call-template name="db2html.anchor">
354
267
      <xsl:with-param name="node" select="$node"/>
355
268
    </xsl:call-template>
456
369
</xsl:template>
457
370
 
458
371
<!-- = ackno = -->
459
 
<xsl:template match="ackno | db:acknowledgements/db:para">
460
 
  <xsl:call-template name="db2html.para">
461
 
    <xsl:with-param name="class">ackno</xsl:with-param>
462
 
  </xsl:call-template>
 
372
<xsl:template match="ackno">
 
373
  <xsl:call-template name="db2html.para"/>
 
374
</xsl:template>
 
375
 
 
376
<!-- = acknowledgements = -->
 
377
<xsl:template match="db:acknowledgements">
 
378
  <xsl:call-template name="db2html.block"/>
463
379
</xsl:template>
464
380
 
465
381
<!-- = address = -->
466
382
<xsl:template match="address | db:address">
467
 
  <xsl:call-template name="db2html.block">
468
 
    <xsl:with-param name="verbatim" select="true()"/>
469
 
  </xsl:call-template>
 
383
  <xsl:call-template name="db2html.block"/>
470
384
</xsl:template>
471
385
 
472
386
<!-- = attribution = -->
481
395
  <xsl:call-template name="db2html.blockquote"/>
482
396
</xsl:template>
483
397
 
 
398
<!-- == bridgehead = -->
 
399
<xsl:template match="bridgehead | db:bridgehead">
 
400
  <xsl:param name="depth_in_chunk">
 
401
    <xsl:call-template name="db.chunk.depth-in-chunk"/>
 
402
  </xsl:param>
 
403
  <xsl:variable name="render">
 
404
    <xsl:choose>
 
405
      <xsl:when test="starts-with(@renderas, 'sect')">
 
406
        <xsl:value-of select="substring-after(@renderas, 'sect')"/>
 
407
      </xsl:when>
 
408
      <xsl:otherwise>
 
409
        <xsl:text>6</xsl:text>
 
410
      </xsl:otherwise>
 
411
    </xsl:choose>
 
412
  </xsl:variable>
 
413
  <xsl:variable name="level" select="number($depth_in_chunk) + number($render) - 1"/>
 
414
  <xsl:variable name="title_h">
 
415
    <xsl:choose>
 
416
      <xsl:when test="$depth_in_chunk &lt; 6">
 
417
        <xsl:value-of select="concat('h', $level)"/>
 
418
      </xsl:when>
 
419
      <xsl:otherwise>
 
420
        <xsl:text>h6</xsl:text>
 
421
      </xsl:otherwise>
 
422
    </xsl:choose>
 
423
  </xsl:variable>
 
424
  <div class="hgroup bridgehead">
 
425
    <xsl:element name="{$title_h}" namespace="{$html.namespace}">
 
426
      <xsl:apply-templates/>
 
427
    </xsl:element>
 
428
  </div>
 
429
</xsl:template>
 
430
 
484
431
<!-- = caption = -->
485
432
<xsl:template match="caption | db:caption">
486
433
  <xsl:call-template name="db2html.block">
490
437
 
491
438
<!-- = caution = -->
492
439
<xsl:template match="caution | db:caution">
493
 
  <xsl:call-template name="db2html.block">
 
440
  <xsl:call-template name="db2html.block.formal">
494
441
    <xsl:with-param name="class" select="'note note-warning'"/>
495
 
    <xsl:with-param name="formal" select="true()"/>
 
442
    <xsl:with-param name="titleattr">
 
443
      <xsl:call-template name="l10n.gettext">
 
444
        <xsl:with-param name="msgid" select="'Warning'"/>
 
445
      </xsl:call-template>
 
446
    </xsl:with-param>
496
447
  </xsl:call-template>
497
448
</xsl:template>
498
449
 
503
454
 
504
455
<!-- = equation = -->
505
456
<xsl:template match="equation | db:equation">
506
 
  <xsl:call-template name="db2html.block">
507
 
    <xsl:with-param name="formal" select="true()"/>
508
 
  </xsl:call-template>
 
457
  <xsl:call-template name="db2html.block.formal"/>
509
458
</xsl:template>
510
459
 
511
460
<!-- = example = -->
512
461
<xsl:template match="example | db:example">
513
 
  <xsl:call-template name="db2html.block">
514
 
    <xsl:with-param name="formal" select="true()"/>
515
 
  </xsl:call-template>
 
462
  <xsl:call-template name="db2html.block.formal"/>
516
463
</xsl:template>
517
464
 
518
465
<!-- = figure = -->
519
466
<xsl:template match="figure | informalfigure | db:figure | db:informalfigure">
520
 
  <xsl:call-template name="db2html.block">
521
 
    <xsl:with-param name="class">
522
 
      <xsl:if test="self::informalfigure | self::db:informalfigure">
523
 
        <xsl:text>figure</xsl:text>
524
 
      </xsl:if>
525
 
    </xsl:with-param>
526
 
    <xsl:with-param name="formal" select="true()"/>
 
467
  <xsl:call-template name="db2html.block.formal">
 
468
    <xsl:with-param name="class" select="'figure'"/>
527
469
    <!-- When a figure contains only a single mediaobject, it eats the caption -->
528
470
    <xsl:with-param name="caption"
529
471
                    select="*[not(self::blockinfo) and not(self::title) and not(self::titleabbrev)]
535
477
 
536
478
<!-- = formalpara = -->
537
479
<xsl:template match="formalpara | db:formalpara">
538
 
  <xsl:call-template name="db2html.block">
539
 
    <xsl:with-param name="formal" select="true()"/>
540
 
  </xsl:call-template>
541
 
</xsl:template>
542
 
 
543
 
<!-- = glossdef = -->
544
 
<xsl:template match="glossdef | db:glossdef">
545
 
  <dd class="glossdef">
546
 
    <xsl:apply-templates select="*[not(self::glossseealso) and not(self::db:glossseealso)]"/>
547
 
  </dd>
548
 
  <xsl:apply-templates select="glossseealso[1] | db:glossseealso[1]"/>
549
 
</xsl:template>
550
 
 
551
 
<!-- = glossentry = -->
552
 
<xsl:template match="glossentry | db:glossentry">
553
 
  <dt>
554
 
    <xsl:attribute name="class">
555
 
      <xsl:text>glossterm</xsl:text>
556
 
    </xsl:attribute>
557
 
    <xsl:apply-templates select="glossterm | db:glossterm"/>
558
 
    <xsl:if test="acronym or abbrev or db:acronym or db:abbrev">
559
 
      <xsl:text> </xsl:text>
560
 
      <xsl:call-template name="l10n.gettext">
561
 
        <xsl:with-param name="msgid" select="'glossentry.abbrev.format'"/>
562
 
        <xsl:with-param name="node" select="(acronym | abbrev | db:acronym | db:abbrev)[1]"/>
563
 
        <xsl:with-param name="format" select="true()"/>
564
 
      </xsl:call-template>
565
 
    </xsl:if>
566
 
  </dt>
567
 
  <xsl:apply-templates select="glossdef | glosssee[1] | db:glossdef | db:glosssee[1]"/>
568
 
</xsl:template>
569
 
 
570
 
<!-- = glosssee(also) = -->
571
 
<xsl:template match="glosssee | glossseealso | db:glosssee | db:glossseealso">
572
 
  <dd class="{local-name(.)}">
573
 
    <p class="block">
574
 
      <xsl:call-template name="l10n.gettext">
575
 
        <xsl:with-param name="msgid" select="concat(local-name(.), '.format')"/>
576
 
        <xsl:with-param name="node" select="."/>
577
 
        <xsl:with-param name="format" select="true()"/>
578
 
      </xsl:call-template>
579
 
    </p>
580
 
  </dd>
581
 
</xsl:template>
582
 
 
583
 
<!--#% l10n.format.mode -->
584
 
<xsl:template mode="l10n.format.mode" match="msg:glosssee">
585
 
  <xsl:param name="node"/>
586
 
  <xsl:for-each select="$node |
587
 
                        $node/following-sibling::*[name(.) = name($node)]">
588
 
    <xsl:if test="position() != 1">
589
 
      <xsl:call-template name="l10n.gettext">
590
 
        <xsl:with-param name="msgid" select="', '"/>
591
 
      </xsl:call-template>
592
 
    </xsl:if>
593
 
    <xsl:choose>
594
 
      <xsl:when test="@otherterm">
595
 
        <a>
596
 
          <xsl:attribute name="href">
597
 
            <xsl:call-template name="db.xref.target">
598
 
              <xsl:with-param name="linkend" select="@otherterm"/>
599
 
            </xsl:call-template>
600
 
          </xsl:attribute>
601
 
          <xsl:attribute name="title">
602
 
            <xsl:call-template name="db.xref.tooltip">
603
 
              <xsl:with-param name="linkend" select="@otherterm"/>
604
 
            </xsl:call-template>
605
 
          </xsl:attribute>
606
 
          <xsl:choose>
607
 
            <xsl:when test="normalize-space(.) != ''">
608
 
              <xsl:apply-templates/>
609
 
            </xsl:when>
610
 
            <xsl:otherwise>
611
 
              <xsl:call-template name="db.xref.content">
612
 
                <xsl:with-param name="linkend" select="@otherterm"/>
613
 
                <xsl:with-param name="role" select="'glosssee'"/>
614
 
              </xsl:call-template>
615
 
            </xsl:otherwise>
616
 
          </xsl:choose>
617
 
        </a>
618
 
      </xsl:when>
619
 
      <xsl:otherwise>
620
 
        <xsl:apply-templates/>
621
 
      </xsl:otherwise>
622
 
    </xsl:choose>
623
 
  </xsl:for-each>
 
480
  <xsl:call-template name="db2html.block.formal"/>
624
481
</xsl:template>
625
482
 
626
483
<!-- = highlights = -->
630
487
 
631
488
<!-- = important = -->
632
489
<xsl:template match="important | db:important">
633
 
  <xsl:call-template name="db2html.block">
 
490
  <xsl:call-template name="db2html.block.formal">
634
491
    <xsl:with-param name="class" select="'note note-important'"/>
635
 
    <xsl:with-param name="formal" select="true()"/>
 
492
    <xsl:with-param name="titleattr">
 
493
      <xsl:call-template name="l10n.gettext">
 
494
        <xsl:with-param name="msgid" select="'Important'"/>
 
495
      </xsl:call-template>
 
496
    </xsl:with-param>
636
497
  </xsl:call-template>
637
498
</xsl:template>
638
499
 
643
504
 
644
505
<!-- = informalexample = -->
645
506
<xsl:template match="informalexample | db:informalexample">
646
 
  <xsl:call-template name="db2html.block"/>
 
507
  <xsl:call-template name="db2html.block">
 
508
    <xsl:with-param name="class" select="'example informalexample'"/>
 
509
  </xsl:call-template>
647
510
</xsl:template>
648
511
 
649
512
<!-- = literallayout = -->
650
513
<xsl:template match="literallayout | db:literallayout">
651
 
  <xsl:call-template name="db2html.block">
652
 
    <xsl:with-param name="verbatim" select="true()"/>
653
 
  </xsl:call-template>
 
514
  <xsl:call-template name="db2html.block"/>
654
515
</xsl:template>
655
516
 
656
517
<!-- = note = -->
657
518
<xsl:template match="note | db:note">
658
 
  <xsl:call-template name="db2html.block">
 
519
  <xsl:call-template name="db2html.block.formal">
659
520
    <xsl:with-param name="class">
660
521
      <xsl:text>note</xsl:text>
661
522
      <xsl:if test="@role = 'bug'">
662
523
        <xsl:text> note-bug</xsl:text>
663
524
      </xsl:if>
664
525
    </xsl:with-param>
665
 
    <xsl:with-param name="formal" select="true()"/>
 
526
    <xsl:with-param name="titleattr">
 
527
      <xsl:choose>
 
528
        <xsl:when test="@role = 'bug'">
 
529
          <xsl:call-template name="l10n.gettext">
 
530
            <xsl:with-param name="msgid" select="'Bug'"/>
 
531
          </xsl:call-template>
 
532
        </xsl:when>
 
533
        <xsl:otherwise>
 
534
          <xsl:call-template name="l10n.gettext">
 
535
            <xsl:with-param name="msgid" select="'Note'"/>
 
536
          </xsl:call-template>
 
537
        </xsl:otherwise>
 
538
      </xsl:choose>
 
539
    </xsl:with-param>
666
540
  </xsl:call-template>
667
541
</xsl:template>
668
542
 
683
557
  <xsl:call-template name="db2html.pre"/>
684
558
</xsl:template>
685
559
 
 
560
<!-- = screenshot = -->
 
561
<xsl:template match="screenshot | db:screenshot">
 
562
  <xsl:call-template name="db2html.block"/>
 
563
</xsl:template>
 
564
 
 
565
<!-- = sidebar = -->
 
566
<xsl:template match="sidebar | db:sidebar">
 
567
  <xsl:call-template name="db2html.block.formal">
 
568
    <xsl:with-param name="class" select="'note note-sidebar'"/>
 
569
    <xsl:with-param name="titleattr">
 
570
      <xsl:call-template name="l10n.gettext">
 
571
        <xsl:with-param name="msgid" select="'Sidebar'"/>
 
572
      </xsl:call-template>
 
573
    </xsl:with-param>
 
574
  </xsl:call-template>
 
575
</xsl:template>
 
576
 
686
577
<!-- = simpara = -->
687
578
<xsl:template match="simpara | db:simpara">
688
579
  <xsl:call-template name="db2html.para"/>
693
584
  <xsl:call-template name="db2html.pre"/>
694
585
</xsl:template>
695
586
 
 
587
<!-- = task = -->
 
588
<xsl:template match="task | db:task">
 
589
  <xsl:call-template name="db2html.block.formal"/>
 
590
</xsl:template>
 
591
 
 
592
<!-- = taskprerequisites = -->
 
593
<xsl:template match="taskprerequisites | db:taskprerequisites">
 
594
  <xsl:call-template name="db2html.block.formal"/>
 
595
</xsl:template>
 
596
 
 
597
<!-- = taskrelated = -->
 
598
<xsl:template match="taskrelated | db:taskrelated">
 
599
  <xsl:call-template name="db2html.block.formal"/>
 
600
</xsl:template>
 
601
 
 
602
<!-- = tasksummary = -->
 
603
<xsl:template match="tasksummary | db:tasksummary">
 
604
  <xsl:call-template name="db2html.block.formal"/>
 
605
</xsl:template>
 
606
 
696
607
<!-- = tip = -->
697
608
<xsl:template match="tip | db:tip">
698
 
  <xsl:call-template name="db2html.block">
 
609
  <xsl:call-template name="db2html.block.formal">
699
610
    <xsl:with-param name="class" select="'note note-tip'"/>
700
 
    <xsl:with-param name="formal" select="true()"/>
 
611
    <xsl:with-param name="titleattr">
 
612
      <xsl:call-template name="l10n.gettext">
 
613
        <xsl:with-param name="msgid" select="'Tip'"/>
 
614
      </xsl:call-template>
 
615
    </xsl:with-param>
701
616
  </xsl:call-template>
702
617
</xsl:template>
703
618
 
711
626
 
712
627
<!-- = warning = -->
713
628
<xsl:template match="warning | db:warning">
714
 
  <xsl:call-template name="db2html.block">
 
629
  <xsl:call-template name="db2html.block.formal">
715
630
    <xsl:with-param name="class" select="'note note-warning'"/>
716
 
    <xsl:with-param name="formal" select="true()"/>
 
631
    <xsl:with-param name="titleattr">
 
632
      <xsl:call-template name="l10n.gettext">
 
633
        <xsl:with-param name="msgid" select="'Warning'"/>
 
634
      </xsl:call-template>
 
635
    </xsl:with-param>
717
636
  </xsl:call-template>
718
637
</xsl:template>
719
638