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 8421 2009-05-04 07:49:49Z 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"/>
151 <!-- If there's a textobject/phrase for the table summary, use it -->
152 <xsl:when test="../textobject/phrase">
153 <xsl:attribute name="summary">
154 <xsl:value-of select="../textobject/phrase"/>
158 <!-- If there's a <?dbhtml table-summary="foo"?> PI, use it for
159 the HTML table summary attribute -->
160 <xsl:when test="$summary != ''">
161 <xsl:attribute name="summary">
162 <xsl:value-of select="$summary"/>
166 <!-- Otherwise, if there's a title, use that -->
167 <xsl:when test="../title">
168 <xsl:attribute name="summary">
169 <!-- This screws up on inline markup and footnotes, oh well... -->
170 <xsl:value-of select="string(../title)"/>
174 <!-- Otherwise, forget the whole idea -->
175 <xsl:otherwise><!-- nevermind --></xsl:otherwise>
178 <xsl:if test="$cellspacing != '' or $html.cellspacing != ''">
179 <xsl:attribute name="cellspacing">
181 <xsl:when test="$cellspacing != ''">
182 <xsl:value-of select="$cellspacing"/>
185 <xsl:value-of select="$html.cellspacing"/>
191 <xsl:if test="$cellpadding != '' or $html.cellpadding != ''">
192 <xsl:attribute name="cellpadding">
194 <xsl:when test="$cellpadding != ''">
195 <xsl:value-of select="$cellpadding"/>
198 <xsl:value-of select="$html.cellpadding"/>
204 <xsl:if test="../@pgwide=1 or local-name(.) = 'entrytbl'">
205 <xsl:attribute name="width">100%</xsl:attribute>
209 <xsl:when test="$table.borders.with.css != 0">
211 <xsl:when test="../@frame='all' or (not(../@frame) and $default.table.frame='all')">
212 <xsl:attribute name="style">
213 <xsl:text>border-collapse: collapse;</xsl:text>
214 <xsl:call-template name="border">
215 <xsl:with-param name="side" select="'top'"/>
216 <xsl:with-param name="style" select="$table.frame.border.style"/>
217 <xsl:with-param name="color" select="$table.frame.border.color"/>
218 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
220 <xsl:call-template name="border">
221 <xsl:with-param name="side" select="'bottom'"/>
222 <xsl:with-param name="style" select="$table.frame.border.style"/>
223 <xsl:with-param name="color" select="$table.frame.border.color"/>
224 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
226 <xsl:call-template name="border">
227 <xsl:with-param name="side" select="'left'"/>
228 <xsl:with-param name="style" select="$table.frame.border.style"/>
229 <xsl:with-param name="color" select="$table.frame.border.color"/>
230 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
232 <xsl:call-template name="border">
233 <xsl:with-param name="side" select="'right'"/>
234 <xsl:with-param name="style" select="$table.frame.border.style"/>
235 <xsl:with-param name="color" select="$table.frame.border.color"/>
236 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
240 <xsl:when test="../@frame='topbot' or (not(../@frame) and $default.table.frame='topbot')">
241 <xsl:attribute name="style">
242 <xsl:text>border-collapse: collapse;</xsl:text>
243 <xsl:call-template name="border">
244 <xsl:with-param name="side" select="'top'"/>
245 <xsl:with-param name="style" select="$table.frame.border.style"/>
246 <xsl:with-param name="color" select="$table.frame.border.color"/>
247 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
249 <xsl:call-template name="border">
250 <xsl:with-param name="side" select="'bottom'"/>
251 <xsl:with-param name="style" select="$table.frame.border.style"/>
252 <xsl:with-param name="color" select="$table.frame.border.color"/>
253 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
257 <xsl:when test="../@frame='top' or (not(../@frame) and $default.table.frame='top')">
258 <xsl:attribute name="style">
259 <xsl:text>border-collapse: collapse;</xsl:text>
260 <xsl:call-template name="border">
261 <xsl:with-param name="side" select="'top'"/>
262 <xsl:with-param name="style" select="$table.frame.border.style"/>
263 <xsl:with-param name="color" select="$table.frame.border.color"/>
264 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
268 <xsl:when test="../@frame='bottom' or (not(../@frame) and $default.table.frame='bottom')">
269 <xsl:attribute name="style">
270 <xsl:text>border-collapse: collapse;</xsl:text>
271 <xsl:call-template name="border">
272 <xsl:with-param name="side" select="'bottom'"/>
273 <xsl:with-param name="style" select="$table.frame.border.style"/>
274 <xsl:with-param name="color" select="$table.frame.border.color"/>
275 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
279 <xsl:when test="../@frame='sides' or (not(../@frame) and $default.table.frame='sides')">
280 <xsl:attribute name="style">
281 <xsl:text>border-collapse: collapse;</xsl:text>
282 <xsl:call-template name="border">
283 <xsl:with-param name="side" select="'left'"/>
284 <xsl:with-param name="style" select="$table.frame.border.style"/>
285 <xsl:with-param name="color" select="$table.frame.border.color"/>
286 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
288 <xsl:call-template name="border">
289 <xsl:with-param name="side" select="'right'"/>
290 <xsl:with-param name="style" select="$table.frame.border.style"/>
291 <xsl:with-param name="color" select="$table.frame.border.color"/>
292 <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
296 <xsl:when test="../@frame='none'">
297 <xsl:attribute name="style">
298 <xsl:text>border: none;</xsl:text>
302 <xsl:attribute name="style">
303 <xsl:text>border-collapse: collapse;</xsl:text>
309 <xsl:when test="../@frame='none' or (not(../@frame) and $default.table.frame='none') or local-name(.) = 'entrytbl'">
310 <xsl:attribute name="border">0</xsl:attribute>
313 <xsl:attribute name="border">1</xsl:attribute>
317 <xsl:variable name="colgroup">
319 <xsl:call-template name="generate.colgroup">
320 <xsl:with-param name="cols" select="@cols"/>
325 <xsl:variable name="explicit.table.width">
326 <xsl:call-template name="pi.dbhtml_table-width">
327 <xsl:with-param name="node" select=".."/>
331 <xsl:variable name="table.width">
333 <xsl:when test="$explicit.table.width != ''">
334 <xsl:value-of select="$explicit.table.width"/>
336 <xsl:when test="$default.table.width = ''">
337 <xsl:text>100%</xsl:text>
340 <xsl:value-of select="$default.table.width"/>
345 <xsl:if test="$default.table.width != '' or $explicit.table.width != ''">
346 <xsl:attribute name="width">
348 <xsl:when test="contains($table.width, '%')">
349 <xsl:value-of select="$table.width"/>
351 <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
353 <xsl:when test="function-available('stbl:convertLength')">
354 <xsl:value-of select="stbl:convertLength($table.width)"/>
356 <xsl:when test="function-available('xtbl:convertLength')">
357 <xsl:value-of select="xtbl:convertLength($table.width)"/>
360 <xsl:message terminate="yes">
361 <xsl:text>No convertLength function available.</xsl:text>
367 <xsl:value-of select="$table.width"/>
374 <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0">
376 <xsl:when test="function-available('stbl:adjustColumnWidths')">
377 <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
379 <xsl:when test="function-available('xtbl:adjustColumnWidths')">
380 <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/>
382 <xsl:when test="function-available('ptbl:adjustColumnWidths')">
383 <xsl:copy-of select="ptbl:adjustColumnWidths($colgroup)"/>
386 <xsl:message terminate="yes">
387 <xsl:text>No adjustColumnWidths function available.</xsl:text>
393 <xsl:copy-of select="$colgroup"/>
397 <xsl:apply-templates select="thead"/>
398 <xsl:apply-templates select="tfoot"/>
399 <xsl:apply-templates select="tbody"/>
401 <xsl:if test=".//footnote|../title//footnote">
402 <tbody class="footnotes">
404 <td colspan="{@cols}">
405 <xsl:apply-templates select=".//footnote|../title//footnote" mode="table.footnote.mode"/>
413 <xsl:template match="tgroup/processing-instruction('dbhtml')">
414 <xsl:variable name="summary">
415 <xsl:call-template name="pi.dbhtml_table-summary"/>
418 <!-- Suppress the table-summary PI -->
419 <xsl:if test="$summary = ''">
420 <xsl:processing-instruction name="dbhtml">
421 <xsl:value-of select="."/>
422 </xsl:processing-instruction>
426 <xsl:template match="colspec"/>
428 <xsl:template match="spanspec"/>
430 <xsl:template match="thead|tfoot">
431 <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
432 <xsl:if test="@align">
433 <xsl:attribute name="align">
434 <xsl:value-of select="@align"/>
437 <xsl:if test="@char">
438 <xsl:attribute name="char">
439 <xsl:value-of select="@char"/>
442 <xsl:if test="@charoff">
443 <xsl:attribute name="charoff">
444 <xsl:value-of select="@charoff"/>
447 <xsl:if test="@valign">
448 <xsl:attribute name="valign">
449 <xsl:value-of select="@valign"/>
453 <xsl:apply-templates select="row[1]">
454 <xsl:with-param name="spans">
455 <xsl:call-template name="blank.spans">
456 <xsl:with-param name="cols" select="../@cols"/>
459 </xsl:apply-templates>
464 <xsl:template match="tbody">
466 <xsl:if test="@align">
467 <xsl:attribute name="align">
468 <xsl:value-of select="@align"/>
471 <xsl:if test="@char">
472 <xsl:attribute name="char">
473 <xsl:value-of select="@char"/>
476 <xsl:if test="@charoff">
477 <xsl:attribute name="charoff">
478 <xsl:value-of select="@charoff"/>
481 <xsl:if test="@valign">
482 <xsl:attribute name="valign">
483 <xsl:value-of select="@valign"/>
487 <xsl:apply-templates select="row[1]">
488 <xsl:with-param name="spans">
489 <xsl:call-template name="blank.spans">
490 <xsl:with-param name="cols" select="../@cols"/>
493 </xsl:apply-templates>
498 <xsl:template match="row">
499 <xsl:param name="spans"/>
502 <xsl:when test="contains($spans, '0')">
503 <xsl:call-template name="normal-row">
504 <xsl:with-param name="spans" select="$spans"/>
510 <xsl:text>Ignoring row: </xsl:text>
511 <xsl:value-of select="$spans"/>
512 <xsl:text> = </xsl:text>
513 <xsl:call-template name="consume-row">
514 <xsl:with-param name="spans" select="$spans"/>
519 <xsl:if test="normalize-space(.//text()) != ''">
520 <xsl:message>Warning: overlapped row contains content!</xsl:message>
523 <tr><xsl:comment> This row intentionally left blank </xsl:comment></tr>
525 <xsl:apply-templates select="following-sibling::row[1]">
526 <xsl:with-param name="spans">
527 <xsl:call-template name="consume-row">
528 <xsl:with-param name="spans" select="$spans"/>
531 </xsl:apply-templates>
536 <xsl:template name="normal-row">
537 <xsl:param name="spans"/>
539 <xsl:variable name="row-height">
540 <xsl:if test="processing-instruction('dbhtml')">
541 <xsl:call-template name="pi.dbhtml_row-height"/>
545 <xsl:variable name="bgcolor">
546 <xsl:if test="processing-instruction('dbhtml')">
547 <xsl:call-template name="pi.dbhtml_bgcolor"/>
551 <xsl:variable name="class">
552 <xsl:if test="processing-instruction('dbhtml')">
553 <xsl:call-template name="pi.dbhtml_class"/>
558 <xsl:call-template name="tr.attributes">
559 <xsl:with-param name="rownum">
560 <xsl:number from="tgroup" count="row"/>
564 <xsl:if test="$row-height != ''">
565 <xsl:attribute name="height">
566 <xsl:value-of select="$row-height"/>
570 <xsl:if test="$bgcolor != ''">
571 <xsl:attribute name="bgcolor">
572 <xsl:value-of select="$bgcolor"/>
576 <xsl:if test="$class != ''">
577 <xsl:attribute name="class">
578 <xsl:value-of select="$class"/>
582 <xsl:if test="$table.borders.with.css != 0">
583 <xsl:if test="@rowsep = 1 and following-sibling::row">
584 <xsl:attribute name="style">
585 <xsl:call-template name="border">
586 <xsl:with-param name="side" select="'bottom'"/>
592 <xsl:if test="@align">
593 <xsl:attribute name="align">
594 <xsl:value-of select="@align"/>
597 <xsl:if test="@char">
598 <xsl:attribute name="char">
599 <xsl:value-of select="@char"/>
602 <xsl:if test="@charoff">
603 <xsl:attribute name="charoff">
604 <xsl:value-of select="@charoff"/>
607 <xsl:if test="@valign">
608 <xsl:attribute name="valign">
609 <xsl:value-of select="@valign"/>
613 <xsl:apply-templates select="(entry|entrytbl)[1]">
614 <xsl:with-param name="spans" select="$spans"/>
615 </xsl:apply-templates>
618 <xsl:if test="following-sibling::row">
619 <xsl:variable name="nextspans">
620 <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
621 <xsl:with-param name="spans" select="$spans"/>
622 </xsl:apply-templates>
625 <xsl:apply-templates select="following-sibling::row[1]">
626 <xsl:with-param name="spans" select="$nextspans"/>
627 </xsl:apply-templates>
631 <xsl:template match="entry|entrytbl" name="entry">
632 <xsl:param name="col">
634 <xsl:when test="@revisionflag">
635 <xsl:number from="row"/>
637 <xsl:otherwise>1</xsl:otherwise>
641 <xsl:param name="spans"/>
643 <xsl:variable name="cellgi">
645 <xsl:when test="ancestor::thead">th</xsl:when>
646 <xsl:when test="ancestor::tfoot">th</xsl:when>
647 <xsl:otherwise>td</xsl:otherwise>
651 <xsl:variable name="empty.cell" select="count(node()) = 0"/>
653 <xsl:variable name="named.colnum">
654 <xsl:call-template name="entry.colnum"/>
657 <xsl:variable name="entry.colnum">
659 <xsl:when test="$named.colnum > 0">
660 <xsl:value-of select="$named.colnum"/>
663 <xsl:value-of select="$col"/>
668 <xsl:variable name="entry.colspan">
670 <xsl:when test="@spanname or @namest">
671 <xsl:call-template name="calculate.colspan"/>
673 <xsl:otherwise>1</xsl:otherwise>
677 <xsl:variable name="following.spans">
678 <xsl:call-template name="calculate.following.spans">
679 <xsl:with-param name="colspan" select="$entry.colspan"/>
680 <xsl:with-param name="spans" select="$spans"/>
684 <xsl:variable name="rowsep">
686 <!-- If this is the last row, rowsep never applies. -->
687 <xsl:when test="ancestor::entrytbl and not (ancestor-or-self::row[1]/following-sibling::row) and not (ancestor::thead)">
688 <xsl:value-of select="0"/>
690 <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)">
691 <xsl:value-of select="0"/>
693 <xsl:when test="@morerows and not(@morerows < count(ancestor-or-self::row[1]/following-sibling::row))">
694 <xsl:value-of select="0"/>
697 <xsl:call-template name="inherited.table.attribute">
698 <xsl:with-param name="entry" select="."/>
699 <xsl:with-param name="colnum" select="$entry.colnum"/>
700 <xsl:with-param name="attribute" select="'rowsep'"/>
706 <xsl:variable name="colsep">
708 <!-- If this is the last column, colsep never applies. -->
709 <xsl:when test="$following.spans = ''">0</xsl:when>
711 <xsl:call-template name="inherited.table.attribute">
712 <xsl:with-param name="entry" select="."/>
713 <xsl:with-param name="colnum" select="$entry.colnum"/>
714 <xsl:with-param name="attribute" select="'colsep'"/>
720 <xsl:variable name="valign">
721 <xsl:call-template name="inherited.table.attribute">
722 <xsl:with-param name="entry" select="."/>
723 <xsl:with-param name="colnum" select="$entry.colnum"/>
724 <xsl:with-param name="attribute" select="'valign'"/>
728 <xsl:variable name="align">
729 <xsl:call-template name="inherited.table.attribute">
730 <xsl:with-param name="entry" select="."/>
731 <xsl:with-param name="colnum" select="$entry.colnum"/>
732 <xsl:with-param name="attribute" select="'align'"/>
736 <xsl:variable name="char">
737 <xsl:call-template name="inherited.table.attribute">
738 <xsl:with-param name="entry" select="."/>
739 <xsl:with-param name="colnum" select="$entry.colnum"/>
740 <xsl:with-param name="attribute" select="'char'"/>
744 <xsl:variable name="charoff">
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="'charoff'"/>
753 <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
754 <xsl:call-template name="entry">
755 <xsl:with-param name="col" select="$col+1"/>
756 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
760 <xsl:when test="number($entry.colnum) > $col">
761 <xsl:call-template name="empty.table.cell"/>
762 <xsl:call-template name="entry">
763 <xsl:with-param name="col" select="$col+1"/>
764 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
769 <xsl:variable name="bgcolor">
770 <xsl:if test="processing-instruction('dbhtml')">
771 <xsl:call-template name="pi.dbhtml_bgcolor"/>
775 <xsl:element name="{$cellgi}" namespace="http://www.w3.org/1999/xhtml">
776 <xsl:if test="$bgcolor != ''">
777 <xsl:attribute name="bgcolor">
778 <xsl:value-of select="$bgcolor"/>
782 <xsl:call-template name="locale.html.attributes"/>
783 <xsl:if test="$entry.propagates.style != 0 and @role">
784 <xsl:apply-templates select="." mode="class.attribute">
785 <xsl:with-param name="class" select="@role"/>
786 </xsl:apply-templates>
789 <xsl:if test="$show.revisionflag and @revisionflag">
790 <xsl:attribute name="class">
791 <xsl:value-of select="@revisionflag"/>
795 <xsl:if test="$table.borders.with.css != 0">
796 <xsl:attribute name="style">
797 <xsl:if test="$colsep > 0">
798 <xsl:call-template name="border">
799 <xsl:with-param name="side" select="'right'"/>
802 <xsl:if test="$rowsep > 0">
803 <xsl:call-template name="border">
804 <xsl:with-param name="side" select="'bottom'"/>
810 <xsl:if test="@morerows > 0">
811 <xsl:attribute name="rowspan">
812 <xsl:value-of select="1+@morerows"/>
816 <xsl:if test="$entry.colspan > 1">
817 <xsl:attribute name="colspan">
818 <xsl:value-of select="$entry.colspan"/>
822 <xsl:if test="$align != ''">
823 <xsl:attribute name="align">
824 <xsl:value-of select="$align"/>
828 <xsl:if test="$valign != ''">
829 <xsl:attribute name="valign">
830 <xsl:value-of select="$valign"/>
834 <xsl:if test="$char != ''">
835 <xsl:attribute name="char">
836 <xsl:value-of select="$char"/>
840 <xsl:if test="$charoff != ''">
841 <xsl:attribute name="charoff">
842 <xsl:value-of select="$charoff"/>
846 <xsl:if test="not(preceding-sibling::*) and (ancestor::row[1]/@id or ancestor::row[1]/@xml:id)">
847 <xsl:call-template name="anchor">
848 <xsl:with-param name="node" select="ancestor::row[1]"/>
852 <xsl:call-template name="anchor"/>
855 <xsl:when test="$empty.cell">
856 <xsl:text> </xsl:text>
858 <xsl:when test="self::entrytbl">
859 <xsl:call-template name="tgroup"/>
862 <xsl:apply-templates/>
868 <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
869 <xsl:apply-templates select="(following-sibling::entry |following-sibling::entrytbl)[1]">
870 <xsl:with-param name="col" select="$col+$entry.colspan"/>
871 <xsl:with-param name="spans" select="$following.spans"/>
872 </xsl:apply-templates>
875 <xsl:call-template name="finaltd">
876 <xsl:with-param name="spans" select="$following.spans"/>
877 <xsl:with-param name="col" select="$col+$entry.colspan"/>
885 <xsl:template match="entry|entrytbl" name="sentry" mode="span">
886 <xsl:param name="col" select="1"/>
887 <xsl:param name="spans"/>
889 <xsl:variable name="entry.colnum">
890 <xsl:call-template name="entry.colnum"/>
893 <xsl:variable name="entry.colspan">
895 <xsl:when test="@spanname or @namest">
896 <xsl:call-template name="calculate.colspan"/>
898 <xsl:otherwise>1</xsl:otherwise>
902 <xsl:variable name="following.spans">
903 <xsl:call-template name="calculate.following.spans">
904 <xsl:with-param name="colspan" select="$entry.colspan"/>
905 <xsl:with-param name="spans" select="$spans"/>
910 <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
911 <xsl:value-of select="substring-before($spans,':')-1"/>
912 <xsl:text>:</xsl:text>
913 <xsl:call-template name="sentry">
914 <xsl:with-param name="col" select="$col+1"/>
915 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
919 <xsl:when test="number($entry.colnum) > $col">
920 <xsl:text>0:</xsl:text>
921 <xsl:call-template name="sentry">
922 <xsl:with-param name="col" select="$col + 1"/>
923 <xsl:with-param name="spans" select="substring-after($spans,':')"/>
928 <xsl:call-template name="copy-string">
929 <xsl:with-param name="count" select="$entry.colspan"/>
930 <xsl:with-param name="string">
932 <xsl:when test="@morerows">
933 <xsl:value-of select="@morerows"/>
935 <xsl:otherwise>0</xsl:otherwise>
937 <xsl:text>:</xsl:text>
942 <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
943 <xsl:apply-templates select="(following-sibling::entry |following-sibling::entrytbl)[1]" mode="span">
944 <xsl:with-param name="col" select="$col+$entry.colspan"/>
945 <xsl:with-param name="spans" select="$following.spans"/>
946 </xsl:apply-templates>
949 <xsl:call-template name="sfinaltd">
950 <xsl:with-param name="spans" select="$following.spans"/>
958 <xsl:template name="generate.colgroup">
959 <xsl:param name="cols" select="1"/>
960 <xsl:param name="count" select="1"/>
962 <xsl:when test="$count > $cols"/>
964 <xsl:call-template name="generate.col">
965 <xsl:with-param name="countcol" select="$count"/>
967 <xsl:call-template name="generate.colgroup">
968 <xsl:with-param name="cols" select="$cols"/>
969 <xsl:with-param name="count" select="$count+1"/>
975 <xsl:template name="generate.col">
976 <xsl:param name="countcol">1</xsl:param>
977 <xsl:param name="colspecs" select="./colspec"/>
978 <xsl:param name="count">1</xsl:param>
979 <xsl:param name="colnum">1</xsl:param>
982 <xsl:when test="$count>count($colspecs)">
986 <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
987 <xsl:variable name="colspec.colnum">
989 <xsl:when test="$colspec/@colnum">
990 <xsl:value-of select="$colspec/@colnum"/>
993 <xsl:value-of select="$colnum"/>
999 <xsl:when test="$colspec.colnum=$countcol">
1002 <xsl:when test="$colspec/@colwidth and $use.extensions != 0 and $tablecolumns.extension != 0">
1003 <xsl:attribute name="width">
1005 <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
1006 <xsl:value-of select="'1*'"/>
1009 <xsl:value-of select="$colspec/@colwidth"/>
1014 <!-- pass through to HTML if no * in colspecs -->
1015 <xsl:when test="$colspec/@colwidth and not($colspec/parent::*/colspec/@colwidth[contains(.,'*')])">
1016 <xsl:attribute name="width">
1018 <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
1019 <xsl:value-of select="'1*'"/>
1022 <xsl:value-of select="$colspec/@colwidth"/>
1030 <xsl:when test="$colspec/@align">
1031 <xsl:attribute name="align">
1032 <xsl:value-of select="$colspec/@align"/>
1035 <!-- Suggested by Pavel ZAMPACH <zampach@nemcb.cz> -->
1036 <xsl:when test="$colspecs/ancestor::tgroup/@align">
1037 <xsl:attribute name="align">
1038 <xsl:value-of select="$colspecs/ancestor::tgroup/@align"/>
1043 <xsl:if test="$colspec/@char">
1044 <xsl:attribute name="char">
1045 <xsl:value-of select="$colspec/@char"/>
1048 <xsl:if test="$colspec/@charoff">
1049 <xsl:attribute name="charoff">
1050 <xsl:value-of select="$colspec/@charoff"/>
1056 <xsl:call-template name="generate.col">
1057 <xsl:with-param name="countcol" select="$countcol"/>
1058 <xsl:with-param name="colspecs" select="$colspecs"/>
1059 <xsl:with-param name="count" select="$count+1"/>
1060 <xsl:with-param name="colnum">
1062 <xsl:when test="$colspec/@colnum">
1063 <xsl:value-of select="$colspec/@colnum + 1"/>
1066 <xsl:value-of select="$colnum + 1"/>
1070 </xsl:call-template>
1077 <xsl:template name="colspec.colwidth">
1078 <!-- when this macro is called, the current context must be an entry -->
1079 <xsl:param name="colname"/>
1080 <!-- .. = row, ../.. = thead|tbody, ../../.. = tgroup -->
1081 <xsl:param name="colspecs" select="../../../../tgroup/colspec"/>
1082 <xsl:param name="count">1</xsl:param>
1084 <xsl:when test="$count>count($colspecs)"/>
1086 <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
1088 <xsl:when test="$colspec/@colname=$colname">
1089 <xsl:value-of select="$colspec/@colwidth"/>
1092 <xsl:call-template name="colspec.colwidth">
1093 <xsl:with-param name="colname" select="$colname"/>
1094 <xsl:with-param name="colspecs" select="$colspecs"/>
1095 <xsl:with-param name="count" select="$count+1"/>
1096 </xsl:call-template>
1103 <!-- ====================================================================== -->
1105 <xsl:template name="tr.attributes">
1106 <xsl:param name="row" select="."/>
1107 <xsl:param name="rownum" select="0"/>
1109 <!-- by default, do nothing. But you might want to say:
1111 <xsl:if test="$rownum mod 2 = 0">
1112 <xsl:attribute name="class">oddrow</xsl:attribute>