1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table" xmlns:xtbl="com.nwalsh.xalan.Table" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="doc stbl xtbl lxslt ptbl" version="1.0">
6 <xsl:include href="../common/table.xsl"/>
8 <!-- ********************************************************************
10 ********************************************************************
12 This file is part of the XSL DocBook Stylesheet distribution.
13 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
14 and other information.
16 ******************************************************************** -->
18 <lxslt:component prefix="xtbl" functions="adjustColumnWidths"/>
20 <xsl:template name="empty.table.cell">
21 <xsl:param name="colnum" select="0"/>
23 <xsl:variable name="rowsep">
25 <!-- If this is the last row, rowsep never applies. -->
26 <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row or ancestor-or-self::thead/following-sibling::tbody or ancestor-or-self::tbody/preceding-sibling::tfoot)">
27 <xsl:value-of select="0"/>
30 <xsl:call-template name="inherited.table.attribute">
31 <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
32 <xsl:with-param name="row" select="ancestor-or-self::row[1]"/>
33 <xsl:with-param name="colnum" select="$colnum"/>
34 <xsl:with-param name="attribute" select="'rowsep'"/>
40 <xsl:variable name="colsep">
42 <!-- If this is the last column, colsep never applies. -->
43 <xsl:when test="$colnum >= ancestor::tgroup/@cols">0</xsl:when>
45 <xsl:call-template name="inherited.table.attribute">
46 <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
47 <xsl:with-param name="row" select="ancestor-or-self::row[1]"/>
48 <xsl:with-param name="colnum" select="$colnum"/>
49 <xsl:with-param name="attribute" select="'colsep'"/>
55 <td class="auto-generated">
56 <xsl:if test="$table.borders.with.css != 0">
57 <xsl:attribute name="style">
58 <xsl:if test="$colsep > 0">
59 <xsl:call-template name="border">
60 <xsl:with-param name="side" select="'right'"/>
63 <xsl:if test="$rowsep > 0">
64 <xsl:call-template name="border">
65 <xsl:with-param name="side" select="'bottom'"/>
70 <xsl:text> </xsl:text>
74 <!-- ==================================================================== -->
76 <xsl:template name="border">
77 <xsl:param name="side" select="'left'"/>
78 <xsl:param name="padding" select="0"/>
79 <xsl:param name="style" select="$table.cell.border.style"/>
80 <xsl:param name="color" select="$table.cell.border.color"/>
81 <xsl:param name="thickness" select="$table.cell.border.thickness"/>
83 <!-- Note: Some browsers (mozilla) require at least a width and style. -->
86 <xsl:when test="($thickness != '' and $style != '' and $color != '') or ($thickness != '' and $style != '') or ($thickness != '')">
87 <!-- use the compound property if we can: -->
88 <!-- it saves space and probably works more reliably -->
89 <xsl:text>border-</xsl:text>
90 <xsl:value-of select="$side"/>
91 <xsl:text>: </xsl:text>
92 <xsl:value-of select="$thickness"/>
93 <xsl:text> </xsl:text>
94 <xsl:value-of select="$style"/>
95 <xsl:text> </xsl:text>
96 <xsl:value-of select="$color"/>
97 <xsl:text>; </xsl:text>
100 <!-- we need to specify the styles individually -->
101 <xsl:if test="$thickness != ''">
102 <xsl:text>border-</xsl:text>
103 <xsl:value-of select="$side"/>
104 <xsl:text>-width: </xsl:text>
105 <xsl:value-of select="$thickness"/>
106 <xsl:text>; </xsl:text>
109 <xsl:if test="$style != ''">
110 <xsl:text>border-</xsl:text>
111 <xsl:value-of select="$side"/>
112 <xsl:text>-style: </xsl:text>
113 <xsl:value-of select="$style"/>
114 <xsl:text>; </xsl:text>
117 <xsl:if test="$color != ''">
118 <xsl:text>border-</xsl:text>
119 <xsl:value-of select="$side"/>
120 <xsl:text>-color: </xsl:text>
121 <xsl:value-of select="$color"/>
122 <xsl:text>; </xsl:text>
128 <!-- ==================================================================== -->
130 <xsl:template match="tgroup" name="tgroup">
131 <xsl:if test="not(@cols)">
132 <xsl:message terminate="yes">
133 <xsl:text>Error: CALS tables must specify the number of columns.</xsl:text>
137 <xsl:variable name="summary">
138 <xsl:call-template name="dbhtml-attribute">
139 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
140 <xsl:with-param name="attribute" select="'table-summary'"/>
144 <xsl:variable name="cellspacing">
145 <xsl:call-template name="dbhtml-attribute">
146 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
147 <xsl:with-param name="attribute" select="'cellspacing'"/>
151 <xsl:variable name="cellpadding">
152 <xsl:call-template name="dbhtml-attribute">
153 <xsl:with-param name="pis" select="processing-instruction('dbhtml')[1]"/>
154 <xsl:with-param name="attribute" select="'cellpadding'"/>
160 <!-- If there's a textobject/phrase for the table summary, use it -->
161 <xsl:when test="../textobject/phrase">
162 <xsl:attribute name="summary">
163 <xsl:value-of select="../textobject/phrase"/>
167 <!-- If there's a <?dbhtml table-summary="foo"?> PI, use it for
168 the HTML table summary attribute -->
169 <xsl:when test="$summary != ''">
170 <xsl:attribute name="summary">
171 <xsl:value-of select="$summary"/>
175 <!-- Otherwise, if there's a title, use that -->
176 <xsl:when test="../title">
177 <xsl:attribute name="summary">
178 <xsl:value-of select="string(../title)"/>
182 <!-- Otherwise, forget the whole idea -->
183 <xsl:otherwise><!-- nevermind --></xsl:otherwise>
186 <xsl:if test="$cellspacing != '' or $html.cellspacing != ''">
187 <xsl:attribute name="cellspacing">
189 <xsl:when test="$cellspacing != ''">
190 <xsl:value-of select="$cellspacing"/>
193 <xsl:value-of select="$html.cellspacing"/>
199 <xsl:if test="$cellpadding != '' or $html.cellpadding != ''">
200 <xsl:attribute name="cellpadding">
202 <xsl:when test="$cellpadding != ''">
203 <xsl:value-of select="$cellpadding"/>
206 <xsl:value-of select="$html.cellpadding"/>
212 <xsl:if test="../@pgwide=1 or local-name(.) = 'entrytbl'">
213 <xsl:attribute name="width">100%</xsl:attribute>
217 <xsl:when test="$table.borders.with.css != 0">
218 <xsl:attribute name="border">0</xsl:attribute>
220 <xsl:when test="../@frame='all' or (not(../@frame) and $default.table.frame='all')">
221 <xsl:attribute name="style">
222 <xsl:text>border-collapse: collapse;</xsl:text>
223 <xsl:call-template name="border">
224 <xsl:with-param name="side" select="'top'"/>
225 <xsl:with-param name="style" select="$table.frame.border.style"/>
226 <xsl:with-param name="color" select="$table.frame.border.color"/>
227 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
229 <xsl:call-template name="border">
230 <xsl:with-param name="side" select="'bottom'"/>
231 <xsl:with-param name="style" select="$table.frame.border.style"/>
232 <xsl:with-param name="color" select="$table.frame.border.color"/>
233 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
235 <xsl:call-template name="border">
236 <xsl:with-param name="side" select="'left'"/>
237 <xsl:with-param name="style" select="$table.frame.border.style"/>
238 <xsl:with-param name="color" select="$table.frame.border.color"/>
239 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
241 <xsl:call-template name="border">
242 <xsl:with-param name="side" select="'right'"/>
243 <xsl:with-param name="style" select="$table.frame.border.style"/>
244 <xsl:with-param name="color" select="$table.frame.border.color"/>
245 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
249 <xsl:when test="../@frame='topbot' or (not(../@frame) and $default.table.frame='topbot')">
250 <xsl:attribute name="style">
251 <xsl:text>border-collapse: collapse;</xsl:text>
252 <xsl:call-template name="border">
253 <xsl:with-param name="side" select="'top'"/>
254 <xsl:with-param name="style" select="$table.frame.border.style"/>
255 <xsl:with-param name="color" select="$table.frame.border.color"/>
256 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
258 <xsl:call-template name="border">
259 <xsl:with-param name="side" select="'bottom'"/>
260 <xsl:with-param name="style" select="$table.frame.border.style"/>
261 <xsl:with-param name="color" select="$table.frame.border.color"/>
262 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
266 <xsl:when test="../@frame='top' or (not(../@frame) and $default.table.frame='top')">
267 <xsl:attribute name="style">
268 <xsl:text>border-collapse: collapse;</xsl:text>
269 <xsl:call-template name="border">
270 <xsl:with-param name="side" select="'top'"/>
271 <xsl:with-param name="style" select="$table.frame.border.style"/>
272 <xsl:with-param name="color" select="$table.frame.border.color"/>
273 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
277 <xsl:when test="../@frame='bottom' or (not(../@frame) and $default.table.frame='bottom')">
278 <xsl:attribute name="style">
279 <xsl:text>border-collapse: collapse;</xsl:text>
280 <xsl:call-template name="border">
281 <xsl:with-param name="side" select="'bottom'"/>
282 <xsl:with-param name="style" select="$table.frame.border.style"/>
283 <xsl:with-param name="color" select="$table.frame.border.color"/>
284 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
288 <xsl:when test="../@frame='sides' or (not(../@frame) and $default.table.frame='sides')">
289 <xsl:attribute name="style">
290 <xsl:text>border-collapse: collapse;</xsl:text>
291 <xsl:call-template name="border">
292 <xsl:with-param name="side" select="'left'"/>
293 <xsl:with-param name="style" select="$table.frame.border.style"/>
294 <xsl:with-param name="color" select="$table.frame.border.color"/>
295 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
297 <xsl:call-template name="border">
298 <xsl:with-param name="side" select="'right'"/>
299 <xsl:with-param name="style" select="$table.frame.border.style"/>
300 <xsl:with-param name="color" select="$table.frame.border.color"/>
301 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
306 <xsl:attribute name="style">
307 <xsl:text>border-collapse: collapse;</xsl:text>
312 <xsl:when test="../@frame='none' or (not(../@frame) and $default.table.frame='none') or local-name(.) = 'entrytbl'">
313 <xsl:attribute name="border">0</xsl:attribute>
316 <xsl:attribute name="border">1</xsl:attribute>
320 <xsl:variable name="colgroup">
322 <xsl:call-template name="generate.colgroup">
323 <xsl:with-param name="cols" select="@cols"/>
328 <xsl:variable name="explicit.table.width">
329 <xsl:call-template name="dbhtml-attribute">
330 <xsl:with-param name="pis" select="../processing-instruction('dbhtml')[1]"/>
331 <xsl:with-param name="attribute" select="'table-width'"/>
335 <xsl:variable name="table.width">
337 <xsl:when test="$explicit.table.width != ''">
338 <xsl:value-of select="$explicit.table.width"/>
340 <xsl:when test="$default.table.width = ''">
341 <xsl:text>100%</xsl:text>
344 <xsl:value-of select="$default.table.width"/>
349 <xsl:if test="$default.table.width != '' or $explicit.table.width != ''">
350 <xsl:attribute name="width">
352 <xsl:when test="contains($table.width, '%')">
353 <xsl:value-of select="$table.width"/>
355 <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
357 <xsl:when test="function-available('stbl:convertLength')">
358 <xsl:value-of select="stbl:convertLength($table.width)"/>
360 <xsl:when test="function-available('xtbl:convertLength')">
361 <xsl:value-of select="xtbl:convertLength($table.width)"/>
364 <xsl:message terminate="yes">
365 <xsl:text>No convertLength function available.</xsl:text>
371 <xsl:value-of select="$table.width"/>
378 <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
380 <xsl:when test="function-available('stbl:adjustColumnWidths')">
381 <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
383 <xsl:when test="function-available('xtbl:adjustColumnWidths')">
384 <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/>
386 <xsl:when test="function-available('ptbl:adjustColumnWidths')">
387 <xsl:copy-of select="ptbl:adjustColumnWidths($colgroup)"/>
390 <xsl:message terminate="yes">
391 <xsl:text>No adjustColumnWidths function available.</xsl:text>
397 <xsl:copy-of select="$colgroup"/>
401 <xsl:apply-templates select="thead"/>
402 <xsl:apply-templates select="tfoot"/>
403 <xsl:apply-templates select="tbody"/>
405 <xsl:if test=".//footnote">
406 <tbody class="footnotes">
408 <td colspan="{@cols}">
409 <xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/>
417 <xsl:template match="tgroup/processing-instruction('dbhtml')">
418 <xsl:variable name="summary">
419 <xsl:call-template name="dbhtml-attribute">
420 <xsl:with-param name="pis" select="."/>
421 <xsl:with-param name="attribute" select="'table-summary'"/>
425 <!-- Suppress the table-summary PI -->
426 <xsl:if test="$summary = ''">
427 <xsl:processing-instruction name="dbhtml">
428 <xsl:value-of select="."/>
429 </xsl:processing-instruction>
433 <xsl:template match="colspec"/>
435 <xsl:template match="spanspec"/>
437 <xsl:template match="thead|tfoot">
438 <xsl:element name="{name(.)}" namespace="http://www.w3.org/1999/xhtml">
439 <xsl:if test="@align">
440 <xsl:attribute name="align">
441 <xsl:value-of select="@align"/>
444 <xsl:if test="@char">
445 <xsl:attribute name="char">
446 <xsl:value-of select="@char"/>
449 <xsl:if test="@charoff">
450 <xsl:attribute name="charoff">
451 <xsl:value-of select="@charoff"/>
454 <xsl:if test="@valign">
455 <xsl:attribute name="valign">
456 <xsl:value-of select="@valign"/>
460 <xsl:apply-templates select="row[1]">
461 <xsl:with-param name="spans">
462 <xsl:call-template name="blank.spans">
463 <xsl:with-param name="cols" select="../@cols"/>
466 </xsl:apply-templates>
471 <xsl:template match="tbody">
473 <xsl:if test="@align">
474 <xsl:attribute name="align">
475 <xsl:value-of select="@align"/>
478 <xsl:if test="@char">
479 <xsl:attribute name="char">
480 <xsl:value-of select="@char"/>
483 <xsl:if test="@charoff">
484 <xsl:attribute name="charoff">
485 <xsl:value-of select="@charoff"/>
488 <xsl:if test="@valign">
489 <xsl:attribute name="valign">
490 <xsl:value-of select="@valign"/>
494 <xsl:apply-templates select="row[1]">
495 <xsl:with-param name="spans">
496 <xsl:call-template name="blank.spans">
497 <xsl:with-param name="cols" select="../@cols"/>
500 </xsl:apply-templates>
505 <xsl:template match="row">
506 <xsl:param name="spans"/>
508 <xsl:variable name="row-height">
509 <xsl:if test="processing-instruction('dbhtml')">
510 <xsl:call-template name="dbhtml-attribute">
511 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
512 <xsl:with-param name="attribute" select="'row-height'"/>
517 <xsl:variable name="bgcolor">
518 <xsl:if test="processing-instruction('dbhtml')">
519 <xsl:call-template name="dbhtml-attribute">
520 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
521 <xsl:with-param name="attribute" select="'bgcolor'"/>
526 <xsl:variable name="class">
527 <xsl:if test="processing-instruction('dbhtml')">
528 <xsl:call-template name="dbhtml-attribute">
529 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
530 <xsl:with-param name="attribute" select="'class'"/>
536 <xsl:call-template name="tr.attributes">
537 <xsl:with-param name="rownum">
538 <xsl:number from="tgroup" count="row"/>
542 <xsl:if test="$row-height != ''">
543 <xsl:attribute name="height">
544 <xsl:value-of select="$row-height"/>
548 <xsl:if test="$bgcolor != ''">
549 <xsl:attribute name="bgcolor">
550 <xsl:value-of select="$bgcolor"/>
554 <xsl:if test="$class != ''">
555 <xsl:attribute name="class">
556 <xsl:value-of select="$class"/>
560 <xsl:if test="$table.borders.with.css != 0">
561 <xsl:if test="@rowsep = 1 and following-sibling::row">
562 <xsl:attribute name="style">
563 <xsl:call-template name="border">
564 <xsl:with-param name="side" select="'bottom'"/>
570 <xsl:if test="@align">
571 <xsl:attribute name="align">
572 <xsl:value-of select="@align"/>
575 <xsl:if test="@char">
576 <xsl:attribute name="char">
577 <xsl:value-of select="@char"/>
580 <xsl:if test="@charoff">
581 <xsl:attribute name="charoff">
582 <xsl:value-of select="@charoff"/>
585 <xsl:if test="@valign">
586 <xsl:attribute name="valign">
587 <xsl:value-of select="@valign"/>
591 <xsl:apply-templates select="(entry|entrytbl)[1]">
592 <xsl:with-param name="spans" select="$spans"/>
593 </xsl:apply-templates>
596 <xsl:if test="following-sibling::row">
597 <xsl:variable name="nextspans">
598 <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
599 <xsl:with-param name="spans" select="$spans"/>
600 </xsl:apply-templates>
603 <xsl:apply-templates select="following-sibling::row[1]">
604 <xsl:with-param name="spans" select="$nextspans"/>
605 </xsl:apply-templates>
609 <xsl:template match="entry|entrytbl" name="entry">
610 <xsl:param name="col" select="1"/>
611 <xsl:param name="spans"/>
613 <xsl:variable name="cellgi">
615 <xsl:when test="ancestor::thead">th</xsl:when>
616 <xsl:when test="ancestor::tfoot">th</xsl:when>
617 <xsl:otherwise>td</xsl:otherwise>
621 <xsl:variable name="empty.cell" select="count(node()) = 0"/>
623 <xsl:variable name="named.colnum">
624 <xsl:call-template name="entry.colnum"/>
627 <xsl:variable name="entry.colnum">
629 <xsl:when test="$named.colnum > 0">
630 <xsl:value-of select="$named.colnum"/>
633 <xsl:value-of select="$col"/>
638 <xsl:variable name="entry.colspan">
640 <xsl:when test="@spanname or @namest">
641 <xsl:call-template name="calculate.colspan"/>
643 <xsl:otherwise>1</xsl:otherwise>
647 <xsl:variable name="following.spans">
648 <xsl:call-template name="calculate.following.spans">
649 <xsl:with-param name="colspan" select="$entry.colspan"/>
650 <xsl:with-param name="spans" select="$spans"/>
654 <xsl:variable name="rowsep">
656 <!-- If this is the last row, rowsep never applies. -->
657 <xsl:when test="ancestor::entrytbl and not (ancestor-or-self::row[1]/following-sibling::row)">
658 <xsl:value-of select="0"/>
660 <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row or ancestor-or-self::thead/following-sibling::tbody or ancestor-or-self::tbody/preceding-sibling::tfoot)">
661 <xsl:value-of select="0"/>
663 <xsl:when test="@morerows and not(@morerows < count(ancestor-or-self::row[1]/following-sibling::row))">
664 <xsl:value-of select="0"/>
667 <xsl:call-template name="inherited.table.attribute">
668 <xsl:with-param name="entry" select="."/>
669 <xsl:with-param name="colnum" select="$entry.colnum"/>
670 <xsl:with-param name="attribute" select="'rowsep'"/>
676 <xsl:variable name="colsep">
678 <!-- If this is the last column, colsep never applies. -->
679 <xsl:when test="$following.spans = ''">0</xsl:when>
681 <xsl:call-template name="inherited.table.attribute">
682 <xsl:with-param name="entry" select="."/>
683 <xsl:with-param name="colnum" select="$entry.colnum"/>
684 <xsl:with-param name="attribute" select="'colsep'"/>
690 <xsl:variable name="valign">
691 <xsl:call-template name="inherited.table.attribute">
692 <xsl:with-param name="entry" select="."/>
693 <xsl:with-param name="colnum" select="$entry.colnum"/>
694 <xsl:with-param name="attribute" select="'valign'"/>
698 <xsl:variable name="align">
699 <xsl:call-template name="inherited.table.attribute">
700 <xsl:with-param name="entry" select="."/>
701 <xsl:with-param name="colnum" select="$entry.colnum"/>
702 <xsl:with-param name="attribute" select="'align'"/>
706 <xsl:variable name="char">
707 <xsl:call-template name="inherited.table.attribute">
708 <xsl:with-param name="entry" select="."/>
709 <xsl:with-param name="colnum" select="$entry.colnum"/>
710 <xsl:with-param name="attribute" select="'char'"/>
714 <xsl:variable name="charoff">
715 <xsl:call-template name="inherited.table.attribute">
716 <xsl:with-param name="entry" select="."/>
717 <xsl:with-param name="colnum" select="$entry.colnum"/>
718 <xsl:with-param name="attribute" select="'charoff'"/>
723 <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
724 <xsl:call-template name="entry">
725 <xsl:with-param name="col" select="$col+1"/>
726 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
730 <xsl:when test="$entry.colnum > $col">
731 <xsl:call-template name="empty.table.cell"/>
732 <xsl:call-template name="entry">
733 <xsl:with-param name="col" select="$col+1"/>
734 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
739 <xsl:variable name="bgcolor">
740 <xsl:if test="processing-instruction('dbhtml')">
741 <xsl:call-template name="dbhtml-attribute">
742 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
743 <xsl:with-param name="attribute" select="'bgcolor'"/>
748 <xsl:element name="{$cellgi}" namespace="http://www.w3.org/1999/xhtml">
749 <xsl:if test="$bgcolor != ''">
750 <xsl:attribute name="bgcolor">
751 <xsl:value-of select="$bgcolor"/>
755 <xsl:if test="$entry.propagates.style != 0 and @role">
756 <xsl:attribute name="class">
757 <xsl:value-of select="@role"/>
761 <xsl:if test="$show.revisionflag and @revisionflag">
762 <xsl:attribute name="class">
763 <xsl:value-of select="@revisionflag"/>
767 <xsl:if test="$table.borders.with.css != 0">
768 <xsl:attribute name="style">
769 <xsl:if test="$colsep > 0">
770 <xsl:call-template name="border">
771 <xsl:with-param name="side" select="'right'"/>
774 <xsl:if test="$rowsep > 0">
775 <xsl:call-template name="border">
776 <xsl:with-param name="side" select="'bottom'"/>
782 <xsl:if test="@morerows > 0">
783 <xsl:attribute name="rowspan">
784 <xsl:value-of select="1+@morerows"/>
788 <xsl:if test="$entry.colspan > 1">
789 <xsl:attribute name="colspan">
790 <xsl:value-of select="$entry.colspan"/>
794 <xsl:if test="$align != ''">
795 <xsl:attribute name="align">
796 <xsl:value-of select="$align"/>
800 <xsl:if test="$valign != ''">
801 <xsl:attribute name="valign">
802 <xsl:value-of select="$valign"/>
806 <xsl:if test="$char != ''">
807 <xsl:attribute name="char">
808 <xsl:value-of select="$char"/>
812 <xsl:if test="$charoff != ''">
813 <xsl:attribute name="charoff">
814 <xsl:value-of select="$charoff"/>
818 <xsl:if test="not(preceding-sibling::*) and ancestor::row/@id">
819 <xsl:call-template name="anchor">
820 <xsl:with-param name="node" select="ancestor::row[1]"/>
824 <xsl:call-template name="anchor"/>
827 <xsl:when test="$empty.cell">
828 <xsl:text> </xsl:text>
830 <xsl:when test="self::entrytbl">
831 <xsl:call-template name="tgroup"/>
834 <xsl:apply-templates/>
840 <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
841 <xsl:apply-templates select="(following-sibling::entry |following-sibling::entrytbl)[1]">
842 <xsl:with-param name="col" select="$col+$entry.colspan"/>
843 <xsl:with-param name="spans" select="$following.spans"/>
844 </xsl:apply-templates>
847 <xsl:call-template name="finaltd">
848 <xsl:with-param name="spans" select="$following.spans"/>
849 <xsl:with-param name="col" select="$col+$entry.colspan"/>
857 <xsl:template match="entry|entrytbl" name="sentry" mode="span">
858 <xsl:param name="col" select="1"/>
859 <xsl:param name="spans"/>
861 <xsl:variable name="entry.colnum">
862 <xsl:call-template name="entry.colnum"/>
865 <xsl:variable name="entry.colspan">
867 <xsl:when test="@spanname or @namest">
868 <xsl:call-template name="calculate.colspan"/>
870 <xsl:otherwise>1</xsl:otherwise>
874 <xsl:variable name="following.spans">
875 <xsl:call-template name="calculate.following.spans">
876 <xsl:with-param name="colspan" select="$entry.colspan"/>
877 <xsl:with-param name="spans" select="$spans"/>
882 <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
883 <xsl:value-of select="substring-before($spans,':')-1"/>
884 <xsl:text>:</xsl:text>
885 <xsl:call-template name="sentry">
886 <xsl:with-param name="col" select="$col+1"/>
887 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
891 <xsl:when test="$entry.colnum > $col">
892 <xsl:text>0:</xsl:text>
893 <xsl:call-template name="sentry">
894 <xsl:with-param name="col" select="$col+$entry.colspan"/>
895 <xsl:with-param name="spans" select="$following.spans"/>
900 <xsl:call-template name="copy-string">
901 <xsl:with-param name="count" select="$entry.colspan"/>
902 <xsl:with-param name="string">
904 <xsl:when test="@morerows">
905 <xsl:value-of select="@morerows"/>
907 <xsl:otherwise>0</xsl:otherwise>
909 <xsl:text>:</xsl:text>
914 <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
915 <xsl:apply-templates select="(following-sibling::entry |following-sibling::entrytbl)[1]" mode="span">
916 <xsl:with-param name="col" select="$col+$entry.colspan"/>
917 <xsl:with-param name="spans" select="$following.spans"/>
918 </xsl:apply-templates>
921 <xsl:call-template name="sfinaltd">
922 <xsl:with-param name="spans" select="$following.spans"/>
930 <xsl:template name="generate.colgroup">
931 <xsl:param name="cols" select="1"/>
932 <xsl:param name="count" select="1"/>
934 <xsl:when test="$count > $cols"/>
936 <xsl:call-template name="generate.col">
937 <xsl:with-param name="countcol" select="$count"/>
939 <xsl:call-template name="generate.colgroup">
940 <xsl:with-param name="cols" select="$cols"/>
941 <xsl:with-param name="count" select="$count+1"/>
947 <xsl:template name="generate.col">
948 <xsl:param name="countcol">1</xsl:param>
949 <xsl:param name="colspecs" select="./colspec"/>
950 <xsl:param name="count">1</xsl:param>
951 <xsl:param name="colnum">1</xsl:param>
954 <xsl:when test="$count>count($colspecs)">
958 <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
959 <xsl:variable name="colspec.colnum">
961 <xsl:when test="$colspec/@colnum">
962 <xsl:value-of select="$colspec/@colnum"/>
965 <xsl:value-of select="$colnum"/>
971 <xsl:when test="$colspec.colnum=$countcol">
973 <xsl:if test="$colspec/@colwidth and $use.extensions != 0 and $tablecolumns.extension != 0">
974 <xsl:attribute name="width">
976 <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
977 <xsl:value-of select="'1*'"/>
980 <xsl:value-of select="$colspec/@colwidth"/>
987 <xsl:when test="$colspec/@align">
988 <xsl:attribute name="align">
989 <xsl:value-of select="$colspec/@align"/>
992 <!-- Suggested by Pavel ZAMPACH <zampach@nemcb.cz> -->
993 <xsl:when test="$colspecs/ancestor::tgroup/@align">
994 <xsl:attribute name="align">
995 <xsl:value-of select="$colspecs/ancestor::tgroup/@align"/>
1000 <xsl:if test="$colspec/@char">
1001 <xsl:attribute name="char">
1002 <xsl:value-of select="$colspec/@char"/>
1005 <xsl:if test="$colspec/@charoff">
1006 <xsl:attribute name="charoff">
1007 <xsl:value-of select="$colspec/@charoff"/>
1013 <xsl:call-template name="generate.col">
1014 <xsl:with-param name="countcol" select="$countcol"/>
1015 <xsl:with-param name="colspecs" select="$colspecs"/>
1016 <xsl:with-param name="count" select="$count+1"/>
1017 <xsl:with-param name="colnum">
1019 <xsl:when test="$colspec/@colnum">
1020 <xsl:value-of select="$colspec/@colnum + 1"/>
1023 <xsl:value-of select="$colnum + 1"/>
1027 </xsl:call-template>
1034 <xsl:template name="colspec.colwidth">
1035 <!-- when this macro is called, the current context must be an entry -->
1036 <xsl:param name="colname"/>
1037 <!-- .. = row, ../.. = thead|tbody, ../../.. = tgroup -->
1038 <xsl:param name="colspecs" select="../../../../tgroup/colspec"/>
1039 <xsl:param name="count">1</xsl:param>
1041 <xsl:when test="$count>count($colspecs)"/>
1043 <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
1045 <xsl:when test="$colspec/@colname=$colname">
1046 <xsl:value-of select="$colspec/@colwidth"/>
1049 <xsl:call-template name="colspec.colwidth">
1050 <xsl:with-param name="colname" select="$colname"/>
1051 <xsl:with-param name="colspecs" select="$colspecs"/>
1052 <xsl:with-param name="count" select="$count+1"/>
1053 </xsl:call-template>
1060 <!-- ====================================================================== -->
1062 <xsl:template name="tr.attributes">
1063 <xsl:param name="row" select="."/>
1064 <xsl:param name="rownum" select="0"/>
1066 <!-- by default, do nothing. But you might want to say:
1068 <xsl:if test="$rownum mod 2 = 0">
1069 <xsl:attribute name="class">oddrow</xsl:attribute>