2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <!-- ********************************************************************
6 $Id: lists.xsl,v 1.1 2007/03/10 05:15:13 scott Exp $
7 ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
11 and other information.
13 ******************************************************************** -->
15 <!-- ==================================================================== -->
17 <xsl:template match=
"itemizedlist">
19 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
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:if test=
"$css.decoration != 0">
35 <xsl:attribute name=
"type">
36 <xsl:call-template name=
"list.itemsymbol"/>
40 <xsl:if test=
"@spacing='compact'">
41 <xsl:attribute name=
"compact">
42 <xsl:value-of select=
"@spacing"/>
47 |comment()[preceding-sibling::listitem]
48 |processing-instruction()[preceding-sibling::listitem]"/>
53 <xsl:template match=
"itemizedlist/title">
57 <xsl:template match=
"itemizedlist/listitem">
58 <xsl:variable name=
"mark" select=
"../@mark"/>
59 <xsl:variable name=
"override" select=
"@override"/>
61 <xsl:variable name=
"usemark">
63 <xsl:when test=
"$override != ''">
64 <xsl:value-of select=
"$override"/>
67 <xsl:value-of select=
"$mark"/>
72 <xsl:variable name=
"cssmark">
74 <xsl:when test=
"$usemark = 'opencircle'">circle
</xsl:when>
75 <xsl:when test=
"$usemark = 'bullet'">disc
</xsl:when>
76 <xsl:when test=
"$usemark = 'box'">square
</xsl:when>
78 <xsl:value-of select=
"$usemark"/>
84 <xsl:if test=
"$css.decoration = '1' and $cssmark != ''">
85 <xsl:attribute name=
"style">
86 <xsl:text>list-style-type:
</xsl:text>
87 <xsl:value-of select=
"$cssmark"/>
91 <!-- we can't just drop the anchor in since some browsers (Opera)
92 get confused about line breaks if we do. So if the first child
93 is a para, assume the para will put in the anchor. Otherwise,
94 put the anchor in anyway. -->
95 <xsl:if test=
"local-name(child::*[1]) != 'para'">
96 <xsl:call-template name=
"anchor"/>
100 <xsl:when test=
"$show.revisionflag != 0 and @revisionflag">
101 <div class=
"{@revisionflag}">
102 <xsl:apply-templates/>
106 <xsl:apply-templates/>
112 <xsl:template match=
"orderedlist">
113 <xsl:variable name=
"start">
114 <xsl:call-template name=
"orderedlist-starting-number"/>
117 <xsl:variable name=
"numeration">
118 <xsl:call-template name=
"list.numeration"/>
121 <xsl:variable name=
"type">
123 <xsl:when test=
"$numeration='arabic'">1</xsl:when>
124 <xsl:when test=
"$numeration='loweralpha'">a
</xsl:when>
125 <xsl:when test=
"$numeration='lowerroman'">i
</xsl:when>
126 <xsl:when test=
"$numeration='upperalpha'">A
</xsl:when>
127 <xsl:when test=
"$numeration='upperroman'">I
</xsl:when>
128 <!-- What!? This should never happen -->
131 <xsl:text>Unexpected numeration:
</xsl:text>
132 <xsl:value-of select=
"$numeration"/>
134 <xsl:value-of select=
"1"/>
140 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
141 <xsl:call-template name=
"anchor"/>
143 <xsl:if test=
"title">
144 <xsl:call-template name=
"formal.object.heading"/>
147 <!-- Preserve order of PIs and comments -->
149 select=
"*[not(self::listitem
151 or self::titleabbrev)]
152 |comment()[not(preceding-sibling::listitem)]
153 |processing-instruction()[not(preceding-sibling::listitem)]"/>
156 <xsl:if test=
"$start != '1'">
157 <xsl:attribute name=
"start">
158 <xsl:value-of select=
"$start"/>
161 <xsl:if test=
"$numeration != ''">
162 <xsl:attribute name=
"type">
163 <xsl:value-of select=
"$type"/>
166 <xsl:if test=
"@spacing='compact'">
167 <xsl:attribute name=
"compact">
168 <xsl:value-of select=
"@spacing"/>
173 |comment()[preceding-sibling::listitem]
174 |processing-instruction()[preceding-sibling::listitem]"/>
179 <xsl:template match=
"orderedlist/title">
183 <xsl:template match=
"orderedlist/listitem">
185 <xsl:if test=
"@override">
186 <xsl:attribute name=
"value">
187 <xsl:value-of select=
"@override"/>
191 <!-- we can't just drop the anchor in since some browsers (Opera)
192 get confused about line breaks if we do. So if the first child
193 is a para, assume the para will put in the anchor. Otherwise,
194 put the anchor in anyway. -->
195 <xsl:if test=
"local-name(child::*[1]) != 'para'">
196 <xsl:call-template name=
"anchor"/>
200 <xsl:when test=
"$show.revisionflag != 0 and @revisionflag">
201 <div class=
"{@revisionflag}">
202 <xsl:apply-templates/>
206 <xsl:apply-templates/>
212 <xsl:template match=
"variablelist">
213 <xsl:variable name=
"pi-presentation">
214 <xsl:call-template name=
"dbhtml-attribute">
215 <xsl:with-param name=
"pis"
216 select=
"processing-instruction('dbhtml')"/>
217 <xsl:with-param name=
"attribute" select=
"'list-presentation'"/>
221 <xsl:variable name=
"presentation">
223 <xsl:when test=
"$pi-presentation != ''">
224 <xsl:value-of select=
"$pi-presentation"/>
226 <xsl:when test=
"$variablelist.as.table != 0">
227 <xsl:value-of select=
"'table'"/>
230 <xsl:value-of select=
"'list'"/>
235 <xsl:variable name=
"list-width">
236 <xsl:call-template name=
"dbhtml-attribute">
237 <xsl:with-param name=
"pis"
238 select=
"processing-instruction('dbhtml')"/>
239 <xsl:with-param name=
"attribute" select=
"'list-width'"/>
243 <xsl:variable name=
"term-width">
244 <xsl:call-template name=
"dbhtml-attribute">
245 <xsl:with-param name=
"pis"
246 select=
"processing-instruction('dbhtml')"/>
247 <xsl:with-param name=
"attribute" select=
"'term-width'"/>
251 <xsl:variable name=
"table-summary">
252 <xsl:call-template name=
"dbhtml-attribute">
253 <xsl:with-param name=
"pis"
254 select=
"processing-instruction('dbhtml')"/>
255 <xsl:with-param name=
"attribute" select=
"'table-summary'"/>
260 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
261 <xsl:call-template name=
"anchor"/>
262 <xsl:if test=
"title">
263 <xsl:call-template name=
"formal.object.heading"/>
267 <xsl:when test=
"$presentation = 'table'">
268 <!-- Preserve order of PIs and comments -->
270 select=
"*[not(self::varlistentry
272 or self::titleabbrev)]
273 |comment()[not(preceding-sibling::varlistentry)]
274 |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
276 <xsl:if test=
"$list-width != ''">
277 <xsl:attribute name=
"width">
278 <xsl:value-of select=
"$list-width"/>
281 <xsl:if test=
"$table-summary != ''">
282 <xsl:attribute name=
"summary">
283 <xsl:value-of select=
"$table-summary"/>
286 <col align=
"left" valign=
"top">
287 <xsl:if test=
"$term-width != ''">
288 <xsl:attribute name=
"width">
289 <xsl:value-of select=
"$term-width"/>
294 <xsl:apply-templates mode=
"varlist-table"
296 |comment()[preceding-sibling::varlistentry]
297 |processing-instruction()[preceding-sibling::varlistentry]"/>
302 <!-- Preserve order of PIs and comments -->
304 select=
"*[not(self::varlistentry
306 or self::titleabbrev)]
307 |comment()[not(preceding-sibling::varlistentry)]
308 |processing-instruction()[not(preceding-sibling::varlistentry)]"/>
312 |comment()[preceding-sibling::varlistentry]
313 |processing-instruction()[preceding-sibling::varlistentry]"/>
320 <xsl:template match=
"variablelist/title">
324 <xsl:template match=
"itemizedlist/titleabbrev|orderedlist/titleabbrev">
328 <xsl:template match=
"variablelist/titleabbrev">
332 <xsl:template match=
"listitem" mode=
"xref">
333 <xsl:number format=
"1"/>
336 <xsl:template match=
"listitem/simpara" priority=
"2">
337 <!-- If a listitem contains only a single simpara, don't output
338 the <p> wrapper; this has the effect of creating an li
339 with simple text content. -->
341 <xsl:when test=
"not(preceding-sibling::*)
342 and not (following-sibling::*)">
343 <xsl:call-template name=
"anchor"/>
344 <xsl:apply-templates/>
348 <xsl:if test=
"@role and $para.propagates.style != 0">
349 <xsl:apply-templates select=
"." mode=
"class.attribute">
350 <xsl:with-param name=
"class" select=
"@role"/>
351 </xsl:apply-templates>
354 <xsl:call-template name=
"anchor"/>
355 <xsl:apply-templates/>
361 <xsl:template match=
"varlistentry">
363 <xsl:call-template name=
"anchor"/>
364 <xsl:apply-templates select=
"term"/>
367 <xsl:apply-templates select=
"listitem"/>
371 <xsl:template match=
"varlistentry" mode=
"varlist-table">
372 <xsl:variable name=
"presentation">
373 <xsl:call-template name=
"dbhtml-attribute">
374 <xsl:with-param name=
"pis"
375 select=
"../processing-instruction('dbhtml')"/>
376 <xsl:with-param name=
"attribute" select=
"'term-presentation'"/>
380 <xsl:variable name=
"separator">
381 <xsl:call-template name=
"dbhtml-attribute">
382 <xsl:with-param name=
"pis"
383 select=
"../processing-instruction('dbhtml')"/>
384 <xsl:with-param name=
"attribute" select=
"'term-separator'"/>
388 <xsl:call-template name=
"tr.attributes">
389 <xsl:with-param name=
"rownum">
390 <xsl:number from=
"variablelist" count=
"varlistentry"/>
395 <xsl:call-template name=
"anchor"/>
397 <xsl:when test=
"$presentation = 'bold'">
399 <xsl:apply-templates select=
"term"/>
400 <xsl:value-of select=
"$separator"/>
403 <xsl:when test=
"$presentation = 'italic'">
405 <xsl:apply-templates select=
"term"/>
406 <xsl:value-of select=
"$separator"/>
409 <xsl:when test=
"$presentation = 'bold-italic'">
412 <xsl:apply-templates select=
"term"/>
413 <xsl:value-of select=
"$separator"/>
418 <xsl:apply-templates select=
"term"/>
419 <xsl:value-of select=
"$separator"/>
424 <xsl:apply-templates select=
"listitem"/>
429 <xsl:template match=
"varlistentry/term">
431 <xsl:call-template name=
"anchor"/>
432 <xsl:call-template name=
"simple.xlink">
433 <xsl:with-param name=
"content">
434 <xsl:apply-templates/>
438 <xsl:when test=
"position() = last()"/> <!-- do nothing -->
440 <!-- * if we have multiple terms in the same varlistentry, generate -->
441 <!-- * a separator (", " by default) and/or an additional line -->
442 <!-- * break after each one except the last -->
443 <xsl:value-of select=
"$variablelist.term.separator"/>
444 <xsl:if test=
"not($variablelist.term.break.after = '0')">
452 <xsl:template match=
"varlistentry/listitem">
453 <!-- we can't just drop the anchor in since some browsers (Opera)
454 get confused about line breaks if we do. So if the first child
455 is a para, assume the para will put in the anchor. Otherwise,
456 put the anchor in anyway. -->
457 <xsl:if test=
"local-name(child::*[1]) != 'para'">
458 <xsl:call-template name=
"anchor"/>
462 <xsl:when test=
"$show.revisionflag != 0 and @revisionflag">
463 <div class=
"{@revisionflag}">
464 <xsl:apply-templates/>
468 <xsl:apply-templates/>
473 <!-- ==================================================================== -->
475 <xsl:template match=
"simplelist">
476 <!-- with no type specified, the default is 'vert' -->
477 <xsl:call-template name=
"anchor"/>
478 <table class=
"simplelist" border=
"0" summary=
"Simple list">
479 <xsl:call-template name=
"simplelist.vert">
480 <xsl:with-param name=
"cols">
482 <xsl:when test=
"@columns">
483 <xsl:value-of select=
"@columns"/>
485 <xsl:otherwise>1</xsl:otherwise>
492 <xsl:template match=
"simplelist[@type='inline']">
494 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
495 <!-- if dbchoice PI exists, use that to determine the choice separator -->
496 <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
497 <!-- value of "choice" otherwise -->
498 <xsl:variable name=
"localized-choice-separator">
500 <xsl:when test=
"processing-instruction('dbchoice')">
501 <xsl:call-template name=
"select.choice.separator"/>
509 <xsl:for-each select=
"member">
510 <xsl:call-template name=
"simple.xlink">
511 <xsl:with-param name=
"content">
512 <xsl:apply-templates/>
516 <xsl:when test=
"position() = last()"/> <!-- do nothing -->
518 <xsl:text>,
</xsl:text>
519 <xsl:if test=
"position() = last() - 1">
520 <xsl:if test=
"$localized-choice-separator != ''">
521 <xsl:value-of select=
"$localized-choice-separator"/>
522 <xsl:text> </xsl:text>
531 <xsl:template match=
"simplelist[@type='horiz']">
532 <xsl:call-template name=
"anchor"/>
533 <table class=
"simplelist" border=
"0" summary=
"Simple list">
534 <xsl:call-template name=
"simplelist.horiz">
535 <xsl:with-param name=
"cols">
537 <xsl:when test=
"@columns">
538 <xsl:value-of select=
"@columns"/>
540 <xsl:otherwise>1</xsl:otherwise>
547 <xsl:template match=
"simplelist[@type='vert']">
548 <xsl:call-template name=
"anchor"/>
549 <table class=
"simplelist" border=
"0" summary=
"Simple list">
550 <xsl:call-template name=
"simplelist.vert">
551 <xsl:with-param name=
"cols">
553 <xsl:when test=
"@columns">
554 <xsl:value-of select=
"@columns"/>
556 <xsl:otherwise>1</xsl:otherwise>
563 <xsl:template name=
"simplelist.horiz">
564 <xsl:param name=
"cols">1</xsl:param>
565 <xsl:param name=
"cell">1</xsl:param>
566 <xsl:param name=
"members" select=
"./member"/>
568 <xsl:if test=
"$cell <= count($members)">
570 <xsl:call-template name=
"tr.attributes">
571 <xsl:with-param name=
"row" select=
"$members[1]"/>
572 <xsl:with-param name=
"rownum" select=
"(($cell - 1) div $cols) + 1"/>
575 <xsl:call-template name=
"simplelist.horiz.row">
576 <xsl:with-param name=
"cols" select=
"$cols"/>
577 <xsl:with-param name=
"cell" select=
"$cell"/>
578 <xsl:with-param name=
"members" select=
"$members"/>
581 <xsl:call-template name=
"simplelist.horiz">
582 <xsl:with-param name=
"cols" select=
"$cols"/>
583 <xsl:with-param name=
"cell" select=
"$cell + $cols"/>
584 <xsl:with-param name=
"members" select=
"$members"/>
589 <xsl:template name=
"simplelist.horiz.row">
590 <xsl:param name=
"cols">1</xsl:param>
591 <xsl:param name=
"cell">1</xsl:param>
592 <xsl:param name=
"members" select=
"./member"/>
593 <xsl:param name=
"curcol">1</xsl:param>
595 <xsl:if test=
"$curcol <= $cols">
598 <xsl:when test=
"$members[position()=$cell]">
599 <xsl:apply-templates select=
"$members[position()=$cell]"/>
602 <xsl:text> </xsl:text>
606 <xsl:call-template name=
"simplelist.horiz.row">
607 <xsl:with-param name=
"cols" select=
"$cols"/>
608 <xsl:with-param name=
"cell" select=
"$cell+1"/>
609 <xsl:with-param name=
"members" select=
"$members"/>
610 <xsl:with-param name=
"curcol" select=
"$curcol+1"/>
615 <xsl:template name=
"simplelist.vert">
616 <xsl:param name=
"cols">1</xsl:param>
617 <xsl:param name=
"cell">1</xsl:param>
618 <xsl:param name=
"members" select=
"./member"/>
619 <xsl:param name=
"rows"
620 select=
"floor((count($members)+$cols - 1) div $cols)"/>
622 <xsl:if test=
"$cell <= $rows">
624 <xsl:call-template name=
"tr.attributes">
625 <xsl:with-param name=
"row" select=
"$members[1]"/>
626 <xsl:with-param name=
"rownum" select=
"$cell"/>
629 <xsl:call-template name=
"simplelist.vert.row">
630 <xsl:with-param name=
"cols" select=
"$cols"/>
631 <xsl:with-param name=
"rows" select=
"$rows"/>
632 <xsl:with-param name=
"cell" select=
"$cell"/>
633 <xsl:with-param name=
"members" select=
"$members"/>
636 <xsl:call-template name=
"simplelist.vert">
637 <xsl:with-param name=
"cols" select=
"$cols"/>
638 <xsl:with-param name=
"cell" select=
"$cell+1"/>
639 <xsl:with-param name=
"members" select=
"$members"/>
640 <xsl:with-param name=
"rows" select=
"$rows"/>
645 <xsl:template name=
"simplelist.vert.row">
646 <xsl:param name=
"cols">1</xsl:param>
647 <xsl:param name=
"rows">1</xsl:param>
648 <xsl:param name=
"cell">1</xsl:param>
649 <xsl:param name=
"members" select=
"./member"/>
650 <xsl:param name=
"curcol">1</xsl:param>
652 <xsl:if test=
"$curcol <= $cols">
655 <xsl:when test=
"$members[position()=$cell]">
656 <xsl:apply-templates select=
"$members[position()=$cell]"/>
659 <xsl:text> </xsl:text>
663 <xsl:call-template name=
"simplelist.vert.row">
664 <xsl:with-param name=
"cols" select=
"$cols"/>
665 <xsl:with-param name=
"rows" select=
"$rows"/>
666 <xsl:with-param name=
"cell" select=
"$cell+$rows"/>
667 <xsl:with-param name=
"members" select=
"$members"/>
668 <xsl:with-param name=
"curcol" select=
"$curcol+1"/>
673 <xsl:template match=
"member">
674 <xsl:call-template name=
"anchor"/>
675 <xsl:call-template name=
"simple.xlink">
676 <xsl:with-param name=
"content">
677 <xsl:apply-templates/>
682 <!-- ==================================================================== -->
684 <xsl:template match=
"procedure">
685 <xsl:variable name=
"param.placement"
686 select=
"substring-after(normalize-space($formal.title.placement),
687 concat(local-name(.), ' '))"/>
689 <xsl:variable name=
"placement">
691 <xsl:when test=
"contains($param.placement, ' ')">
692 <xsl:value-of select=
"substring-before($param.placement, ' ')"/>
694 <xsl:when test=
"$param.placement = ''">before
</xsl:when>
696 <xsl:value-of select=
"$param.placement"/>
701 <!-- Preserve order of PIs and comments -->
702 <xsl:variable name=
"preamble"
703 select=
"*[not(self::step
705 or self::titleabbrev)]
706 |comment()[not(preceding-sibling::step)]
707 |processing-instruction()[not(preceding-sibling::step)]"/>
710 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
711 <xsl:call-template name=
"anchor">
712 <xsl:with-param name=
"conditional">
714 <xsl:when test=
"title">0</xsl:when>
715 <xsl:otherwise>1</xsl:otherwise>
720 <xsl:if test=
"title and $placement = 'before'">
721 <xsl:call-template name=
"formal.object.heading"/>
724 <xsl:apply-templates select=
"$preamble"/>
727 <xsl:when test=
"count(step) = 1">
731 |comment()[preceding-sibling::step]
732 |processing-instruction()[preceding-sibling::step]"/>
737 <xsl:attribute name=
"type">
738 <xsl:value-of select=
"substring($procedure.step.numeration.formats,1,1)"/>
742 |comment()[preceding-sibling::step]
743 |processing-instruction()[preceding-sibling::step]"/>
748 <xsl:if test=
"title and $placement != 'before'">
749 <xsl:call-template name=
"formal.object.heading"/>
754 <xsl:template match=
"procedure/title">
758 <xsl:template match=
"substeps">
759 <xsl:variable name=
"numeration">
760 <xsl:call-template name=
"procedure.step.numeration"/>
763 <xsl:call-template name=
"anchor"/>
765 <ol type=
"{$numeration}">
766 <xsl:apply-templates/>
770 <xsl:template match=
"step">
772 <xsl:call-template name=
"anchor"/>
773 <xsl:apply-templates/>
777 <xsl:template match=
"stepalternatives">
778 <xsl:call-template name=
"anchor"/>
780 <xsl:apply-templates/>
784 <xsl:template match=
"step/title">
787 <xsl:apply-templates/>
792 <!-- ==================================================================== -->
794 <xsl:template match=
"segmentedlist">
795 <xsl:variable name=
"presentation">
796 <xsl:call-template name=
"dbhtml-attribute">
797 <xsl:with-param name=
"pis"
798 select=
"processing-instruction('dbhtml')"/>
799 <xsl:with-param name=
"attribute" select=
"'list-presentation'"/>
804 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
805 <xsl:call-template name=
"anchor"/>
808 <xsl:when test=
"$presentation = 'table'">
809 <xsl:apply-templates select=
"." mode=
"seglist-table"/>
811 <xsl:when test=
"$presentation = 'list'">
812 <xsl:apply-templates/>
814 <xsl:when test=
"$segmentedlist.as.table != 0">
815 <xsl:apply-templates select=
"." mode=
"seglist-table"/>
818 <xsl:apply-templates/>
824 <xsl:template match=
"segmentedlist/title">
826 <strong><span class=
"title"><xsl:apply-templates/></span></strong>
830 <xsl:template match=
"segtitle">
833 <xsl:template match=
"segtitle" mode=
"segtitle-in-seg">
834 <xsl:apply-templates/>
837 <xsl:template match=
"seglistitem">
838 <div class=
"seglistitem">
839 <xsl:call-template name=
"anchor"/>
840 <xsl:apply-templates/>
844 <xsl:template match=
"seg">
845 <xsl:variable name=
"segnum" select=
"count(preceding-sibling::seg)+1"/>
846 <xsl:variable name=
"seglist" select=
"ancestor::segmentedlist"/>
847 <xsl:variable name=
"segtitles" select=
"$seglist/segtitle"/>
850 Note: segtitle is only going to be the right thing in a well formed
851 SegmentedList. If there are too many Segs or too few SegTitles,
852 you'll get something odd...maybe an error
857 <span class=
"segtitle">
858 <xsl:apply-templates select=
"$segtitles[$segnum=position()]"
859 mode=
"segtitle-in-seg"/>
860 <xsl:text>:
</xsl:text>
863 <xsl:apply-templates/>
867 <xsl:template match=
"segmentedlist" mode=
"seglist-table">
868 <xsl:variable name=
"table-summary">
869 <xsl:call-template name=
"dbhtml-attribute">
870 <xsl:with-param name=
"pis"
871 select=
"processing-instruction('dbhtml')"/>
872 <xsl:with-param name=
"attribute" select=
"'table-summary'"/>
876 <xsl:variable name=
"list-width">
877 <xsl:call-template name=
"dbhtml-attribute">
878 <xsl:with-param name=
"pis"
879 select=
"processing-instruction('dbhtml')"/>
880 <xsl:with-param name=
"attribute" select=
"'list-width'"/>
884 <xsl:apply-templates select=
"title"/>
887 <xsl:if test=
"$list-width != ''">
888 <xsl:attribute name=
"width">
889 <xsl:value-of select=
"$list-width"/>
892 <xsl:if test=
"$table-summary != ''">
893 <xsl:attribute name=
"summary">
894 <xsl:value-of select=
"$table-summary"/>
898 <tr class=
"segtitle">
899 <xsl:call-template name=
"tr.attributes">
900 <xsl:with-param name=
"row" select=
"segtitle[1]"/>
901 <xsl:with-param name=
"rownum" select=
"1"/>
903 <xsl:apply-templates select=
"segtitle" mode=
"seglist-table"/>
907 <xsl:apply-templates select=
"seglistitem" mode=
"seglist-table"/>
912 <xsl:template match=
"segtitle" mode=
"seglist-table">
913 <th><xsl:apply-templates/></th>
916 <xsl:template match=
"seglistitem" mode=
"seglist-table">
917 <xsl:variable name=
"seglinum">
918 <xsl:number from=
"segmentedlist" count=
"seglistitem"/>
921 <tr class=
"seglistitem">
922 <xsl:call-template name=
"tr.attributes">
923 <xsl:with-param name=
"rownum" select=
"$seglinum + 1"/>
925 <xsl:apply-templates mode=
"seglist-table"/>
929 <xsl:template match=
"seg" mode=
"seglist-table">
930 <td class=
"seg"><xsl:apply-templates/></td>
933 <xsl:template match=
"seg[1]" mode=
"seglist-table">
935 <xsl:call-template name=
"anchor">
936 <xsl:with-param name=
"node" select=
"ancestor::seglistitem"/>
938 <xsl:apply-templates/>
942 <!-- ==================================================================== -->
944 <xsl:template match=
"calloutlist">
946 <xsl:apply-templates select=
"." mode=
"class.attribute"/>
947 <xsl:call-template name=
"anchor"/>
948 <xsl:if test=
"title|info/title">
949 <xsl:call-template name=
"formal.object.heading"/>
952 <!-- Preserve order of PIs and comments -->
954 select=
"*[not(self::callout or self::title or self::titleabbrev)]
955 |comment()[not(preceding-sibling::callout)]
956 |processing-instruction()[not(preceding-sibling::callout)]"/>
959 <xsl:when test=
"$callout.list.table != 0">
960 <table border=
"0" summary=
"Callout list">
961 <xsl:apply-templates select=
"callout
962 |comment()[preceding-sibling::calllout]
963 |processing-instruction()[preceding-sibling::callout]"/>
967 <dl compact=
"compact">
968 <xsl:apply-templates select=
"callout
969 |comment()[preceding-sibling::calllout]
970 |processing-instruction()[preceding-sibling::callout]"/>
977 <xsl:template match=
"calloutlist/title">
980 <xsl:template match=
"callout">
982 <xsl:when test=
"$callout.list.table != 0">
984 <xsl:call-template name=
"tr.attributes">
985 <xsl:with-param name=
"rownum">
986 <xsl:number from=
"calloutlist" count=
"callout"/>
990 <td width=
"5%" valign=
"top" align=
"left">
991 <xsl:call-template name=
"anchor"/>
992 <xsl:call-template name=
"callout.arearefs">
993 <xsl:with-param name=
"arearefs" select=
"@arearefs"/>
996 <td valign=
"top" align=
"left">
997 <xsl:apply-templates/>
1003 <xsl:call-template name=
"anchor"/>
1004 <xsl:call-template name=
"callout.arearefs">
1005 <xsl:with-param name=
"arearefs" select=
"@arearefs"/>
1006 </xsl:call-template>
1008 <dd><xsl:apply-templates/></dd>
1013 <xsl:template match=
"callout/simpara" priority=
"2">
1014 <!-- If a callout contains only a single simpara, don't output
1015 the <p> wrapper; this has the effect of creating an li
1016 with simple text content. -->
1018 <xsl:when test=
"not(preceding-sibling::*)
1019 and not (following-sibling::*)">
1020 <xsl:call-template name=
"anchor"/>
1021 <xsl:apply-templates/>
1025 <xsl:if test=
"@role and $para.propagates.style != 0">
1026 <xsl:apply-templates select=
"." mode=
"class.attribute">
1027 <xsl:with-param name=
"class" select=
"@role"/>
1028 </xsl:apply-templates>
1031 <xsl:call-template name=
"anchor"/>
1032 <xsl:apply-templates/>
1038 <xsl:template name=
"callout.arearefs">
1039 <xsl:param name=
"arearefs"></xsl:param>
1040 <xsl:if test=
"$arearefs!=''">
1042 <xsl:when test=
"substring-before($arearefs,' ')=''">
1043 <xsl:call-template name=
"callout.arearef">
1044 <xsl:with-param name=
"arearef" select=
"$arearefs"/>
1045 </xsl:call-template>
1048 <xsl:call-template name=
"callout.arearef">
1049 <xsl:with-param name=
"arearef"
1050 select=
"substring-before($arearefs,' ')"/>
1051 </xsl:call-template>
1054 <xsl:call-template name=
"callout.arearefs">
1055 <xsl:with-param name=
"arearefs"
1056 select=
"substring-after($arearefs,' ')"/>
1057 </xsl:call-template>
1061 <xsl:template name=
"callout.arearef">
1062 <xsl:param name=
"arearef"></xsl:param>
1063 <xsl:variable name=
"targets" select=
"key('id',$arearef)"/>
1064 <xsl:variable name=
"target" select=
"$targets[1]"/>
1066 <xsl:call-template name=
"check.id.unique">
1067 <xsl:with-param name=
"linkend" select=
"$arearef"/>
1068 </xsl:call-template>
1071 <xsl:when test=
"count($target)=0">
1072 <xsl:text>???
</xsl:text>
1074 <xsl:when test=
"local-name($target)='co'">
1076 <xsl:attribute name=
"href">
1077 <xsl:text>#
</xsl:text>
1078 <xsl:value-of select=
"$arearef"/>
1080 <xsl:apply-templates select=
"$target" mode=
"callout-bug"/>
1082 <xsl:text> </xsl:text>
1084 <xsl:when test=
"local-name($target)='areaset'">
1085 <xsl:call-template name=
"callout-bug">
1086 <xsl:with-param name=
"conum">
1087 <xsl:apply-templates select=
"$target" mode=
"conumber"/>
1089 </xsl:call-template>
1091 <xsl:when test=
"local-name($target)='area'">
1093 <xsl:when test=
"$target/parent::areaset">
1094 <xsl:call-template name=
"callout-bug">
1095 <xsl:with-param name=
"conum">
1096 <xsl:apply-templates select=
"$target/parent::areaset"
1099 </xsl:call-template>
1102 <xsl:call-template name=
"callout-bug">
1103 <xsl:with-param name=
"conum">
1104 <xsl:apply-templates select=
"$target" mode=
"conumber"/>
1106 </xsl:call-template>
1111 <xsl:text>???
</xsl:text>
1116 <!-- ==================================================================== -->