Debian Codegraph @

xslt/docbook/html/db2html-list.xsl

raw
1 <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
2 <!--
3 This program is free software; you can redistribute it and/or modify it under
4 the terms of the GNU Lesser General Public License as published by the Free
5 Software Foundation; either version 2 of the License, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful, but WITHOUT
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 details.
12
13 You should have received a copy of the GNU Lesser General Public License
14 along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu.org/licenses/>.
15 -->
16
17 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18 xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:msg="http://projects.gnome.org/yelp/gettext/"
20 xmlns:str="http://exslt.org/strings"
21 xmlns:set="http://exslt.org/sets"
22 xmlns="http://www.w3.org/1999/xhtml"
23 exclude-result-prefixes="db msg str set"
24 version="1.0">
25
26
27 <!--!!==========================================================================
28 DocBook to HTML - Lists
29 @revision[version=3.28 date=2016-10-27 status=review]
30
31 This stylesheet handles most list-like elements in DocBook, turning them into
32 appropriate HTML tags.
33 -->
34
35
36 <!-- == Matched Templates == -->
37
38 <!-- = glosslist = -->
39 <xsl:template match="glosslist | db:glosslist">
40 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
41 <xsl:if test="$if != ''">
42 <div>
43 <xsl:variable name="title" select="title | blockinfo/title |
44 db:title | db:info/db:title"/>
45 <xsl:call-template name="html.class.attr">
46 <xsl:with-param name="class" select="'list glosslist'"/>
47 </xsl:call-template>
48 <xsl:call-template name="html.lang.attrs"/>
49 <xsl:call-template name="db2html.anchor"/>
50 <xsl:apply-templates select="$title[1]"/>
51 <dl class="glosslist">
52 <xsl:apply-templates select="glossentry | db:glossentry"/>
53 </dl>
54 </div>
55 </xsl:if>
56 </xsl:template>
57
58 <!-- = glossdef = -->
59 <xsl:template match="glossdef | db:glossdef">
60 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
61 <xsl:if test="$if != ''">
62 <dd>
63 <xsl:call-template name="html.class.attr">
64 <xsl:with-param name="class" select="'glossdef'"/>
65 </xsl:call-template>
66 <xsl:apply-templates select="*[not(self::glossseealso) and not(self::db:glossseealso)]"/>
67 </dd>
68 <xsl:apply-templates select="glossseealso[1] | db:glossseealso[1]"/>
69 </xsl:if>
70 </xsl:template>
71
72 <!-- = glossentry = -->
73 <xsl:template match="glossentry | db:glossentry">
74 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
75 <xsl:if test="$if != ''">
76 <dt>
77 <xsl:call-template name="html.class.attr">
78 <xsl:with-param name="class" select="'glossterm'"/>
79 </xsl:call-template>
80 <xsl:call-template name="html.lang.attrs"/>
81 <xsl:call-template name="db2html.anchor"/>
82 <xsl:apply-templates select="glossterm | db:glossterm"/>
83 <xsl:if test="acronym or abbrev or db:acronym or db:abbrev">
84 <xsl:text> (</xsl:text>
85 <xsl:apply-templates select="(acronym | abbrev | db:acronym | db:abbrev)[1]"/>
86 <xsl:text>)</xsl:text>
87 </xsl:if>
88 </dt>
89 <xsl:apply-templates select="glossdef | glosssee[1] | db:glossdef | db:glosssee[1]"/>
90 </xsl:if>
91 </xsl:template>
92
93 <!-- = glosssee(also) = -->
94 <xsl:template match="glosssee | glossseealso | db:glosssee | db:glossseealso">
95 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
96 <xsl:if test="$if != ''">
97 <dd>
98 <xsl:call-template name="html.class.attr">
99 <xsl:with-param name="class" select="local-name(.)"/>
100 </xsl:call-template>
101 <p>
102 <xsl:call-template name="l10n.gettext">
103 <xsl:with-param name="msgid" select="concat(local-name(.), '.format')"/>
104 <xsl:with-param name="node" select="."/>
105 <xsl:with-param name="format" select="true()"/>
106 </xsl:call-template>
107 </p>
108 </dd>
109 </xsl:if>
110 </xsl:template>
111
112 <!--#% l10n.format.mode -->
113 <xsl:template mode="l10n.format.mode" match="msg:glosssee">
114 <xsl:param name="node"/>
115 <xsl:for-each select="$node |
116 $node/following-sibling::*[name(.) = name($node)]">
117 <xsl:if test="position() != 1">
118 <xsl:call-template name="l10n.gettext">
119 <xsl:with-param name="msgid" select="', '"/>
120 </xsl:call-template>
121 </xsl:if>
122 <xsl:choose>
123 <xsl:when test="@otherterm">
124 <a>
125 <xsl:attribute name="href">
126 <xsl:call-template name="db.xref.target">
127 <xsl:with-param name="linkend" select="@otherterm"/>
128 </xsl:call-template>
129 </xsl:attribute>
130 <xsl:attribute name="title">
131 <xsl:call-template name="db.xref.tooltip">
132 <xsl:with-param name="linkend" select="@otherterm"/>
133 </xsl:call-template>
134 </xsl:attribute>
135 <xsl:choose>
136 <xsl:when test="normalize-space(.) != ''">
137 <xsl:apply-templates/>
138 </xsl:when>
139 <xsl:otherwise>
140 <xsl:call-template name="db.xref.content">
141 <xsl:with-param name="linkend" select="@otherterm"/>
142 <xsl:with-param name="role" select="'glosssee'"/>
143 </xsl:call-template>
144 </xsl:otherwise>
145 </xsl:choose>
146 </a>
147 </xsl:when>
148 <xsl:otherwise>
149 <xsl:apply-templates/>
150 </xsl:otherwise>
151 </xsl:choose>
152 </xsl:for-each>
153 </xsl:template>
154
155 <!-- = itemizedlist = -->
156 <xsl:template match="itemizedlist | db:itemizedlist">
157 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
158 <xsl:if test="$if != ''">
159 <div>
160 <xsl:variable name="title" select="title | blockinfo/title |
161 db:title | db:info/db:title"/>
162 <xsl:variable name="items" select="listitem | db:listitem"/>
163 <xsl:call-template name="html.class.attr">
164 <xsl:with-param name="class" select="'list itemizedlist'"/>
165 </xsl:call-template>
166 <xsl:call-template name="html.lang.attrs"/>
167 <xsl:call-template name="db2html.anchor"/>
168 <div class="inner">
169 <xsl:apply-templates select="$title[1]"/>
170 <div class="region"><div class="contents">
171 <xsl:apply-templates select="*[not(set:has-same-node(., $title | $items))]"/>
172 <ul>
173 <xsl:attribute name="class">
174 <xsl:text>list itemizedlist</xsl:text>
175 <xsl:if test="@spacing = 'compact'">
176 <xsl:text> compact</xsl:text>
177 </xsl:if>
178 </xsl:attribute>
179 <xsl:if test="@mark">
180 <xsl:attribute name="style">
181 <xsl:text>list-style-type: </xsl:text>
182 <xsl:choose>
183 <xsl:when test="@mark = 'bullet'">disc</xsl:when>
184 <xsl:when test="@mark = 'box'">square</xsl:when>
185 <xsl:otherwise><xsl:value-of select="@mark"/></xsl:otherwise>
186 </xsl:choose>
187 </xsl:attribute>
188 </xsl:if>
189 <xsl:apply-templates select="$items"/>
190 </ul>
191 </div></div>
192 </div>
193 </div>
194 </xsl:if>
195 </xsl:template>
196
197 <!-- = itemizedlist/listitem = -->
198 <xsl:template match="itemizedlist/listitem | db:itemizedlist/db:listitem">
199 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
200 <xsl:if test="$if != ''">
201 <li>
202 <xsl:call-template name="html.class.attr">
203 <xsl:with-param name="class" select="'list itemizedlist'"/>
204 </xsl:call-template>
205 <xsl:call-template name="html.lang.attrs"/>
206 <xsl:if test="@override">
207 <xsl:attribute name="style">
208 <xsl:text>list-style-type: </xsl:text>
209 <xsl:choose>
210 <xsl:when test="@override = 'bullet'">disc</xsl:when>
211 <xsl:when test="@override = 'box'">square</xsl:when>
212 <xsl:otherwise><xsl:value-of select="@override"/></xsl:otherwise>
213 </xsl:choose>
214 </xsl:attribute>
215 </xsl:if>
216 <xsl:call-template name="db2html.anchor"/>
217 <xsl:apply-templates/>
218 </li>
219 </xsl:if>
220 </xsl:template>
221
222 <!-- = member = -->
223 <xsl:template match="member | db:member">
224 <!-- Do something trivial, and rely on simplelist to do the rest -->
225 <xsl:call-template name="db2html.inline"/>
226 </xsl:template>
227
228 <!-- = orderedlist = -->
229 <xsl:template match="orderedlist | db:orderedlist">
230 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
231 <xsl:if test="$if != ''">
232 <xsl:variable name="start">
233 <xsl:choose>
234 <xsl:when test="@continuation = 'continues'">
235 <xsl:call-template name="db.orderedlist.start"/>
236 </xsl:when>
237 <xsl:otherwise>1</xsl:otherwise>
238 </xsl:choose>
239 </xsl:variable>
240 <!-- FIXME: auto-numeration for nested lists -->
241 <div>
242 <xsl:variable name="title" select="title | blockinfo/title |
243 db:title | db:info/db:title"/>
244 <xsl:variable name="items" select="listitem | db:listitem"/>
245 <xsl:call-template name="html.class.attr">
246 <xsl:with-param name="class" select="'list orderedlist'"/>
247 </xsl:call-template>
248 <xsl:call-template name="html.lang.attrs"/>
249 <xsl:call-template name="db2html.anchor"/>
250 <div class="inner">
251 <xsl:apply-templates select="$title[1]"/>
252 <div class="region"><div class="contents">
253 <xsl:apply-templates select="*[not(set:has-same-node(., $title | $items))]"/>
254 <ol>
255 <xsl:attribute name="class">
256 <xsl:text>list orderedlist</xsl:text>
257 <xsl:if test="@spacing = 'compact'">
258 <xsl:text> compact</xsl:text>
259 </xsl:if>
260 </xsl:attribute>
261 <xsl:if test="@numeration">
262 <xsl:attribute name="type">
263 <xsl:choose>
264 <xsl:when test="@numeration = 'arabic'">1</xsl:when>
265 <xsl:when test="@numeration = 'loweralpha'">a</xsl:when>
266 <xsl:when test="@numeration = 'lowerroman'">i</xsl:when>
267 <xsl:when test="@numeration = 'upperalpha'">A</xsl:when>
268 <xsl:when test="@numeration = 'upperroman'">I</xsl:when>
269 <xsl:otherwise>1</xsl:otherwise>
270 </xsl:choose>
271 </xsl:attribute>
272 </xsl:if>
273 <xsl:if test="$start != '1'">
274 <xsl:attribute name="start">
275 <xsl:value-of select="$start"/>
276 </xsl:attribute>
277 </xsl:if>
278 <!-- FIXME: @inheritnum -->
279 <xsl:apply-templates select="listitem | db:listitem"/>
280 </ol>
281 </div></div>
282 </div>
283 </div>
284 </xsl:if>
285 </xsl:template>
286
287 <!-- = orderedlist/listitem = -->
288 <xsl:template match="orderedlist/listitem | db:orderedlist/db:listitem">
289 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
290 <xsl:if test="$if != ''">
291 <li>
292 <xsl:call-template name="html.class.attr">
293 <xsl:with-param name="class" select="'list orderedlist'"/>
294 </xsl:call-template>
295 <xsl:call-template name="html.lang.attrs"/>
296 <xsl:if test="@override">
297 <xsl:attribute name="value">
298 <xsl:value-of select="@override"/>
299 </xsl:attribute>
300 </xsl:if>
301 <xsl:call-template name="db2html.anchor"/>
302 <xsl:apply-templates/>
303 </li>
304 </xsl:if>
305 </xsl:template>
306
307 <!-- = procedure = -->
308 <xsl:template match="procedure | db:procedure">
309 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
310 <xsl:if test="$if != ''">
311 <div>
312 <xsl:variable name="title" select="title | blockinfo/title |
313 db:title | db:info/db:title"/>
314 <xsl:variable name="steps" select="step | db:step"/>
315 <xsl:variable name="result" select="db:result"/>
316 <xsl:call-template name="html.class.attr">
317 <xsl:with-param name="class" select="'steps'"/>
318 </xsl:call-template>
319 <xsl:call-template name="html.lang.attrs"/>
320 <xsl:call-template name="db2html.anchor"/>
321 <div class="inner">
322 <xsl:apply-templates select="$title[1]"/>
323 <div class="region"><div class="contents">
324 <xsl:apply-templates select="*[not(set:has-same-node(., $title | $steps | $result))]"/>
325 <xsl:choose>
326 <xsl:when test="count($steps) = 1">
327 <ul class="steps">
328 <xsl:apply-templates select="$steps"/>
329 </ul>
330 </xsl:when>
331 <xsl:otherwise>
332 <ol class="steps">
333 <xsl:apply-templates select="$steps"/>
334 </ol>
335 </xsl:otherwise>
336 </xsl:choose>
337 <xsl:apply-templates select="$result"/>
338 </div></div></div>
339 </div>
340 </xsl:if>
341 </xsl:template>
342
343 <!-- = answer = -->
344 <xsl:template match="answer | db:answer">
345 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
346 <xsl:if test="$if != ''">
347 <dd>
348 <xsl:call-template name="html.class.attr">
349 <xsl:with-param name="class" select="'answer'"/>
350 </xsl:call-template>
351 <xsl:call-template name="html.lang.attrs"/>
352 <xsl:choose>
353 <xsl:when test="label | db:label">
354 <div class="qanda-label">
355 <xsl:apply-templates select="label/node() | db:label/node()"/>
356 </div>
357 </xsl:when>
358 <xsl:when test="ancestor::qandaset/@defaultlabel = 'qanda' or
359 ancestor::db:qandaset/@defaultlabel = 'qanda'">
360 <div class="qanda-label">
361 <xsl:call-template name="l10n.gettext">
362 <xsl:with-param name="msgid" select="'A:'"/>
363 </xsl:call-template>
364 </div>
365 </xsl:when>
366 </xsl:choose>
367 <xsl:apply-templates/>
368 </dd>
369 </xsl:if>
370 </xsl:template>
371
372 <!-- = qandaentry = -->
373 <xsl:template match="qandaentry | db:qandaentry">
374 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
375 <xsl:if test="$if != ''">
376 <xsl:apply-templates/>
377 </xsl:if>
378 </xsl:template>
379
380 <!-- = question = -->
381 <xsl:template match="question | db:question">
382 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
383 <xsl:if test="$if != ''">
384 <dt>
385 <xsl:call-template name="html.class.attr">
386 <xsl:with-param name="class" select="'question'"/>
387 </xsl:call-template>
388 <xsl:call-template name="html.lang.attrs"/>
389 <xsl:choose>
390 <xsl:when test="label | db:label">
391 <div class="qanda-label">
392 <xsl:apply-templates select="label/node() | db:label/node()"/>
393 </div>
394 </xsl:when>
395 <xsl:when test="ancestor::qandaset/@defaultlabel = 'qanda' or
396 ancestor::db:qandaset/@defaultlabel = 'qanda'">
397 <div class="qanda-label">
398 <xsl:call-template name="l10n.gettext">
399 <xsl:with-param name="msgid" select="'Q:'"/>
400 </xsl:call-template>
401 </div>
402 </xsl:when>
403 </xsl:choose>
404 <xsl:apply-templates/>
405 </dt>
406 </xsl:if>
407 </xsl:template>
408
409 <!-- = seg = -->
410 <xsl:template match="seg | db:seg">
411 <xsl:variable name="position"
412 select="count(preceding-sibling::seg) +
413 count(preceding-sibling::db:seg) + 1"/>
414 <p>
415 <xsl:call-template name="html.class.attr">
416 <xsl:with-param name="class" select="'seg'"/>
417 </xsl:call-template>
418 <xsl:call-template name="html.lang.attrs"/>
419 <xsl:apply-templates select="../../segtitle[position() = $position] |
420 ../../db:segtitle[position() = $position]"/>
421 <xsl:apply-templates/>
422 </p>
423 </xsl:template>
424
425 <!-- = seglistitem = -->
426 <xsl:template match="seglistitem | db:seglistitem">
427 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
428 <xsl:if test="$if != ''">
429 <div>
430 <xsl:call-template name="html.class.attr">
431 <xsl:with-param name="class" select="'seglistitem'"/>
432 </xsl:call-template>
433 <xsl:call-template name="html.lang.attrs"/>
434 <xsl:call-template name="db2html.anchor"/>
435 <xsl:apply-templates select="seg | db:seg"/>
436 </div>
437 </xsl:if>
438 </xsl:template>
439
440 <!-- FIXME: Implement tabular segmentedlists -->
441 <!-- = segmentedlist = -->
442 <xsl:template match="segmentedlist | db:segmentedlist">
443 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
444 <xsl:if test="$if != ''">
445 <div>
446 <xsl:call-template name="html.class.attr">
447 <xsl:with-param name="class" select="'list segmentedlist'"/>
448 </xsl:call-template>
449 <xsl:call-template name="html.lang.attrs"/>
450 <xsl:call-template name="db2html.anchor"/>
451 <xsl:apply-templates select="title | db:title | db:info/db:title"/>
452 <xsl:apply-templates select="seglistitem | db:seglistitem"/>
453 </div>
454 </xsl:if>
455 </xsl:template>
456
457 <!-- = segtitle = -->
458 <xsl:template match="segtitle | db:segtitle">
459 <!-- FIXME: no style tags -->
460 <b>
461 <xsl:call-template name="html.class.attr"/>
462 <xsl:call-template name="html.lang.attrs"/>
463 <xsl:apply-templates/>
464 <!-- FIXME: i18n -->
465 <xsl:text>: </xsl:text>
466 </b>
467 </xsl:template>
468
469 <!-- = simplelist = -->
470 <xsl:template match="simplelist | db:simplelist">
471 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
472 <xsl:if test="$if != ''">
473 <xsl:variable name="columns">
474 <xsl:choose>
475 <xsl:when test="@columns">
476 <xsl:value-of select="@columns"/>
477 </xsl:when>
478 <xsl:otherwise>
479 <xsl:value-of select="1"/>
480 </xsl:otherwise>
481 </xsl:choose>
482 </xsl:variable>
483 <xsl:variable name="allmembers" select="member | db:member"/>
484 <xsl:variable name="memberpos">
485 <xsl:for-each select="member | db:member">
486 <xsl:variable name="memberif">
487 <xsl:call-template name="db.profile.test"/>
488 </xsl:variable>
489 <xsl:if test="$memberif != ''">
490 <xsl:value-of select="concat(',', position())"/>
491 </xsl:if>
492 </xsl:for-each>
493 </xsl:variable>
494 <xsl:choose>
495 <xsl:when test="@type = 'inline'">
496 <span>
497 <xsl:call-template name="html.class.attr">
498 <xsl:with-param name="class" select="'simplelist'"/>
499 </xsl:call-template>
500 <xsl:call-template name="html.lang.attrs"/>
501 <xsl:call-template name="db2html.anchor"/>
502 <xsl:for-each select="str:split($memberpos, ',')">
503 <xsl:if test="position() != 1">
504 <xsl:call-template name="l10n.gettext">
505 <xsl:with-param name="msgid" select="', '"/>
506 </xsl:call-template>
507 </xsl:if>
508 <xsl:variable name="pos" select="number(.)"/>
509 <xsl:apply-templates select="$allmembers[$pos]"/>
510 </xsl:for-each>
511 </span>
512 </xsl:when>
513 <xsl:when test="@type = 'horiz'">
514 <div>
515 <xsl:call-template name="html.class.attr">
516 <xsl:with-param name="class" select="'list simplelist'"/>
517 </xsl:call-template>
518 <xsl:call-template name="html.lang.attrs"/>
519 <xsl:call-template name="db2html.anchor"/>
520 <table class="simplelist">
521 <xsl:for-each select="str:split($memberpos, ',')[$columns = 1 or position() mod $columns = 1]">
522 <xsl:variable name="pos" select="number(.)"/>
523 <tr>
524 <td>
525 <xsl:apply-templates select="$allmembers[$pos]"/>
526 </td>
527 <xsl:for-each select="following-sibling::*[position() &lt; $columns]">
528 <xsl:variable name="fpos" select="number(.)"/>
529 <td>
530 <xsl:apply-templates select="$allmembers[$fpos]"/>
531 </td>
532 </xsl:for-each>
533 <xsl:variable name="fcount" select="count(following-sibling::*)"/>
534 <xsl:if test="$fcount &lt; ($columns - 1)">
535 <td colspan="{$columns - $fcount - 1}"/>
536 </xsl:if>
537 </tr>
538 </xsl:for-each>
539 </table>
540 </div>
541 </xsl:when>
542 <xsl:otherwise>
543 <div>
544 <xsl:call-template name="html.class.attr">
545 <xsl:with-param name="class" select="'list simplelist'"/>
546 </xsl:call-template>
547 <xsl:call-template name="html.lang.attrs"/>
548 <xsl:call-template name="db2html.anchor"/>
549 <xsl:variable name="rows"
550 select="ceiling(count(str:split($memberpos, ',')) div $columns)"/>
551 <table class="simplelist">
552 <xsl:for-each select="str:split($memberpos, ',')[position() &lt;= $rows]">
553 <xsl:variable name="pos" select="number(.)"/>
554 <tr>
555 <td>
556 <xsl:apply-templates select="$allmembers[$pos]"/>
557 </td>
558 <xsl:for-each select="following-sibling::*[position() mod $rows = 0]">
559 <xsl:variable name="fpos" select="number(.)"/>
560 <td>
561 <xsl:apply-templates select="$allmembers[$fpos]"/>
562 </td>
563 </xsl:for-each>
564 <xsl:variable name="fcount"
565 select="count(following-sibling::*[position() mod $rows = 0])"/>
566 <xsl:if test="$fcount &lt; ($columns - 1)">
567 <td/>
568 </xsl:if>
569 </tr>
570 </xsl:for-each>
571 </table>
572 </div>
573 </xsl:otherwise>
574 </xsl:choose>
575 </xsl:if>
576 </xsl:template>
577
578 <!-- = result = -->
579 <xsl:template match="result | db:result">
580 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
581 <xsl:if test="$if != ''">
582 <div>
583 <xsl:call-template name="html.class.attr">
584 <xsl:with-param name="class" select="'result'"/>
585 </xsl:call-template>
586 <xsl:call-template name="html.lang.attrs"/>
587 <xsl:call-template name="db2html.anchor"/>
588 <xsl:apply-templates/>
589 </div>
590 </xsl:if>
591 </xsl:template>
592
593 <!-- FIXME: Do something with @performance -->
594 <!-- = step = -->
595 <xsl:template match="step | db:step">
596 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
597 <xsl:if test="$if != ''">
598 <li>
599 <xsl:call-template name="html.class.attr">
600 <xsl:with-param name="class" select="'steps'"/>
601 </xsl:call-template>
602 <xsl:call-template name="html.lang.attrs"/>
603 <xsl:apply-templates/>
604 </li>
605 </xsl:if>
606 </xsl:template>
607
608 <!-- FIXME: Do something with @performance -->
609 <!-- = stepalternatives = -->
610 <xsl:template match="stepalternatives | db:stepalternatives">
611 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
612 <xsl:if test="$if != ''">
613 <div>
614 <xsl:call-template name="html.class.attr">
615 <xsl:with-param name="class" select="'steps stepalternatives'"/>
616 </xsl:call-template>
617 <xsl:call-template name="html.lang.attrs"/>
618 <xsl:call-template name="db2html.anchor"/>
619 <ul class="steps stepalternatives">
620 <xsl:apply-templates/>
621 </ul>
622 </div>
623 </xsl:if>
624 </xsl:template>
625
626 <!-- FIXME: Do something with @performance -->
627 <!-- = substeps = -->
628 <xsl:template match="substeps | db:substeps">
629 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
630 <xsl:if test="$if != ''">
631 <xsl:variable name="depth" select="count(ancestor::substeps | ancestor::db:substeps)"/>
632 <div>
633 <xsl:call-template name="html.class.attr">
634 <xsl:with-param name="class" select="'steps substeps'"/>
635 </xsl:call-template>
636 <xsl:call-template name="html.lang.attrs"/>
637 <xsl:call-template name="db2html.anchor"/>
638 <ol class="steps substeps">
639 <xsl:attribute name="type">
640 <xsl:choose>
641 <xsl:when test="$depth mod 3 = 0">a</xsl:when>
642 <xsl:when test="$depth mod 3 = 1">i</xsl:when>
643 <xsl:when test="$depth mod 3 = 2">1</xsl:when>
644 </xsl:choose>
645 </xsl:attribute>
646 <xsl:apply-templates/>
647 </ol>
648 </div>
649 </xsl:if>
650 </xsl:template>
651
652 <!-- = term = -->
653 <xsl:template match="term | db:term">
654 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
655 <xsl:if test="$if != ''">
656 <dt>
657 <xsl:call-template name="html.class.attr">
658 <xsl:with-param name="class" select="'terms'"/>
659 </xsl:call-template>
660 <xsl:call-template name="html.lang.attrs"/>
661 <xsl:if test="(../varlistentry/@id and not(preceding-sibling::term)) or
662 (../db:varlistentry/@xml:id and not(preceding-sibling::db:term))">
663 <xsl:call-template name="db2html.anchor">
664 <xsl:with-param name="node" select=".."/>
665 </xsl:call-template>
666 </xsl:if>
667 <xsl:apply-templates select="db:info/db:title"/>
668 <xsl:apply-templates/>
669 </dt>
670 </xsl:if>
671 </xsl:template>
672
673 <!-- = variablelist = -->
674 <xsl:template match="variablelist | db:variablelist">
675 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
676 <xsl:if test="$if != ''">
677 <div>
678 <xsl:variable name="title" select="title | blockinfo/title |
679 db:title | db:info/db:title"/>
680 <xsl:variable name="items" select="varlistentry | db:varlistentry"/>
681 <xsl:call-template name="html.class.attr">
682 <xsl:with-param name="class" select="'terms variablelist'"/>
683 </xsl:call-template>
684 <xsl:call-template name="html.lang.attrs"/>
685 <xsl:call-template name="db2html.anchor"/>
686 <div class="inner">
687 <xsl:apply-templates select="$title[1]"/>
688 <div class="region"><div class="contents">
689 <xsl:apply-templates select="*[not(set:has-same-node(., $title | $items))]"/>
690 <dl class="terms variablelist">
691 <xsl:apply-templates select="$items"/>
692 </dl>
693 </div></div>
694 </div>
695 </div>
696 </xsl:if>
697 </xsl:template>
698
699 <!-- = varlistentry = -->
700 <xsl:template match="varlistentry | db:varlistentry">
701 <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
702 <xsl:if test="$if != ''">
703 <xsl:apply-templates select="term | db:term"/>
704 <xsl:apply-templates select="listitem | db:listitem"/>
705 </xsl:if>
706 </xsl:template>
707
708 <!-- = varlistentry/listitem = -->
709 <xsl:template match="varlistentry/listitem | db:varlistentry/db:listitem">
710 <dd>
711 <xsl:call-template name="html.class.attr">
712 <xsl:with-param name="class" select="'terms'"/>
713 </xsl:call-template>
714 <xsl:call-template name="html.lang.attrs"/>
715 <xsl:call-template name="db2html.anchor"/>
716 <xsl:apply-templates/>
717 </dd>
718 </xsl:template>
719
720 </xsl:stylesheet>