1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table" xmlns:xtbl="xalan://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 <!-- ********************************************************************
9 $Id: table.xsl 9978 2015-07-31 23:47:28Z bobstayton $
10 ********************************************************************
12 This file is part of the XSL DocBook Stylesheet distribution.
13 See ../README or http://docbook.sf.net/release/xsl/current/ for
14 copyright 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="number($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) or @cols = '' or string(number(@cols)) = 'NaN'">
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="pi.dbhtml_table-summary"/>
141 <xsl:variable name="cellspacing">
142 <xsl:call-template name="pi.dbhtml_cellspacing"/>
145 <xsl:variable name="cellpadding">
146 <xsl:call-template name="pi.dbhtml_cellpadding"/>
150 <!-- common attributes should come from parent table, not tgroup -->
151 <xsl:apply-templates select=".." mode="common.html.attributes"/>
154 <!-- If there's a textobject/phrase for the table summary, use it -->
155 <xsl:when test="../textobject/phrase">
156 <xsl:attribute name="summary">
157 <xsl:value-of select="../textobject/phrase"/>
161 <!-- If there's a <?dbhtml table-summary="foo"?> PI, use it for
162 the HTML table summary attribute -->
163 <xsl:when test="$summary != ''">
164 <xsl:attribute name="summary">
165 <xsl:value-of select="$summary"/>
169 <!-- Otherwise, if there's a title, use that -->
170 <xsl:when test="../title">
171 <xsl:attribute name="summary">
172 <!-- This screws up on inline markup and footnotes, oh well... -->
173 <xsl:value-of select="string(../title)"/>
177 <!-- Otherwise, forget the whole idea -->
178 <xsl:otherwise><!-- nevermind --></xsl:otherwise>
181 <xsl:if test="$cellspacing != '' or $html.cellspacing != ''">
182 <xsl:attribute name="cellspacing">
184 <xsl:when test="$cellspacing != ''">
185 <xsl:value-of select="$cellspacing"/>
188 <xsl:value-of select="$html.cellspacing"/>
194 <xsl:if test="$cellpadding != '' or $html.cellpadding != ''">
195 <xsl:attribute name="cellpadding">
197 <xsl:when test="$cellpadding != ''">
198 <xsl:value-of select="$cellpadding"/>
201 <xsl:value-of select="$html.cellpadding"/>
207 <xsl:if test="../@pgwide=1 or local-name(.) = 'entrytbl'">
208 <xsl:attribute name="width">100%</xsl:attribute>
212 <xsl:when test="$table.borders.with.css != 0">
214 <xsl:when test="../@frame='all' or (not(../@frame) and $default.table.frame='all')">
215 <xsl:attribute name="style">
216 <xsl:text>border-collapse: collapse;</xsl:text>
217 <xsl:call-template name="border">
218 <xsl:with-param name="side" select="'top'"/>
219 <xsl:with-param name="style" select="$table.frame.border.style"/>
220 <xsl:with-param name="color" select="$table.frame.border.color"/>
221 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
223 <xsl:call-template name="border">
224 <xsl:with-param name="side" select="'bottom'"/>
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="'left'"/>
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="'right'"/>
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"/>
243 <xsl:when test="../@frame='topbot' or (not(../@frame) and $default.table.frame='topbot')">
244 <xsl:attribute name="style">
245 <xsl:text>border-collapse: collapse;</xsl:text>
246 <xsl:call-template name="border">
247 <xsl:with-param name="side" select="'top'"/>
248 <xsl:with-param name="style" select="$table.frame.border.style"/>
249 <xsl:with-param name="color" select="$table.frame.border.color"/>
250 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
252 <xsl:call-template name="border">
253 <xsl:with-param name="side" select="'bottom'"/>
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"/>
260 <xsl:when test="../@frame='top' or (not(../@frame) and $default.table.frame='top')">
261 <xsl:attribute name="style">
262 <xsl:text>border-collapse: collapse;</xsl:text>
263 <xsl:call-template name="border">
264 <xsl:with-param name="side" select="'top'"/>
265 <xsl:with-param name="style" select="$table.frame.border.style"/>
266 <xsl:with-param name="color" select="$table.frame.border.color"/>
267 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
271 <xsl:when test="../@frame='bottom' or (not(../@frame) and $default.table.frame='bottom')">
272 <xsl:attribute name="style">
273 <xsl:text>border-collapse: collapse;</xsl:text>
274 <xsl:call-template name="border">
275 <xsl:with-param name="side" select="'bottom'"/>
276 <xsl:with-param name="style" select="$table.frame.border.style"/>
277 <xsl:with-param name="color" select="$table.frame.border.color"/>
278 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
282 <xsl:when test="../@frame='sides' or (not(../@frame) and $default.table.frame='sides')">
283 <xsl:attribute name="style">
284 <xsl:text>border-collapse: collapse;</xsl:text>
285 <xsl:call-template name="border">
286 <xsl:with-param name="side" select="'left'"/>
287 <xsl:with-param name="style" select="$table.frame.border.style"/>
288 <xsl:with-param name="color" select="$table.frame.border.color"/>
289 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
291 <xsl:call-template name="border">
292 <xsl:with-param name="side" select="'right'"/>
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"/>
299 <xsl:when test="../@frame='none'">
300 <xsl:attribute name="style">
301 <xsl:text>border: none;</xsl:text>
305 <xsl:attribute name="style">
306 <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="pi.dbhtml_table-width">
330 <xsl:with-param name="node" select=".."/>
334 <xsl:variable name="table.width">
336 <xsl:when test="$explicit.table.width != ''">
337 <xsl:value-of select="$explicit.table.width"/>
339 <xsl:when test="$default.table.width = ''">
340 <xsl:text>100%</xsl:text>
343 <xsl:value-of select="$default.table.width"/>
348 <xsl:if test="$default.table.width != '' or $explicit.table.width != ''">
349 <xsl:attribute name="width">
351 <xsl:when test="contains($table.width, '%')">
352 <xsl:value-of select="$table.width"/>
354 <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
356 <xsl:when test="function-available('stbl:convertLength')">
357 <xsl:value-of select="stbl:convertLength($table.width)"/>
359 <xsl:when test="function-available('xtbl:convertLength')">
360 <xsl:value-of select="xtbl:convertLength($table.width)"/>
363 <xsl:message terminate="yes">
364 <xsl:text>No convertLength function available.</xsl:text>
370 <xsl:value-of select="$table.width"/>
377 <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
379 <xsl:when test="function-available('stbl:adjustColumnWidths')">
380 <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
382 <xsl:when test="function-available('xtbl:adjustColumnWidths')">
383 <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/>
385 <xsl:when test="function-available('ptbl:adjustColumnWidths')">
386 <xsl:copy-of select="ptbl:adjustColumnWidths($colgroup)"/>
389 <xsl:message terminate="yes">
390 <xsl:text>No adjustColumnWidths function available.</xsl:text>
396 <xsl:copy-of select="$colgroup"/>
400 <xsl:apply-templates select="thead"/>
401 <xsl:apply-templates select="tfoot"/>
402 <xsl:apply-templates select="tbody"/>
404 <xsl:if test=".//footnote|../title//footnote">
405 <tbody class="footnotes">
407 <td colspan="{@cols}">
408 <xsl:apply-templates select=".//footnote|../title//footnote" mode="table.footnote.mode"/>
416 <xsl:template match="tgroup/processing-instruction('dbhtml')">
417 <xsl:variable name="summary">
418 <xsl:call-template name="pi.dbhtml_table-summary"/>
421 <!-- Suppress the table-summary PI -->
422 <xsl:if test="$summary = ''">
423 <xsl:processing-instruction name="dbhtml">
424 <xsl:value-of select="."/>
425 </xsl:processing-instruction>
429 <xsl:template match="colspec"/>
431 <xsl:template match="spanspec"/>
433 <xsl:template match="thead|tfoot">
434 <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
435 <xsl:if test="@align">
436 <xsl:attribute name="align">
437 <xsl:value-of select="@align"/>
440 <xsl:if test="@char">
441 <xsl:attribute name="char">
442 <xsl:value-of select="@char"/>
445 <xsl:if test="@charoff">
446 <xsl:attribute name="charoff">
447 <xsl:value-of select="@charoff"/>
450 <xsl:if test="@valign">
451 <xsl:attribute name="valign">
452 <xsl:value-of select="@valign"/>
457 <!-- recurse on rows only if @morerows is present -->
458 <xsl:when test="row/entry/@morerows|row/entrytbl/@morerows">
459 <xsl:apply-templates select="row[1]">
460 <xsl:with-param name="spans">
461 <xsl:call-template name="blank.spans">
462 <xsl:with-param name="cols" select="../@cols"/>
465 <xsl:with-param name="browserows" select="'recurse'"/>
466 </xsl:apply-templates>
469 <xsl:apply-templates select="row">
470 <xsl:with-param name="spans">
471 <xsl:call-template name="blank.spans">
472 <xsl:with-param name="cols" select="../@cols"/>
475 <xsl:with-param name="browserows" select="'loop'"/>
476 </xsl:apply-templates>
483 <xsl:template match="tbody">
485 <xsl:if test="@align">
486 <xsl:attribute name="align">
487 <xsl:value-of select="@align"/>
490 <xsl:if test="@char">
491 <xsl:attribute name="char">
492 <xsl:value-of select="@char"/>
495 <xsl:if test="@charoff">
496 <xsl:attribute name="charoff">
497 <xsl:value-of select="@charoff"/>
500 <xsl:if test="@valign">
501 <xsl:attribute name="valign">
502 <xsl:value-of select="@valign"/>
507 <xsl:when test="row/entry/@morerows|row/entrytbl/@morerows">
508 <xsl:apply-templates select="row[1]">
509 <xsl:with-param name="spans">
510 <xsl:call-template name="blank.spans">
511 <xsl:with-param name="cols" select="../@cols"/>
514 <xsl:with-param name="browserows" select="'recurse'"/>
515 </xsl:apply-templates>
518 <xsl:apply-templates select="row">
519 <xsl:with-param name="spans">
520 <xsl:call-template name="blank.spans">
521 <xsl:with-param name="cols" select="../@cols"/>
524 <xsl:with-param name="browserows" select="'loop'"/>
525 </xsl:apply-templates>
532 <xsl:template match="row">
533 <xsl:param name="spans"/>
534 <xsl:param name="browserows"/>
537 <xsl:when test="contains($spans, '0')">
538 <xsl:call-template name="normal-row">
539 <xsl:with-param name="spans" select="$spans"/>
540 <xsl:with-param name="browserows" select="$browserows"/>
546 <xsl:text>Ignoring row: </xsl:text>
547 <xsl:value-of select="$spans"/>
548 <xsl:text> = </xsl:text>
549 <xsl:call-template name="consume-row">
550 <xsl:with-param name="spans" select="$spans"/>
555 <xsl:if test="normalize-space(.//text()) != ''">
556 <xsl:message>Warning: overlapped row contains content!</xsl:message>
559 <tr><xsl:comment> This row intentionally left blank </xsl:comment></tr>
561 <xsl:if test="$browserows = 'recurse'">
562 <xsl:apply-templates select="following-sibling::row[1]">
563 <xsl:with-param name="spans">
564 <xsl:call-template name="consume-row">
565 <xsl:with-param name="spans" select="$spans"/>
568 <xsl:with-param name="browserows" select="$browserows"/>
569 </xsl:apply-templates>
575 <xsl:template name="normal-row">
576 <xsl:param name="spans"/>
577 <xsl:param name="browserows"/>
579 <xsl:variable name="row-height">
580 <xsl:if test="processing-instruction('dbhtml')">
581 <xsl:call-template name="pi.dbhtml_row-height"/>
585 <xsl:variable name="bgcolor">
586 <xsl:if test="processing-instruction('dbhtml')">
587 <xsl:call-template name="pi.dbhtml_bgcolor"/>
591 <xsl:variable name="class">
592 <xsl:if test="processing-instruction('dbhtml')">
593 <xsl:call-template name="pi.dbhtml_class"/>
598 <xsl:call-template name="id.attribute"/>
599 <xsl:call-template name="tr.attributes">
600 <xsl:with-param name="rownum">
601 <xsl:number from="tgroup" count="row"/>
605 <xsl:if test="$row-height != ''">
606 <xsl:attribute name="height">
607 <xsl:value-of select="$row-height"/>
611 <xsl:if test="$bgcolor != ''">
612 <xsl:attribute name="bgcolor">
613 <xsl:value-of select="$bgcolor"/>
617 <xsl:if test="$class != ''">
618 <xsl:attribute name="class">
619 <xsl:value-of select="$class"/>
623 <xsl:if test="$table.borders.with.css != 0">
624 <xsl:if test="@rowsep = 1 and following-sibling::row">
625 <xsl:attribute name="style">
626 <xsl:call-template name="border">
627 <xsl:with-param name="side" select="'bottom'"/>
633 <xsl:if test="@align">
634 <xsl:attribute name="align">
635 <xsl:value-of select="@align"/>
638 <xsl:if test="@char">
639 <xsl:attribute name="char">
640 <xsl:value-of select="@char"/>
643 <xsl:if test="@charoff">
644 <xsl:attribute name="charoff">
645 <xsl:value-of select="@charoff"/>
648 <xsl:if test="@valign">
649 <xsl:attribute name="valign">
650 <xsl:value-of select="@valign"/>
654 <xsl:apply-templates select="(entry|entrytbl)[1]">
655 <xsl:with-param name="spans" select="$spans"/>
656 </xsl:apply-templates>
659 <xsl:if test="$browserows = 'recurse'">
660 <xsl:if test="following-sibling::row">
661 <xsl:variable name="nextspans">
662 <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
663 <xsl:with-param name="spans" select="$spans"/>
664 </xsl:apply-templates>
667 <xsl:apply-templates select="following-sibling::row[1]">
668 <xsl:with-param name="spans" select="$nextspans"/>
669 <xsl:with-param name="browserows" select="$browserows"/>
670 </xsl:apply-templates>
675 <xsl:template match="entry|entrytbl" name="entry">
676 <xsl:param name="col">
678 <xsl:when test="@revisionflag">
679 <xsl:number from="row"/>
681 <xsl:otherwise>1</xsl:otherwise>
685 <xsl:param name="spans"/>
687 <xsl:variable name="empty.cell" select="count(node()) = 0"/>
689 <xsl:variable name="named.colnum">
690 <xsl:call-template name="entry.colnum"/>
693 <xsl:variable name="entry.colnum">
695 <xsl:when test="$named.colnum > 0">
696 <xsl:value-of select="$named.colnum"/>
699 <xsl:value-of select="$col"/>
704 <xsl:variable name="entry.colspan">
706 <xsl:when test="@spanname or @namest">
707 <xsl:call-template name="calculate.colspan"/>
709 <xsl:otherwise>1</xsl:otherwise>
713 <xsl:variable name="following.spans">
714 <xsl:call-template name="calculate.following.spans">
715 <xsl:with-param name="colspan" select="$entry.colspan"/>
716 <xsl:with-param name="spans" select="$spans"/>
720 <xsl:variable name="cellgi">
722 <xsl:when test="ancestor::thead">th</xsl:when>
723 <xsl:when test="ancestor::tfoot">th</xsl:when>
724 <xsl:when test="ancestor::tbody and (ancestor::table[@rowheader = 'firstcol'] or ancestor::informaltable[@rowheader = 'firstcol']) and $entry.colnum = 1">
725 <xsl:text>th</xsl:text>
727 <xsl:otherwise>td</xsl:otherwise>
731 <xsl:variable name="rowsep">
733 <!-- If this is the last row, rowsep never applies. -->
734 <xsl:when test="ancestor::entrytbl and not (ancestor-or-self::row[1]/following-sibling::row) and not (ancestor::thead)">
735 <xsl:value-of select="0"/>
737 <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)">
738 <xsl:value-of select="0"/>
740 <!-- not last row with @morerows (thead is not last row) -->
741 <xsl:when test="not(ancestor::thead) and @morerows and not(@morerows < count(ancestor-or-self::row[1]/following-sibling::row))">
742 <xsl:value-of select="0"/>
745 <xsl:call-template name="inherited.table.attribute">
746 <xsl:with-param name="entry" select="."/>
747 <xsl:with-param name="colnum" select="$entry.colnum"/>
748 <xsl:with-param name="attribute" select="'rowsep'"/>
754 <xsl:variable name="colsep">
756 <!-- If this is the last column, colsep never applies. -->
757 <xsl:when test="$following.spans = ''">0</xsl:when>
759 <xsl:call-template name="inherited.table.attribute">
760 <xsl:with-param name="entry" select="."/>
761 <xsl:with-param name="colnum" select="$entry.colnum"/>
762 <xsl:with-param name="attribute" select="'colsep'"/>
768 <xsl:variable name="valign">
769 <xsl:call-template name="inherited.table.attribute">
770 <xsl:with-param name="entry" select="."/>
771 <xsl:with-param name="colnum" select="$entry.colnum"/>
772 <xsl:with-param name="attribute" select="'valign'"/>
776 <xsl:variable name="align">
777 <xsl:call-template name="inherited.table.attribute">
778 <xsl:with-param name="entry" select="."/>
779 <xsl:with-param name="colnum" select="$entry.colnum"/>
780 <xsl:with-param name="attribute" select="'align'"/>
784 <xsl:variable name="char">
785 <xsl:call-template name="inherited.table.attribute">
786 <xsl:with-param name="entry" select="."/>
787 <xsl:with-param name="colnum" select="$entry.colnum"/>
788 <xsl:with-param name="attribute" select="'char'"/>
792 <xsl:variable name="charoff">
793 <xsl:call-template name="inherited.table.attribute">
794 <xsl:with-param name="entry" select="."/>
795 <xsl:with-param name="colnum" select="$entry.colnum"/>
796 <xsl:with-param name="attribute" select="'charoff'"/>
801 <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
802 <xsl:call-template name="entry">
803 <xsl:with-param name="col" select="$col+1"/>
804 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
808 <xsl:when test="number($entry.colnum) > $col">
809 <xsl:call-template name="empty.table.cell"/>
810 <xsl:call-template name="entry">
811 <xsl:with-param name="col" select="$col+1"/>
812 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
817 <xsl:variable name="bgcolor">
818 <xsl:if test="processing-instruction('dbhtml')">
819 <xsl:call-template name="pi.dbhtml_bgcolor"/>
823 <xsl:element name="{$cellgi}" namespace="http://www.w3.org/1999/xhtml">
824 <xsl:call-template name="id.attribute"/>
825 <xsl:if test="$bgcolor != ''">
826 <xsl:attribute name="bgcolor">
827 <xsl:value-of select="$bgcolor"/>
831 <xsl:call-template name="locale.html.attributes"/>
833 <xsl:when test="$entry.propagates.style != 0 and @role">
834 <xsl:apply-templates select="." mode="class.attribute">
835 <xsl:with-param name="class" select="@role"/>
836 </xsl:apply-templates>
839 <xsl:apply-templates select="." mode="class.attribute">
840 <xsl:with-param name="class" select="''"/>
841 </xsl:apply-templates>
845 <xsl:if test="$show.revisionflag and @revisionflag">
846 <xsl:attribute name="class">
847 <xsl:value-of select="@revisionflag"/>
851 <xsl:if test="$table.borders.with.css != 0">
852 <xsl:attribute name="style">
853 <xsl:if test="$colsep > 0">
854 <xsl:call-template name="border">
855 <xsl:with-param name="side" select="'right'"/>
858 <xsl:if test="$rowsep > 0">
859 <xsl:call-template name="border">
860 <xsl:with-param name="side" select="'bottom'"/>
866 <xsl:if test="@morerows > 0">
867 <xsl:attribute name="rowspan">
868 <xsl:value-of select="1+@morerows"/>
872 <xsl:if test="$entry.colspan > 1">
873 <xsl:attribute name="colspan">
874 <xsl:value-of select="$entry.colspan"/>
878 <xsl:if test="$align != ''">
879 <xsl:attribute name="align">
880 <xsl:value-of select="$align"/>
884 <xsl:if test="$valign != ''">
885 <xsl:attribute name="valign">
886 <xsl:value-of select="$valign"/>
890 <xsl:if test="$char != ''">
891 <xsl:attribute name="char">
892 <xsl:value-of select="$char"/>
896 <xsl:if test="$charoff != ''">
897 <xsl:attribute name="charoff">
898 <xsl:value-of select="$charoff"/>
902 <xsl:if test="not(preceding-sibling::*) and (ancestor::row[1]/@id or ancestor::row[1]/@xml:id)">
903 <xsl:call-template name="anchor">
904 <xsl:with-param name="node" select="ancestor::row[1]"/>
908 <xsl:call-template name="anchor"/>
911 <xsl:when test="$empty.cell">
912 <xsl:text> </xsl:text>
914 <xsl:when test="self::entrytbl">
915 <xsl:call-template name="tgroup"/>
918 <xsl:apply-templates/>
924 <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
925 <xsl:apply-templates select="(following-sibling::entry |following-sibling::entrytbl)[1]">
926 <xsl:with-param name="col" select="$col+$entry.colspan"/>
927 <xsl:with-param name="spans" select="$following.spans"/>
928 </xsl:apply-templates>
931 <xsl:call-template name="finaltd">
932 <xsl:with-param name="spans" select="$following.spans"/>
933 <xsl:with-param name="col" select="$col+$entry.colspan"/>
941 <xsl:template match="entry|entrytbl" name="sentry" mode="span">
942 <xsl:param name="col" select="1"/>
943 <xsl:param name="spans"/>
945 <xsl:variable name="entry.colnum">
946 <xsl:call-template name="entry.colnum"/>
949 <xsl:variable name="entry.colspan">
951 <xsl:when test="@spanname or @namest">
952 <xsl:call-template name="calculate.colspan"/>
954 <xsl:otherwise>1</xsl:otherwise>
958 <xsl:variable name="following.spans">
959 <xsl:call-template name="calculate.following.spans">
960 <xsl:with-param name="colspan" select="$entry.colspan"/>
961 <xsl:with-param name="spans" select="$spans"/>
966 <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
967 <xsl:value-of select="substring-before($spans,':')-1"/>
968 <xsl:text>:</xsl:text>
969 <xsl:call-template name="sentry">
970 <xsl:with-param name="col" select="$col+1"/>
971 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
975 <xsl:when test="number($entry.colnum) > $col">
976 <xsl:text>0:</xsl:text>
977 <xsl:call-template name="sentry">
978 <xsl:with-param name="col" select="$col + 1"/>
979 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
984 <xsl:call-template name="copy-string">
985 <xsl:with-param name="count" select="$entry.colspan"/>
986 <xsl:with-param name="string">
988 <xsl:when test="@morerows">
989 <xsl:value-of select="@morerows"/>
991 <xsl:otherwise>0</xsl:otherwise>
993 <xsl:text>:</xsl:text>
998 <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
999 <xsl:apply-templates select="(following-sibling::entry |following-sibling::entrytbl)[1]" mode="span">
1000 <xsl:with-param name="col" select="$col+$entry.colspan"/>
1001 <xsl:with-param name="spans" select="$following.spans"/>
1002 </xsl:apply-templates>
1005 <xsl:call-template name="sfinaltd">
1006 <xsl:with-param name="spans" select="$following.spans"/>
1007 </xsl:call-template>
1014 <xsl:template name="generate.colgroup">
1015 <xsl:param name="cols" select="1"/>
1016 <xsl:param name="count" select="1"/>
1018 <xsl:when test="$count > $cols"/>
1020 <xsl:call-template name="generate.col">
1021 <xsl:with-param name="countcol" select="$count"/>
1022 </xsl:call-template>
1023 <xsl:call-template name="generate.colgroup">
1024 <xsl:with-param name="cols" select="$cols"/>
1025 <xsl:with-param name="count" select="$count+1"/>
1026 </xsl:call-template>
1031 <xsl:template name="generate.col">
1032 <xsl:param name="countcol">1</xsl:param>
1033 <xsl:param name="colspecs" select="./colspec"/>
1034 <xsl:param name="count">1</xsl:param>
1035 <xsl:param name="colnum">1</xsl:param>
1038 <xsl:when test="$count>count($colspecs)">
1042 <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
1043 <xsl:variable name="colspec.colnum">
1045 <xsl:when test="$colspec/@colnum">
1046 <xsl:value-of select="$colspec/@colnum"/>
1049 <xsl:value-of select="$colnum"/>
1055 <xsl:when test="$colspec.colnum=$countcol">
1058 <xsl:when test="$colspec/@colwidth and $use.extensions != 0 and $tablecolumns.extension != 0">
1059 <xsl:attribute name="width">
1061 <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
1062 <xsl:value-of select="'1*'"/>
1065 <xsl:value-of select="$colspec/@colwidth"/>
1070 <!-- pass through to HTML if no * in colspecs -->
1071 <xsl:when test="$colspec/@colwidth and not($colspec/parent::*/colspec/@colwidth[contains(.,'*')])">
1072 <xsl:attribute name="width">
1074 <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
1075 <xsl:value-of select="'1*'"/>
1078 <xsl:value-of select="$colspec/@colwidth"/>
1086 <xsl:when test="$colspec/@align">
1087 <xsl:attribute name="align">
1088 <xsl:value-of select="$colspec/@align"/>
1091 <!-- Suggested by Pavel ZAMPACH <zampach@nemcb.cz> -->
1092 <xsl:when test="$colspecs/ancestor::tgroup/@align">
1093 <xsl:attribute name="align">
1094 <xsl:value-of select="$colspecs/ancestor::tgroup/@align"/>
1099 <xsl:if test="$colspec/@char">
1100 <xsl:attribute name="char">
1101 <xsl:value-of select="$colspec/@char"/>
1105 <xsl:if test="$colspec/@charoff">
1106 <xsl:attribute name="charoff">
1107 <xsl:value-of select="$colspec/@charoff"/>
1111 <xsl:if test="$colspec/@colname">
1112 <xsl:attribute name="class">
1113 <xsl:value-of select="$colspec/@colname"/>
1119 <xsl:call-template name="generate.col">
1120 <xsl:with-param name="countcol" select="$countcol"/>
1121 <xsl:with-param name="colspecs" select="$colspecs"/>
1122 <xsl:with-param name="count" select="$count+1"/>
1123 <xsl:with-param name="colnum">
1125 <xsl:when test="$colspec/@colnum">
1126 <xsl:value-of select="$colspec/@colnum + 1"/>
1129 <xsl:value-of select="$colnum + 1"/>
1133 </xsl:call-template>
1140 <xsl:template name="colspec.colwidth">
1141 <!-- when this macro is called, the current context must be an entry -->
1142 <xsl:param name="colname"/>
1143 <!-- .. = row, ../.. = thead|tbody, ../../.. = tgroup -->
1144 <xsl:param name="colspecs" select="../../../../tgroup/colspec"/>
1145 <xsl:param name="count">1</xsl:param>
1147 <xsl:when test="$count>count($colspecs)"/>
1149 <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
1151 <xsl:when test="$colspec/@colname=$colname">
1152 <xsl:value-of select="$colspec/@colwidth"/>
1155 <xsl:call-template name="colspec.colwidth">
1156 <xsl:with-param name="colname" select="$colname"/>
1157 <xsl:with-param name="colspecs" select="$colspecs"/>
1158 <xsl:with-param name="count" select="$count+1"/>
1159 </xsl:call-template>
1166 <!-- ====================================================================== -->
1168 <xsl:template name="tr.attributes">
1169 <xsl:param name="row" select="."/>
1170 <xsl:param name="rownum" select="0"/>
1172 <!-- by default, do nothing. But you might want to say:
1174 <xsl:if test="$rownum mod 2 = 0">
1175 <xsl:attribute name="class">oddrow</xsl:attribute>