docbook_xsl_wrapper 0.1.2 → 0.5.2

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