2 <xsl:stylesheet exclude-result-prefixes="d"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:d="http://docbook.org/ns/docbook"
7 <!-- ********************************************************************
9 This file is part of the XSL DocBook Stylesheet distribution.
10 See ../README or http://cdn.docbook.org/release/xsl/current/ for
11 copyright and other information.
13 ******************************************************************** -->
15 <!-- ==================================================================== -->
17 <xsl:template match="d:itemizedlist">
18 <!-- Handle spacing="compact" as multiple class attribute instead
19 of the deprecated HTML compact attribute -->
20 <xsl:variable name="default.class">
21 <xsl:value-of select="local-name()"/>
22 <xsl:if test="@spacing = 'compact'">
23 <xsl:text> compact</xsl:text>
27 <xsl:variable name="style.value">
28 <xsl:variable name="type">
29 <xsl:call-template name="list.itemsymbol"/>
32 <xsl:text>list-style-type: </xsl:text>
33 <xsl:value-of select="$type"/>
34 <xsl:text>; </xsl:text>
38 <xsl:call-template name="common.html.attributes"/>
39 <xsl:call-template name="id.attribute"/>
40 <xsl:call-template name="anchor"/>
41 <xsl:if test="d:title|d:info/d:title">
42 <xsl:call-template name="formal.object.heading"/>
45 <!-- Preserve order of PIs and comments -->
47 select="*[not(self::d:listitem
49 or self::d:titleabbrev)]
50 |comment()[not(preceding-sibling::d:listitem)]
51 |processing-instruction()[not(preceding-sibling::d:listitem)]"/>
54 <xsl:call-template name="generate.class.attribute">
55 <xsl:with-param name="class" select="$default.class"/>
58 <xsl:when test="$css.decoration != 0">
59 <xsl:attribute name="style">
60 <xsl:value-of select="$style.value"/>
63 <xsl:when test="$make.clean.html != 0">
64 <!-- styled by separate css only -->
67 <!-- use the old @type attribute -->
68 <xsl:attribute name="type">
69 <xsl:call-template name="list.itemsymbol"/>
76 |comment()[preceding-sibling::d:listitem]
77 |processing-instruction()[preceding-sibling::d:listitem]"/>
82 <xsl:template match="d:itemizedlist/d:title">
86 <xsl:template match="d:itemizedlist/d:listitem">
87 <xsl:variable name="mark" select="../@mark"/>
88 <xsl:variable name="override" select="@override"/>
90 <xsl:variable name="usemark">
92 <xsl:when test="$override != ''">
93 <xsl:value-of select="$override"/>
96 <xsl:value-of select="$mark"/>
101 <xsl:variable name="cssmark">
103 <xsl:when test="$usemark = 'opencircle'">circle</xsl:when>
104 <xsl:when test="$usemark = 'bullet'">disc</xsl:when>
105 <xsl:when test="$usemark = 'box'">square</xsl:when>
107 <xsl:value-of select="$usemark"/>
113 <xsl:call-template name="common.html.attributes"/>
114 <xsl:call-template name="id.attribute"/>
115 <xsl:if test="$css.decoration = '1' and $cssmark != ''">
116 <xsl:attribute name="style">
117 <xsl:text>list-style-type: </xsl:text>
118 <xsl:value-of select="$cssmark"/>
122 <!-- we can't just drop the anchor in since some browsers (Opera)
123 get confused about line breaks if we do. So if the first child
124 is a para, assume the para will put in the anchor. Otherwise,
125 put the anchor in anyway. -->
126 <xsl:if test="local-name(child::*[1]) != 'para'">
127 <xsl:call-template name="anchor"/>
131 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
132 <div class="{@revisionflag}">
133 <xsl:apply-templates/>
137 <xsl:apply-templates/>
143 <xsl:template match="d:orderedlist">
144 <!-- Handle spacing="compact" as multiple class attribute instead
145 of the deprecated HTML compact attribute -->
146 <xsl:variable name="default.class">
147 <xsl:value-of select="local-name()"/>
148 <xsl:if test="@spacing = 'compact'">
149 <xsl:text> compact</xsl:text>
153 <xsl:variable name="start">
154 <xsl:call-template name="orderedlist-starting-number"/>
157 <xsl:variable name="numeration">
158 <xsl:call-template name="list.numeration"/>
161 <xsl:variable name="type">
163 <xsl:when test="$numeration='arabic'">1</xsl:when>
164 <xsl:when test="$numeration='loweralpha'">a</xsl:when>
165 <xsl:when test="$numeration='lowerroman'">i</xsl:when>
166 <xsl:when test="$numeration='upperalpha'">A</xsl:when>
167 <xsl:when test="$numeration='upperroman'">I</xsl:when>
168 <!-- What!? This should never happen -->
171 <xsl:text>Unexpected numeration: </xsl:text>
172 <xsl:value-of select="$numeration"/>
174 <xsl:value-of select="1"/>
180 <xsl:call-template name="common.html.attributes"/>
181 <xsl:call-template name="id.attribute"/>
182 <xsl:call-template name="anchor"/>
184 <xsl:if test="d:title|d:info/d:title">
185 <xsl:call-template name="formal.object.heading"/>
188 <!-- Preserve order of PIs and comments -->
190 select="*[not(self::d:listitem
192 or self::d:titleabbrev)]
193 |comment()[not(preceding-sibling::d:listitem)]
194 |processing-instruction()[not(preceding-sibling::d:listitem)]"/>
197 <xsl:when test="@inheritnum='inherit' and ancestor::d:listitem[parent::d:orderedlist]">
198 <table border="{$table.border.off}">
199 <xsl:call-template name="generate.class.attribute">
200 <xsl:with-param name="class" select="$default.class"/>
203 <col align="{$direction.align.start}" valign="top"/>
208 mode="orderedlist-table"
210 |comment()[preceding-sibling::d:listitem]
211 |processing-instruction()[preceding-sibling::d:listitem]"/>
217 <xsl:call-template name="generate.class.attribute">
218 <xsl:with-param name="class" select="$default.class"/>
220 <xsl:if test="$start != '1'">
221 <xsl:attribute name="start">
222 <xsl:value-of select="$start"/>
225 <xsl:if test="$numeration != ''">
226 <xsl:attribute name="type">
227 <xsl:value-of select="$type"/>
232 |comment()[preceding-sibling::d:listitem]
233 |processing-instruction()[preceding-sibling::d:listitem]"/>
240 <xsl:template match="d:orderedlist/d:title">
244 <xsl:template match="d:orderedlist/d:listitem">
246 <xsl:call-template name="common.html.attributes"/>
247 <xsl:call-template name="id.attribute"/>
248 <xsl:if test="@override">
249 <xsl:attribute name="value">
250 <xsl:value-of select="@override"/>
254 <!-- we can't just drop the anchor in since some browsers (Opera)
255 get confused about line breaks if we do. So if the first child
256 is a para, assume the para will put in the anchor. Otherwise,
257 put the anchor in anyway. -->
258 <xsl:if test="local-name(child::*[1]) != 'para'">
259 <xsl:call-template name="anchor"/>
263 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
264 <div class="{@revisionflag}">
265 <xsl:apply-templates/>
269 <xsl:apply-templates/>
275 <xsl:template match="d:orderedlist/d:listitem" mode="orderedlist-table">
278 <xsl:apply-templates select="." mode="item-number"/>
281 <xsl:if test="local-name(child::*[1]) != 'para'">
282 <xsl:call-template name="id.attribute"/>
283 <xsl:call-template name="anchor"/>
287 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
288 <div class="{@revisionflag}">
289 <xsl:apply-templates/>
293 <xsl:apply-templates/>
300 <xsl:template match="d:variablelist">
301 <xsl:variable name="pi-presentation">
302 <xsl:call-template name="pi.dbhtml_list-presentation"/>
304 <!-- Handle spacing="compact" as multiple class attribute instead
305 of the deprecated HTML compact attribute -->
306 <xsl:variable name="default.class">
307 <xsl:value-of select="local-name()"/>
308 <xsl:if test="@spacing = 'compact'">
309 <xsl:text> compact</xsl:text>
314 <xsl:variable name="presentation">
316 <xsl:when test="$pi-presentation != ''">
317 <xsl:value-of select="$pi-presentation"/>
319 <xsl:when test="$variablelist.as.table != 0">
320 <xsl:value-of select="'table'"/>
323 <xsl:value-of select="'list'"/>
328 <xsl:variable name="list-width">
329 <xsl:call-template name="pi.dbhtml_list-width"/>
332 <xsl:variable name="term-width">
333 <xsl:call-template name="pi.dbhtml_term-width"/>
336 <xsl:variable name="table-summary">
337 <xsl:call-template name="pi.dbhtml_table-summary"/>
341 <xsl:call-template name="common.html.attributes"/>
342 <xsl:call-template name="id.attribute"/>
343 <xsl:call-template name="anchor"/>
344 <xsl:if test="d:title|d:info/d:title">
345 <xsl:call-template name="formal.object.heading"/>
349 <xsl:when test="$presentation = 'table'">
350 <!-- Preserve order of PIs and comments -->
352 select="*[not(self::d:varlistentry
354 or self::d:titleabbrev)]
355 |comment()[not(preceding-sibling::d:varlistentry)]
356 |processing-instruction()[not(preceding-sibling::d:varlistentry)]"/>
357 <table border="{$table.border.off}">
358 <xsl:call-template name="generate.class.attribute">
359 <xsl:with-param name="class" select="$default.class"/>
361 <xsl:if test="$list-width != ''">
362 <xsl:attribute name="width">
363 <xsl:value-of select="$list-width"/>
366 <xsl:if test="$table-summary != ''">
367 <xsl:attribute name="summary">
368 <xsl:value-of select="$table-summary"/>
372 <col align="{$direction.align.start}" valign="top">
373 <xsl:if test="$term-width != ''">
374 <xsl:attribute name="width">
375 <xsl:value-of select="$term-width"/>
382 <xsl:apply-templates mode="varlist-table"
383 select="d:varlistentry
384 |comment()[preceding-sibling::d:varlistentry]
385 |processing-instruction()[preceding-sibling::d:varlistentry]"/>
390 <!-- Preserve order of PIs and comments -->
392 select="*[not(self::d:varlistentry
394 or self::d:titleabbrev)]
395 |comment()[not(preceding-sibling::d:varlistentry)]
396 |processing-instruction()[not(preceding-sibling::d:varlistentry)]"/>
398 <xsl:call-template name="generate.class.attribute">
399 <xsl:with-param name="class" select="$default.class"/>
402 select="d:varlistentry
403 |comment()[preceding-sibling::d:varlistentry]
404 |processing-instruction()[preceding-sibling::d:varlistentry]"/>
411 <xsl:template match="d:variablelist/d:title">
415 <xsl:template match="d:itemizedlist/d:titleabbrev|d:orderedlist/d:titleabbrev">
419 <xsl:template match="d:variablelist/d:titleabbrev">
423 <xsl:template match="d:listitem" mode="xref">
424 <xsl:number format="1"/>
427 <xsl:template match="d:listitem/d:simpara" priority="2">
428 <!-- If a listitem contains only a single simpara, don't output
429 the <p> wrapper; this has the effect of creating an li
430 with simple text content. -->
432 <xsl:when test="not(preceding-sibling::*)
433 and not (following-sibling::*)">
434 <xsl:call-template name="anchor"/>
435 <xsl:apply-templates/>
439 <xsl:call-template name="id.attribute"/>
441 <xsl:when test="@role and $para.propagates.style != 0">
442 <xsl:call-template name="common.html.attributes">
443 <xsl:with-param name="class" select="@role"/>
447 <xsl:call-template name="common.html.attributes"/>
451 <xsl:call-template name="anchor"/>
452 <xsl:apply-templates/>
458 <xsl:template match="d:varlistentry">
460 <xsl:call-template name="id.attribute"/>
461 <xsl:call-template name="anchor"/>
462 <xsl:apply-templates select="d:term"/>
465 <xsl:apply-templates select="d:listitem"/>
469 <xsl:template match="d:varlistentry" mode="varlist-table">
470 <xsl:variable name="presentation">
471 <xsl:call-template name="pi.dbhtml_term-presentation">
472 <xsl:with-param name="node" select=".."/>
476 <xsl:variable name="separator">
477 <xsl:call-template name="pi.dbhtml_term-separator">
478 <xsl:with-param name="node" select=".."/>
482 <xsl:call-template name="tr.attributes">
483 <xsl:with-param name="rownum">
484 <xsl:number from="d:variablelist" count="d:varlistentry"/>
489 <xsl:call-template name="id.attribute"/>
491 <xsl:call-template name="anchor"/>
493 <xsl:when test="$presentation = 'bold'">
495 <xsl:apply-templates select="d:term"/>
496 <xsl:value-of select="$separator"/>
499 <xsl:when test="$presentation = 'italic'">
501 <xsl:apply-templates select="d:term"/>
502 <xsl:value-of select="$separator"/>
505 <xsl:when test="$presentation = 'bold-italic'">
508 <xsl:apply-templates select="d:term"/>
509 <xsl:value-of select="$separator"/>
514 <xsl:apply-templates select="d:term"/>
515 <xsl:value-of select="$separator"/>
521 <xsl:apply-templates select="d:listitem"/>
526 <xsl:template match="d:varlistentry/d:term">
528 <xsl:call-template name="common.html.attributes"/>
529 <xsl:call-template name="id.attribute"/>
530 <xsl:call-template name="anchor"/>
531 <xsl:call-template name="simple.xlink">
532 <xsl:with-param name="content">
533 <xsl:apply-templates/>
537 <xsl:when test="position() = last()"/> <!-- do nothing -->
539 <!-- * if we have multiple terms in the same varlistentry, generate -->
540 <!-- * a separator (", " by default) and/or an additional line -->
541 <!-- * break after each one except the last -->
542 <xsl:value-of select="$variablelist.term.separator"/>
543 <xsl:if test="not($variablelist.term.break.after = '0')">
551 <xsl:template match="d:varlistentry/d:listitem">
552 <!-- we can't just drop the anchor in since some browsers (Opera)
553 get confused about line breaks if we do. So if the first child
554 is a para, assume the para will put in the anchor. Otherwise,
555 put the anchor in anyway. -->
556 <xsl:if test="local-name(child::*[1]) != 'para'">
557 <xsl:call-template name="anchor"/>
561 <xsl:when test="$show.revisionflag != 0 and @revisionflag">
562 <div class="{@revisionflag}">
563 <xsl:apply-templates/>
567 <xsl:apply-templates/>
572 <!-- ==================================================================== -->
574 <xsl:template match="d:simplelist">
575 <!-- with no type specified, the default is 'vert' -->
576 <xsl:call-template name="anchor"/>
577 <table border="{$table.border.off}">
578 <xsl:if test="$div.element != 'section'">
579 <xsl:attribute name="summary">Simple list</xsl:attribute>
581 <xsl:call-template name="common.html.attributes"/>
582 <xsl:call-template name="id.attribute"/>
583 <xsl:call-template name="simplelist.vert">
584 <xsl:with-param name="cols">
586 <xsl:when test="@columns">
587 <xsl:value-of select="@columns"/>
589 <xsl:otherwise>1</xsl:otherwise>
596 <xsl:template match="d:simplelist[@type='inline']">
598 <xsl:call-template name="common.html.attributes"/>
599 <xsl:call-template name="id.attribute"/>
600 <!-- if dbchoice PI exists, use that to determine the choice separator -->
601 <!-- (that is, equivalent of "and" or "or" in current locale), or literal -->
602 <!-- value of "choice" otherwise -->
603 <xsl:variable name="localized-choice-separator">
605 <xsl:when test="processing-instruction('dbchoice')">
606 <xsl:call-template name="select.choice.separator"/>
614 <xsl:for-each select="d:member">
615 <xsl:call-template name="simple.xlink">
616 <xsl:with-param name="content">
617 <xsl:apply-templates/>
621 <xsl:when test="position() = last()"/> <!-- do nothing -->
623 <xsl:text>, </xsl:text>
624 <xsl:if test="position() = last() - 1">
625 <xsl:if test="$localized-choice-separator != ''">
626 <xsl:value-of select="$localized-choice-separator"/>
627 <xsl:text> </xsl:text>
636 <xsl:template match="d:simplelist[@type='horiz']">
637 <xsl:call-template name="anchor"/>
638 <table border="{$table.border.off}">
639 <xsl:if test="$div.element != 'section'">
640 <xsl:attribute name="summary">Simple list</xsl:attribute>
642 <xsl:call-template name="common.html.attributes"/>
643 <xsl:call-template name="id.attribute"/>
644 <xsl:call-template name="simplelist.horiz">
645 <xsl:with-param name="cols">
647 <xsl:when test="@columns">
648 <xsl:value-of select="@columns"/>
650 <xsl:otherwise>1</xsl:otherwise>
657 <xsl:template match="d:simplelist[@type='vert']">
658 <xsl:call-template name="anchor"/>
659 <table border="{$table.border.off}">
660 <xsl:if test="$div.element != 'section'">
661 <xsl:attribute name="summary">Simple list</xsl:attribute>
663 <xsl:call-template name="common.html.attributes"/>
664 <xsl:call-template name="id.attribute"/>
665 <xsl:call-template name="simplelist.vert">
666 <xsl:with-param name="cols">
668 <xsl:when test="@columns">
669 <xsl:value-of select="@columns"/>
671 <xsl:otherwise>1</xsl:otherwise>
678 <xsl:template name="simplelist.horiz">
679 <xsl:param name="cols">1</xsl:param>
680 <xsl:param name="cell">1</xsl:param>
681 <xsl:param name="members" select="./d:member"/>
683 <xsl:if test="$cell <= count($members)">
685 <xsl:call-template name="tr.attributes">
686 <xsl:with-param name="row" select="$members[1]"/>
687 <xsl:with-param name="rownum" select="(($cell - 1) div $cols) + 1"/>
690 <xsl:call-template name="simplelist.horiz.row">
691 <xsl:with-param name="cols" select="$cols"/>
692 <xsl:with-param name="cell" select="$cell"/>
693 <xsl:with-param name="members" select="$members"/>
696 <xsl:call-template name="simplelist.horiz">
697 <xsl:with-param name="cols" select="$cols"/>
698 <xsl:with-param name="cell" select="$cell + $cols"/>
699 <xsl:with-param name="members" select="$members"/>
704 <xsl:template name="simplelist.horiz.row">
705 <xsl:param name="cols">1</xsl:param>
706 <xsl:param name="cell">1</xsl:param>
707 <xsl:param name="members" select="./d:member"/>
708 <xsl:param name="curcol">1</xsl:param>
710 <xsl:if test="$curcol <= $cols">
713 <xsl:when test="$members[position()=$cell]">
714 <xsl:apply-templates select="$members[position()=$cell]"/>
717 <xsl:text> </xsl:text>
721 <xsl:call-template name="simplelist.horiz.row">
722 <xsl:with-param name="cols" select="$cols"/>
723 <xsl:with-param name="cell" select="$cell+1"/>
724 <xsl:with-param name="members" select="$members"/>
725 <xsl:with-param name="curcol" select="$curcol+1"/>
730 <xsl:template name="simplelist.vert">
731 <xsl:param name="cols">1</xsl:param>
732 <xsl:param name="cell">1</xsl:param>
733 <xsl:param name="members" select="./d:member"/>
734 <xsl:param name="rows"
735 select="floor((count($members)+$cols - 1) div $cols)"/>
737 <xsl:if test="$cell <= $rows">
739 <xsl:call-template name="tr.attributes">
740 <xsl:with-param name="row" select="$members[1]"/>
741 <xsl:with-param name="rownum" select="$cell"/>
744 <xsl:call-template name="simplelist.vert.row">
745 <xsl:with-param name="cols" select="$cols"/>
746 <xsl:with-param name="rows" select="$rows"/>
747 <xsl:with-param name="cell" select="$cell"/>
748 <xsl:with-param name="members" select="$members"/>
751 <xsl:call-template name="simplelist.vert">
752 <xsl:with-param name="cols" select="$cols"/>
753 <xsl:with-param name="cell" select="$cell+1"/>
754 <xsl:with-param name="members" select="$members"/>
755 <xsl:with-param name="rows" select="$rows"/>
760 <xsl:template name="simplelist.vert.row">
761 <xsl:param name="cols">1</xsl:param>
762 <xsl:param name="rows">1</xsl:param>
763 <xsl:param name="cell">1</xsl:param>
764 <xsl:param name="members" select="./d:member"/>
765 <xsl:param name="curcol">1</xsl:param>
767 <xsl:if test="$curcol <= $cols">
770 <xsl:when test="$members[position()=$cell]">
771 <xsl:apply-templates select="$members[position()=$cell]"/>
774 <xsl:text> </xsl:text>
778 <xsl:call-template name="simplelist.vert.row">
779 <xsl:with-param name="cols" select="$cols"/>
780 <xsl:with-param name="rows" select="$rows"/>
781 <xsl:with-param name="cell" select="$cell+$rows"/>
782 <xsl:with-param name="members" select="$members"/>
783 <xsl:with-param name="curcol" select="$curcol+1"/>
788 <xsl:template match="d:member">
789 <xsl:call-template name="anchor"/>
790 <xsl:call-template name="simple.xlink">
791 <xsl:with-param name="content">
792 <xsl:apply-templates/>
797 <!-- ==================================================================== -->
799 <xsl:template match="d:procedure">
800 <xsl:variable name="param.placement"
801 select="substring-after(normalize-space($formal.title.placement),
802 concat(local-name(.), ' '))"/>
804 <xsl:variable name="placement">
806 <xsl:when test="contains($param.placement, ' ')">
807 <xsl:value-of select="substring-before($param.placement, ' ')"/>
809 <xsl:when test="$param.placement = ''">before</xsl:when>
811 <xsl:value-of select="$param.placement"/>
816 <!-- Preserve order of PIs and comments -->
817 <xsl:variable name="preamble"
818 select="*[not(self::d:step
820 or self::d:titleabbrev)]
821 |comment()[not(preceding-sibling::d:step)]
822 |processing-instruction()[not(preceding-sibling::d:step)]"/>
825 <xsl:call-template name="common.html.attributes"/>
826 <xsl:call-template name="id.attribute">
827 <xsl:with-param name="conditional">
829 <xsl:when test="d:title">0</xsl:when>
830 <xsl:otherwise>1</xsl:otherwise>
834 <xsl:call-template name="anchor">
835 <xsl:with-param name="conditional">
837 <xsl:when test="d:title|d:info/d:title|d:blockinfo/d:title">0</xsl:when>
838 <xsl:otherwise>1</xsl:otherwise>
843 <xsl:if test="(d:title or d:info/d:title or d:blockinfo/d:title) and $placement = 'before'">
844 <xsl:call-template name="formal.object.heading"/>
847 <xsl:apply-templates select="$preamble"/>
850 <xsl:when test="count(d:step) = 1">
852 <xsl:call-template name="generate.class.attribute"/>
855 |comment()[preceding-sibling::d:step]
856 |processing-instruction()[preceding-sibling::d:step]"/>
861 <xsl:call-template name="generate.class.attribute"/>
862 <xsl:attribute name="type">
863 <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/>
867 |comment()[preceding-sibling::d:step]
868 |processing-instruction()[preceding-sibling::d:step]"/>
873 <xsl:if test="(d:title or d:info/d:title or d:blockinfo/d:title) and $placement != 'before'">
874 <xsl:call-template name="formal.object.heading"/>
879 <xsl:template match="d:procedure/d:title">
883 <xsl:template match="d:substeps">
884 <xsl:variable name="numeration">
885 <xsl:call-template name="procedure.step.numeration"/>
888 <xsl:call-template name="anchor"/>
890 <ol type="{$numeration}">
891 <xsl:call-template name="common.html.attributes"/>
892 <xsl:call-template name="id.attribute"/>
893 <xsl:apply-templates/>
897 <xsl:template match="d:step">
899 <xsl:call-template name="common.html.attributes"/>
900 <xsl:call-template name="id.attribute"/>
901 <xsl:call-template name="anchor"/>
902 <xsl:apply-templates/>
906 <xsl:template match="d:stepalternatives">
907 <xsl:call-template name="anchor"/>
909 <xsl:call-template name="common.html.attributes"/>
910 <xsl:call-template name="id.attribute"/>
911 <xsl:apply-templates/>
915 <xsl:template match="d:step/d:title">
917 <xsl:call-template name="common.html.attributes"/>
919 <xsl:apply-templates/>
924 <!-- ==================================================================== -->
926 <xsl:template match="d:segmentedlist">
927 <xsl:variable name="presentation">
928 <xsl:call-template name="pi.dbhtml_list-presentation"/>
932 <xsl:call-template name="common.html.attributes"/>
933 <xsl:call-template name="id.attribute"/>
934 <xsl:call-template name="anchor"/>
937 <xsl:when test="$presentation = 'table'">
938 <xsl:apply-templates select="." mode="seglist-table"/>
940 <xsl:when test="$presentation = 'list'">
941 <xsl:apply-templates/>
943 <xsl:when test="$segmentedlist.as.table != 0">
944 <xsl:apply-templates select="." mode="seglist-table"/>
947 <xsl:apply-templates/>
953 <xsl:template match="d:segmentedlist/d:title">
955 <xsl:call-template name="common.html.attributes"/>
958 <xsl:call-template name="generate.class.attribute"/>
959 <xsl:apply-templates/>
965 <xsl:template match="d:segtitle">
968 <xsl:template match="d:segtitle" mode="segtitle-in-seg">
969 <xsl:apply-templates/>
972 <xsl:template match="d:seglistitem">
974 <xsl:call-template name="common.html.attributes"/>
975 <xsl:call-template name="id.attribute"/>
976 <xsl:call-template name="anchor"/>
977 <xsl:apply-templates/>
981 <xsl:template match="d:seg">
982 <xsl:variable name="segnum" select="count(preceding-sibling::d:seg)+1"/>
983 <xsl:variable name="seglist" select="ancestor::d:segmentedlist"/>
984 <xsl:variable name="segtitles" select="$seglist/d:segtitle"/>
987 Note: segtitle is only going to be the right thing in a well formed
988 SegmentedList. If there are too many Segs or too few SegTitles,
989 you'll get something odd...maybe an error
993 <xsl:call-template name="common.html.attributes"/>
994 <xsl:call-template name="id.attribute"/>
996 <span class="segtitle">
997 <xsl:apply-templates select="$segtitles[$segnum=position()]"
998 mode="segtitle-in-seg"/>
999 <xsl:text>: </xsl:text>
1002 <xsl:apply-templates/>
1006 <xsl:template match="d:segmentedlist" mode="seglist-table">
1007 <xsl:variable name="table-summary">
1008 <xsl:call-template name="pi.dbhtml_table-summary"/>
1011 <xsl:variable name="list-width">
1012 <xsl:call-template name="pi.dbhtml_list-width"/>
1015 <xsl:apply-templates select="d:title"/>
1017 <table border="{$table.border.off}">
1018 <xsl:if test="$list-width != ''">
1019 <xsl:attribute name="width">
1020 <xsl:value-of select="$list-width"/>
1023 <xsl:if test="$table-summary != '' and $div.element != 'section'">
1024 <xsl:attribute name="summary">
1025 <xsl:value-of select="$table-summary"/>
1029 <tr class="segtitle">
1030 <xsl:call-template name="tr.attributes">
1031 <xsl:with-param name="row" select="d:segtitle[1]"/>
1032 <xsl:with-param name="rownum" select="1"/>
1033 </xsl:call-template>
1034 <xsl:apply-templates select="d:segtitle" mode="seglist-table"/>
1038 <xsl:apply-templates select="d:seglistitem" mode="seglist-table"/>
1043 <xsl:template match="d:segtitle" mode="seglist-table">
1044 <th><xsl:apply-templates/></th>
1047 <xsl:template match="d:seglistitem" mode="seglist-table">
1048 <xsl:variable name="seglinum">
1049 <xsl:number from="d:segmentedlist" count="d:seglistitem"/>
1053 <xsl:call-template name="common.html.attributes"/>
1054 <xsl:call-template name="id.attribute"/>
1055 <xsl:call-template name="tr.attributes">
1056 <xsl:with-param name="rownum" select="$seglinum + 1"/>
1057 </xsl:call-template>
1058 <xsl:apply-templates mode="seglist-table"/>
1062 <xsl:template match="d:seg" mode="seglist-table">
1064 <xsl:call-template name="common.html.attributes"/>
1065 <xsl:call-template name="id.attribute"/>
1066 <xsl:apply-templates/>
1070 <xsl:template match="d:seg[1]" mode="seglist-table">
1072 <xsl:call-template name="common.html.attributes"/>
1073 <xsl:call-template name="id.attribute"/>
1074 <xsl:call-template name="anchor">
1075 <xsl:with-param name="node" select="ancestor::d:seglistitem"/>
1076 </xsl:call-template>
1077 <xsl:apply-templates/>
1081 <!-- ==================================================================== -->
1083 <xsl:template match="d:calloutlist">
1085 <xsl:call-template name="common.html.attributes"/>
1086 <xsl:call-template name="id.attribute"/>
1087 <xsl:call-template name="anchor"/>
1088 <xsl:if test="d:title|d:info/d:title">
1089 <xsl:call-template name="formal.object.heading"/>
1092 <!-- Preserve order of PIs and comments -->
1093 <xsl:apply-templates
1094 select="*[not(self::d:callout or self::d:title or self::d:titleabbrev)]
1095 |comment()[not(preceding-sibling::d:callout)]
1096 |processing-instruction()[not(preceding-sibling::d:callout)]"/>
1099 <xsl:when test="$callout.list.table != 0">
1100 <table border="{$table.border.off}">
1101 <xsl:if test="$div.element != 'section'">
1102 <xsl:attribute name="summary">Callout list</xsl:attribute>
1104 <xsl:apply-templates select="d:callout
1105 |comment()[preceding-sibling::d:callout]
1106 |processing-instruction()[preceding-sibling::d:callout]"/>
1111 <xsl:apply-templates select="." mode="class.attribute"/>
1112 <xsl:apply-templates select="d:callout
1113 |comment()[preceding-sibling::d:callout]
1114 |processing-instruction()[preceding-sibling::d:callout]"/>
1121 <xsl:template match="d:calloutlist/d:title">
1124 <xsl:template match="d:callout">
1126 <xsl:when test="$callout.list.table != 0">
1128 <xsl:call-template name="tr.attributes">
1129 <xsl:with-param name="rownum">
1130 <xsl:number from="d:calloutlist" count="d:callout"/>
1132 </xsl:call-template>
1134 <td width="5%" valign="top" align="{$direction.align.start}">
1135 <xsl:call-template name="id.attribute"/>
1137 <xsl:call-template name="anchor"/>
1138 <xsl:call-template name="callout.arearefs">
1139 <xsl:with-param name="arearefs" select="@arearefs"/>
1140 </xsl:call-template>
1143 <td valign="top" align="{$direction.align.start}">
1144 <xsl:apply-templates/>
1150 <xsl:call-template name="id.attribute"/>
1151 <xsl:call-template name="anchor"/>
1152 <xsl:call-template name="callout.arearefs">
1153 <xsl:with-param name="arearefs" select="@arearefs"/>
1154 </xsl:call-template>
1156 <dd><xsl:apply-templates/></dd>
1161 <xsl:template match="d:callout/d:simpara" priority="2">
1162 <!-- If a callout contains only a single simpara, don't output
1163 the <p> wrapper; this has the effect of creating an li
1164 with simple text content. -->
1166 <xsl:when test="not(preceding-sibling::*)
1167 and not (following-sibling::*)">
1168 <xsl:call-template name="anchor"/>
1169 <xsl:apply-templates/>
1173 <xsl:call-template name="id.attribute"/>
1174 <xsl:if test="@role and $para.propagates.style != 0">
1176 <xsl:when test="@role and $para.propagates.style != 0">
1177 <xsl:call-template name="common.html.attributes">
1178 <xsl:with-param name="class" select="@role"/>
1179 </xsl:call-template>
1182 <xsl:call-template name="common.html.attributes"/>
1187 <xsl:call-template name="anchor"/>
1188 <xsl:apply-templates/>
1194 <xsl:template name="callout.arearefs">
1195 <xsl:param name="arearefs"></xsl:param>
1196 <xsl:if test="$arearefs!=''">
1198 <xsl:when test="substring-before($arearefs,' ')=''">
1199 <xsl:call-template name="callout.arearef">
1200 <xsl:with-param name="arearef" select="$arearefs"/>
1201 </xsl:call-template>
1204 <xsl:call-template name="callout.arearef">
1205 <xsl:with-param name="arearef"
1206 select="substring-before($arearefs,' ')"/>
1207 </xsl:call-template>
1210 <xsl:call-template name="callout.arearefs">
1211 <xsl:with-param name="arearefs"
1212 select="substring-after($arearefs,' ')"/>
1213 </xsl:call-template>
1217 <xsl:template name="callout.arearef">
1218 <xsl:param name="arearef"></xsl:param>
1219 <xsl:variable name="targets" select="key('id',$arearef)"/>
1220 <xsl:variable name="target" select="$targets[1]"/>
1222 <xsl:call-template name="check.id.unique">
1223 <xsl:with-param name="linkend" select="$arearef"/>
1224 </xsl:call-template>
1227 <xsl:when test="count($target)=0">
1228 <xsl:text>???</xsl:text>
1230 <xsl:when test="local-name($target)='co'">
1232 <xsl:attribute name="href">
1233 <xsl:text>#</xsl:text>
1234 <xsl:value-of select="$arearef"/>
1236 <xsl:apply-templates select="$target" mode="callout-bug"/>
1238 <xsl:text> </xsl:text>
1240 <xsl:when test="local-name($target)='areaset'">
1241 <xsl:call-template name="callout-bug">
1242 <xsl:with-param name="conum">
1243 <xsl:apply-templates select="$target" mode="conumber"/>
1245 </xsl:call-template>
1247 <xsl:when test="local-name($target)='area'">
1249 <xsl:when test="$target/parent::d:areaset">
1250 <xsl:call-template name="callout-bug">
1251 <xsl:with-param name="conum">
1252 <xsl:apply-templates select="$target/parent::d:areaset"
1255 </xsl:call-template>
1258 <xsl:call-template name="callout-bug">
1259 <xsl:with-param name="conum">
1260 <xsl:apply-templates select="$target" mode="conumber"/>
1262 </xsl:call-template>
1267 <xsl:text>???</xsl:text>
1272 <!-- ==================================================================== -->
1274 <xsl:template name="orderedlist-starting-number">
1275 <xsl:param name="list" select="."/>
1276 <xsl:variable name="pi-start">
1277 <xsl:call-template name="pi.dbhtml_start">
1278 <xsl:with-param name="node" select="$list"/>
1279 </xsl:call-template>
1281 <xsl:call-template name="output-orderedlist-starting-number">
1282 <xsl:with-param name="list" select="$list"/>
1283 <xsl:with-param name="pi-start" select="$pi-start"/>
1284 </xsl:call-template>