[15c7d39] | 1 | <?xml version='1.0'?>
|
---|
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 3 | xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
|
---|
| 4 | xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table"
|
---|
| 5 | xmlns:xtbl="xalan://com.nwalsh.xalan.Table"
|
---|
| 6 | xmlns:lxslt="http://xml.apache.org/xslt"
|
---|
| 7 | xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table"
|
---|
| 8 | exclude-result-prefixes="doc stbl xtbl lxslt ptbl"
|
---|
| 9 | version='1.0'>
|
---|
[c873d807] | 10 |
|
---|
| 11 | <xsl:include href="../common/table.xsl"/>
|
---|
| 12 |
|
---|
| 13 | <!-- ********************************************************************
|
---|
[15c7d39] | 14 | $Id: table.xsl 9297 2012-04-22 03:56:16Z bobstayton $
|
---|
[c873d807] | 15 | ********************************************************************
|
---|
| 16 |
|
---|
| 17 | This file is part of the XSL DocBook Stylesheet distribution.
|
---|
| 18 | See ../README or http://docbook.sf.net/release/xsl/current/ for
|
---|
| 19 | copyright and other information.
|
---|
| 20 |
|
---|
| 21 | ******************************************************************** -->
|
---|
| 22 |
|
---|
[15c7d39] | 23 | <lxslt:component prefix="xtbl"
|
---|
| 24 | functions="adjustColumnWidths"/>
|
---|
[c873d807] | 25 |
|
---|
| 26 | <xsl:template name="empty.table.cell">
|
---|
| 27 | <xsl:param name="colnum" select="0"/>
|
---|
| 28 |
|
---|
| 29 | <xsl:variable name="rowsep">
|
---|
| 30 | <xsl:choose>
|
---|
| 31 | <!-- If this is the last row, rowsep never applies. -->
|
---|
[15c7d39] | 32 | <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
|
---|
| 33 | or ancestor-or-self::thead/following-sibling::tbody
|
---|
| 34 | or ancestor-or-self::tbody/preceding-sibling::tfoot)">
|
---|
[c873d807] | 35 | <xsl:value-of select="0"/>
|
---|
| 36 | </xsl:when>
|
---|
| 37 | <xsl:otherwise>
|
---|
| 38 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 39 | <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
|
---|
| 40 | <xsl:with-param name="row" select="ancestor-or-self::row[1]"/>
|
---|
| 41 | <xsl:with-param name="colnum" select="$colnum"/>
|
---|
| 42 | <xsl:with-param name="attribute" select="'rowsep'"/>
|
---|
| 43 | </xsl:call-template>
|
---|
| 44 | </xsl:otherwise>
|
---|
| 45 | </xsl:choose>
|
---|
| 46 | </xsl:variable>
|
---|
| 47 |
|
---|
| 48 | <xsl:variable name="colsep">
|
---|
| 49 | <xsl:choose>
|
---|
| 50 | <!-- If this is the last column, colsep never applies. -->
|
---|
| 51 | <xsl:when test="number($colnum) >= ancestor::tgroup/@cols">0</xsl:when>
|
---|
| 52 | <xsl:otherwise>
|
---|
| 53 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 54 | <xsl:with-param name="entry" select="NOT-AN-ELEMENT-NAME"/>
|
---|
| 55 | <xsl:with-param name="row" select="ancestor-or-self::row[1]"/>
|
---|
| 56 | <xsl:with-param name="colnum" select="$colnum"/>
|
---|
| 57 | <xsl:with-param name="attribute" select="'colsep'"/>
|
---|
| 58 | </xsl:call-template>
|
---|
| 59 | </xsl:otherwise>
|
---|
| 60 | </xsl:choose>
|
---|
| 61 | </xsl:variable>
|
---|
| 62 |
|
---|
| 63 | <td class="auto-generated">
|
---|
| 64 | <xsl:if test="$table.borders.with.css != 0">
|
---|
| 65 | <xsl:attribute name="style">
|
---|
| 66 | <xsl:if test="$colsep > 0">
|
---|
| 67 | <xsl:call-template name="border">
|
---|
| 68 | <xsl:with-param name="side" select="'right'"/>
|
---|
| 69 | </xsl:call-template>
|
---|
| 70 | </xsl:if>
|
---|
| 71 | <xsl:if test="$rowsep > 0">
|
---|
| 72 | <xsl:call-template name="border">
|
---|
| 73 | <xsl:with-param name="side" select="'bottom'"/>
|
---|
| 74 | </xsl:call-template>
|
---|
| 75 | </xsl:if>
|
---|
| 76 | </xsl:attribute>
|
---|
| 77 | </xsl:if>
|
---|
| 78 | <xsl:text> </xsl:text>
|
---|
| 79 | </td>
|
---|
| 80 | </xsl:template>
|
---|
| 81 |
|
---|
| 82 | <!-- ==================================================================== -->
|
---|
| 83 |
|
---|
| 84 | <xsl:template name="border">
|
---|
| 85 | <xsl:param name="side" select="'left'"/>
|
---|
| 86 | <xsl:param name="padding" select="0"/>
|
---|
| 87 | <xsl:param name="style" select="$table.cell.border.style"/>
|
---|
| 88 | <xsl:param name="color" select="$table.cell.border.color"/>
|
---|
| 89 | <xsl:param name="thickness" select="$table.cell.border.thickness"/>
|
---|
| 90 |
|
---|
| 91 | <!-- Note: Some browsers (mozilla) require at least a width and style. -->
|
---|
| 92 |
|
---|
| 93 | <xsl:choose>
|
---|
[15c7d39] | 94 | <xsl:when test="($thickness != ''
|
---|
| 95 | and $style != ''
|
---|
| 96 | and $color != '')
|
---|
| 97 | or ($thickness != ''
|
---|
| 98 | and $style != '')
|
---|
| 99 | or ($thickness != '')">
|
---|
[c873d807] | 100 | <!-- use the compound property if we can: -->
|
---|
| 101 | <!-- it saves space and probably works more reliably -->
|
---|
| 102 | <xsl:text>border-</xsl:text>
|
---|
| 103 | <xsl:value-of select="$side"/>
|
---|
| 104 | <xsl:text>: </xsl:text>
|
---|
| 105 | <xsl:value-of select="$thickness"/>
|
---|
| 106 | <xsl:text> </xsl:text>
|
---|
| 107 | <xsl:value-of select="$style"/>
|
---|
| 108 | <xsl:text> </xsl:text>
|
---|
| 109 | <xsl:value-of select="$color"/>
|
---|
| 110 | <xsl:text>; </xsl:text>
|
---|
| 111 | </xsl:when>
|
---|
| 112 | <xsl:otherwise>
|
---|
| 113 | <!-- we need to specify the styles individually -->
|
---|
| 114 | <xsl:if test="$thickness != ''">
|
---|
| 115 | <xsl:text>border-</xsl:text>
|
---|
| 116 | <xsl:value-of select="$side"/>
|
---|
| 117 | <xsl:text>-width: </xsl:text>
|
---|
| 118 | <xsl:value-of select="$thickness"/>
|
---|
| 119 | <xsl:text>; </xsl:text>
|
---|
| 120 | </xsl:if>
|
---|
| 121 |
|
---|
| 122 | <xsl:if test="$style != ''">
|
---|
| 123 | <xsl:text>border-</xsl:text>
|
---|
| 124 | <xsl:value-of select="$side"/>
|
---|
| 125 | <xsl:text>-style: </xsl:text>
|
---|
| 126 | <xsl:value-of select="$style"/>
|
---|
| 127 | <xsl:text>; </xsl:text>
|
---|
| 128 | </xsl:if>
|
---|
| 129 |
|
---|
| 130 | <xsl:if test="$color != ''">
|
---|
| 131 | <xsl:text>border-</xsl:text>
|
---|
| 132 | <xsl:value-of select="$side"/>
|
---|
| 133 | <xsl:text>-color: </xsl:text>
|
---|
| 134 | <xsl:value-of select="$color"/>
|
---|
| 135 | <xsl:text>; </xsl:text>
|
---|
| 136 | </xsl:if>
|
---|
| 137 | </xsl:otherwise>
|
---|
| 138 | </xsl:choose>
|
---|
| 139 | </xsl:template>
|
---|
| 140 |
|
---|
| 141 | <!-- ==================================================================== -->
|
---|
| 142 |
|
---|
| 143 | <xsl:template match="tgroup" name="tgroup">
|
---|
| 144 | <xsl:if test="not(@cols) or @cols = '' or string(number(@cols)) = 'NaN'">
|
---|
| 145 | <xsl:message terminate="yes">
|
---|
| 146 | <xsl:text>Error: CALS tables must specify the number of columns.</xsl:text>
|
---|
| 147 | </xsl:message>
|
---|
| 148 | </xsl:if>
|
---|
| 149 |
|
---|
| 150 | <xsl:variable name="summary">
|
---|
[60a5a938] | 151 | <xsl:call-template name="pi.dbhtml_table-summary"/>
|
---|
[c873d807] | 152 | </xsl:variable>
|
---|
| 153 |
|
---|
| 154 | <xsl:variable name="cellspacing">
|
---|
[60a5a938] | 155 | <xsl:call-template name="pi.dbhtml_cellspacing"/>
|
---|
[c873d807] | 156 | </xsl:variable>
|
---|
| 157 |
|
---|
| 158 | <xsl:variable name="cellpadding">
|
---|
[60a5a938] | 159 | <xsl:call-template name="pi.dbhtml_cellpadding"/>
|
---|
[c873d807] | 160 | </xsl:variable>
|
---|
| 161 |
|
---|
| 162 | <table>
|
---|
| 163 | <xsl:choose>
|
---|
| 164 | <!-- If there's a textobject/phrase for the table summary, use it -->
|
---|
| 165 | <xsl:when test="../textobject/phrase">
|
---|
| 166 | <xsl:attribute name="summary">
|
---|
| 167 | <xsl:value-of select="../textobject/phrase"/>
|
---|
| 168 | </xsl:attribute>
|
---|
| 169 | </xsl:when>
|
---|
| 170 |
|
---|
| 171 | <!-- If there's a <?dbhtml table-summary="foo"?> PI, use it for
|
---|
| 172 | the HTML table summary attribute -->
|
---|
| 173 | <xsl:when test="$summary != ''">
|
---|
| 174 | <xsl:attribute name="summary">
|
---|
| 175 | <xsl:value-of select="$summary"/>
|
---|
| 176 | </xsl:attribute>
|
---|
| 177 | </xsl:when>
|
---|
| 178 |
|
---|
| 179 | <!-- Otherwise, if there's a title, use that -->
|
---|
| 180 | <xsl:when test="../title">
|
---|
| 181 | <xsl:attribute name="summary">
|
---|
[15c7d39] | 182 | <!-- This screws up on inline markup and footnotes, oh well... -->
|
---|
[c873d807] | 183 | <xsl:value-of select="string(../title)"/>
|
---|
| 184 | </xsl:attribute>
|
---|
| 185 | </xsl:when>
|
---|
| 186 |
|
---|
| 187 | <!-- Otherwise, forget the whole idea -->
|
---|
| 188 | <xsl:otherwise><!-- nevermind --></xsl:otherwise>
|
---|
| 189 | </xsl:choose>
|
---|
| 190 |
|
---|
| 191 | <xsl:if test="$cellspacing != '' or $html.cellspacing != ''">
|
---|
| 192 | <xsl:attribute name="cellspacing">
|
---|
| 193 | <xsl:choose>
|
---|
| 194 | <xsl:when test="$cellspacing != ''">
|
---|
| 195 | <xsl:value-of select="$cellspacing"/>
|
---|
| 196 | </xsl:when>
|
---|
| 197 | <xsl:otherwise>
|
---|
| 198 | <xsl:value-of select="$html.cellspacing"/>
|
---|
| 199 | </xsl:otherwise>
|
---|
| 200 | </xsl:choose>
|
---|
| 201 | </xsl:attribute>
|
---|
| 202 | </xsl:if>
|
---|
| 203 |
|
---|
| 204 | <xsl:if test="$cellpadding != '' or $html.cellpadding != ''">
|
---|
| 205 | <xsl:attribute name="cellpadding">
|
---|
| 206 | <xsl:choose>
|
---|
| 207 | <xsl:when test="$cellpadding != ''">
|
---|
| 208 | <xsl:value-of select="$cellpadding"/>
|
---|
| 209 | </xsl:when>
|
---|
| 210 | <xsl:otherwise>
|
---|
| 211 | <xsl:value-of select="$html.cellpadding"/>
|
---|
| 212 | </xsl:otherwise>
|
---|
| 213 | </xsl:choose>
|
---|
| 214 | </xsl:attribute>
|
---|
| 215 | </xsl:if>
|
---|
| 216 |
|
---|
| 217 | <xsl:if test="../@pgwide=1 or local-name(.) = 'entrytbl'">
|
---|
| 218 | <xsl:attribute name="width">100%</xsl:attribute>
|
---|
| 219 | </xsl:if>
|
---|
| 220 |
|
---|
| 221 | <xsl:choose>
|
---|
| 222 | <xsl:when test="$table.borders.with.css != 0">
|
---|
| 223 | <xsl:choose>
|
---|
| 224 | <xsl:when test="../@frame='all' or (not(../@frame) and $default.table.frame='all')">
|
---|
| 225 | <xsl:attribute name="style">
|
---|
| 226 | <xsl:text>border-collapse: collapse;</xsl:text>
|
---|
| 227 | <xsl:call-template name="border">
|
---|
| 228 | <xsl:with-param name="side" select="'top'"/>
|
---|
| 229 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 230 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 231 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 232 | </xsl:call-template>
|
---|
| 233 | <xsl:call-template name="border">
|
---|
| 234 | <xsl:with-param name="side" select="'bottom'"/>
|
---|
| 235 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 236 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 237 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 238 | </xsl:call-template>
|
---|
| 239 | <xsl:call-template name="border">
|
---|
| 240 | <xsl:with-param name="side" select="'left'"/>
|
---|
| 241 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 242 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 243 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 244 | </xsl:call-template>
|
---|
| 245 | <xsl:call-template name="border">
|
---|
| 246 | <xsl:with-param name="side" select="'right'"/>
|
---|
| 247 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 248 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 249 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 250 | </xsl:call-template>
|
---|
| 251 | </xsl:attribute>
|
---|
| 252 | </xsl:when>
|
---|
| 253 | <xsl:when test="../@frame='topbot' or (not(../@frame) and $default.table.frame='topbot')">
|
---|
| 254 | <xsl:attribute name="style">
|
---|
| 255 | <xsl:text>border-collapse: collapse;</xsl:text>
|
---|
| 256 | <xsl:call-template name="border">
|
---|
| 257 | <xsl:with-param name="side" select="'top'"/>
|
---|
| 258 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 259 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 260 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 261 | </xsl:call-template>
|
---|
| 262 | <xsl:call-template name="border">
|
---|
| 263 | <xsl:with-param name="side" select="'bottom'"/>
|
---|
| 264 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 265 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 266 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 267 | </xsl:call-template>
|
---|
| 268 | </xsl:attribute>
|
---|
| 269 | </xsl:when>
|
---|
| 270 | <xsl:when test="../@frame='top' or (not(../@frame) and $default.table.frame='top')">
|
---|
| 271 | <xsl:attribute name="style">
|
---|
| 272 | <xsl:text>border-collapse: collapse;</xsl:text>
|
---|
| 273 | <xsl:call-template name="border">
|
---|
| 274 | <xsl:with-param name="side" select="'top'"/>
|
---|
| 275 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 276 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 277 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 278 | </xsl:call-template>
|
---|
| 279 | </xsl:attribute>
|
---|
| 280 | </xsl:when>
|
---|
| 281 | <xsl:when test="../@frame='bottom' or (not(../@frame) and $default.table.frame='bottom')">
|
---|
| 282 | <xsl:attribute name="style">
|
---|
| 283 | <xsl:text>border-collapse: collapse;</xsl:text>
|
---|
| 284 | <xsl:call-template name="border">
|
---|
| 285 | <xsl:with-param name="side" select="'bottom'"/>
|
---|
| 286 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 287 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 288 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 289 | </xsl:call-template>
|
---|
| 290 | </xsl:attribute>
|
---|
| 291 | </xsl:when>
|
---|
| 292 | <xsl:when test="../@frame='sides' or (not(../@frame) and $default.table.frame='sides')">
|
---|
| 293 | <xsl:attribute name="style">
|
---|
| 294 | <xsl:text>border-collapse: collapse;</xsl:text>
|
---|
| 295 | <xsl:call-template name="border">
|
---|
| 296 | <xsl:with-param name="side" select="'left'"/>
|
---|
| 297 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 298 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 299 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 300 | </xsl:call-template>
|
---|
| 301 | <xsl:call-template name="border">
|
---|
| 302 | <xsl:with-param name="side" select="'right'"/>
|
---|
| 303 | <xsl:with-param name="style" select="$table.frame.border.style"/>
|
---|
| 304 | <xsl:with-param name="color" select="$table.frame.border.color"/>
|
---|
| 305 | <xsl:with-param name="thickness" select="$table.frame.border.thickness"/>
|
---|
| 306 | </xsl:call-template>
|
---|
| 307 | </xsl:attribute>
|
---|
| 308 | </xsl:when>
|
---|
[15c7d39] | 309 | <xsl:when test="../@frame='none'">
|
---|
| 310 | <xsl:attribute name="style">
|
---|
| 311 | <xsl:text>border: none;</xsl:text>
|
---|
| 312 | </xsl:attribute>
|
---|
| 313 | </xsl:when>
|
---|
[c873d807] | 314 | <xsl:otherwise>
|
---|
| 315 | <xsl:attribute name="style">
|
---|
| 316 | <xsl:text>border-collapse: collapse;</xsl:text>
|
---|
| 317 | </xsl:attribute>
|
---|
| 318 | </xsl:otherwise>
|
---|
| 319 | </xsl:choose>
|
---|
[60a5a938] | 320 |
|
---|
[c873d807] | 321 | </xsl:when>
|
---|
| 322 | <xsl:when test="../@frame='none' or (not(../@frame) and $default.table.frame='none') or local-name(.) = 'entrytbl'">
|
---|
| 323 | <xsl:attribute name="border">0</xsl:attribute>
|
---|
| 324 | </xsl:when>
|
---|
| 325 | <xsl:otherwise>
|
---|
| 326 | <xsl:attribute name="border">1</xsl:attribute>
|
---|
| 327 | </xsl:otherwise>
|
---|
| 328 | </xsl:choose>
|
---|
| 329 |
|
---|
| 330 | <xsl:variable name="colgroup">
|
---|
| 331 | <colgroup>
|
---|
| 332 | <xsl:call-template name="generate.colgroup">
|
---|
| 333 | <xsl:with-param name="cols" select="@cols"/>
|
---|
| 334 | </xsl:call-template>
|
---|
| 335 | </colgroup>
|
---|
| 336 | </xsl:variable>
|
---|
| 337 |
|
---|
| 338 | <xsl:variable name="explicit.table.width">
|
---|
[60a5a938] | 339 | <xsl:call-template name="pi.dbhtml_table-width">
|
---|
| 340 | <xsl:with-param name="node" select=".."/>
|
---|
[c873d807] | 341 | </xsl:call-template>
|
---|
| 342 | </xsl:variable>
|
---|
| 343 |
|
---|
| 344 | <xsl:variable name="table.width">
|
---|
| 345 | <xsl:choose>
|
---|
| 346 | <xsl:when test="$explicit.table.width != ''">
|
---|
| 347 | <xsl:value-of select="$explicit.table.width"/>
|
---|
| 348 | </xsl:when>
|
---|
| 349 | <xsl:when test="$default.table.width = ''">
|
---|
| 350 | <xsl:text>100%</xsl:text>
|
---|
| 351 | </xsl:when>
|
---|
| 352 | <xsl:otherwise>
|
---|
| 353 | <xsl:value-of select="$default.table.width"/>
|
---|
| 354 | </xsl:otherwise>
|
---|
| 355 | </xsl:choose>
|
---|
| 356 | </xsl:variable>
|
---|
| 357 |
|
---|
[15c7d39] | 358 | <xsl:if test="$default.table.width != ''
|
---|
| 359 | or $explicit.table.width != ''">
|
---|
[c873d807] | 360 | <xsl:attribute name="width">
|
---|
| 361 | <xsl:choose>
|
---|
| 362 | <xsl:when test="contains($table.width, '%')">
|
---|
| 363 | <xsl:value-of select="$table.width"/>
|
---|
| 364 | </xsl:when>
|
---|
[15c7d39] | 365 | <xsl:when test="$use.extensions != 0
|
---|
| 366 | and $tablecolumns.extension != 0">
|
---|
[c873d807] | 367 | <xsl:choose>
|
---|
| 368 | <xsl:when test="function-available('stbl:convertLength')">
|
---|
| 369 | <xsl:value-of select="stbl:convertLength($table.width)"/>
|
---|
| 370 | </xsl:when>
|
---|
| 371 | <xsl:when test="function-available('xtbl:convertLength')">
|
---|
| 372 | <xsl:value-of select="xtbl:convertLength($table.width)"/>
|
---|
| 373 | </xsl:when>
|
---|
| 374 | <xsl:otherwise>
|
---|
| 375 | <xsl:message terminate="yes">
|
---|
| 376 | <xsl:text>No convertLength function available.</xsl:text>
|
---|
| 377 | </xsl:message>
|
---|
| 378 | </xsl:otherwise>
|
---|
| 379 | </xsl:choose>
|
---|
| 380 | </xsl:when>
|
---|
| 381 | <xsl:otherwise>
|
---|
| 382 | <xsl:value-of select="$table.width"/>
|
---|
| 383 | </xsl:otherwise>
|
---|
| 384 | </xsl:choose>
|
---|
| 385 | </xsl:attribute>
|
---|
| 386 | </xsl:if>
|
---|
| 387 |
|
---|
| 388 | <xsl:choose>
|
---|
[15c7d39] | 389 | <xsl:when test="$use.extensions != 0
|
---|
| 390 | and $tablecolumns.extension != 0">
|
---|
[c873d807] | 391 | <xsl:choose>
|
---|
| 392 | <xsl:when test="function-available('stbl:adjustColumnWidths')">
|
---|
| 393 | <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
|
---|
| 394 | </xsl:when>
|
---|
| 395 | <xsl:when test="function-available('xtbl:adjustColumnWidths')">
|
---|
| 396 | <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/>
|
---|
| 397 | </xsl:when>
|
---|
| 398 | <xsl:when test="function-available('ptbl:adjustColumnWidths')">
|
---|
| 399 | <xsl:copy-of select="ptbl:adjustColumnWidths($colgroup)"/>
|
---|
| 400 | </xsl:when>
|
---|
| 401 | <xsl:otherwise>
|
---|
| 402 | <xsl:message terminate="yes">
|
---|
| 403 | <xsl:text>No adjustColumnWidths function available.</xsl:text>
|
---|
| 404 | </xsl:message>
|
---|
| 405 | </xsl:otherwise>
|
---|
| 406 | </xsl:choose>
|
---|
| 407 | </xsl:when>
|
---|
| 408 | <xsl:otherwise>
|
---|
| 409 | <xsl:copy-of select="$colgroup"/>
|
---|
| 410 | </xsl:otherwise>
|
---|
| 411 | </xsl:choose>
|
---|
| 412 |
|
---|
| 413 | <xsl:apply-templates select="thead"/>
|
---|
| 414 | <xsl:apply-templates select="tfoot"/>
|
---|
| 415 | <xsl:apply-templates select="tbody"/>
|
---|
| 416 |
|
---|
[15c7d39] | 417 | <xsl:if test=".//footnote|../title//footnote">
|
---|
[c873d807] | 418 | <tbody class="footnotes">
|
---|
| 419 | <tr>
|
---|
| 420 | <td colspan="{@cols}">
|
---|
[15c7d39] | 421 | <xsl:apply-templates select=".//footnote|../title//footnote" mode="table.footnote.mode"/>
|
---|
[c873d807] | 422 | </td>
|
---|
| 423 | </tr>
|
---|
| 424 | </tbody>
|
---|
| 425 | </xsl:if>
|
---|
| 426 | </table>
|
---|
| 427 | </xsl:template>
|
---|
| 428 |
|
---|
| 429 | <xsl:template match="tgroup/processing-instruction('dbhtml')">
|
---|
| 430 | <xsl:variable name="summary">
|
---|
[60a5a938] | 431 | <xsl:call-template name="pi.dbhtml_table-summary"/>
|
---|
[c873d807] | 432 | </xsl:variable>
|
---|
| 433 |
|
---|
| 434 | <!-- Suppress the table-summary PI -->
|
---|
| 435 | <xsl:if test="$summary = ''">
|
---|
| 436 | <xsl:processing-instruction name="dbhtml">
|
---|
| 437 | <xsl:value-of select="."/>
|
---|
| 438 | </xsl:processing-instruction>
|
---|
| 439 | </xsl:if>
|
---|
| 440 | </xsl:template>
|
---|
| 441 |
|
---|
[15c7d39] | 442 | <xsl:template match="colspec"></xsl:template>
|
---|
[c873d807] | 443 |
|
---|
[15c7d39] | 444 | <xsl:template match="spanspec"></xsl:template>
|
---|
[c873d807] | 445 |
|
---|
| 446 | <xsl:template match="thead|tfoot">
|
---|
[15c7d39] | 447 | <xsl:element name="{local-name(.)}">
|
---|
[c873d807] | 448 | <xsl:if test="@align">
|
---|
| 449 | <xsl:attribute name="align">
|
---|
| 450 | <xsl:value-of select="@align"/>
|
---|
| 451 | </xsl:attribute>
|
---|
| 452 | </xsl:if>
|
---|
| 453 | <xsl:if test="@char">
|
---|
| 454 | <xsl:attribute name="char">
|
---|
| 455 | <xsl:value-of select="@char"/>
|
---|
| 456 | </xsl:attribute>
|
---|
| 457 | </xsl:if>
|
---|
| 458 | <xsl:if test="@charoff">
|
---|
| 459 | <xsl:attribute name="charoff">
|
---|
| 460 | <xsl:value-of select="@charoff"/>
|
---|
| 461 | </xsl:attribute>
|
---|
| 462 | </xsl:if>
|
---|
| 463 | <xsl:if test="@valign">
|
---|
| 464 | <xsl:attribute name="valign">
|
---|
| 465 | <xsl:value-of select="@valign"/>
|
---|
| 466 | </xsl:attribute>
|
---|
| 467 | </xsl:if>
|
---|
| 468 |
|
---|
[15c7d39] | 469 | <xsl:choose>
|
---|
| 470 | <!-- recurse on rows only if @morerows is present -->
|
---|
| 471 | <xsl:when test="row/entry/@morerows|row/entrytbl/@morerows">
|
---|
| 472 | <xsl:apply-templates select="row[1]">
|
---|
| 473 | <xsl:with-param name="spans">
|
---|
| 474 | <xsl:call-template name="blank.spans">
|
---|
| 475 | <xsl:with-param name="cols" select="../@cols"/>
|
---|
| 476 | </xsl:call-template>
|
---|
| 477 | </xsl:with-param>
|
---|
| 478 | <xsl:with-param name="browserows" select="'recurse'"/>
|
---|
| 479 | </xsl:apply-templates>
|
---|
| 480 | </xsl:when>
|
---|
| 481 | <xsl:otherwise>
|
---|
| 482 | <xsl:apply-templates select="row">
|
---|
| 483 | <xsl:with-param name="spans">
|
---|
| 484 | <xsl:call-template name="blank.spans">
|
---|
| 485 | <xsl:with-param name="cols" select="../@cols"/>
|
---|
| 486 | </xsl:call-template>
|
---|
| 487 | </xsl:with-param>
|
---|
| 488 | <xsl:with-param name="browserows" select="'loop'" />
|
---|
| 489 | </xsl:apply-templates>
|
---|
| 490 | </xsl:otherwise>
|
---|
| 491 | </xsl:choose>
|
---|
[c873d807] | 492 |
|
---|
| 493 | </xsl:element>
|
---|
| 494 | </xsl:template>
|
---|
| 495 |
|
---|
| 496 | <xsl:template match="tbody">
|
---|
| 497 | <tbody>
|
---|
| 498 | <xsl:if test="@align">
|
---|
| 499 | <xsl:attribute name="align">
|
---|
| 500 | <xsl:value-of select="@align"/>
|
---|
| 501 | </xsl:attribute>
|
---|
| 502 | </xsl:if>
|
---|
| 503 | <xsl:if test="@char">
|
---|
| 504 | <xsl:attribute name="char">
|
---|
| 505 | <xsl:value-of select="@char"/>
|
---|
| 506 | </xsl:attribute>
|
---|
| 507 | </xsl:if>
|
---|
| 508 | <xsl:if test="@charoff">
|
---|
| 509 | <xsl:attribute name="charoff">
|
---|
| 510 | <xsl:value-of select="@charoff"/>
|
---|
| 511 | </xsl:attribute>
|
---|
| 512 | </xsl:if>
|
---|
| 513 | <xsl:if test="@valign">
|
---|
| 514 | <xsl:attribute name="valign">
|
---|
| 515 | <xsl:value-of select="@valign"/>
|
---|
| 516 | </xsl:attribute>
|
---|
| 517 | </xsl:if>
|
---|
| 518 |
|
---|
[15c7d39] | 519 | <xsl:choose>
|
---|
| 520 | <xsl:when test="row/entry/@morerows|row/entrytbl/@morerows">
|
---|
| 521 | <xsl:apply-templates select="row[1]">
|
---|
| 522 | <xsl:with-param name="spans">
|
---|
| 523 | <xsl:call-template name="blank.spans">
|
---|
| 524 | <xsl:with-param name="cols" select="../@cols"/>
|
---|
| 525 | </xsl:call-template>
|
---|
| 526 | </xsl:with-param>
|
---|
| 527 | <xsl:with-param name="browserows" select="'recurse'"/>
|
---|
| 528 | </xsl:apply-templates>
|
---|
| 529 | </xsl:when>
|
---|
| 530 | <xsl:otherwise>
|
---|
| 531 | <xsl:apply-templates select="row">
|
---|
| 532 | <xsl:with-param name="spans">
|
---|
| 533 | <xsl:call-template name="blank.spans">
|
---|
| 534 | <xsl:with-param name="cols" select="../@cols"/>
|
---|
| 535 | </xsl:call-template>
|
---|
| 536 | </xsl:with-param>
|
---|
| 537 | <xsl:with-param name="browserows" select="'loop'" />
|
---|
| 538 | </xsl:apply-templates>
|
---|
| 539 | </xsl:otherwise>
|
---|
| 540 | </xsl:choose>
|
---|
[c873d807] | 541 |
|
---|
| 542 | </tbody>
|
---|
| 543 | </xsl:template>
|
---|
| 544 |
|
---|
| 545 | <xsl:template match="row">
|
---|
| 546 | <xsl:param name="spans"/>
|
---|
[15c7d39] | 547 | <xsl:param name="browserows"/>
|
---|
[c873d807] | 548 |
|
---|
| 549 | <xsl:choose>
|
---|
| 550 | <xsl:when test="contains($spans, '0')">
|
---|
| 551 | <xsl:call-template name="normal-row">
|
---|
[15c7d39] | 552 | <xsl:with-param name="spans" select="$spans"/>
|
---|
| 553 | <xsl:with-param name="browserows" select="$browserows"/>
|
---|
[c873d807] | 554 | </xsl:call-template>
|
---|
| 555 | </xsl:when>
|
---|
| 556 | <xsl:otherwise>
|
---|
| 557 | <!--
|
---|
| 558 | <xsl:message>
|
---|
[15c7d39] | 559 | <xsl:text>Ignoring row: </xsl:text>
|
---|
| 560 | <xsl:value-of select="$spans"/>
|
---|
| 561 | <xsl:text> = </xsl:text>
|
---|
| 562 | <xsl:call-template name="consume-row">
|
---|
| 563 | <xsl:with-param name="spans" select="$spans"/>
|
---|
| 564 | </xsl:call-template>
|
---|
[c873d807] | 565 | </xsl:message>
|
---|
| 566 | -->
|
---|
| 567 |
|
---|
| 568 | <xsl:if test="normalize-space(.//text()) != ''">
|
---|
[15c7d39] | 569 | <xsl:message>Warning: overlapped row contains content!</xsl:message>
|
---|
[c873d807] | 570 | </xsl:if>
|
---|
| 571 |
|
---|
| 572 | <tr><xsl:comment> This row intentionally left blank </xsl:comment></tr>
|
---|
| 573 |
|
---|
[15c7d39] | 574 | <xsl:if test="$browserows = 'recurse'">
|
---|
| 575 | <xsl:apply-templates select="following-sibling::row[1]">
|
---|
| 576 | <xsl:with-param name="spans">
|
---|
| 577 | <xsl:call-template name="consume-row">
|
---|
| 578 | <xsl:with-param name="spans" select="$spans"/>
|
---|
| 579 | </xsl:call-template>
|
---|
| 580 | </xsl:with-param>
|
---|
| 581 | <xsl:with-param name="browserows" select="$browserows"/>
|
---|
| 582 | </xsl:apply-templates>
|
---|
| 583 | </xsl:if>
|
---|
[c873d807] | 584 | </xsl:otherwise>
|
---|
| 585 | </xsl:choose>
|
---|
| 586 | </xsl:template>
|
---|
| 587 |
|
---|
| 588 | <xsl:template name="normal-row">
|
---|
| 589 | <xsl:param name="spans"/>
|
---|
[15c7d39] | 590 | <xsl:param name="browserows"/>
|
---|
[c873d807] | 591 |
|
---|
| 592 | <xsl:variable name="row-height">
|
---|
| 593 | <xsl:if test="processing-instruction('dbhtml')">
|
---|
[60a5a938] | 594 | <xsl:call-template name="pi.dbhtml_row-height"/>
|
---|
[c873d807] | 595 | </xsl:if>
|
---|
| 596 | </xsl:variable>
|
---|
| 597 |
|
---|
| 598 | <xsl:variable name="bgcolor">
|
---|
| 599 | <xsl:if test="processing-instruction('dbhtml')">
|
---|
[60a5a938] | 600 | <xsl:call-template name="pi.dbhtml_bgcolor"/>
|
---|
[c873d807] | 601 | </xsl:if>
|
---|
| 602 | </xsl:variable>
|
---|
| 603 |
|
---|
| 604 | <xsl:variable name="class">
|
---|
| 605 | <xsl:if test="processing-instruction('dbhtml')">
|
---|
[60a5a938] | 606 | <xsl:call-template name="pi.dbhtml_class"/>
|
---|
[c873d807] | 607 | </xsl:if>
|
---|
| 608 | </xsl:variable>
|
---|
| 609 |
|
---|
| 610 | <tr>
|
---|
[15c7d39] | 611 | <xsl:call-template name="id.attribute"/>
|
---|
[c873d807] | 612 | <xsl:call-template name="tr.attributes">
|
---|
| 613 | <xsl:with-param name="rownum">
|
---|
| 614 | <xsl:number from="tgroup" count="row"/>
|
---|
| 615 | </xsl:with-param>
|
---|
| 616 | </xsl:call-template>
|
---|
| 617 |
|
---|
| 618 | <xsl:if test="$row-height != ''">
|
---|
| 619 | <xsl:attribute name="height">
|
---|
| 620 | <xsl:value-of select="$row-height"/>
|
---|
| 621 | </xsl:attribute>
|
---|
| 622 | </xsl:if>
|
---|
| 623 |
|
---|
| 624 | <xsl:if test="$bgcolor != ''">
|
---|
| 625 | <xsl:attribute name="bgcolor">
|
---|
| 626 | <xsl:value-of select="$bgcolor"/>
|
---|
| 627 | </xsl:attribute>
|
---|
| 628 | </xsl:if>
|
---|
| 629 |
|
---|
| 630 | <xsl:if test="$class != ''">
|
---|
| 631 | <xsl:attribute name="class">
|
---|
| 632 | <xsl:value-of select="$class"/>
|
---|
| 633 | </xsl:attribute>
|
---|
| 634 | </xsl:if>
|
---|
| 635 |
|
---|
| 636 | <xsl:if test="$table.borders.with.css != 0">
|
---|
| 637 | <xsl:if test="@rowsep = 1 and following-sibling::row">
|
---|
| 638 | <xsl:attribute name="style">
|
---|
| 639 | <xsl:call-template name="border">
|
---|
| 640 | <xsl:with-param name="side" select="'bottom'"/>
|
---|
| 641 | </xsl:call-template>
|
---|
| 642 | </xsl:attribute>
|
---|
| 643 | </xsl:if>
|
---|
| 644 | </xsl:if>
|
---|
| 645 |
|
---|
| 646 | <xsl:if test="@align">
|
---|
| 647 | <xsl:attribute name="align">
|
---|
| 648 | <xsl:value-of select="@align"/>
|
---|
| 649 | </xsl:attribute>
|
---|
| 650 | </xsl:if>
|
---|
| 651 | <xsl:if test="@char">
|
---|
| 652 | <xsl:attribute name="char">
|
---|
| 653 | <xsl:value-of select="@char"/>
|
---|
| 654 | </xsl:attribute>
|
---|
| 655 | </xsl:if>
|
---|
| 656 | <xsl:if test="@charoff">
|
---|
| 657 | <xsl:attribute name="charoff">
|
---|
| 658 | <xsl:value-of select="@charoff"/>
|
---|
| 659 | </xsl:attribute>
|
---|
| 660 | </xsl:if>
|
---|
| 661 | <xsl:if test="@valign">
|
---|
| 662 | <xsl:attribute name="valign">
|
---|
| 663 | <xsl:value-of select="@valign"/>
|
---|
| 664 | </xsl:attribute>
|
---|
| 665 | </xsl:if>
|
---|
| 666 |
|
---|
| 667 | <xsl:apply-templates select="(entry|entrytbl)[1]">
|
---|
| 668 | <xsl:with-param name="spans" select="$spans"/>
|
---|
| 669 | </xsl:apply-templates>
|
---|
| 670 | </tr>
|
---|
| 671 |
|
---|
[15c7d39] | 672 | <xsl:if test="$browserows = 'recurse'">
|
---|
| 673 | <xsl:if test="following-sibling::row">
|
---|
| 674 | <xsl:variable name="nextspans">
|
---|
| 675 | <xsl:apply-templates select="(entry|entrytbl)[1]" mode="span">
|
---|
| 676 | <xsl:with-param name="spans" select="$spans"/>
|
---|
| 677 | </xsl:apply-templates>
|
---|
| 678 | </xsl:variable>
|
---|
| 679 |
|
---|
| 680 | <xsl:apply-templates select="following-sibling::row[1]">
|
---|
| 681 | <xsl:with-param name="spans" select="$nextspans"/>
|
---|
| 682 | <xsl:with-param name="browserows" select="$browserows"/>
|
---|
[c873d807] | 683 | </xsl:apply-templates>
|
---|
[15c7d39] | 684 | </xsl:if>
|
---|
[c873d807] | 685 | </xsl:if>
|
---|
| 686 | </xsl:template>
|
---|
| 687 |
|
---|
| 688 | <xsl:template match="entry|entrytbl" name="entry">
|
---|
[15c7d39] | 689 | <xsl:param name="col">
|
---|
| 690 | <xsl:choose>
|
---|
| 691 | <xsl:when test="@revisionflag">
|
---|
| 692 | <xsl:number from="row"/>
|
---|
| 693 | </xsl:when>
|
---|
| 694 | <xsl:otherwise>1</xsl:otherwise>
|
---|
| 695 | </xsl:choose>
|
---|
| 696 | </xsl:param>
|
---|
| 697 |
|
---|
[c873d807] | 698 | <xsl:param name="spans"/>
|
---|
| 699 |
|
---|
| 700 | <xsl:variable name="cellgi">
|
---|
| 701 | <xsl:choose>
|
---|
| 702 | <xsl:when test="ancestor::thead">th</xsl:when>
|
---|
| 703 | <xsl:when test="ancestor::tfoot">th</xsl:when>
|
---|
[15c7d39] | 704 | <xsl:when test="ancestor::tbody and
|
---|
| 705 | (ancestor::table[@rowheader = 'firstcol'] or
|
---|
| 706 | ancestor::informaltable[@rowheader = 'firstcol']) and
|
---|
| 707 | ancestor-or-self::entry[1][count(preceding-sibling::entry) = 0]">
|
---|
| 708 | <xsl:text>th</xsl:text>
|
---|
| 709 | </xsl:when>
|
---|
[c873d807] | 710 | <xsl:otherwise>td</xsl:otherwise>
|
---|
| 711 | </xsl:choose>
|
---|
| 712 | </xsl:variable>
|
---|
| 713 |
|
---|
| 714 | <xsl:variable name="empty.cell" select="count(node()) = 0"/>
|
---|
| 715 |
|
---|
| 716 | <xsl:variable name="named.colnum">
|
---|
| 717 | <xsl:call-template name="entry.colnum"/>
|
---|
| 718 | </xsl:variable>
|
---|
| 719 |
|
---|
| 720 | <xsl:variable name="entry.colnum">
|
---|
| 721 | <xsl:choose>
|
---|
| 722 | <xsl:when test="$named.colnum > 0">
|
---|
| 723 | <xsl:value-of select="$named.colnum"/>
|
---|
| 724 | </xsl:when>
|
---|
| 725 | <xsl:otherwise>
|
---|
| 726 | <xsl:value-of select="$col"/>
|
---|
| 727 | </xsl:otherwise>
|
---|
| 728 | </xsl:choose>
|
---|
| 729 | </xsl:variable>
|
---|
| 730 |
|
---|
| 731 | <xsl:variable name="entry.colspan">
|
---|
| 732 | <xsl:choose>
|
---|
| 733 | <xsl:when test="@spanname or @namest">
|
---|
| 734 | <xsl:call-template name="calculate.colspan"/>
|
---|
| 735 | </xsl:when>
|
---|
| 736 | <xsl:otherwise>1</xsl:otherwise>
|
---|
| 737 | </xsl:choose>
|
---|
| 738 | </xsl:variable>
|
---|
| 739 |
|
---|
| 740 | <xsl:variable name="following.spans">
|
---|
| 741 | <xsl:call-template name="calculate.following.spans">
|
---|
| 742 | <xsl:with-param name="colspan" select="$entry.colspan"/>
|
---|
| 743 | <xsl:with-param name="spans" select="$spans"/>
|
---|
| 744 | </xsl:call-template>
|
---|
| 745 | </xsl:variable>
|
---|
| 746 |
|
---|
| 747 | <xsl:variable name="rowsep">
|
---|
| 748 | <xsl:choose>
|
---|
| 749 | <!-- If this is the last row, rowsep never applies. -->
|
---|
[15c7d39] | 750 | <xsl:when test="ancestor::entrytbl
|
---|
| 751 | and not (ancestor-or-self::row[1]/following-sibling::row)
|
---|
| 752 | and not (ancestor::thead)">
|
---|
[c873d807] | 753 | <xsl:value-of select="0"/>
|
---|
| 754 | </xsl:when>
|
---|
[15c7d39] | 755 | <xsl:when test="not(ancestor-or-self::row[1]/following-sibling::row
|
---|
| 756 | or ancestor-or-self::thead/following-sibling::tbody
|
---|
| 757 | or ancestor-or-self::tbody/preceding-sibling::tfoot)">
|
---|
[c873d807] | 758 | <xsl:value-of select="0"/>
|
---|
| 759 | </xsl:when>
|
---|
[15c7d39] | 760 | <xsl:when test="@morerows and not(@morerows <
|
---|
| 761 | count(ancestor-or-self::row[1]/following-sibling::row))">
|
---|
[c873d807] | 762 | <xsl:value-of select="0"/>
|
---|
| 763 | </xsl:when>
|
---|
| 764 | <xsl:otherwise>
|
---|
| 765 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 766 | <xsl:with-param name="entry" select="."/>
|
---|
| 767 | <xsl:with-param name="colnum" select="$entry.colnum"/>
|
---|
| 768 | <xsl:with-param name="attribute" select="'rowsep'"/>
|
---|
| 769 | </xsl:call-template>
|
---|
| 770 | </xsl:otherwise>
|
---|
| 771 | </xsl:choose>
|
---|
| 772 | </xsl:variable>
|
---|
| 773 |
|
---|
| 774 | <xsl:variable name="colsep">
|
---|
| 775 | <xsl:choose>
|
---|
| 776 | <!-- If this is the last column, colsep never applies. -->
|
---|
| 777 | <xsl:when test="$following.spans = ''">0</xsl:when>
|
---|
| 778 | <xsl:otherwise>
|
---|
| 779 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 780 | <xsl:with-param name="entry" select="."/>
|
---|
| 781 | <xsl:with-param name="colnum" select="$entry.colnum"/>
|
---|
| 782 | <xsl:with-param name="attribute" select="'colsep'"/>
|
---|
| 783 | </xsl:call-template>
|
---|
| 784 | </xsl:otherwise>
|
---|
| 785 | </xsl:choose>
|
---|
| 786 | </xsl:variable>
|
---|
| 787 |
|
---|
| 788 | <xsl:variable name="valign">
|
---|
| 789 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 790 | <xsl:with-param name="entry" select="."/>
|
---|
| 791 | <xsl:with-param name="colnum" select="$entry.colnum"/>
|
---|
| 792 | <xsl:with-param name="attribute" select="'valign'"/>
|
---|
| 793 | </xsl:call-template>
|
---|
| 794 | </xsl:variable>
|
---|
| 795 |
|
---|
| 796 | <xsl:variable name="align">
|
---|
| 797 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 798 | <xsl:with-param name="entry" select="."/>
|
---|
| 799 | <xsl:with-param name="colnum" select="$entry.colnum"/>
|
---|
| 800 | <xsl:with-param name="attribute" select="'align'"/>
|
---|
| 801 | </xsl:call-template>
|
---|
| 802 | </xsl:variable>
|
---|
| 803 |
|
---|
| 804 | <xsl:variable name="char">
|
---|
| 805 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 806 | <xsl:with-param name="entry" select="."/>
|
---|
| 807 | <xsl:with-param name="colnum" select="$entry.colnum"/>
|
---|
| 808 | <xsl:with-param name="attribute" select="'char'"/>
|
---|
| 809 | </xsl:call-template>
|
---|
| 810 | </xsl:variable>
|
---|
| 811 |
|
---|
| 812 | <xsl:variable name="charoff">
|
---|
| 813 | <xsl:call-template name="inherited.table.attribute">
|
---|
| 814 | <xsl:with-param name="entry" select="."/>
|
---|
| 815 | <xsl:with-param name="colnum" select="$entry.colnum"/>
|
---|
| 816 | <xsl:with-param name="attribute" select="'charoff'"/>
|
---|
| 817 | </xsl:call-template>
|
---|
| 818 | </xsl:variable>
|
---|
| 819 |
|
---|
| 820 | <xsl:choose>
|
---|
| 821 | <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
|
---|
| 822 | <xsl:call-template name="entry">
|
---|
| 823 | <xsl:with-param name="col" select="$col+1"/>
|
---|
| 824 | <xsl:with-param name="spans" select="substring-after($spans,':')"/>
|
---|
| 825 | </xsl:call-template>
|
---|
| 826 | </xsl:when>
|
---|
| 827 |
|
---|
| 828 | <xsl:when test="number($entry.colnum) > $col">
|
---|
| 829 | <xsl:call-template name="empty.table.cell"/>
|
---|
| 830 | <xsl:call-template name="entry">
|
---|
| 831 | <xsl:with-param name="col" select="$col+1"/>
|
---|
| 832 | <xsl:with-param name="spans" select="substring-after($spans,':')"/>
|
---|
| 833 | </xsl:call-template>
|
---|
| 834 | </xsl:when>
|
---|
| 835 |
|
---|
| 836 | <xsl:otherwise>
|
---|
| 837 | <xsl:variable name="bgcolor">
|
---|
| 838 | <xsl:if test="processing-instruction('dbhtml')">
|
---|
[60a5a938] | 839 | <xsl:call-template name="pi.dbhtml_bgcolor"/>
|
---|
[c873d807] | 840 | </xsl:if>
|
---|
| 841 | </xsl:variable>
|
---|
| 842 |
|
---|
[15c7d39] | 843 | <xsl:element name="{$cellgi}">
|
---|
| 844 | <xsl:call-template name="id.attribute"/>
|
---|
[c873d807] | 845 | <xsl:if test="$bgcolor != ''">
|
---|
| 846 | <xsl:attribute name="bgcolor">
|
---|
| 847 | <xsl:value-of select="$bgcolor"/>
|
---|
| 848 | </xsl:attribute>
|
---|
| 849 | </xsl:if>
|
---|
| 850 |
|
---|
[15c7d39] | 851 | <xsl:call-template name="locale.html.attributes"/>
|
---|
| 852 | <xsl:choose>
|
---|
| 853 | <xsl:when test="$entry.propagates.style != 0 and @role">
|
---|
| 854 | <xsl:apply-templates select="." mode="class.attribute">
|
---|
| 855 | <xsl:with-param name="class" select="@role"/>
|
---|
| 856 | </xsl:apply-templates>
|
---|
| 857 | </xsl:when>
|
---|
| 858 | <xsl:otherwise>
|
---|
| 859 | <xsl:apply-templates select="." mode="class.attribute">
|
---|
| 860 | <xsl:with-param name="class" select="''"/>
|
---|
| 861 | </xsl:apply-templates>
|
---|
| 862 | </xsl:otherwise>
|
---|
| 863 | </xsl:choose>
|
---|
[c873d807] | 864 |
|
---|
| 865 | <xsl:if test="$show.revisionflag and @revisionflag">
|
---|
| 866 | <xsl:attribute name="class">
|
---|
| 867 | <xsl:value-of select="@revisionflag"/>
|
---|
| 868 | </xsl:attribute>
|
---|
| 869 | </xsl:if>
|
---|
| 870 |
|
---|
| 871 | <xsl:if test="$table.borders.with.css != 0">
|
---|
| 872 | <xsl:attribute name="style">
|
---|
| 873 | <xsl:if test="$colsep > 0">
|
---|
| 874 | <xsl:call-template name="border">
|
---|
| 875 | <xsl:with-param name="side" select="'right'"/>
|
---|
| 876 | </xsl:call-template>
|
---|
| 877 | </xsl:if>
|
---|
| 878 | <xsl:if test="$rowsep > 0">
|
---|
| 879 | <xsl:call-template name="border">
|
---|
| 880 | <xsl:with-param name="side" select="'bottom'"/>
|
---|
| 881 | </xsl:call-template>
|
---|
| 882 | </xsl:if>
|
---|
| 883 | </xsl:attribute>
|
---|
| 884 | </xsl:if>
|
---|
| 885 |
|
---|
| 886 | <xsl:if test="@morerows > 0">
|
---|
| 887 | <xsl:attribute name="rowspan">
|
---|
| 888 | <xsl:value-of select="1+@morerows"/>
|
---|
| 889 | </xsl:attribute>
|
---|
| 890 | </xsl:if>
|
---|
| 891 |
|
---|
| 892 | <xsl:if test="$entry.colspan > 1">
|
---|
| 893 | <xsl:attribute name="colspan">
|
---|
| 894 | <xsl:value-of select="$entry.colspan"/>
|
---|
| 895 | </xsl:attribute>
|
---|
| 896 | </xsl:if>
|
---|
| 897 |
|
---|
| 898 | <xsl:if test="$align != ''">
|
---|
| 899 | <xsl:attribute name="align">
|
---|
| 900 | <xsl:value-of select="$align"/>
|
---|
| 901 | </xsl:attribute>
|
---|
| 902 | </xsl:if>
|
---|
| 903 |
|
---|
| 904 | <xsl:if test="$valign != ''">
|
---|
| 905 | <xsl:attribute name="valign">
|
---|
| 906 | <xsl:value-of select="$valign"/>
|
---|
| 907 | </xsl:attribute>
|
---|
| 908 | </xsl:if>
|
---|
| 909 |
|
---|
| 910 | <xsl:if test="$char != ''">
|
---|
| 911 | <xsl:attribute name="char">
|
---|
| 912 | <xsl:value-of select="$char"/>
|
---|
| 913 | </xsl:attribute>
|
---|
| 914 | </xsl:if>
|
---|
| 915 |
|
---|
| 916 | <xsl:if test="$charoff != ''">
|
---|
| 917 | <xsl:attribute name="charoff">
|
---|
| 918 | <xsl:value-of select="$charoff"/>
|
---|
| 919 | </xsl:attribute>
|
---|
| 920 | </xsl:if>
|
---|
| 921 |
|
---|
[15c7d39] | 922 | <xsl:if test="not(preceding-sibling::*) and
|
---|
| 923 | (ancestor::row[1]/@id or ancestor::row[1]/@xml:id)">
|
---|
[c873d807] | 924 | <xsl:call-template name="anchor">
|
---|
| 925 | <xsl:with-param name="node" select="ancestor::row[1]"/>
|
---|
| 926 | </xsl:call-template>
|
---|
| 927 | </xsl:if>
|
---|
| 928 |
|
---|
| 929 | <xsl:call-template name="anchor"/>
|
---|
| 930 |
|
---|
| 931 | <xsl:choose>
|
---|
| 932 | <xsl:when test="$empty.cell">
|
---|
| 933 | <xsl:text> </xsl:text>
|
---|
| 934 | </xsl:when>
|
---|
| 935 | <xsl:when test="self::entrytbl">
|
---|
| 936 | <xsl:call-template name="tgroup"/>
|
---|
| 937 | </xsl:when>
|
---|
| 938 | <xsl:otherwise>
|
---|
| 939 | <xsl:apply-templates/>
|
---|
| 940 | </xsl:otherwise>
|
---|
| 941 | </xsl:choose>
|
---|
| 942 | </xsl:element>
|
---|
| 943 |
|
---|
| 944 | <xsl:choose>
|
---|
| 945 | <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
|
---|
[15c7d39] | 946 | <xsl:apply-templates select="(following-sibling::entry
|
---|
| 947 | |following-sibling::entrytbl)[1]">
|
---|
[c873d807] | 948 | <xsl:with-param name="col" select="$col+$entry.colspan"/>
|
---|
| 949 | <xsl:with-param name="spans" select="$following.spans"/>
|
---|
| 950 | </xsl:apply-templates>
|
---|
| 951 | </xsl:when>
|
---|
| 952 | <xsl:otherwise>
|
---|
| 953 | <xsl:call-template name="finaltd">
|
---|
| 954 | <xsl:with-param name="spans" select="$following.spans"/>
|
---|
| 955 | <xsl:with-param name="col" select="$col+$entry.colspan"/>
|
---|
| 956 | </xsl:call-template>
|
---|
| 957 | </xsl:otherwise>
|
---|
| 958 | </xsl:choose>
|
---|
| 959 | </xsl:otherwise>
|
---|
| 960 | </xsl:choose>
|
---|
| 961 | </xsl:template>
|
---|
| 962 |
|
---|
| 963 | <xsl:template match="entry|entrytbl" name="sentry" mode="span">
|
---|
| 964 | <xsl:param name="col" select="1"/>
|
---|
| 965 | <xsl:param name="spans"/>
|
---|
| 966 |
|
---|
| 967 | <xsl:variable name="entry.colnum">
|
---|
| 968 | <xsl:call-template name="entry.colnum"/>
|
---|
| 969 | </xsl:variable>
|
---|
| 970 |
|
---|
| 971 | <xsl:variable name="entry.colspan">
|
---|
| 972 | <xsl:choose>
|
---|
| 973 | <xsl:when test="@spanname or @namest">
|
---|
| 974 | <xsl:call-template name="calculate.colspan"/>
|
---|
| 975 | </xsl:when>
|
---|
| 976 | <xsl:otherwise>1</xsl:otherwise>
|
---|
| 977 | </xsl:choose>
|
---|
| 978 | </xsl:variable>
|
---|
| 979 |
|
---|
| 980 | <xsl:variable name="following.spans">
|
---|
| 981 | <xsl:call-template name="calculate.following.spans">
|
---|
| 982 | <xsl:with-param name="colspan" select="$entry.colspan"/>
|
---|
| 983 | <xsl:with-param name="spans" select="$spans"/>
|
---|
| 984 | </xsl:call-template>
|
---|
| 985 | </xsl:variable>
|
---|
| 986 |
|
---|
| 987 | <xsl:choose>
|
---|
| 988 | <xsl:when test="$spans != '' and not(starts-with($spans,'0:'))">
|
---|
| 989 | <xsl:value-of select="substring-before($spans,':')-1"/>
|
---|
| 990 | <xsl:text>:</xsl:text>
|
---|
| 991 | <xsl:call-template name="sentry">
|
---|
| 992 | <xsl:with-param name="col" select="$col+1"/>
|
---|
| 993 | <xsl:with-param name="spans" select="substring-after($spans,':')"/>
|
---|
| 994 | </xsl:call-template>
|
---|
| 995 | </xsl:when>
|
---|
| 996 |
|
---|
| 997 | <xsl:when test="number($entry.colnum) > $col">
|
---|
| 998 | <xsl:text>0:</xsl:text>
|
---|
| 999 | <xsl:call-template name="sentry">
|
---|
[15c7d39] | 1000 | <xsl:with-param name="col" select="$col + 1"/>
|
---|
| 1001 | <xsl:with-param name="spans" select="substring-after($spans,':')"/>
|
---|
[c873d807] | 1002 | </xsl:call-template>
|
---|
| 1003 | </xsl:when>
|
---|
| 1004 |
|
---|
| 1005 | <xsl:otherwise>
|
---|
| 1006 | <xsl:call-template name="copy-string">
|
---|
| 1007 | <xsl:with-param name="count" select="$entry.colspan"/>
|
---|
| 1008 | <xsl:with-param name="string">
|
---|
| 1009 | <xsl:choose>
|
---|
| 1010 | <xsl:when test="@morerows">
|
---|
| 1011 | <xsl:value-of select="@morerows"/>
|
---|
| 1012 | </xsl:when>
|
---|
| 1013 | <xsl:otherwise>0</xsl:otherwise>
|
---|
| 1014 | </xsl:choose>
|
---|
| 1015 | <xsl:text>:</xsl:text>
|
---|
| 1016 | </xsl:with-param>
|
---|
| 1017 | </xsl:call-template>
|
---|
| 1018 |
|
---|
| 1019 | <xsl:choose>
|
---|
| 1020 | <xsl:when test="following-sibling::entry|following-sibling::entrytbl">
|
---|
[15c7d39] | 1021 | <xsl:apply-templates select="(following-sibling::entry
|
---|
| 1022 | |following-sibling::entrytbl)[1]"
|
---|
| 1023 | mode="span">
|
---|
[c873d807] | 1024 | <xsl:with-param name="col" select="$col+$entry.colspan"/>
|
---|
| 1025 | <xsl:with-param name="spans" select="$following.spans"/>
|
---|
| 1026 | </xsl:apply-templates>
|
---|
| 1027 | </xsl:when>
|
---|
| 1028 | <xsl:otherwise>
|
---|
| 1029 | <xsl:call-template name="sfinaltd">
|
---|
| 1030 | <xsl:with-param name="spans" select="$following.spans"/>
|
---|
| 1031 | </xsl:call-template>
|
---|
| 1032 | </xsl:otherwise>
|
---|
| 1033 | </xsl:choose>
|
---|
| 1034 | </xsl:otherwise>
|
---|
| 1035 | </xsl:choose>
|
---|
| 1036 | </xsl:template>
|
---|
| 1037 |
|
---|
| 1038 | <xsl:template name="generate.colgroup">
|
---|
| 1039 | <xsl:param name="cols" select="1"/>
|
---|
| 1040 | <xsl:param name="count" select="1"/>
|
---|
| 1041 | <xsl:choose>
|
---|
[15c7d39] | 1042 | <xsl:when test="$count > $cols"></xsl:when>
|
---|
[c873d807] | 1043 | <xsl:otherwise>
|
---|
| 1044 | <xsl:call-template name="generate.col">
|
---|
| 1045 | <xsl:with-param name="countcol" select="$count"/>
|
---|
| 1046 | </xsl:call-template>
|
---|
| 1047 | <xsl:call-template name="generate.colgroup">
|
---|
| 1048 | <xsl:with-param name="cols" select="$cols"/>
|
---|
| 1049 | <xsl:with-param name="count" select="$count+1"/>
|
---|
| 1050 | </xsl:call-template>
|
---|
| 1051 | </xsl:otherwise>
|
---|
| 1052 | </xsl:choose>
|
---|
| 1053 | </xsl:template>
|
---|
| 1054 |
|
---|
| 1055 | <xsl:template name="generate.col">
|
---|
| 1056 | <xsl:param name="countcol">1</xsl:param>
|
---|
| 1057 | <xsl:param name="colspecs" select="./colspec"/>
|
---|
| 1058 | <xsl:param name="count">1</xsl:param>
|
---|
| 1059 | <xsl:param name="colnum">1</xsl:param>
|
---|
| 1060 |
|
---|
| 1061 | <xsl:choose>
|
---|
[15c7d39] | 1062 | <xsl:when test="$count>count($colspecs)">
|
---|
[c873d807] | 1063 | <col/>
|
---|
| 1064 | </xsl:when>
|
---|
| 1065 | <xsl:otherwise>
|
---|
| 1066 | <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
|
---|
| 1067 | <xsl:variable name="colspec.colnum">
|
---|
| 1068 | <xsl:choose>
|
---|
| 1069 | <xsl:when test="$colspec/@colnum">
|
---|
| 1070 | <xsl:value-of select="$colspec/@colnum"/>
|
---|
| 1071 | </xsl:when>
|
---|
| 1072 | <xsl:otherwise>
|
---|
| 1073 | <xsl:value-of select="$colnum"/>
|
---|
| 1074 | </xsl:otherwise>
|
---|
| 1075 | </xsl:choose>
|
---|
| 1076 | </xsl:variable>
|
---|
| 1077 |
|
---|
| 1078 | <xsl:choose>
|
---|
| 1079 | <xsl:when test="$colspec.colnum=$countcol">
|
---|
| 1080 | <col>
|
---|
[15c7d39] | 1081 | <xsl:choose>
|
---|
| 1082 | <xsl:when test="$colspec/@colwidth
|
---|
| 1083 | and $use.extensions != 0
|
---|
| 1084 | and $tablecolumns.extension != 0">
|
---|
| 1085 | <xsl:attribute name="width">
|
---|
| 1086 | <xsl:choose>
|
---|
| 1087 | <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
|
---|
| 1088 | <xsl:value-of select="'1*'"/>
|
---|
| 1089 | </xsl:when>
|
---|
| 1090 | <xsl:otherwise>
|
---|
| 1091 | <xsl:value-of select="$colspec/@colwidth"/>
|
---|
| 1092 | </xsl:otherwise>
|
---|
| 1093 | </xsl:choose>
|
---|
| 1094 | </xsl:attribute>
|
---|
| 1095 | </xsl:when>
|
---|
| 1096 | <!-- pass through to HTML if no * in colspecs -->
|
---|
| 1097 | <xsl:when test="$colspec/@colwidth and
|
---|
| 1098 | not($colspec/parent::*/colspec/@colwidth[contains(.,'*')])">
|
---|
| 1099 | <xsl:attribute name="width">
|
---|
| 1100 | <xsl:choose>
|
---|
| 1101 | <xsl:when test="normalize-space($colspec/@colwidth) = '*'">
|
---|
| 1102 | <xsl:value-of select="'1*'"/>
|
---|
| 1103 | </xsl:when>
|
---|
| 1104 | <xsl:otherwise>
|
---|
| 1105 | <xsl:value-of select="$colspec/@colwidth"/>
|
---|
| 1106 | </xsl:otherwise>
|
---|
| 1107 | </xsl:choose>
|
---|
| 1108 | </xsl:attribute>
|
---|
| 1109 | </xsl:when>
|
---|
| 1110 | </xsl:choose>
|
---|
[c873d807] | 1111 |
|
---|
| 1112 | <xsl:choose>
|
---|
| 1113 | <xsl:when test="$colspec/@align">
|
---|
| 1114 | <xsl:attribute name="align">
|
---|
| 1115 | <xsl:value-of select="$colspec/@align"/>
|
---|
| 1116 | </xsl:attribute>
|
---|
| 1117 | </xsl:when>
|
---|
| 1118 | <!-- Suggested by Pavel ZAMPACH <zampach@nemcb.cz> -->
|
---|
| 1119 | <xsl:when test="$colspecs/ancestor::tgroup/@align">
|
---|
| 1120 | <xsl:attribute name="align">
|
---|
| 1121 | <xsl:value-of select="$colspecs/ancestor::tgroup/@align"/>
|
---|
| 1122 | </xsl:attribute>
|
---|
| 1123 | </xsl:when>
|
---|
| 1124 | </xsl:choose>
|
---|
| 1125 |
|
---|
| 1126 | <xsl:if test="$colspec/@char">
|
---|
| 1127 | <xsl:attribute name="char">
|
---|
| 1128 | <xsl:value-of select="$colspec/@char"/>
|
---|
| 1129 | </xsl:attribute>
|
---|
| 1130 | </xsl:if>
|
---|
[15c7d39] | 1131 |
|
---|
[c873d807] | 1132 | <xsl:if test="$colspec/@charoff">
|
---|
| 1133 | <xsl:attribute name="charoff">
|
---|
| 1134 | <xsl:value-of select="$colspec/@charoff"/>
|
---|
| 1135 | </xsl:attribute>
|
---|
| 1136 | </xsl:if>
|
---|
[15c7d39] | 1137 |
|
---|
| 1138 | <xsl:if test="$colspec/@colname">
|
---|
| 1139 | <xsl:attribute name="class">
|
---|
| 1140 | <xsl:value-of select="$colspec/@colname"/>
|
---|
| 1141 | </xsl:attribute>
|
---|
| 1142 | </xsl:if>
|
---|
[c873d807] | 1143 | </col>
|
---|
| 1144 | </xsl:when>
|
---|
| 1145 | <xsl:otherwise>
|
---|
| 1146 | <xsl:call-template name="generate.col">
|
---|
| 1147 | <xsl:with-param name="countcol" select="$countcol"/>
|
---|
| 1148 | <xsl:with-param name="colspecs" select="$colspecs"/>
|
---|
| 1149 | <xsl:with-param name="count" select="$count+1"/>
|
---|
| 1150 | <xsl:with-param name="colnum">
|
---|
| 1151 | <xsl:choose>
|
---|
| 1152 | <xsl:when test="$colspec/@colnum">
|
---|
| 1153 | <xsl:value-of select="$colspec/@colnum + 1"/>
|
---|
| 1154 | </xsl:when>
|
---|
| 1155 | <xsl:otherwise>
|
---|
| 1156 | <xsl:value-of select="$colnum + 1"/>
|
---|
| 1157 | </xsl:otherwise>
|
---|
| 1158 | </xsl:choose>
|
---|
| 1159 | </xsl:with-param>
|
---|
| 1160 | </xsl:call-template>
|
---|
| 1161 | </xsl:otherwise>
|
---|
| 1162 | </xsl:choose>
|
---|
| 1163 | </xsl:otherwise>
|
---|
| 1164 | </xsl:choose>
|
---|
| 1165 | </xsl:template>
|
---|
| 1166 |
|
---|
| 1167 | <xsl:template name="colspec.colwidth">
|
---|
| 1168 | <!-- when this macro is called, the current context must be an entry -->
|
---|
[15c7d39] | 1169 | <xsl:param name="colname"></xsl:param>
|
---|
[c873d807] | 1170 | <!-- .. = row, ../.. = thead|tbody, ../../.. = tgroup -->
|
---|
| 1171 | <xsl:param name="colspecs" select="../../../../tgroup/colspec"/>
|
---|
| 1172 | <xsl:param name="count">1</xsl:param>
|
---|
| 1173 | <xsl:choose>
|
---|
[15c7d39] | 1174 | <xsl:when test="$count>count($colspecs)"></xsl:when>
|
---|
[c873d807] | 1175 | <xsl:otherwise>
|
---|
| 1176 | <xsl:variable name="colspec" select="$colspecs[$count=position()]"/>
|
---|
| 1177 | <xsl:choose>
|
---|
| 1178 | <xsl:when test="$colspec/@colname=$colname">
|
---|
| 1179 | <xsl:value-of select="$colspec/@colwidth"/>
|
---|
| 1180 | </xsl:when>
|
---|
| 1181 | <xsl:otherwise>
|
---|
| 1182 | <xsl:call-template name="colspec.colwidth">
|
---|
| 1183 | <xsl:with-param name="colname" select="$colname"/>
|
---|
| 1184 | <xsl:with-param name="colspecs" select="$colspecs"/>
|
---|
| 1185 | <xsl:with-param name="count" select="$count+1"/>
|
---|
| 1186 | </xsl:call-template>
|
---|
| 1187 | </xsl:otherwise>
|
---|
| 1188 | </xsl:choose>
|
---|
| 1189 | </xsl:otherwise>
|
---|
| 1190 | </xsl:choose>
|
---|
| 1191 | </xsl:template>
|
---|
| 1192 |
|
---|
| 1193 | <!-- ====================================================================== -->
|
---|
| 1194 |
|
---|
| 1195 | <xsl:template name="tr.attributes">
|
---|
| 1196 | <xsl:param name="row" select="."/>
|
---|
| 1197 | <xsl:param name="rownum" select="0"/>
|
---|
| 1198 |
|
---|
| 1199 | <!-- by default, do nothing. But you might want to say:
|
---|
| 1200 |
|
---|
| 1201 | <xsl:if test="$rownum mod 2 = 0">
|
---|
| 1202 | <xsl:attribute name="class">oddrow</xsl:attribute>
|
---|
| 1203 | </xsl:if>
|
---|
| 1204 |
|
---|
| 1205 | -->
|
---|
| 1206 | </xsl:template>
|
---|
| 1207 |
|
---|
| 1208 | </xsl:stylesheet>
|
---|
[15c7d39] | 1209 |
|
---|