2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: lists.xsl 8524 2009-10-10 02:45:47Z abdelazer $
7 ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://docbook.sf.net/release/xsl/current/ for
11 copyright and other information.
13 ******************************************************************** -->
15 <!-- ==================================================================== -->
17 <xsl:template match="itemizedlist">
19 <xsl:call-template name="common.html.attributes"/>
20 <xsl:call-template name="anchor"/>
22 <xsl:call-template name="formal.object.heading"/>
25 <!-- Preserve order of PIs and comments -->
27 select="*[not(self::listitem
29 or self::titleabbrev)]
30 |comment()[not(preceding-sibling::listitem)]
31 |processing-instruction()[not(preceding-sibling::listitem)]"/>
34 <xsl:call-template name="generate.class.attribute"/>
35 <xsl:if test="$css.decoration != 0">
36 <xsl:attribute name="type">
37 <xsl:call-template name="list.itemsymbol"/>
41 <xsl:if test="@spacing='compact'">
42 <xsl:attribute name="compact">
43 <xsl:value-of select="@spacing"/>
48 |comment()[preceding-sibling::listitem]
49 |processing-instruction()[preceding-sibling::listitem]"/>
54 <xsl:template match="itemizedlist/title">
58 <xsl:template match="itemizedlist/listitem">
59 <xsl:variable name="mark" select="../@mark"/>
60 <xsl:variable name="override" select="@override"/>
62 <xsl:variable name="usemark">
64 <xsl:when test="$override != ''">
65 <xsl:value-of select="$override"/>
68 <xsl:value-of select="$mark"/>
73 <xsl:variable name="cssmark">
75 <xsl:when test="$usemark = 'opencircle'">circle</xsl:when>
76 <xsl:when test="$usemark = 'bullet'">disc</xsl:when>
77 <xsl:when test="$usemark = 'box'">square</xsl:when>
79 <xsl:value-of select="$usemark"/>
85 <xsl:call-template name="common.html.attributes"/>
86 <xsl:if test="$css.decoration = '1' and $cssmark != ''">
87 <xsl:attribute name="style">
88 <xsl:text>list-style-type: </xsl:text>
89 <xsl:value-of select="$cssmark"/>
93 <!-- we can't just drop the anchor in since some browsers (Opera)
94 get confused about line breaks if we do. So if the first child
95 is a para, assume the para will put in the anchor. Otherwise,
96 put the anchor in anyway. -->
97 <xsl:if test="local-name(child::*[1]) != 'para'">
98 <xsl:call-template name="anchor"/>
102 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
103 <div class="{@revisionflag}">
104 <xsl:apply-templates/>
108 <xsl:apply-templates/>
114 <xsl:template match="orderedlist">
115 <xsl:variable name="start">
116 <xsl:call-template name="orderedlist-starting-number"/>
119 <xsl:variable name="numeration">
120 <xsl:call-template name="list.numeration"/>
123 <xsl:variable name="type">
125 <xsl:when test="$numeration='arabic'">1</xsl:when>
126 <xsl:when test="$numeration='loweralpha'">a</xsl:when>
127 <xsl:when test="$numeration='lowerroman'">i</xsl:when>
128 <xsl:when test="$numeration='upperalpha'">A</xsl:when>
129 <xsl:when test="$numeration='upperroman'">I</xsl:when>
130 <!-- What!? This should never happen -->
133 <xsl:text>Unexpected numeration: </xsl:text>
134 <xsl:value-of select="$numeration"/>
136 <xsl:value-of select="1"/>
142 <xsl:call-template name="common.html.attributes"/>
143 <xsl:call-template name="anchor"/>
145 <xsl:if test="title">
146 <xsl:call-template name="formal.object.heading"/>
149 <!-- Preserve order of PIs and comments -->
151 select="*[not(self::listitem
153 or self::titleabbrev)]
154 |comment()[not(preceding-sibling::listitem)]
155 |processing-instruction()[not(preceding-sibling::listitem)]"/>
158 <xsl:when test="@inheritnum='inherit' and ancestor::listitem[parent::orderedlist]">
160 <xsl:call-template name="generate.class.attribute"/>
161 <col align="{$direction.align.start}" valign="top"/>
164 mode="orderedlist-table"
166 |comment()[preceding-sibling::listitem]
167 |processing-instruction()[preceding-sibling::listitem]"/>
173 <xsl:call-template name="generate.class.attribute"/>
174 <xsl:if test="$start != '1'">
175 <xsl:attribute name="start">
176 <xsl:value-of select="$start"/>
179 <xsl:if test="$numeration != ''">
180 <xsl:attribute name="type">
181 <xsl:value-of select="$type"/>
184 <xsl:if test="@spacing='compact'">
185 <xsl:attribute name="compact">
186 <xsl:value-of select="@spacing"/>
191 |comment()[preceding-sibling::listitem]
192 |processing-instruction()[preceding-sibling::listitem]"/>
199 <xsl:template match="orderedlist/title">
203 <xsl:template match="orderedlist/listitem">
205 <xsl:call-template name="common.html.attributes"/>
206 <xsl:if test="@override">
207 <xsl:attribute name="value">
208 <xsl:value-of select="@override"/>
212 <!-- we can't just drop the anchor in since some browsers (Opera)
213 get confused about line breaks if we do. So if the first child
214 is a para, assume the para will put in the anchor. Otherwise,
215 put the anchor in anyway. -->
216 <xsl:if test="local-name(child::*[1]) != 'para'">
217 <xsl:call-template name="anchor"/>
221 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
222 <div class="{@revisionflag}">
223 <xsl:apply-templates/>
227 <xsl:apply-templates/>
233 <xsl:template match="orderedlist/listitem" mode="orderedlist-table">
236 <xsl:apply-templates select="." mode="item-number"/>
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/>
257 <xsl:template match="variablelist">
258 <xsl:variable name="pi-presentation">
259 <xsl:call-template name="pi.dbhtml_list-presentation"/>
262 <xsl:variable name="presentation">
264 <xsl:when test="$pi-presentation != ''">
265 <xsl:value-of select="$pi-presentation"/>
267 <xsl:when test="$variablelist.as.table != 0">
268 <xsl:value-of select="'table'"/>
271 <xsl:value-of select="'list'"/>
276 <xsl:variable name="list-width">
277 <xsl:call-template name="pi.dbhtml_list-width"/>
280 <xsl:variable name="term-width">
281 <xsl:call-template name="pi.dbhtml_term-width"/>
284 <xsl:variable name="table-summary">
285 <xsl:call-template name="pi.dbhtml_table-summary"/>
289 <xsl:call-template name="common.html.attributes"/>
290 <xsl:call-template name="anchor"/>
291 <xsl:if test="title">
292 <xsl:call-template name="formal.object.heading"/>
296 <xsl:when test="$presentation = 'table'">
297 <!-- Preserve order of PIs and comments -->
299 select="*[not(self::varlistentry
301 or self::titleabbrev)]
302 |comment()[not(preceding-sibling::varlistentry)]
303 |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
305 <xsl:if test="$list-width != ''">
306 <xsl:attribute name="width">
307 <xsl:value-of select="$list-width"/>
310 <xsl:if test="$table-summary != ''">
311 <xsl:attribute name="summary">
312 <xsl:value-of select="$table-summary"/>
315 <col align="{$direction.align.start}" valign="top">
316 <xsl:if test="$term-width != ''">
317 <xsl:attribute name="width">
318 <xsl:value-of select="$term-width"/>
323 <xsl:apply-templates mode="varlist-table"
325 |comment()[preceding-sibling::varlistentry]
326 |processing-instruction()[preceding-sibling::varlistentry]"/>
331 <!-- Preserve order of PIs and comments -->
333 select="*[not(self::varlistentry
335 or self::titleabbrev)]
336 |comment()[not(preceding-sibling::varlistentry)]
337 |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
341 |comment()[preceding-sibling::varlistentry]
342 |processing-instruction()[preceding-sibling::varlistentry]"/>
349 <xsl:template match="variablelist/title">
353 <xsl:template match="itemizedlist/titleabbrev|orderedlist/titleabbrev">
357 <xsl:template match="variablelist/titleabbrev">
361 <xsl:template match="listitem" mode="xref">
362 <xsl:number format="1"/>
365 <xsl:template match="listitem/simpara" priority="2">
366 <!-- If a listitem contains only a single simpara, don't output
367 the <p> wrapper; this has the effect of creating an li
368 with simple text content. -->
370 <xsl:when test="not(preceding-sibling::*)
371 and not (following-sibling::*)">
372 <xsl:call-template name="anchor"/>
373 <xsl:apply-templates/>
378 <xsl:when test="@role and $para.propagates.style != 0">
379 <xsl:call-template name="common.html.attributes">
380 <xsl:with-param name="class" select="@role"/>
384 <xsl:call-template name="common.html.attributes"/>
388 <xsl:call-template name="anchor"/>
389 <xsl:apply-templates/>
395 <xsl:template match="varlistentry">
397 <xsl:call-template name="anchor"/>
398 <xsl:apply-templates select="term"/>
401 <xsl:apply-templates select="listitem"/>
405 <xsl:template match="varlistentry" mode="varlist-table">
406 <xsl:variable name="presentation">
407 <xsl:call-template name="pi.dbhtml_term-presentation">
408 <xsl:with-param name="node" select=".."/>
412 <xsl:variable name="separator">
413 <xsl:call-template name="pi.dbhtml_term-separator">
414 <xsl:with-param name="node" select=".."/>
418 <xsl:call-template name="tr.attributes">
419 <xsl:with-param name="rownum">
420 <xsl:number from="variablelist" count="varlistentry"/>
426 <xsl:call-template name="anchor"/>
428 <xsl:when test="$presentation = 'bold'">
430 <xsl:apply-templates select="term"/>
431 <xsl:value-of select="$separator"/>
434 <xsl:when test="$presentation = 'italic'">
436 <xsl:apply-templates select="term"/>
437 <xsl:value-of select="$separator"/>
440 <xsl:when test="$presentation = 'bold-italic'">
443 <xsl:apply-templates select="term"/>
444 <xsl:value-of select="$separator"/>
449 <xsl:apply-templates select="term"/>
450 <xsl:value-of select="$separator"/>
456 <xsl:apply-templates select="listitem"/>
461 <xsl:template match="varlistentry/term">
463 <xsl:call-template name="common.html.attributes"/>
464 <xsl:call-template name="anchor"/>
465 <xsl:call-template name="simple.xlink">
466 <xsl:with-param name="content">
467 <xsl:apply-templates/>
471 <xsl:when test="position() = last()"/> <!-- do nothing -->
473 <!-- * if we have multiple terms in the same varlistentry, generate -->
474 <!-- * a separator (", " by default) and/or an additional line -->
475 <!-- * break after each one except the last -->
476 <xsl:value-of select="$variablelist.term.separator"/>
477 <xsl:if test="not($variablelist.term.break.after = '0')">
485 <xsl:template match="varlistentry/listitem">
486 <!-- we can't just drop the anchor in since some browsers (Opera)
487 get confused about line breaks if we do. So if the first child
488 is a para, assume the para will put in the anchor. Otherwise,
489 put the anchor in anyway. -->
490 <xsl:if test="local-name(child::*[1]) != 'para'">
491 <xsl:call-template name="anchor"/>
495 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
496 <div class="{@revisionflag}">
497 <xsl:apply-templates/>
501 <xsl:apply-templates/>
506 <!-- ==================================================================== -->
508 <xsl:template match="simplelist">
509 <!-- with no type specified, the default is 'vert' -->
510 <xsl:call-template name="anchor"/>
511 <table border="0" summary="Simple list">
512 <xsl:call-template name="common.html.attributes"/>
513 <xsl:call-template name="simplelist.vert">
514 <xsl:with-param name="cols">
516 <xsl:when test="@columns">
517 <xsl:value-of select="@columns"/>
519 <xsl:otherwise>1</xsl:otherwise>
526 <xsl:template match="simplelist[@type='inline']">
528 <xsl:call-template name="common.html.attributes"/>
529 <!-- if dbchoice PI exists, use that to determine the choice separator -->
530 <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
531 <!-- value of "choice" otherwise -->
532 <xsl:variable name="localized-choice-separator">
534 <xsl:when test="processing-instruction('dbchoice')">
535 <xsl:call-template name="select.choice.separator"/>
543 <xsl:for-each select="member">
544 <xsl:call-template name="simple.xlink">
545 <xsl:with-param name="content">
546 <xsl:apply-templates/>
550 <xsl:when test="position() = last()"/> <!-- do nothing -->
552 <xsl:text>, </xsl:text>
553 <xsl:if test="position() = last() - 1">
554 <xsl:if test="$localized-choice-separator != ''">
555 <xsl:value-of select="$localized-choice-separator"/>
556 <xsl:text> </xsl:text>
565 <xsl:template match="simplelist[@type='horiz']">
566 <xsl:call-template name="anchor"/>
567 <table border="0" summary="Simple list">
568 <xsl:call-template name="common.html.attributes"/>
569 <xsl:call-template name="simplelist.horiz">
570 <xsl:with-param name="cols">
572 <xsl:when test="@columns">
573 <xsl:value-of select="@columns"/>
575 <xsl:otherwise>1</xsl:otherwise>
582 <xsl:template match="simplelist[@type='vert']">
583 <xsl:call-template name="anchor"/>
584 <table border="0" summary="Simple list">
585 <xsl:call-template name="common.html.attributes"/>
586 <xsl:call-template name="simplelist.vert">
587 <xsl:with-param name="cols">
589 <xsl:when test="@columns">
590 <xsl:value-of select="@columns"/>
592 <xsl:otherwise>1</xsl:otherwise>
599 <xsl:template name="simplelist.horiz">
600 <xsl:param name="cols">1</xsl:param>
601 <xsl:param name="cell">1</xsl:param>
602 <xsl:param name="members" select="./member"/>
604 <xsl:if test="$cell <= count($members)">
606 <xsl:call-template name="tr.attributes">
607 <xsl:with-param name="row" select="$members[1]"/>
608 <xsl:with-param name="rownum" select="(($cell - 1) div $cols) + 1"/>
611 <xsl:call-template name="simplelist.horiz.row">
612 <xsl:with-param name="cols" select="$cols"/>
613 <xsl:with-param name="cell" select="$cell"/>
614 <xsl:with-param name="members" select="$members"/>
617 <xsl:call-template name="simplelist.horiz">
618 <xsl:with-param name="cols" select="$cols"/>
619 <xsl:with-param name="cell" select="$cell + $cols"/>
620 <xsl:with-param name="members" select="$members"/>
625 <xsl:template name="simplelist.horiz.row">
626 <xsl:param name="cols">1</xsl:param>
627 <xsl:param name="cell">1</xsl:param>
628 <xsl:param name="members" select="./member"/>
629 <xsl:param name="curcol">1</xsl:param>
631 <xsl:if test="$curcol <= $cols">
634 <xsl:when test="$members[position()=$cell]">
635 <xsl:apply-templates select="$members[position()=$cell]"/>
638 <xsl:text> </xsl:text>
642 <xsl:call-template name="simplelist.horiz.row">
643 <xsl:with-param name="cols" select="$cols"/>
644 <xsl:with-param name="cell" select="$cell+1"/>
645 <xsl:with-param name="members" select="$members"/>
646 <xsl:with-param name="curcol" select="$curcol+1"/>
651 <xsl:template name="simplelist.vert">
652 <xsl:param name="cols">1</xsl:param>
653 <xsl:param name="cell">1</xsl:param>
654 <xsl:param name="members" select="./member"/>
655 <xsl:param name="rows"
656 select="floor((count($members)+$cols - 1) div $cols)"/>
658 <xsl:if test="$cell <= $rows">
660 <xsl:call-template name="tr.attributes">
661 <xsl:with-param name="row" select="$members[1]"/>
662 <xsl:with-param name="rownum" select="$cell"/>
665 <xsl:call-template name="simplelist.vert.row">
666 <xsl:with-param name="cols" select="$cols"/>
667 <xsl:with-param name="rows" select="$rows"/>
668 <xsl:with-param name="cell" select="$cell"/>
669 <xsl:with-param name="members" select="$members"/>
672 <xsl:call-template name="simplelist.vert">
673 <xsl:with-param name="cols" select="$cols"/>
674 <xsl:with-param name="cell" select="$cell+1"/>
675 <xsl:with-param name="members" select="$members"/>
676 <xsl:with-param name="rows" select="$rows"/>
681 <xsl:template name="simplelist.vert.row">
682 <xsl:param name="cols">1</xsl:param>
683 <xsl:param name="rows">1</xsl:param>
684 <xsl:param name="cell">1</xsl:param>
685 <xsl:param name="members" select="./member"/>
686 <xsl:param name="curcol">1</xsl:param>
688 <xsl:if test="$curcol <= $cols">
691 <xsl:when test="$members[position()=$cell]">
692 <xsl:apply-templates select="$members[position()=$cell]"/>
695 <xsl:text> </xsl:text>
699 <xsl:call-template name="simplelist.vert.row">
700 <xsl:with-param name="cols" select="$cols"/>
701 <xsl:with-param name="rows" select="$rows"/>
702 <xsl:with-param name="cell" select="$cell+$rows"/>
703 <xsl:with-param name="members" select="$members"/>
704 <xsl:with-param name="curcol" select="$curcol+1"/>
709 <xsl:template match="member">
710 <xsl:call-template name="anchor"/>
711 <xsl:call-template name="simple.xlink">
712 <xsl:with-param name="content">
713 <xsl:apply-templates/>
718 <!-- ==================================================================== -->
720 <xsl:template match="procedure">
721 <xsl:variable name="param.placement"
722 select="substring-after(normalize-space($formal.title.placement),
723 concat(local-name(.), ' '))"/>
725 <xsl:variable name="placement">
727 <xsl:when test="contains($param.placement, ' ')">
728 <xsl:value-of select="substring-before($param.placement, ' ')"/>
730 <xsl:when test="$param.placement = ''">before</xsl:when>
732 <xsl:value-of select="$param.placement"/>
737 <!-- Preserve order of PIs and comments -->
738 <xsl:variable name="preamble"
739 select="*[not(self::step
741 or self::titleabbrev)]
742 |comment()[not(preceding-sibling::step)]
743 |processing-instruction()[not(preceding-sibling::step)]"/>
746 <xsl:call-template name="common.html.attributes"/>
747 <xsl:call-template name="anchor">
748 <xsl:with-param name="conditional">
750 <xsl:when test="title">0</xsl:when>
751 <xsl:otherwise>1</xsl:otherwise>
756 <xsl:if test="title and $placement = 'before'">
757 <xsl:call-template name="formal.object.heading"/>
760 <xsl:apply-templates select="$preamble"/>
763 <xsl:when test="count(step) = 1">
765 <xsl:call-template name="generate.class.attribute"/>
768 |comment()[preceding-sibling::step]
769 |processing-instruction()[preceding-sibling::step]"/>
774 <xsl:call-template name="generate.class.attribute"/>
775 <xsl:attribute name="type">
776 <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
780 |comment()[preceding-sibling::step]
781 |processing-instruction()[preceding-sibling::step]"/>
786 <xsl:if test="title and $placement != 'before'">
787 <xsl:call-template name="formal.object.heading"/>
792 <xsl:template match="procedure/title">
796 <xsl:template match="substeps">
797 <xsl:variable name="numeration">
798 <xsl:call-template name="procedure.step.numeration"/>
801 <xsl:call-template name="anchor"/>
803 <ol type="{$numeration}">
804 <xsl:call-template name="common.html.attributes"/>
805 <xsl:apply-templates/>
809 <xsl:template match="step">
811 <xsl:call-template name="common.html.attributes"/>
812 <xsl:call-template name="anchor"/>
813 <xsl:apply-templates/>
817 <xsl:template match="stepalternatives">
818 <xsl:call-template name="anchor"/>
820 <xsl:call-template name="common.html.attributes"/>
821 <xsl:apply-templates/>
825 <xsl:template match="step/title">
827 <xsl:call-template name="common.html.attributes"/>
829 <xsl:apply-templates/>
834 <!-- ==================================================================== -->
836 <xsl:template match="segmentedlist">
837 <xsl:variable name="presentation">
838 <xsl:call-template name="pi.dbhtml_list-presentation"/>
842 <xsl:call-template name="common.html.attributes"/>
843 <xsl:call-template name="anchor"/>
846 <xsl:when test="$presentation = 'table'">
847 <xsl:apply-templates select="." mode="seglist-table"/>
849 <xsl:when test="$presentation = 'list'">
850 <xsl:apply-templates/>
852 <xsl:when test="$segmentedlist.as.table != 0">
853 <xsl:apply-templates select="." mode="seglist-table"/>
856 <xsl:apply-templates/>
862 <xsl:template match="segmentedlist/title">
864 <xsl:call-template name="common.html.attributes"/>
867 <xsl:call-template name="generate.class.attribute"/>
868 <xsl:apply-templates/>
874 <xsl:template match="segtitle">
877 <xsl:template match="segtitle" mode="segtitle-in-seg">
878 <xsl:apply-templates/>
881 <xsl:template match="seglistitem">
883 <xsl:call-template name="common.html.attributes"/>
884 <xsl:call-template name="anchor"/>
885 <xsl:apply-templates/>
889 <xsl:template match="seg">
890 <xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
891 <xsl:variable name="seglist" select="ancestor::segmentedlist"/>
892 <xsl:variable name="segtitles" select="$seglist/segtitle"/>
895 Note: segtitle is only going to be the right thing in a well formed
896 SegmentedList. If there are too many Segs or too few SegTitles,
897 you'll get something odd...maybe an error
901 <xsl:call-template name="common.html.attributes"/>
903 <span class="segtitle">
904 <xsl:apply-templates select="$segtitles[$segnum=position()]"
905 mode="segtitle-in-seg"/>
906 <xsl:text>: </xsl:text>
909 <xsl:apply-templates/>
913 <xsl:template match="segmentedlist" mode="seglist-table">
914 <xsl:variable name="table-summary">
915 <xsl:call-template name="pi.dbhtml_table-summary"/>
918 <xsl:variable name="list-width">
919 <xsl:call-template name="pi.dbhtml_list-width"/>
922 <xsl:apply-templates select="title"/>
925 <xsl:if test="$list-width != ''">
926 <xsl:attribute name="width">
927 <xsl:value-of select="$list-width"/>
930 <xsl:if test="$table-summary != ''">
931 <xsl:attribute name="summary">
932 <xsl:value-of select="$table-summary"/>
936 <tr class="segtitle">
937 <xsl:call-template name="tr.attributes">
938 <xsl:with-param name="row" select="segtitle[1]"/>
939 <xsl:with-param name="rownum" select="1"/>
941 <xsl:apply-templates select="segtitle" mode="seglist-table"/>
945 <xsl:apply-templates select="seglistitem" mode="seglist-table"/>
950 <xsl:template match="segtitle" mode="seglist-table">
951 <th><xsl:apply-templates/></th>
954 <xsl:template match="seglistitem" mode="seglist-table">
955 <xsl:variable name="seglinum">
956 <xsl:number from="segmentedlist" count="seglistitem"/>
960 <xsl:call-template name="common.html.attributes"/>
961 <xsl:call-template name="tr.attributes">
962 <xsl:with-param name="rownum" select="$seglinum + 1"/>
964 <xsl:apply-templates mode="seglist-table"/>
968 <xsl:template match="seg" mode="seglist-table">
970 <xsl:call-template name="common.html.attributes"/>
971 <xsl:apply-templates/>
975 <xsl:template match="seg[1]" mode="seglist-table">
977 <xsl:call-template name="common.html.attributes"/>
978 <xsl:call-template name="anchor">
979 <xsl:with-param name="node" select="ancestor::seglistitem"/>
981 <xsl:apply-templates/>
985 <!-- ==================================================================== -->
987 <xsl:template match="calloutlist">
989 <xsl:call-template name="common.html.attributes"/>
990 <xsl:call-template name="anchor"/>
991 <xsl:if test="title|info/title">
992 <xsl:call-template name="formal.object.heading"/>
995 <!-- Preserve order of PIs and comments -->
997 select="*[not(self::callout or self::title or self::titleabbrev)]
998 |comment()[not(preceding-sibling::callout)]
999 |processing-instruction()[not(preceding-sibling::callout)]"/>
1002 <xsl:when test="$callout.list.table != 0">
1003 <table border="0" summary="Callout list">
1004 <xsl:apply-templates select="callout
1005 |comment()[preceding-sibling::callout]
1006 |processing-instruction()[preceding-sibling::callout]"/>
1010 <dl compact="compact">
1011 <xsl:apply-templates select="callout
1012 |comment()[preceding-sibling::callout]
1013 |processing-instruction()[preceding-sibling::callout]"/>
1020 <xsl:template match="calloutlist/title">
1023 <xsl:template match="callout">
1025 <xsl:when test="$callout.list.table != 0">
1027 <xsl:call-template name="tr.attributes">
1028 <xsl:with-param name="rownum">
1029 <xsl:number from="calloutlist" count="callout"/>
1031 </xsl:call-template>
1033 <td width="5%" valign="top" align="{$direction.align.start}">
1035 <xsl:call-template name="anchor"/>
1036 <xsl:call-template name="callout.arearefs">
1037 <xsl:with-param name="arearefs" select="@arearefs"/>
1038 </xsl:call-template>
1041 <td valign="top" align="{$direction.align.start}">
1042 <xsl:apply-templates/>
1048 <xsl:call-template name="anchor"/>
1049 <xsl:call-template name="callout.arearefs">
1050 <xsl:with-param name="arearefs" select="@arearefs"/>
1051 </xsl:call-template>
1053 <dd><xsl:apply-templates/></dd>
1058 <xsl:template match="callout/simpara" priority="2">
1059 <!-- If a callout contains only a single simpara, don't output
1060 the <p> wrapper; this has the effect of creating an li
1061 with simple text content. -->
1063 <xsl:when test="not(preceding-sibling::*)
1064 and not (following-sibling::*)">
1065 <xsl:call-template name="anchor"/>
1066 <xsl:apply-templates/>
1070 <xsl:if test="@role and $para.propagates.style != 0">
1072 <xsl:when test="@role and $para.propagates.style != 0">
1073 <xsl:call-template name="common.html.attributes">
1074 <xsl:with-param name="class" select="@role"/>
1075 </xsl:call-template>
1078 <xsl:call-template name="common.html.attributes"/>
1083 <xsl:call-template name="anchor"/>
1084 <xsl:apply-templates/>
1090 <xsl:template name="callout.arearefs">
1091 <xsl:param name="arearefs"></xsl:param>
1092 <xsl:if test="$arearefs!=''">
1094 <xsl:when test="substring-before($arearefs,' ')=''">
1095 <xsl:call-template name="callout.arearef">
1096 <xsl:with-param name="arearef" select="$arearefs"/>
1097 </xsl:call-template>
1100 <xsl:call-template name="callout.arearef">
1101 <xsl:with-param name="arearef"
1102 select="substring-before($arearefs,' ')"/>
1103 </xsl:call-template>
1106 <xsl:call-template name="callout.arearefs">
1107 <xsl:with-param name="arearefs"
1108 select="substring-after($arearefs,' ')"/>
1109 </xsl:call-template>
1113 <xsl:template name="callout.arearef">
1114 <xsl:param name="arearef"></xsl:param>
1115 <xsl:variable name="targets" select="key('id',$arearef)"/>
1116 <xsl:variable name="target" select="$targets[1]"/>
1118 <xsl:call-template name="check.id.unique">
1119 <xsl:with-param name="linkend" select="$arearef"/>
1120 </xsl:call-template>
1123 <xsl:when test="count($target)=0">
1124 <xsl:text>???</xsl:text>
1126 <xsl:when test="local-name($target)='co'">
1128 <xsl:attribute name="href">
1129 <xsl:text>#</xsl:text>
1130 <xsl:value-of select="$arearef"/>
1132 <xsl:apply-templates select="$target" mode="callout-bug"/>
1134 <xsl:text> </xsl:text>
1136 <xsl:when test="local-name($target)='areaset'">
1137 <xsl:call-template name="callout-bug">
1138 <xsl:with-param name="conum">
1139 <xsl:apply-templates select="$target" mode="conumber"/>
1141 </xsl:call-template>
1143 <xsl:when test="local-name($target)='area'">
1145 <xsl:when test="$target/parent::areaset">
1146 <xsl:call-template name="callout-bug">
1147 <xsl:with-param name="conum">
1148 <xsl:apply-templates select="$target/parent::areaset"
1151 </xsl:call-template>
1154 <xsl:call-template name="callout-bug">
1155 <xsl:with-param name="conum">
1156 <xsl:apply-templates select="$target" mode="conumber"/>
1158 </xsl:call-template>
1163 <xsl:text>???</xsl:text>
1168 <!-- ==================================================================== -->
1170 <xsl:template name="orderedlist-starting-number">
1171 <xsl:param name="list" select="."/>
1172 <xsl:variable name="pi-start">
1173 <xsl:call-template name="pi.dbhtml_start">
1174 <xsl:with-param name="node" select="$list"/>
1175 </xsl:call-template>
1177 <xsl:call-template name="output-orderedlist-starting-number">
1178 <xsl:with-param name="list" select="$list"/>
1179 <xsl:with-param name="pi-start" select="$pi-start"/>
1180 </xsl:call-template>