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="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
7 $Id: lists.xsl 9792 2013-08-28 23:03:16Z bobstayton $
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <xsl:template match="itemizedlist">
19 <!-- Handle spacing="compact" as multiple class attribute instead
20 of the deprecated HTML compact attribute -->
21 <xsl:variable name="default.class">
22 <xsl:value-of select="local-name()"/>
23 <xsl:if test="@spacing = 'compact'">
24 <xsl:text> compact</xsl:text>
28 <xsl:variable name="style.value">
29 <xsl:variable name="type">
30 <xsl:call-template name="list.itemsymbol"/>
33 <xsl:text>list-style-type: </xsl:text>
34 <xsl:value-of select="$type"/>
35 <xsl:text>; </xsl:text>
39 <xsl:call-template name="common.html.attributes"/>
40 <xsl:call-template name="id.attribute"/>
41 <xsl:call-template name="anchor"/>
42 <xsl:if test="title|info/title">
43 <xsl:call-template name="formal.object.heading"/>
46 <!-- Preserve order of PIs and comments -->
47 <xsl:apply-templates select="*[not(self::listitem or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::listitem)] |processing-instruction()[not(preceding-sibling::listitem)]"/>
50 <xsl:call-template name="generate.class.attribute">
51 <xsl:with-param name="class" select="$default.class"/>
54 <xsl:when test="$css.decoration != 0">
55 <xsl:attribute name="style">
56 <xsl:value-of select="$style.value"/>
59 <xsl:when test="$make.clean.html != 0">
60 <!-- styled by separate css only -->
63 <!-- use the old @type attribute -->
64 <xsl:attribute name="type">
65 <xsl:call-template name="list.itemsymbol"/>
70 <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
75 <xsl:template match="itemizedlist/title">
79 <xsl:template match="itemizedlist/listitem">
80 <xsl:variable name="mark" select="../@mark"/>
81 <xsl:variable name="override" select="@override"/>
83 <xsl:variable name="usemark">
85 <xsl:when test="$override != ''">
86 <xsl:value-of select="$override"/>
89 <xsl:value-of select="$mark"/>
94 <xsl:variable name="cssmark">
96 <xsl:when test="$usemark = 'opencircle'">circle</xsl:when>
97 <xsl:when test="$usemark = 'bullet'">disc</xsl:when>
98 <xsl:when test="$usemark = 'box'">square</xsl:when>
100 <xsl:value-of select="$usemark"/>
106 <xsl:call-template name="common.html.attributes"/>
107 <xsl:call-template name="id.attribute"/>
108 <xsl:if test="$css.decoration = '1' and $cssmark != ''">
109 <xsl:attribute name="style">
110 <xsl:text>list-style-type: </xsl:text>
111 <xsl:value-of select="$cssmark"/>
115 <!-- we can't just drop the anchor in since some browsers (Opera)
116 get confused about line breaks if we do. So if the first child
117 is a para, assume the para will put in the anchor. Otherwise,
118 put the anchor in anyway. -->
119 <xsl:if test="local-name(child::*[1]) != 'para'">
120 <xsl:call-template name="anchor"/>
124 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
125 <div class="{@revisionflag}">
126 <xsl:apply-templates/>
130 <xsl:apply-templates/>
136 <xsl:template match="orderedlist">
137 <!-- Handle spacing="compact" as multiple class attribute instead
138 of the deprecated HTML compact attribute -->
139 <xsl:variable name="default.class">
140 <xsl:value-of select="local-name()"/>
141 <xsl:if test="@spacing = 'compact'">
142 <xsl:text> compact</xsl:text>
146 <xsl:variable name="start">
147 <xsl:call-template name="orderedlist-starting-number"/>
150 <xsl:variable name="numeration">
151 <xsl:call-template name="list.numeration"/>
154 <xsl:variable name="type">
156 <xsl:when test="$numeration='arabic'">1</xsl:when>
157 <xsl:when test="$numeration='loweralpha'">a</xsl:when>
158 <xsl:when test="$numeration='lowerroman'">i</xsl:when>
159 <xsl:when test="$numeration='upperalpha'">A</xsl:when>
160 <xsl:when test="$numeration='upperroman'">I</xsl:when>
161 <!-- What!? This should never happen -->
164 <xsl:text>Unexpected numeration: </xsl:text>
165 <xsl:value-of select="$numeration"/>
167 <xsl:value-of select="1"/>
173 <xsl:call-template name="common.html.attributes"/>
174 <xsl:call-template name="id.attribute"/>
175 <xsl:call-template name="anchor"/>
177 <xsl:if test="title|info/title">
178 <xsl:call-template name="formal.object.heading"/>
181 <!-- Preserve order of PIs and comments -->
182 <xsl:apply-templates select="*[not(self::listitem or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::listitem)] |processing-instruction()[not(preceding-sibling::listitem)]"/>
185 <xsl:when test="@inheritnum='inherit' and ancestor::listitem[parent::orderedlist]">
186 <table border="{$table.border.off}">
187 <xsl:call-template name="generate.class.attribute">
188 <xsl:with-param name="class" select="$default.class"/>
191 <col align="{$direction.align.start}" valign="top"/>
195 <xsl:apply-templates mode="orderedlist-table" select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
201 <xsl:call-template name="generate.class.attribute">
202 <xsl:with-param name="class" select="$default.class"/>
204 <xsl:if test="$start != '1'">
205 <xsl:attribute name="start">
206 <xsl:value-of select="$start"/>
209 <xsl:if test="$numeration != ''">
210 <xsl:attribute name="type">
211 <xsl:value-of select="$type"/>
214 <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem] |processing-instruction()[preceding-sibling::listitem]"/>
221 <xsl:template match="orderedlist/title">
225 <xsl:template match="orderedlist/listitem">
227 <xsl:call-template name="common.html.attributes"/>
228 <xsl:call-template name="id.attribute"/>
229 <xsl:if test="@override">
230 <xsl:attribute name="value">
231 <xsl:value-of select="@override"/>
235 <!-- we can't just drop the anchor in since some browsers (Opera)
236 get confused about line breaks if we do. So if the first child
237 is a para, assume the para will put in the anchor. Otherwise,
238 put the anchor in anyway. -->
239 <xsl:if test="local-name(child::*[1]) != 'para'">
240 <xsl:call-template name="anchor"/>
244 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
245 <div class="{@revisionflag}">
246 <xsl:apply-templates/>
250 <xsl:apply-templates/>
256 <xsl:template match="orderedlist/listitem" mode="orderedlist-table">
259 <xsl:apply-templates select="." mode="item-number"/>
262 <xsl:if test="local-name(child::*[1]) != 'para'">
263 <xsl:call-template name="id.attribute"/>
264 <xsl:call-template name="anchor"/>
268 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
269 <div class="{@revisionflag}">
270 <xsl:apply-templates/>
274 <xsl:apply-templates/>
281 <xsl:template match="variablelist">
282 <xsl:variable name="pi-presentation">
283 <xsl:call-template name="pi.dbhtml_list-presentation"/>
285 <!-- Handle spacing="compact" as multiple class attribute instead
286 of the deprecated HTML compact attribute -->
287 <xsl:variable name="default.class">
288 <xsl:value-of select="local-name()"/>
289 <xsl:if test="@spacing = 'compact'">
290 <xsl:text> compact</xsl:text>
295 <xsl:variable name="presentation">
297 <xsl:when test="$pi-presentation != ''">
298 <xsl:value-of select="$pi-presentation"/>
300 <xsl:when test="$variablelist.as.table != 0">
301 <xsl:value-of select="'table'"/>
304 <xsl:value-of select="'list'"/>
309 <xsl:variable name="list-width">
310 <xsl:call-template name="pi.dbhtml_list-width"/>
313 <xsl:variable name="term-width">
314 <xsl:call-template name="pi.dbhtml_term-width"/>
317 <xsl:variable name="table-summary">
318 <xsl:call-template name="pi.dbhtml_table-summary"/>
322 <xsl:call-template name="common.html.attributes"/>
323 <xsl:call-template name="id.attribute"/>
324 <xsl:call-template name="anchor"/>
325 <xsl:if test="title|info/title">
326 <xsl:call-template name="formal.object.heading"/>
330 <xsl:when test="$presentation = 'table'">
331 <!-- Preserve order of PIs and comments -->
332 <xsl:apply-templates select="*[not(self::varlistentry or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::varlistentry)] |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
333 <table border="{$table.border.off}">
334 <xsl:call-template name="generate.class.attribute">
335 <xsl:with-param name="class" select="$default.class"/>
337 <xsl:if test="$list-width != ''">
338 <xsl:attribute name="width">
339 <xsl:value-of select="$list-width"/>
342 <xsl:if test="$table-summary != ''">
343 <xsl:attribute name="summary">
344 <xsl:value-of select="$table-summary"/>
348 <col align="{$direction.align.start}" valign="top">
349 <xsl:if test="$term-width != ''">
350 <xsl:attribute name="width">
351 <xsl:value-of select="$term-width"/>
358 <xsl:apply-templates mode="varlist-table" select="varlistentry |comment()[preceding-sibling::varlistentry] |processing-instruction()[preceding-sibling::varlistentry]"/>
363 <!-- Preserve order of PIs and comments -->
364 <xsl:apply-templates select="*[not(self::varlistentry or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::varlistentry)] |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
366 <xsl:call-template name="generate.class.attribute">
367 <xsl:with-param name="class" select="$default.class"/>
369 <xsl:apply-templates select="varlistentry |comment()[preceding-sibling::varlistentry] |processing-instruction()[preceding-sibling::varlistentry]"/>
376 <xsl:template match="variablelist/title">
380 <xsl:template match="itemizedlist/titleabbrev|orderedlist/titleabbrev">
384 <xsl:template match="variablelist/titleabbrev">
388 <xsl:template match="listitem" mode="xref">
389 <xsl:number format="1"/>
392 <xsl:template match="listitem/simpara" priority="2">
393 <!-- If a listitem contains only a single simpara, don't output
394 the <p> wrapper; this has the effect of creating an li
395 with simple text content. -->
397 <xsl:when test="not(preceding-sibling::*) and not (following-sibling::*)">
398 <xsl:call-template name="anchor"/>
399 <xsl:apply-templates/>
403 <xsl:call-template name="id.attribute"/>
405 <xsl:when test="@role and $para.propagates.style != 0">
406 <xsl:call-template name="common.html.attributes">
407 <xsl:with-param name="class" select="@role"/>
411 <xsl:call-template name="common.html.attributes"/>
415 <xsl:call-template name="anchor"/>
416 <xsl:apply-templates/>
422 <xsl:template match="varlistentry">
424 <xsl:call-template name="id.attribute"/>
425 <xsl:call-template name="anchor"/>
426 <xsl:apply-templates select="term"/>
429 <xsl:apply-templates select="listitem"/>
433 <xsl:template match="varlistentry" mode="varlist-table">
434 <xsl:variable name="presentation">
435 <xsl:call-template name="pi.dbhtml_term-presentation">
436 <xsl:with-param name="node" select=".."/>
440 <xsl:variable name="separator">
441 <xsl:call-template name="pi.dbhtml_term-separator">
442 <xsl:with-param name="node" select=".."/>
446 <xsl:call-template name="tr.attributes">
447 <xsl:with-param name="rownum">
448 <xsl:number from="variablelist" count="varlistentry"/>
453 <xsl:call-template name="id.attribute"/>
455 <xsl:call-template name="anchor"/>
457 <xsl:when test="$presentation = 'bold'">
459 <xsl:apply-templates select="term"/>
460 <xsl:value-of select="$separator"/>
463 <xsl:when test="$presentation = 'italic'">
465 <xsl:apply-templates select="term"/>
466 <xsl:value-of select="$separator"/>
469 <xsl:when test="$presentation = 'bold-italic'">
472 <xsl:apply-templates select="term"/>
473 <xsl:value-of select="$separator"/>
478 <xsl:apply-templates select="term"/>
479 <xsl:value-of select="$separator"/>
485 <xsl:apply-templates select="listitem"/>
490 <xsl:template match="varlistentry/term">
492 <xsl:call-template name="common.html.attributes"/>
493 <xsl:call-template name="id.attribute"/>
494 <xsl:call-template name="anchor"/>
495 <xsl:call-template name="simple.xlink">
496 <xsl:with-param name="content">
497 <xsl:apply-templates/>
501 <xsl:when test="position() = last()"/> <!-- do nothing -->
503 <!-- * if we have multiple terms in the same varlistentry, generate -->
504 <!-- * a separator (", " by default) and/or an additional line -->
505 <!-- * break after each one except the last -->
506 <xsl:value-of select="$variablelist.term.separator"/>
507 <xsl:if test="not($variablelist.term.break.after = '0')">
515 <xsl:template match="varlistentry/listitem">
516 <!-- we can't just drop the anchor in since some browsers (Opera)
517 get confused about line breaks if we do. So if the first child
518 is a para, assume the para will put in the anchor. Otherwise,
519 put the anchor in anyway. -->
520 <xsl:if test="local-name(child::*[1]) != 'para'">
521 <xsl:call-template name="anchor"/>
525 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
526 <div class="{@revisionflag}">
527 <xsl:apply-templates/>
531 <xsl:apply-templates/>
536 <!-- ==================================================================== -->
538 <xsl:template match="simplelist">
539 <!-- with no type specified, the default is 'vert' -->
540 <xsl:call-template name="anchor"/>
541 <table border="{$table.border.off}">
542 <xsl:if test="$div.element != 'section'">
543 <xsl:attribute name="summary">Simple list</xsl:attribute>
545 <xsl:call-template name="common.html.attributes"/>
546 <xsl:call-template name="id.attribute"/>
547 <xsl:call-template name="simplelist.vert">
548 <xsl:with-param name="cols">
550 <xsl:when test="@columns">
551 <xsl:value-of select="@columns"/>
553 <xsl:otherwise>1</xsl:otherwise>
560 <xsl:template match="simplelist[@type='inline']">
562 <xsl:call-template name="common.html.attributes"/>
563 <xsl:call-template name="id.attribute"/>
564 <!-- if dbchoice PI exists, use that to determine the choice separator -->
565 <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
566 <!-- value of "choice" otherwise -->
567 <xsl:variable name="localized-choice-separator">
569 <xsl:when test="processing-instruction('dbchoice')">
570 <xsl:call-template name="select.choice.separator"/>
578 <xsl:for-each select="member">
579 <xsl:call-template name="simple.xlink">
580 <xsl:with-param name="content">
581 <xsl:apply-templates/>
585 <xsl:when test="position() = last()"/> <!-- do nothing -->
587 <xsl:text>, </xsl:text>
588 <xsl:if test="position() = last() - 1">
589 <xsl:if test="$localized-choice-separator != ''">
590 <xsl:value-of select="$localized-choice-separator"/>
591 <xsl:text> </xsl:text>
600 <xsl:template match="simplelist[@type='horiz']">
601 <xsl:call-template name="anchor"/>
602 <table border="{$table.border.off}">
603 <xsl:if test="$div.element != 'section'">
604 <xsl:attribute name="summary">Simple list</xsl:attribute>
606 <xsl:call-template name="common.html.attributes"/>
607 <xsl:call-template name="id.attribute"/>
608 <xsl:call-template name="simplelist.horiz">
609 <xsl:with-param name="cols">
611 <xsl:when test="@columns">
612 <xsl:value-of select="@columns"/>
614 <xsl:otherwise>1</xsl:otherwise>
621 <xsl:template match="simplelist[@type='vert']">
622 <xsl:call-template name="anchor"/>
623 <table border="{$table.border.off}">
624 <xsl:if test="$div.element != 'section'">
625 <xsl:attribute name="summary">Simple list</xsl:attribute>
627 <xsl:call-template name="common.html.attributes"/>
628 <xsl:call-template name="id.attribute"/>
629 <xsl:call-template name="simplelist.vert">
630 <xsl:with-param name="cols">
632 <xsl:when test="@columns">
633 <xsl:value-of select="@columns"/>
635 <xsl:otherwise>1</xsl:otherwise>
642 <xsl:template name="simplelist.horiz">
643 <xsl:param name="cols">1</xsl:param>
644 <xsl:param name="cell">1</xsl:param>
645 <xsl:param name="members" select="./member"/>
647 <xsl:if test="$cell <= count($members)">
649 <xsl:call-template name="tr.attributes">
650 <xsl:with-param name="row" select="$members[1]"/>
651 <xsl:with-param name="rownum" select="(($cell - 1) div $cols) + 1"/>
654 <xsl:call-template name="simplelist.horiz.row">
655 <xsl:with-param name="cols" select="$cols"/>
656 <xsl:with-param name="cell" select="$cell"/>
657 <xsl:with-param name="members" select="$members"/>
660 <xsl:call-template name="simplelist.horiz">
661 <xsl:with-param name="cols" select="$cols"/>
662 <xsl:with-param name="cell" select="$cell + $cols"/>
663 <xsl:with-param name="members" select="$members"/>
668 <xsl:template name="simplelist.horiz.row">
669 <xsl:param name="cols">1</xsl:param>
670 <xsl:param name="cell">1</xsl:param>
671 <xsl:param name="members" select="./member"/>
672 <xsl:param name="curcol">1</xsl:param>
674 <xsl:if test="$curcol <= $cols">
677 <xsl:when test="$members[position()=$cell]">
678 <xsl:apply-templates select="$members[position()=$cell]"/>
681 <xsl:text> </xsl:text>
685 <xsl:call-template name="simplelist.horiz.row">
686 <xsl:with-param name="cols" select="$cols"/>
687 <xsl:with-param name="cell" select="$cell+1"/>
688 <xsl:with-param name="members" select="$members"/>
689 <xsl:with-param name="curcol" select="$curcol+1"/>
694 <xsl:template name="simplelist.vert">
695 <xsl:param name="cols">1</xsl:param>
696 <xsl:param name="cell">1</xsl:param>
697 <xsl:param name="members" select="./member"/>
698 <xsl:param name="rows" select="floor((count($members)+$cols - 1) div $cols)"/>
700 <xsl:if test="$cell <= $rows">
702 <xsl:call-template name="tr.attributes">
703 <xsl:with-param name="row" select="$members[1]"/>
704 <xsl:with-param name="rownum" select="$cell"/>
707 <xsl:call-template name="simplelist.vert.row">
708 <xsl:with-param name="cols" select="$cols"/>
709 <xsl:with-param name="rows" select="$rows"/>
710 <xsl:with-param name="cell" select="$cell"/>
711 <xsl:with-param name="members" select="$members"/>
714 <xsl:call-template name="simplelist.vert">
715 <xsl:with-param name="cols" select="$cols"/>
716 <xsl:with-param name="cell" select="$cell+1"/>
717 <xsl:with-param name="members" select="$members"/>
718 <xsl:with-param name="rows" select="$rows"/>
723 <xsl:template name="simplelist.vert.row">
724 <xsl:param name="cols">1</xsl:param>
725 <xsl:param name="rows">1</xsl:param>
726 <xsl:param name="cell">1</xsl:param>
727 <xsl:param name="members" select="./member"/>
728 <xsl:param name="curcol">1</xsl:param>
730 <xsl:if test="$curcol <= $cols">
733 <xsl:when test="$members[position()=$cell]">
734 <xsl:apply-templates select="$members[position()=$cell]"/>
737 <xsl:text> </xsl:text>
741 <xsl:call-template name="simplelist.vert.row">
742 <xsl:with-param name="cols" select="$cols"/>
743 <xsl:with-param name="rows" select="$rows"/>
744 <xsl:with-param name="cell" select="$cell+$rows"/>
745 <xsl:with-param name="members" select="$members"/>
746 <xsl:with-param name="curcol" select="$curcol+1"/>
751 <xsl:template match="member">
752 <xsl:call-template name="anchor"/>
753 <xsl:call-template name="simple.xlink">
754 <xsl:with-param name="content">
755 <xsl:apply-templates/>
760 <!-- ==================================================================== -->
762 <xsl:template match="procedure">
763 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/>
765 <xsl:variable name="placement">
767 <xsl:when test="contains($param.placement, ' ')">
768 <xsl:value-of select="substring-before($param.placement, ' ')"/>
770 <xsl:when test="$param.placement = ''">before</xsl:when>
772 <xsl:value-of select="$param.placement"/>
777 <!-- Preserve order of PIs and comments -->
778 <xsl:variable name="preamble" select="*[not(self::step or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::step)] |processing-instruction()[not(preceding-sibling::step)]"/>
781 <xsl:call-template name="common.html.attributes"/>
782 <xsl:call-template name="id.attribute">
783 <xsl:with-param name="conditional">
785 <xsl:when test="title">0</xsl:when>
786 <xsl:otherwise>1</xsl:otherwise>
790 <xsl:call-template name="anchor">
791 <xsl:with-param name="conditional">
793 <xsl:when test="title|info/title|blockinfo/title">0</xsl:when>
794 <xsl:otherwise>1</xsl:otherwise>
799 <xsl:if test="(title or info/title or blockinfo/title) and $placement = 'before'">
800 <xsl:call-template name="formal.object.heading"/>
803 <xsl:apply-templates select="$preamble"/>
806 <xsl:when test="count(step) = 1">
808 <xsl:call-template name="generate.class.attribute"/>
809 <xsl:apply-templates select="step |comment()[preceding-sibling::step] |processing-instruction()[preceding-sibling::step]"/>
814 <xsl:call-template name="generate.class.attribute"/>
815 <xsl:attribute name="type">
816 <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
818 <xsl:apply-templates select="step |comment()[preceding-sibling::step] |processing-instruction()[preceding-sibling::step]"/>
823 <xsl:if test="(title or info/title or blockinfo/title) and $placement != 'before'">
824 <xsl:call-template name="formal.object.heading"/>
829 <xsl:template match="procedure/title">
833 <xsl:template match="substeps">
834 <xsl:variable name="numeration">
835 <xsl:call-template name="procedure.step.numeration"/>
838 <xsl:call-template name="anchor"/>
840 <ol type="{$numeration}">
841 <xsl:call-template name="common.html.attributes"/>
842 <xsl:call-template name="id.attribute"/>
843 <xsl:apply-templates/>
847 <xsl:template match="step">
849 <xsl:call-template name="common.html.attributes"/>
850 <xsl:call-template name="id.attribute"/>
851 <xsl:call-template name="anchor"/>
852 <xsl:apply-templates/>
856 <xsl:template match="stepalternatives">
857 <xsl:call-template name="anchor"/>
859 <xsl:call-template name="common.html.attributes"/>
860 <xsl:call-template name="id.attribute"/>
861 <xsl:apply-templates/>
865 <xsl:template match="step/title">
867 <xsl:call-template name="common.html.attributes"/>
868 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
869 <xsl:apply-templates/>
874 <!-- ==================================================================== -->
876 <xsl:template match="segmentedlist">
877 <xsl:variable name="presentation">
878 <xsl:call-template name="pi.dbhtml_list-presentation"/>
882 <xsl:call-template name="common.html.attributes"/>
883 <xsl:call-template name="id.attribute"/>
884 <xsl:call-template name="anchor"/>
887 <xsl:when test="$presentation = 'table'">
888 <xsl:apply-templates select="." mode="seglist-table"/>
890 <xsl:when test="$presentation = 'list'">
891 <xsl:apply-templates/>
893 <xsl:when test="$segmentedlist.as.table != 0">
894 <xsl:apply-templates select="." mode="seglist-table"/>
897 <xsl:apply-templates/>
903 <xsl:template match="segmentedlist/title">
905 <xsl:call-template name="common.html.attributes"/>
908 <xsl:call-template name="generate.class.attribute"/>
909 <xsl:apply-templates/>
915 <xsl:template match="segtitle">
918 <xsl:template match="segtitle" mode="segtitle-in-seg">
919 <xsl:apply-templates/>
922 <xsl:template match="seglistitem">
924 <xsl:call-template name="common.html.attributes"/>
925 <xsl:call-template name="id.attribute"/>
926 <xsl:call-template name="anchor"/>
927 <xsl:apply-templates/>
931 <xsl:template match="seg">
932 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
933 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
934 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
937 Note: segtitle is only going to be the right thing in a well formed
938 SegmentedList. If there are too many Segs or too few SegTitles,
939 you'll get something odd...maybe an error
943 <xsl:call-template name="common.html.attributes"/>
944 <xsl:call-template name="id.attribute"/>
946 <span class="segtitle">
947 <xsl:apply-templates select="$segtitles[$segnum=position()]" mode="segtitle-in-seg"/>
948 <xsl:text>: </xsl:text>
951 <xsl:apply-templates/>
955 <xsl:template match="segmentedlist" mode="seglist-table">
956 <xsl:variable name="table-summary">
957 <xsl:call-template name="pi.dbhtml_table-summary"/>
960 <xsl:variable name="list-width">
961 <xsl:call-template name="pi.dbhtml_list-width"/>
964 <xsl:apply-templates select="title"/>
966 <table border="{$table.border.off}">
967 <xsl:if test="$list-width != ''">
968 <xsl:attribute name="width">
969 <xsl:value-of select="$list-width"/>
972 <xsl:if test="$table-summary != '' and $div.element != 'section'">
973 <xsl:attribute name="summary">
974 <xsl:value-of select="$table-summary"/>
978 <tr class="segtitle">
979 <xsl:call-template name="tr.attributes">
980 <xsl:with-param name="row" select="segtitle[1]"/>
981 <xsl:with-param name="rownum" select="1"/>
983 <xsl:apply-templates select="segtitle" mode="seglist-table"/>
987 <xsl:apply-templates select="seglistitem" mode="seglist-table"/>
992 <xsl:template match="segtitle" mode="seglist-table">
993 <th><xsl:apply-templates/></th>
996 <xsl:template match="seglistitem" mode="seglist-table">
997 <xsl:variable name="seglinum">
998 <xsl:number from="segmentedlist" count="seglistitem"/>
1002 <xsl:call-template name="common.html.attributes"/>
1003 <xsl:call-template name="id.attribute"/>
1004 <xsl:call-template name="tr.attributes">
1005 <xsl:with-param name="rownum" select="$seglinum + 1"/>
1006 </xsl:call-template>
1007 <xsl:apply-templates mode="seglist-table"/>
1011 <xsl:template match="seg" mode="seglist-table">
1013 <xsl:call-template name="common.html.attributes"/>
1014 <xsl:call-template name="id.attribute"/>
1015 <xsl:apply-templates/>
1019 <xsl:template match="seg[1]" mode="seglist-table">
1021 <xsl:call-template name="common.html.attributes"/>
1022 <xsl:call-template name="id.attribute"/>
1023 <xsl:call-template name="anchor">
1024 <xsl:with-param name="node" select="ancestor::seglistitem"/>
1025 </xsl:call-template>
1026 <xsl:apply-templates/>
1030 <!-- ==================================================================== -->
1032 <xsl:template match="calloutlist">
1034 <xsl:call-template name="common.html.attributes"/>
1035 <xsl:call-template name="id.attribute"/>
1036 <xsl:call-template name="anchor"/>
1037 <xsl:if test="title|info/title">
1038 <xsl:call-template name="formal.object.heading"/>
1041 <!-- Preserve order of PIs and comments -->
1042 <xsl:apply-templates select="*[not(self::callout or self::title or self::titleabbrev)] |comment()[not(preceding-sibling::callout)] |processing-instruction()[not(preceding-sibling::callout)]"/>
1045 <xsl:when test="$callout.list.table != 0">
1046 <table border="{$table.border.off}">
1047 <xsl:if test="$div.element != 'section'">
1048 <xsl:attribute name="summary">Callout list</xsl:attribute>
1050 <xsl:apply-templates select="callout |comment()[preceding-sibling::callout] |processing-instruction()[preceding-sibling::callout]"/>
1055 <xsl:apply-templates select="." mode="class.attribute"/>
1056 <xsl:apply-templates select="callout |comment()[preceding-sibling::callout] |processing-instruction()[preceding-sibling::callout]"/>
1063 <xsl:template match="calloutlist/title">
1066 <xsl:template match="callout">
1068 <xsl:when test="$callout.list.table != 0">
1070 <xsl:call-template name="tr.attributes">
1071 <xsl:with-param name="rownum">
1072 <xsl:number from="calloutlist" count="callout"/>
1074 </xsl:call-template>
1076 <td width="5%" valign="top" align="{$direction.align.start}">
1077 <xsl:call-template name="id.attribute"/>
1079 <xsl:call-template name="anchor"/>
1080 <xsl:call-template name="callout.arearefs">
1081 <xsl:with-param name="arearefs" select="@arearefs"/>
1082 </xsl:call-template>
1085 <td valign="top" align="{$direction.align.start}">
1086 <xsl:apply-templates/>
1092 <xsl:call-template name="id.attribute"/>
1093 <xsl:call-template name="anchor"/>
1094 <xsl:call-template name="callout.arearefs">
1095 <xsl:with-param name="arearefs" select="@arearefs"/>
1096 </xsl:call-template>
1098 <dd><xsl:apply-templates/></dd>
1103 <xsl:template match="callout/simpara" priority="2">
1104 <!-- If a callout contains only a single simpara, don't output
1105 the <p> wrapper; this has the effect of creating an li
1106 with simple text content. -->
1108 <xsl:when test="not(preceding-sibling::*) and not (following-sibling::*)">
1109 <xsl:call-template name="anchor"/>
1110 <xsl:apply-templates/>
1114 <xsl:call-template name="id.attribute"/>
1115 <xsl:if test="@role and $para.propagates.style != 0">
1117 <xsl:when test="@role and $para.propagates.style != 0">
1118 <xsl:call-template name="common.html.attributes">
1119 <xsl:with-param name="class" select="@role"/>
1120 </xsl:call-template>
1123 <xsl:call-template name="common.html.attributes"/>
1128 <xsl:call-template name="anchor"/>
1129 <xsl:apply-templates/>
1135 <xsl:template name="callout.arearefs">
1136 <xsl:param name="arearefs"/>
1137 <xsl:if test="$arearefs!=''">
1139 <xsl:when test="substring-before($arearefs,' ')=''">
1140 <xsl:call-template name="callout.arearef">
1141 <xsl:with-param name="arearef" select="$arearefs"/>
1142 </xsl:call-template>
1145 <xsl:call-template name="callout.arearef">
1146 <xsl:with-param name="arearef" select="substring-before($arearefs,' ')"/>
1147 </xsl:call-template>
1150 <xsl:call-template name="callout.arearefs">
1151 <xsl:with-param name="arearefs" select="substring-after($arearefs,' ')"/>
1152 </xsl:call-template>
1156 <xsl:template name="callout.arearef">
1157 <xsl:param name="arearef"/>
1158 <xsl:variable name="targets" select="key('id',$arearef)"/>
1159 <xsl:variable name="target" select="$targets[1]"/>
1161 <xsl:call-template name="check.id.unique">
1162 <xsl:with-param name="linkend" select="$arearef"/>
1163 </xsl:call-template>
1166 <xsl:when test="count($target)=0">
1167 <xsl:text>???</xsl:text>
1169 <xsl:when test="local-name($target)='co'">
1171 <xsl:attribute name="href">
1172 <xsl:text>#</xsl:text>
1173 <xsl:value-of select="$arearef"/>
1175 <xsl:apply-templates select="$target" mode="callout-bug"/>
1177 <xsl:text> </xsl:text>
1179 <xsl:when test="local-name($target)='areaset'">
1180 <xsl:call-template name="callout-bug">
1181 <xsl:with-param name="conum">
1182 <xsl:apply-templates select="$target" mode="conumber"/>
1184 </xsl:call-template>
1186 <xsl:when test="local-name($target)='area'">
1188 <xsl:when test="$target/parent::areaset">
1189 <xsl:call-template name="callout-bug">
1190 <xsl:with-param name="conum">
1191 <xsl:apply-templates select="$target/parent::areaset" mode="conumber"/>
1193 </xsl:call-template>
1196 <xsl:call-template name="callout-bug">
1197 <xsl:with-param name="conum">
1198 <xsl:apply-templates select="$target" mode="conumber"/>
1200 </xsl:call-template>
1205 <xsl:text>???</xsl:text>
1210 <!-- ==================================================================== -->
1212 <xsl:template name="orderedlist-starting-number">
1213 <xsl:param name="list" select="."/>
1214 <xsl:variable name="pi-start">
1215 <xsl:call-template name="pi.dbhtml_start">
1216 <xsl:with-param name="node" select="$list"/>
1217 </xsl:call-template>
1219 <xsl:call-template name="output-orderedlist-starting-number">
1220 <xsl:with-param name="list" select="$list"/>
1221 <xsl:with-param name="pi-start" select="$pi-start"/>
1222 </xsl:call-template>