metanorma-csa 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -454,6 +454,7 @@
454
454
 
455
455
  <xsl:template match="csa:p" name="paragraph">
456
456
  <xsl:param name="inline" select="'false'"/>
457
+ <xsl:param name="split_keep-within-line"/>
457
458
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
458
459
  <xsl:variable name="element-name">
459
460
  <xsl:choose>
@@ -481,7 +482,9 @@
481
482
  </xsl:choose>
482
483
  </xsl:attribute>
483
484
  <xsl:attribute name="line-height">155%</xsl:attribute>
484
- <xsl:apply-templates/>
485
+ <xsl:apply-templates>
486
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
487
+ </xsl:apply-templates>
485
488
  </xsl:element>
486
489
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
487
490
  <fo:block margin-bottom="12pt">
@@ -571,7 +574,9 @@
571
574
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAASEAAAEhCAYAAAAwHRYbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3BpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5z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kSuQmCC</xsl:text>
572
575
  </xsl:variable>
573
576
 
574
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:variable name="lang">
577
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
578
+ false
579
+ </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
575
580
  <xsl:call-template name="getLang"/>
576
581
  </xsl:variable><xsl:variable name="pageWidth_">
577
582
  215.9
@@ -1027,6 +1032,7 @@
1027
1032
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1028
1033
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1029
1034
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1035
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1030
1036
  <xsl:attribute name="display-align">center</xsl:attribute>
1031
1037
 
1032
1038
 
@@ -1045,6 +1051,7 @@
1045
1051
  <xsl:attribute name="display-align">center</xsl:attribute>
1046
1052
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1047
1053
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1054
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1048
1055
 
1049
1056
 
1050
1057
 
@@ -1127,7 +1134,8 @@
1127
1134
  </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1128
1135
 
1129
1136
 
1130
- </xsl:attribute-set><xsl:attribute-set name="dt-style">
1137
+ </xsl:attribute-set><xsl:attribute-set name="dt-cell-style">
1138
+ </xsl:attribute-set><xsl:attribute-set name="dt-block-style">
1131
1139
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1132
1140
 
1133
1141
 
@@ -1139,6 +1147,8 @@
1139
1147
 
1140
1148
 
1141
1149
 
1150
+ </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
1151
+ <xsl:attribute name="padding-left">2mm</xsl:attribute>
1142
1152
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1143
1153
 
1144
1154
 
@@ -1996,7 +2006,38 @@
1996
2006
  </xsl:template><xsl:template match="*[local-name()='br']">
1997
2007
  <xsl:value-of select="$linebreak"/>
1998
2008
  </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
1999
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2009
+ <xsl:param name="split_keep-within-line"/>
2010
+
2011
+ <!-- <fo:inline>split_keep-within-line='<xsl:value-of select="$split_keep-within-line"/>'</fo:inline> -->
2012
+ <xsl:choose>
2013
+
2014
+ <xsl:when test="normalize-space($split_keep-within-line) = 'true'">
2015
+ <xsl:variable name="sep">_</xsl:variable>
2016
+ <xsl:variable name="items">
2017
+ <xsl:call-template name="split">
2018
+ <xsl:with-param name="pText" select="."/>
2019
+ <xsl:with-param name="sep" select="$sep"/>
2020
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
2021
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
2022
+ </xsl:call-template>
2023
+ </xsl:variable>
2024
+ <xsl:for-each select="xalan:nodeset($items)/item">
2025
+ <xsl:choose>
2026
+ <xsl:when test=". = $sep">
2027
+ <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2028
+ </xsl:when>
2029
+ <xsl:otherwise>
2030
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2031
+ </xsl:otherwise>
2032
+ </xsl:choose>
2033
+ </xsl:for-each>
2034
+ </xsl:when>
2035
+
2036
+ <xsl:otherwise>
2037
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2038
+ </xsl:otherwise>
2039
+
2040
+ </xsl:choose>
2000
2041
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2001
2042
  <fo:block xsl:use-attribute-sets="copyright-statement-style">
2002
2043
  <xsl:apply-templates/>
@@ -2088,9 +2129,14 @@
2088
2129
 
2089
2130
  <xsl:variable name="table">
2090
2131
 
2091
- <xsl:variable name="simple-table">
2092
- <xsl:call-template name="getSimpleTable"/>
2132
+ <xsl:variable name="simple-table">
2133
+ <xsl:call-template name="getSimpleTable">
2134
+ <xsl:with-param name="id" select="@id"/>
2135
+ </xsl:call-template>
2093
2136
  </xsl:variable>
2137
+ <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2138
+
2139
+ <!-- simple-table=<xsl:copy-of select="$simple-table"/> -->
2094
2140
 
2095
2141
 
2096
2142
  <!-- Display table's name before table as standalone block -->
@@ -2111,7 +2157,23 @@
2111
2157
  </xsl:call-template>
2112
2158
  </xsl:if>
2113
2159
  </xsl:variable>
2114
- <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2160
+ <!-- <xsl:variable name="colwidths" select="xalan:nodeset($colwidths_)"/> -->
2161
+
2162
+ <!-- DEBUG -->
2163
+ <xsl:if test="$table_if_debug = 'true'">
2164
+ <fo:block font-size="60%">
2165
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
2166
+ </fo:block>
2167
+ </xsl:if>
2168
+
2169
+
2170
+ <!-- <xsl:copy-of select="$colwidths"/> -->
2171
+
2172
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
2173
+ DEBUG
2174
+ colwidths=<xsl:copy-of select="$colwidths"/>
2175
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
2176
+
2115
2177
 
2116
2178
 
2117
2179
  <xsl:variable name="margin-side">
@@ -2178,9 +2240,17 @@
2178
2240
  </xsl:element>
2179
2241
  </xsl:variable>
2180
2242
 
2243
+ <xsl:if test="$isGenerateTableIF = 'true'">
2244
+ <!-- to determine start of table -->
2245
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
2246
+ </xsl:if>
2181
2247
 
2182
2248
  <fo:table id="{@id}">
2183
2249
 
2250
+ <xsl:if test="$isGenerateTableIF = 'true'">
2251
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
2252
+ </xsl:if>
2253
+
2184
2254
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2185
2255
  <xsl:attribute name="{local-name()}">
2186
2256
  <xsl:value-of select="."/>
@@ -2194,24 +2264,47 @@
2194
2264
 
2195
2265
 
2196
2266
  <xsl:choose>
2197
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2198
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2199
- <fo:table-column column-width="{@width}"/>
2200
- </xsl:for-each>
2267
+ <xsl:when test="$isGenerateTableIF = 'true'">
2268
+ <!-- generate IF for table widths -->
2269
+ <!-- example:
2270
+ <tr>
2271
+ <td valign="top" align="left" id="tab-symdu_1_1">
2272
+ <p>Symbol</p>
2273
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
2274
+ </td>
2275
+ <td valign="top" align="left" id="tab-symdu_1_2">
2276
+ <p>Description</p>
2277
+ <word id="tab-symdu_1_2_word_1">Description</word>
2278
+ </td>
2279
+ </tr>
2280
+ -->
2281
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2282
+
2201
2283
  </xsl:when>
2202
2284
  <xsl:otherwise>
2203
- <xsl:call-template name="insertTableColumnWidth">
2204
- <xsl:with-param name="colwidths" select="$colwidths"/>
2205
- </xsl:call-template>
2206
- </xsl:otherwise>
2207
- </xsl:choose>
2208
2285
 
2209
- <xsl:choose>
2210
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2211
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2212
- </xsl:when>
2213
- <xsl:otherwise>
2214
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
2286
+ <xsl:choose>
2287
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2288
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2289
+ <fo:table-column column-width="{@width}"/>
2290
+ </xsl:for-each>
2291
+ </xsl:when>
2292
+ <xsl:otherwise>
2293
+ <xsl:call-template name="insertTableColumnWidth">
2294
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2295
+ </xsl:call-template>
2296
+ </xsl:otherwise>
2297
+ </xsl:choose>
2298
+
2299
+ <xsl:choose>
2300
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2301
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2302
+ </xsl:when>
2303
+ <xsl:otherwise>
2304
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
2305
+ </xsl:otherwise>
2306
+ </xsl:choose>
2307
+
2215
2308
  </xsl:otherwise>
2216
2309
  </xsl:choose>
2217
2310
 
@@ -2314,11 +2407,22 @@
2314
2407
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2315
2408
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
2316
2409
  </xsl:template><xsl:template name="calculate-column-widths">
2410
+ <xsl:param name="table"/>
2411
+ <xsl:param name="cols-count"/>
2412
+
2413
+ <xsl:call-template name="calculate-column-widths-proportional">
2414
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2415
+ <xsl:with-param name="table" select="$table"/>
2416
+ </xsl:call-template>
2417
+
2418
+ </xsl:template><xsl:template name="calculate-column-widths-proportional">
2317
2419
  <xsl:param name="table"/>
2318
2420
  <xsl:param name="cols-count"/>
2319
2421
  <xsl:param name="curr-col" select="1"/>
2320
2422
  <xsl:param name="width" select="0"/>
2321
2423
 
2424
+ <!-- table=<xsl:copy-of select="$table"/> -->
2425
+
2322
2426
  <xsl:if test="$curr-col &lt;= $cols-count">
2323
2427
  <xsl:variable name="widths">
2324
2428
  <xsl:choose>
@@ -2356,10 +2460,15 @@
2356
2460
  </xsl:for-each>
2357
2461
  </xsl:when>
2358
2462
  <xsl:otherwise>
2359
- <xsl:for-each select="xalan:nodeset($table)/*/tr">
2463
+ <!-- <curr_col><xsl:value-of select="$curr-col"/></curr_col> -->
2464
+
2465
+ <!-- <table><xsl:copy-of select="$table"/></table>
2466
+ -->
2467
+ <xsl:for-each select="xalan:nodeset($table)/*/*[local-name()='tr']">
2360
2468
  <xsl:variable name="td_text">
2361
2469
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2362
2470
  </xsl:variable>
2471
+ <!-- <td_text><xsl:value-of select="$td_text"/></td_text> -->
2363
2472
  <xsl:variable name="words">
2364
2473
  <xsl:variable name="string_with_added_zerospaces">
2365
2474
  <xsl:call-template name="add-zero-spaces-java">
@@ -2374,6 +2483,7 @@
2374
2483
  <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2375
2484
  </xsl:call-template>
2376
2485
  </xsl:variable>
2486
+ <!-- words=<xsl:copy-of select="$words"/> -->
2377
2487
  <xsl:variable name="max_length">
2378
2488
  <xsl:call-template name="max_length">
2379
2489
  <xsl:with-param name="words" select="xalan:nodeset($words)"/>
@@ -2398,6 +2508,8 @@
2398
2508
  </xsl:choose>
2399
2509
  </xsl:variable>
2400
2510
 
2511
+ <!-- widths=<xsl:copy-of select="$widths"/> -->
2512
+
2401
2513
  <column>
2402
2514
  <xsl:for-each select="xalan:nodeset($widths)//width">
2403
2515
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -2406,33 +2518,327 @@
2406
2518
  </xsl:if>
2407
2519
  </xsl:for-each>
2408
2520
  </column>
2409
- <xsl:call-template name="calculate-column-widths">
2521
+ <xsl:call-template name="calculate-column-widths-proportional">
2410
2522
  <xsl:with-param name="cols-count" select="$cols-count"/>
2411
2523
  <xsl:with-param name="curr-col" select="$curr-col +1"/>
2412
2524
  <xsl:with-param name="table" select="$table"/>
2413
2525
  </xsl:call-template>
2414
2526
  </xsl:if>
2415
- </xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
2527
+ </xsl:template><xsl:template match="*[@keep-together.within-line or local-name() = 'keep-together_within-line']/text()" priority="2" mode="td_text">
2416
2528
  <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
2417
2529
  <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
2418
2530
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
2531
+
2532
+ <!-- if all capitals english letters or digits -->
2533
+ <xsl:if test="normalize-space(translate(., concat($upper,'0123456789'), '')) = ''">
2534
+ <xsl:call-template name="repeat">
2535
+ <xsl:with-param name="char" select="'X'"/>
2536
+ <xsl:with-param name="count" select="string-length(normalize-space(.)) * 0.5"/>
2537
+ </xsl:call-template>
2538
+ </xsl:if>
2419
2539
  </xsl:template><xsl:template match="text()" mode="td_text">
2420
2540
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2421
2541
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2422
2542
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2423
2543
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2424
2544
  <xsl:value-of select="@target"/>
2425
- </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2426
- <xsl:variable name="mathml">
2427
- <xsl:for-each select="*">
2428
- <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2429
- <xsl:copy-of select="."/>
2545
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text" name="math_length">
2546
+ <xsl:if test="$isGenerateTableIF = 'false'">
2547
+ <xsl:variable name="mathml_">
2548
+ <xsl:for-each select="*">
2549
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2550
+ <xsl:copy-of select="."/>
2551
+ </xsl:if>
2552
+ </xsl:for-each>
2553
+ </xsl:variable>
2554
+ <xsl:variable name="mathml" select="xalan:nodeset($mathml_)"/>
2555
+
2556
+ <xsl:variable name="math_text">
2557
+ <xsl:value-of select="normalize-space($mathml)"/>
2558
+ <xsl:for-each select="$mathml//@open"><xsl:value-of select="."/></xsl:for-each>
2559
+ <xsl:for-each select="$mathml//@close"><xsl:value-of select="."/></xsl:for-each>
2560
+ </xsl:variable>
2561
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2562
+ </xsl:if>
2563
+ </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
2564
+ <xsl:param name="table"/>
2565
+ <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
2566
+
2567
+ <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
2568
+
2569
+ <!-- In the first pass, line wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. -->
2570
+
2571
+ <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2572
+
2573
+ <!-- get current table id -->
2574
+ <xsl:variable name="table_id" select="@id"/>
2575
+ <!-- find table by id in the file 'table_widths' -->
2576
+ <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2577
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
2578
+
2579
+
2580
+ <!-- table='<xsl:copy-of select="$table"/>' -->
2581
+ <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2582
+ <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2583
+ <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2584
+
2585
+ <xsl:variable name="table_with_cell_widths_">
2586
+ <xsl:choose>
2587
+ <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
2588
+
2589
+ <!-- Example: <column>10</column>
2590
+ <column>11</column>
2591
+ -->
2592
+ <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
2593
+ </xsl:when>
2594
+ <xsl:otherwise>
2595
+ <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
2596
+ </xsl:otherwise>
2597
+ </xsl:choose>
2598
+ </xsl:variable>
2599
+ <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2600
+
2601
+ <xsl:if test="$table_if_debug = 'true'">
2602
+ <xsl:copy-of select="$table_with_cell_widths"/>
2603
+ </xsl:if>
2604
+
2605
+
2606
+ <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2607
+
2608
+ <xsl:variable name="column_widths_">
2609
+ <!-- iteration of columns -->
2610
+ <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2611
+ <xsl:variable name="pos" select="position()"/>
2612
+ <column>
2613
+ <xsl:attribute name="width_max">
2614
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2615
+ <xsl:sort select="." data-type="number" order="descending"/>
2616
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2617
+ </xsl:for-each>
2618
+ </xsl:attribute>
2619
+ <xsl:attribute name="width_min">
2620
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2621
+ <xsl:sort select="." data-type="number" order="descending"/>
2622
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2623
+ </xsl:for-each>
2624
+ </xsl:attribute>
2625
+ </column>
2626
+ </xsl:for-each>
2627
+ </xsl:variable>
2628
+ <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2629
+
2630
+ <!-- <column_widths>
2631
+ <xsl:copy-of select="$column_widths"/>
2632
+ </column_widths> -->
2633
+
2634
+ <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2635
+ <xsl:variable name="table_widths_">
2636
+ <table>
2637
+ <xsl:attribute name="width_max">
2638
+ <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2639
+ </xsl:attribute>
2640
+ <xsl:attribute name="width_min">
2641
+ <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2642
+ </xsl:attribute>
2643
+ </table>
2644
+ </xsl:variable>
2645
+ <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2646
+
2647
+ <xsl:variable name="page_width">
2648
+ <xsl:choose>
2649
+ <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
2650
+ <xsl:otherwise>75</xsl:otherwise>
2651
+ </xsl:choose>
2652
+ </xsl:variable>
2653
+
2654
+ <xsl:if test="$table_if_debug = 'true'">
2655
+ <table_width>
2656
+ <xsl:copy-of select="$table_widths"/>
2657
+ </table_width>
2658
+ <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
2659
+ <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
2660
+ -->
2661
+ <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2662
+ </xsl:if>
2663
+
2664
+
2665
+ <!-- There are three cases: -->
2666
+ <xsl:choose>
2667
+ <!-- 1. The minimum table width is equal to or wider than the available space -->
2668
+ <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2669
+ <!-- call old algorithm -->
2670
+ <case1/>
2671
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
2672
+ <xsl:call-template name="calculate-column-widths-proportional">
2673
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2674
+ <xsl:with-param name="table" select="$table"/>
2675
+ </xsl:call-template>
2676
+ </xsl:when>
2677
+ <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2678
+ <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2679
+ <case2/>
2680
+ <autolayout/>
2681
+ <xsl:for-each select="$column_widths/column/@width_max">
2682
+ <column divider="100"><xsl:value-of select="."/></column>
2683
+ </xsl:for-each>
2684
+ </xsl:when>
2685
+ <!-- 3. The maximum width of the table is greater than the available space, but the minimum table width is smaller.
2686
+ In this case, find the difference between the available space and the minimum table width, lets call it W.
2687
+ Lets also call D the difference between maximum and minimum width of the table.
2688
+ For each column, let d be the difference between maximum and minimum width of that column.
2689
+ Now set the column's width to the minimum width plus d times W over D.
2690
+ This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2691
+ <xsl:when test="($table_widths/table/@width_max &gt; $page_width and $table_widths/table/@width_min &lt; $page_width) or ($table_widths/table/@width_min &gt;= $page_width)">
2692
+ <!-- difference between the available space and the minimum table width -->
2693
+ <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2694
+ <W><xsl:value-of select="$W"/></W>
2695
+ <!-- difference between maximum and minimum width of the table -->
2696
+ <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2697
+ <D><xsl:value-of select="$D"/></D>
2698
+ <case3/>
2699
+ <autolayout/>
2700
+ <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2701
+ <split_keep-within-line>true</split_keep-within-line>
2702
+ </xsl:if>
2703
+ <xsl:for-each select="$column_widths/column">
2704
+ <!-- difference between maximum and minimum width of that column. -->
2705
+ <xsl:variable name="d" select="@width_max - @width_min"/>
2706
+ <d><xsl:value-of select="$d"/></d>
2707
+ <width_min><xsl:value-of select="@width_min"/></width_min>
2708
+ <e><xsl:value-of select="$d * $W div $D"/></e>
2709
+ <!-- set the column's width to the minimum width plus d times W over D. -->
2710
+ <column divider="100">
2711
+ <xsl:value-of select="round(@width_min + $d * $W div $D)"/> <!-- * 10 -->
2712
+ </column>
2713
+ </xsl:for-each>
2714
+
2715
+ </xsl:when>
2716
+ <xsl:otherwise><unknown_case/></xsl:otherwise>
2717
+ </xsl:choose>
2718
+
2719
+
2720
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
2721
+ <xsl:copy>
2722
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
2723
+ </xsl:copy>
2724
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
2725
+ <xsl:copy>
2726
+ <xsl:copy-of select="@*"/>
2727
+
2728
+ <!-- The maximum width is given by the widest line. -->
2729
+ <xsl:variable name="widths_max">
2730
+ <xsl:for-each select=".//*[local-name() = 'p']">
2731
+ <xsl:call-template name="add_width"/>
2732
+ </xsl:for-each>
2733
+ <xsl:if test="not(*[local-name() = 'p'])">
2734
+ <xsl:call-template name="add_width"/>
2430
2735
  </xsl:if>
2736
+ </xsl:variable>
2737
+ <xsl:variable name="width_max">
2738
+ <xsl:for-each select="xalan:nodeset($widths_max)//width">
2739
+ <xsl:sort select="." data-type="number" order="descending"/>
2740
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2741
+ </xsl:for-each>
2742
+ </xsl:variable>
2743
+ <xsl:attribute name="width_max">
2744
+ <xsl:value-of select="$width_max"/>
2745
+ </xsl:attribute>
2746
+
2747
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2748
+ <!-- To do: image width -->
2749
+ <xsl:variable name="td_text">
2750
+ <xsl:apply-templates select="." mode="td_text"/>
2751
+ </xsl:variable>
2752
+ <xsl:variable name="words">
2753
+ <xsl:variable name="string_with_added_zerospaces">
2754
+ <xsl:call-template name="add-zero-spaces-java">
2755
+ <xsl:with-param name="text" select="$td_text"/>
2756
+ </xsl:call-template>
2757
+ </xsl:variable>
2758
+ <xsl:call-template name="tokenize">
2759
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2760
+ </xsl:call-template>
2761
+ </xsl:variable>
2762
+
2763
+ <xsl:variable name="max_word_length">
2764
+ <xsl:call-template name="max_length">
2765
+ <xsl:with-param name="words" select="xalan:nodeset($words)"/>
2766
+ </xsl:call-template>
2767
+ </xsl:variable>
2768
+ <xsl:variable name="width_min">
2769
+ <xsl:value-of select="$max_word_length"/>
2770
+ </xsl:variable>
2771
+ <xsl:attribute name="width_min">
2772
+ <xsl:value-of select="$width_min"/>
2773
+ </xsl:attribute>
2774
+ <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
2775
+ <xsl:if test="$width_min &gt; $width_max">
2776
+ <xsl:attribute name="width_max">
2777
+ <xsl:value-of select="$width_min"/>
2778
+ </xsl:attribute>
2779
+ </xsl:if>
2780
+ <xsl:if test="$width_min = 0">
2781
+ <xsl:attribute name="width_min">1</xsl:attribute>
2782
+ </xsl:if>
2783
+
2784
+ <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
2785
+
2786
+ </xsl:copy>
2787
+ </xsl:template><xsl:template name="add_width">
2788
+ <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
2789
+ <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
2790
+
2791
+ <xsl:variable name="p_text_len">
2792
+ <xsl:choose>
2793
+ <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
2794
+ <xsl:value-of select="$p_text_len_ * 1.5"/>
2795
+ </xsl:when>
2796
+ <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
2797
+ </xsl:choose>
2798
+ </xsl:variable>
2799
+
2800
+ <xsl:variable name="math_addon_text">
2801
+ <xsl:for-each select=".//*[local-name() = 'math']">
2802
+ <xsl:apply-templates mode="td_text"/>
2431
2803
  </xsl:for-each>
2432
2804
  </xsl:variable>
2805
+ <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
2433
2806
 
2434
- <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2435
- <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2807
+ <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
2808
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
2809
+ <xsl:copy>
2810
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2811
+ </xsl:copy>
2812
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths-if">
2813
+ <xsl:copy>
2814
+ <xsl:copy-of select="@*"/>
2815
+
2816
+ <!-- The maximum width is given by the widest line. -->
2817
+ <xsl:attribute name="width_max">
2818
+ <xsl:for-each select="p_len">
2819
+ <xsl:sort select="." data-type="number" order="descending"/>
2820
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2821
+ </xsl:for-each>
2822
+ </xsl:attribute>
2823
+
2824
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2825
+ <xsl:variable name="width_min">
2826
+ <xsl:for-each select="word_len">
2827
+ <xsl:sort select="." data-type="number" order="descending"/>
2828
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2829
+ </xsl:for-each>
2830
+ </xsl:variable>
2831
+ <xsl:attribute name="width_min">
2832
+ <xsl:value-of select="$width_min"/>
2833
+ </xsl:attribute>
2834
+
2835
+ <xsl:if test="$width_min = 0">
2836
+ <xsl:attribute name="width_min">1</xsl:attribute>
2837
+ </xsl:if>
2838
+
2839
+ <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2840
+
2841
+ </xsl:copy>
2436
2842
  </xsl:template><xsl:template match="*[local-name()='thead']">
2437
2843
  <xsl:param name="cols-count"/>
2438
2844
  <fo:table-header>
@@ -2517,6 +2923,7 @@
2517
2923
  </xsl:for-each>
2518
2924
  </xsl:when>
2519
2925
  <xsl:otherwise>
2926
+ <!-- $colwidths=<xsl:copy-of select="$colwidths"/> -->
2520
2927
  <xsl:call-template name="insertTableColumnWidth">
2521
2928
  <xsl:with-param name="colwidths" select="$colwidths"/>
2522
2929
  </xsl:call-template>
@@ -2596,6 +3003,52 @@
2596
3003
 
2597
3004
  </fo:table-body>
2598
3005
 
3006
+ </xsl:template><xsl:template match="/" mode="process_table-if">
3007
+ <xsl:param name="table_or_dl">table</xsl:param>
3008
+ <xsl:apply-templates mode="process_table-if">
3009
+ <xsl:with-param name="table_or_dl" select="$table_or_dl"/>
3010
+ </xsl:apply-templates>
3011
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="process_table-if">
3012
+ <xsl:param name="table_or_dl">table</xsl:param>
3013
+
3014
+ <fo:table-body>
3015
+ <xsl:for-each select="*[local-name() = 'tr']">
3016
+ <xsl:variable name="col_count" select="count(*)"/>
3017
+
3018
+ <!-- iteration for each tr/td -->
3019
+
3020
+ <xsl:choose>
3021
+ <xsl:when test="$table_or_dl = 'table'">
3022
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3023
+ <fo:table-row number-columns-spanned="{$col_count}">
3024
+ <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3025
+ <xsl:call-template name="td"/>
3026
+ </fo:table-row>
3027
+ </xsl:for-each>
3028
+ </xsl:when>
3029
+ <xsl:otherwise> <!-- $table_or_dl = 'dl' -->
3030
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']">
3031
+ <xsl:variable name="is_dt" select="position() = 1"/>
3032
+
3033
+ <xsl:for-each select="*">
3034
+ <!-- <test><xsl:copy-of select="."/></test> -->
3035
+ <fo:table-row number-columns-spanned="{$col_count}">
3036
+ <xsl:choose>
3037
+ <xsl:when test="$is_dt">
3038
+ <xsl:call-template name="insert_dt_cell"/>
3039
+ </xsl:when>
3040
+ <xsl:otherwise>
3041
+ <xsl:call-template name="insert_dd_cell"/>
3042
+ </xsl:otherwise>
3043
+ </xsl:choose>
3044
+ </fo:table-row>
3045
+ </xsl:for-each>
3046
+ </xsl:for-each>
3047
+ </xsl:otherwise>
3048
+ </xsl:choose>
3049
+
3050
+ </xsl:for-each>
3051
+ </fo:table-body>
2599
3052
  </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2600
3053
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2601
3054
 
@@ -2682,7 +3135,7 @@
2682
3135
  </xsl:choose>
2683
3136
  </xsl:attribute>
2684
3137
  </xsl:if>
2685
- </xsl:template><xsl:template match="*[local-name()='td']">
3138
+ </xsl:template><xsl:template match="*[local-name()='td']" name="td">
2686
3139
  <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2687
3140
  <xsl:call-template name="setTextAlignment">
2688
3141
  <xsl:with-param name="default">left</xsl:with-param>
@@ -2716,11 +3169,24 @@
2716
3169
 
2717
3170
  <xsl:call-template name="setTableCellAttributes"/>
2718
3171
 
3172
+ <xsl:if test="$isGenerateTableIF = 'true'">
3173
+ <xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
3174
+ <xsl:attribute name="text-align">left</xsl:attribute>
3175
+ </xsl:if>
3176
+
2719
3177
  <fo:block>
2720
3178
 
3179
+ <xsl:if test="$isGenerateTableIF = 'true'">
3180
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3181
+ </xsl:if>
3182
+
3183
+
2721
3184
 
2722
3185
 
2723
3186
  <xsl:apply-templates/>
3187
+
3188
+ <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
3189
+
2724
3190
  </fo:block>
2725
3191
  </fo:table-cell>
2726
3192
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
@@ -2917,9 +3383,9 @@
2917
3383
  <!-- current hierarchy is 'figure' element -->
2918
3384
  <xsl:variable name="following_dl_colwidths">
2919
3385
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2920
- <xsl:variable name="html-table">
2921
- <xsl:variable name="doc_ns">
2922
-
3386
+ <xsl:variable name="simple-table">
3387
+ <!-- <xsl:variable name="doc_ns">
3388
+ <xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
2923
3389
  </xsl:variable>
2924
3390
  <xsl:variable name="ns">
2925
3391
  <xsl:choose>
@@ -2930,7 +3396,7 @@
2930
3396
  <xsl:value-of select="substring-before(name(/*), '-')"/>
2931
3397
  </xsl:otherwise>
2932
3398
  </xsl:choose>
2933
- </xsl:variable>
3399
+ </xsl:variable> -->
2934
3400
 
2935
3401
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2936
3402
  <tbody>
@@ -2941,7 +3407,7 @@
2941
3407
 
2942
3408
  <xsl:call-template name="calculate-column-widths">
2943
3409
  <xsl:with-param name="cols-count" select="2"/>
2944
- <xsl:with-param name="table" select="$html-table"/>
3410
+ <xsl:with-param name="table" select="$simple-table"/>
2945
3411
  </xsl:call-template>
2946
3412
 
2947
3413
  </xsl:if>
@@ -3121,7 +3587,18 @@
3121
3587
 
3122
3588
 
3123
3589
 
3590
+
3591
+ <xsl:if test="$isGenerateTableIF = 'true'">
3592
+ <!-- to determine start of table -->
3593
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
3594
+ </xsl:if>
3595
+
3124
3596
  <fo:table width="95%" table-layout="fixed">
3597
+
3598
+ <xsl:if test="$isGenerateTableIF = 'true'">
3599
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
3600
+ </xsl:if>
3601
+
3125
3602
 
3126
3603
  <xsl:choose>
3127
3604
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
@@ -3130,52 +3607,130 @@
3130
3607
 
3131
3608
  </xsl:when>
3132
3609
  </xsl:choose>
3133
- <!-- create virtual html table for dl/[dt and dd] -->
3134
- <xsl:variable name="html-table">
3135
- <xsl:variable name="doc_ns">
3610
+
3611
+
3612
+ <xsl:choose>
3613
+ <xsl:when test="$isGenerateTableIF = 'true'">
3614
+ <!-- generate IF for table widths -->
3615
+ <!-- example:
3616
+ <tr>
3617
+ <td valign="top" align="left" id="tab-symdu_1_1">
3618
+ <p>Symbol</p>
3619
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
3620
+ </td>
3621
+ <td valign="top" align="left" id="tab-symdu_1_2">
3622
+ <p>Description</p>
3623
+ <word id="tab-symdu_1_2_word_1">Description</word>
3624
+ </td>
3625
+ </tr>
3626
+ -->
3136
3627
 
3137
- </xsl:variable>
3138
- <xsl:variable name="ns">
3139
- <xsl:choose>
3140
- <xsl:when test="normalize-space($doc_ns) != ''">
3141
- <xsl:value-of select="normalize-space($doc_ns)"/>
3142
- </xsl:when>
3143
- <xsl:otherwise>
3144
- <xsl:value-of select="substring-before(name(/*), '-')"/>
3145
- </xsl:otherwise>
3146
- </xsl:choose>
3147
- </xsl:variable>
3148
- <tbody>
3149
- <xsl:apply-templates mode="dl"/>
3150
- </tbody>
3151
- </xsl:variable>
3152
- <!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
3153
- <xsl:variable name="colwidths">
3154
- <xsl:call-template name="calculate-column-widths">
3155
- <xsl:with-param name="cols-count" select="2"/>
3156
- <xsl:with-param name="table" select="$html-table"/>
3157
- </xsl:call-template>
3158
- </xsl:variable>
3159
- <!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
3160
- <xsl:variable name="maxlength_dt">
3161
- <xsl:call-template name="getMaxLength_dt"/>
3162
- </xsl:variable>
3163
- <xsl:variable name="isContainsKeepTogetherTag_">
3164
- false
3165
- </xsl:variable>
3166
- <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3167
- <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3168
- <xsl:call-template name="setColumnWidth_dl">
3169
- <xsl:with-param name="colwidths" select="$colwidths"/>
3170
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3171
- <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3172
- </xsl:call-template>
3628
+ <!-- create virtual html table for dl/[dt and dd] -->
3629
+ <xsl:variable name="simple-table">
3630
+
3631
+ <xsl:variable name="dl_table">
3632
+ <tbody>
3633
+ <xsl:apply-templates mode="dl_if">
3634
+ <xsl:with-param name="id" select="@id"/>
3635
+ </xsl:apply-templates>
3636
+ </tbody>
3637
+ </xsl:variable>
3638
+
3639
+ <!-- dl_table='<xsl:copy-of select="$dl_table"/>' -->
3640
+
3641
+ <!-- Step: replace <br/> to <p>...</p> -->
3642
+ <xsl:variable name="table_without_br">
3643
+ <xsl:apply-templates select="xalan:nodeset($dl_table)" mode="table-without-br"/>
3644
+ </xsl:variable>
3645
+
3646
+ <!-- table_without_br='<xsl:copy-of select="$table_without_br"/>' -->
3647
+
3648
+ <!-- Step: add id to each cell -->
3649
+ <!-- add <word>...</word> for each word, image, math -->
3650
+ <xsl:variable name="simple-table-id">
3651
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-id">
3652
+ <xsl:with-param name="id" select="@id"/>
3653
+ </xsl:apply-templates>
3654
+ </xsl:variable>
3655
+
3656
+ <!-- simple-table-id='<xsl:copy-of select="$simple-table-id"/>' -->
3657
+
3658
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
3659
+
3660
+ </xsl:variable>
3661
+
3662
+ <!-- DEBUG: simple-table<xsl:copy-of select="$simple-table"/> -->
3663
+
3664
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if">
3665
+ <xsl:with-param name="table_or_dl">dl</xsl:with-param>
3666
+ </xsl:apply-templates>
3667
+
3668
+ </xsl:when>
3669
+ <xsl:otherwise>
3173
3670
 
3174
- <fo:table-body>
3175
- <xsl:apply-templates>
3176
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3177
- </xsl:apply-templates>
3178
- </fo:table-body>
3671
+ <xsl:variable name="simple-table">
3672
+
3673
+ <xsl:variable name="dl_table">
3674
+ <tbody>
3675
+ <xsl:apply-templates mode="dl">
3676
+ <xsl:with-param name="id" select="@id"/>
3677
+ </xsl:apply-templates>
3678
+ </tbody>
3679
+ </xsl:variable>
3680
+
3681
+ <xsl:copy-of select="$dl_table"/>
3682
+ </xsl:variable>
3683
+
3684
+ <xsl:variable name="colwidths">
3685
+ <xsl:call-template name="calculate-column-widths">
3686
+ <xsl:with-param name="cols-count" select="2"/>
3687
+ <xsl:with-param name="table" select="$simple-table"/>
3688
+ </xsl:call-template>
3689
+ </xsl:variable>
3690
+
3691
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
3692
+ DEBUG
3693
+ colwidths=<xsl:copy-of select="$colwidths"/>
3694
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
3695
+
3696
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3697
+
3698
+ <xsl:variable name="maxlength_dt">
3699
+ <xsl:call-template name="getMaxLength_dt"/>
3700
+ </xsl:variable>
3701
+
3702
+ <xsl:variable name="isContainsKeepTogetherTag_">
3703
+ false
3704
+ </xsl:variable>
3705
+ <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3706
+ <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3707
+
3708
+
3709
+ <xsl:call-template name="setColumnWidth_dl">
3710
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3711
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3712
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3713
+ </xsl:call-template>
3714
+
3715
+ <fo:table-body>
3716
+
3717
+ <!-- DEBUG -->
3718
+ <xsl:if test="$table_if_debug = 'true'">
3719
+ <fo:table-row>
3720
+ <fo:table-cell number-columns-spanned="2" font-size="60%">
3721
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
3722
+ </fo:table-cell>
3723
+ </fo:table-row>
3724
+ </xsl:if>
3725
+
3726
+ <xsl:apply-templates>
3727
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3728
+ <xsl:with-param name="split_keep-within-line" select="xalan:nodeset($colwidths)/split_keep-within-line"/>
3729
+ </xsl:apply-templates>
3730
+
3731
+ </fo:table-body>
3732
+ </xsl:otherwise>
3733
+ </xsl:choose>
3179
3734
  </fo:table>
3180
3735
  </fo:block>
3181
3736
  </fo:block>
@@ -3186,6 +3741,9 @@
3186
3741
  <xsl:param name="colwidths"/>
3187
3742
  <xsl:param name="maxlength_dt"/>
3188
3743
  <xsl:param name="isContainsKeepTogetherTag"/>
3744
+
3745
+ <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
3746
+
3189
3747
  <xsl:choose>
3190
3748
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3191
3749
  <fo:table-column column-width="50%"/>
@@ -3193,6 +3751,11 @@
3193
3751
  </xsl:when>
3194
3752
  <xsl:otherwise>
3195
3753
  <xsl:choose>
3754
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
3755
+ <xsl:call-template name="insertTableColumnWidth">
3756
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3757
+ </xsl:call-template>
3758
+ </xsl:when>
3196
3759
  <xsl:when test="$isContainsKeepTogetherTag">
3197
3760
  <xsl:call-template name="insertTableColumnWidth">
3198
3761
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -3237,13 +3800,19 @@
3237
3800
  </xsl:choose>
3238
3801
  </xsl:template><xsl:template name="insertTableColumnWidth">
3239
3802
  <xsl:param name="colwidths"/>
3803
+
3240
3804
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
3241
3805
  <xsl:choose>
3242
3806
  <xsl:when test=". = 1 or . = 0">
3243
3807
  <fo:table-column column-width="proportional-column-width(2)"/>
3244
3808
  </xsl:when>
3245
3809
  <xsl:otherwise>
3246
- <fo:table-column column-width="proportional-column-width({.})"/>
3810
+ <!-- <fo:table-column column-width="proportional-column-width({.})"/> -->
3811
+ <xsl:variable name="divider">
3812
+ <xsl:value-of select="@divider"/>
3813
+ <xsl:if test="not(@divider)">1</xsl:if>
3814
+ </xsl:variable>
3815
+ <fo:table-column column-width="proportional-column-width({round(. div $divider)})"/>
3247
3816
  </xsl:otherwise>
3248
3817
  </xsl:choose>
3249
3818
  </xsl:for-each>
@@ -3305,11 +3874,19 @@
3305
3874
  </fo:table-cell>
3306
3875
  </fo:table-row>
3307
3876
  </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
3877
+ <xsl:param name="id"/>
3878
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3308
3879
  <tr>
3309
3880
  <td>
3881
+ <xsl:attribute name="id">
3882
+ <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
3883
+ </xsl:attribute>
3310
3884
  <xsl:apply-templates/>
3311
3885
  </td>
3312
3886
  <td>
3887
+ <xsl:attribute name="id">
3888
+ <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
3889
+ </xsl:attribute>
3313
3890
 
3314
3891
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3315
3892
  <xsl:with-param name="process">true</xsl:with-param>
@@ -3320,50 +3897,122 @@
3320
3897
 
3321
3898
  </xsl:template><xsl:template match="*[local-name()='dt']">
3322
3899
  <xsl:param name="key_iso"/>
3900
+ <xsl:param name="split_keep-within-line"/>
3323
3901
 
3324
3902
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
3325
- <fo:table-cell>
3903
+ <xsl:call-template name="insert_dt_cell">
3904
+ <xsl:with-param name="key_iso" select="$key_iso"/>
3905
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3906
+ </xsl:call-template>
3907
+ <xsl:for-each select="following-sibling::*[local-name()='dd'][1]">
3908
+ <xsl:call-template name="insert_dd_cell">
3909
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3910
+ </xsl:call-template>
3911
+ </xsl:for-each>
3912
+ </fo:table-row>
3913
+ </xsl:template><xsl:template name="insert_dt_cell">
3914
+ <xsl:param name="key_iso"/>
3915
+ <xsl:param name="split_keep-within-line"/>
3916
+ <fo:table-cell xsl:use-attribute-sets="dt-cell-style">
3917
+
3918
+ <xsl:if test="$isGenerateTableIF = 'true'">
3919
+ <!-- border is mandatory, to calculate real width -->
3920
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
3921
+ <xsl:attribute name="text-align">left</xsl:attribute>
3922
+ </xsl:if>
3923
+
3924
+
3925
+ <fo:block xsl:use-attribute-sets="dt-block-style">
3926
+ <xsl:copy-of select="@id"/>
3927
+
3928
+ <xsl:if test="normalize-space($key_iso) = 'true'">
3929
+ <xsl:attribute name="margin-top">0</xsl:attribute>
3930
+ </xsl:if>
3931
+
3932
+
3933
+
3934
+ <xsl:apply-templates>
3935
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3936
+ </xsl:apply-templates>
3937
+
3938
+ <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
3939
+
3940
+ </fo:block>
3941
+ </fo:table-cell>
3942
+ </xsl:template><xsl:template name="insert_dd_cell">
3943
+ <xsl:param name="split_keep-within-line"/>
3944
+ <fo:table-cell xsl:use-attribute-sets="dd-cell-style">
3945
+
3946
+ <xsl:if test="$isGenerateTableIF = 'true'">
3947
+ <!-- border is mandatory, to calculate real width -->
3948
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
3949
+ </xsl:if>
3950
+
3951
+ <fo:block>
3952
+
3953
+ <xsl:if test="$isGenerateTableIF = 'true'">
3954
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3955
+ </xsl:if>
3956
+
3326
3957
 
3327
- <fo:block xsl:use-attribute-sets="dt-style">
3328
- <xsl:copy-of select="@id"/>
3329
-
3330
- <xsl:if test="normalize-space($key_iso) = 'true'">
3331
- <xsl:attribute name="margin-top">0</xsl:attribute>
3332
- </xsl:if>
3333
-
3334
-
3335
-
3336
- <xsl:apply-templates/>
3337
- </fo:block>
3338
- </fo:table-cell>
3339
- <fo:table-cell>
3340
- <fo:block>
3341
-
3342
3958
 
3343
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3344
- <xsl:with-param name="process">true</xsl:with-param>
3345
- </xsl:apply-templates>
3346
- </fo:block>
3347
- </fo:table-cell>
3348
- </fo:table-row>
3959
+ <xsl:choose>
3960
+ <xsl:when test="$isGenerateTableIF = 'true'">
3961
+ <xsl:apply-templates> <!-- following-sibling::*[local-name()='dd'][1] -->
3962
+ <xsl:with-param name="process">true</xsl:with-param>
3963
+ </xsl:apply-templates>
3964
+ </xsl:when>
3965
+ <xsl:otherwise>
3966
+ <xsl:apply-templates select="."> <!-- following-sibling::*[local-name()='dd'][1] -->
3967
+ <xsl:with-param name="process">true</xsl:with-param>
3968
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3969
+ </xsl:apply-templates>
3970
+ </xsl:otherwise>
3971
+
3972
+ </xsl:choose>
3973
+
3974
+ <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
3975
+
3976
+ </fo:block>
3977
+ </fo:table-cell>
3349
3978
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3350
3979
  <xsl:apply-templates/>
3351
3980
  </xsl:template><xsl:template match="*[local-name()='dd']">
3352
3981
  <xsl:param name="process">false</xsl:param>
3982
+ <xsl:param name="split_keep-within-line"/>
3353
3983
  <xsl:if test="$process = 'true'">
3354
3984
  <xsl:apply-templates select="@language"/>
3355
- <xsl:apply-templates/>
3985
+ <xsl:apply-templates>
3986
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3987
+ </xsl:apply-templates>
3356
3988
  </xsl:if>
3357
3989
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3358
3990
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3359
- </xsl:template><xsl:template match="*[local-name()='em']">
3991
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl_if">
3992
+ <xsl:param name="id"/>
3993
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3994
+ <tr>
3995
+ <td>
3996
+ <xsl:copy-of select="node()"/>
3997
+ </td>
3998
+ <td>
3999
+
4000
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
4001
+
4002
+ </td>
4003
+ </tr>
4004
+
4005
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
3360
4006
  <fo:inline font-style="italic">
3361
4007
  <xsl:apply-templates/>
3362
4008
  </fo:inline>
3363
4009
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
4010
+ <xsl:param name="split_keep-within-line"/>
3364
4011
  <fo:inline font-weight="bold">
3365
4012
 
3366
- <xsl:apply-templates/>
4013
+ <xsl:apply-templates>
4014
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4015
+ </xsl:apply-templates>
3367
4016
  </fo:inline>
3368
4017
  </xsl:template><xsl:template match="*[local-name()='padding']">
3369
4018
  <fo:inline padding-right="{@value}"> </fo:inline>
@@ -3564,6 +4213,10 @@
3564
4213
  <xsl:param name="text"/>
3565
4214
  <xsl:param name="separator" select="' '"/>
3566
4215
  <xsl:choose>
4216
+
4217
+ <xsl:when test="$isGenerateTableIF = 'true' and not(contains($text, $separator))">
4218
+ <word><xsl:value-of select="normalize-space($text)"/></word>
4219
+ </xsl:when>
3567
4220
  <xsl:when test="not(contains($text, $separator))">
3568
4221
  <word>
3569
4222
  <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
@@ -3608,13 +4261,66 @@
3608
4261
  </xsl:when>
3609
4262
  <xsl:otherwise>
3610
4263
  <word>
3611
- <xsl:value-of select="string-length(normalize-space(substring-before($text, $separator)))"/>
4264
+ <xsl:variable name="word" select="normalize-space(substring-before($text, $separator))"/>
4265
+ <xsl:choose>
4266
+ <xsl:when test="$isGenerateTableIF = 'true'">
4267
+ <xsl:value-of select="$word"/>
4268
+ </xsl:when>
4269
+ <xsl:otherwise>
4270
+ <xsl:value-of select="string-length($word)"/>
4271
+ </xsl:otherwise>
4272
+ </xsl:choose>
3612
4273
  </word>
3613
4274
  <xsl:call-template name="tokenize">
3614
4275
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
3615
4276
  </xsl:call-template>
3616
4277
  </xsl:otherwise>
3617
4278
  </xsl:choose>
4279
+ </xsl:template><xsl:template name="tokenize_with_tags">
4280
+ <xsl:param name="tags"/>
4281
+ <xsl:param name="text"/>
4282
+ <xsl:param name="separator" select="' '"/>
4283
+ <xsl:choose>
4284
+
4285
+ <xsl:when test="not(contains($text, $separator))">
4286
+ <word>
4287
+ <xsl:call-template name="enclose_text_in_tags">
4288
+ <xsl:with-param name="text" select="normalize-space($text)"/>
4289
+ <xsl:with-param name="tags" select="$tags"/>
4290
+ </xsl:call-template>
4291
+ </word>
4292
+ </xsl:when>
4293
+ <xsl:otherwise>
4294
+ <word>
4295
+ <xsl:call-template name="enclose_text_in_tags">
4296
+ <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
4297
+ <xsl:with-param name="tags" select="$tags"/>
4298
+ </xsl:call-template>
4299
+ </word>
4300
+ <xsl:call-template name="tokenize_with_tags">
4301
+ <xsl:with-param name="text" select="substring-after($text, $separator)"/>
4302
+ </xsl:call-template>
4303
+ </xsl:otherwise>
4304
+ </xsl:choose>
4305
+ </xsl:template><xsl:template name="enclose_text_in_tags">
4306
+ <xsl:param name="text"/>
4307
+ <xsl:param name="tags"/>
4308
+ <xsl:param name="num">1</xsl:param> <!-- default (start) value -->
4309
+
4310
+ <xsl:variable name="tag_name" select="normalize-space(xalan:nodeset($tags)//tag[$num])"/>
4311
+
4312
+ <xsl:choose>
4313
+ <xsl:when test="$tag_name = ''"><xsl:value-of select="$text"/></xsl:when>
4314
+ <xsl:otherwise>
4315
+ <xsl:element name="{$tag_name}">
4316
+ <xsl:call-template name="enclose_text_in_tags">
4317
+ <xsl:with-param name="text" select="$text"/>
4318
+ <xsl:with-param name="tags" select="$tags"/>
4319
+ <xsl:with-param name="num" select="$num + 1"/>
4320
+ </xsl:call-template>
4321
+ </xsl:element>
4322
+ </xsl:otherwise>
4323
+ </xsl:choose>
3618
4324
  </xsl:template><xsl:template name="max_length">
3619
4325
  <xsl:param name="words"/>
3620
4326
  <xsl:for-each select="$words//word">
@@ -3715,12 +4421,19 @@
3715
4421
  </xsl:otherwise>
3716
4422
  </xsl:choose>
3717
4423
  </xsl:template><xsl:template name="getSimpleTable">
4424
+ <xsl:param name="id"/>
4425
+
3718
4426
  <xsl:variable name="simple-table">
3719
4427
 
4428
+ <!-- Step 0. replace <br/> to <p>...</p> -->
4429
+ <xsl:variable name="table_without_br">
4430
+ <xsl:apply-templates mode="table-without-br"/>
4431
+ </xsl:variable>
4432
+
3720
4433
  <!-- Step 1. colspan processing -->
3721
4434
  <xsl:variable name="simple-table-colspan">
3722
4435
  <tbody>
3723
- <xsl:apply-templates mode="simple-table-colspan"/>
4436
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-colspan"/>
3724
4437
  </tbody>
3725
4438
  </xsl:variable>
3726
4439
 
@@ -3729,10 +4442,67 @@
3729
4442
  <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
3730
4443
  </xsl:variable>
3731
4444
 
3732
- <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3733
-
4445
+ <!-- Step 3: add id to each cell -->
4446
+ <!-- add <word>...</word> for each word, image, math -->
4447
+ <xsl:variable name="simple-table-id">
4448
+ <xsl:apply-templates select="xalan:nodeset($simple-table-rowspan)" mode="simple-table-id">
4449
+ <xsl:with-param name="id" select="$id"/>
4450
+ </xsl:apply-templates>
4451
+ </xsl:variable>
4452
+
4453
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
4454
+
3734
4455
  </xsl:variable>
3735
4456
  <xsl:copy-of select="$simple-table"/>
4457
+ </xsl:template><xsl:template match="@*|node()" mode="table-without-br">
4458
+ <xsl:copy>
4459
+ <xsl:apply-templates select="@*|node()" mode="table-without-br"/>
4460
+ </xsl:copy>
4461
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
4462
+ <xsl:copy>
4463
+ <xsl:copy-of select="@*"/>
4464
+ <p>
4465
+ <xsl:copy-of select="node()"/>
4466
+ </p>
4467
+ </xsl:copy>
4468
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td'][*[local-name()='br']]" mode="table-without-br">
4469
+ <xsl:copy>
4470
+ <xsl:copy-of select="@*"/>
4471
+ <xsl:for-each select="*[local-name()='br']">
4472
+ <xsl:variable name="current_id" select="generate-id()"/>
4473
+ <p>
4474
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4475
+ <xsl:copy-of select="."/>
4476
+ </xsl:for-each>
4477
+ </p>
4478
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4479
+ <p>
4480
+ <xsl:for-each select="following-sibling::node()">
4481
+ <xsl:copy-of select="."/>
4482
+ </xsl:for-each>
4483
+ </p>
4484
+ </xsl:if>
4485
+ </xsl:for-each>
4486
+ </xsl:copy>
4487
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p'][*[local-name()='br']]" mode="table-without-br">
4488
+ <xsl:for-each select="*[local-name()='br']">
4489
+ <xsl:variable name="current_id" select="generate-id()"/>
4490
+ <p>
4491
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4492
+ <xsl:copy-of select="."/>
4493
+ </xsl:for-each>
4494
+ </p>
4495
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4496
+ <p>
4497
+ <xsl:for-each select="following-sibling::node()">
4498
+ <xsl:copy-of select="."/>
4499
+ </xsl:for-each>
4500
+ </p>
4501
+ </xsl:if>
4502
+ </xsl:for-each>
4503
+ </xsl:template><xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
4504
+ <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
4505
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
3736
4506
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3737
4507
  <xsl:apply-templates mode="simple-table-colspan"/>
3738
4508
  </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
@@ -3822,6 +4592,126 @@
3822
4592
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
3823
4593
  <xsl:with-param name="previousRow" select="$newRow"/>
3824
4594
  </xsl:apply-templates>
4595
+ </xsl:template><xsl:template match="/" mode="simple-table-id">
4596
+ <xsl:param name="id"/>
4597
+ <xsl:variable name="id_prefixed" select="concat('table_if_',$id)"/> <!-- table id prefixed by 'table_if_' to simple search in IF -->
4598
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4599
+ <xsl:with-param name="id" select="$id_prefixed"/>
4600
+ </xsl:apply-templates>
4601
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-id">
4602
+ <xsl:param name="id"/>
4603
+ <xsl:copy>
4604
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4605
+ <xsl:with-param name="id" select="$id"/>
4606
+ </xsl:apply-templates>
4607
+ </xsl:copy>
4608
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="simple-table-id">
4609
+ <xsl:param name="id"/>
4610
+ <xsl:copy>
4611
+ <xsl:copy-of select="@*"/>
4612
+ <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
4613
+ <xsl:apply-templates select="node()" mode="simple-table-id">
4614
+ <xsl:with-param name="id" select="$id"/>
4615
+ </xsl:apply-templates>
4616
+ </xsl:copy>
4617
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
4618
+ <xsl:param name="id"/>
4619
+ <xsl:copy>
4620
+ <xsl:copy-of select="@*"/>
4621
+ <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4622
+ <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4623
+ <xsl:attribute name="id">
4624
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4625
+ </xsl:attribute>
4626
+
4627
+ <xsl:for-each select="*[local-name() = 'p']">
4628
+ <xsl:copy>
4629
+ <xsl:copy-of select="@*"/>
4630
+ <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
4631
+ <xsl:attribute name="id">
4632
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4633
+ </xsl:attribute>
4634
+
4635
+ <xsl:copy-of select="node()"/>
4636
+ </xsl:copy>
4637
+ </xsl:for-each>
4638
+
4639
+
4640
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- split each paragraph to words, image, math -->
4641
+
4642
+ <xsl:variable name="td_text">
4643
+ <xsl:apply-templates select="." mode="td_text_with_formatting"/>
4644
+ </xsl:variable>
4645
+
4646
+ <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
4647
+
4648
+ <xsl:variable name="words">
4649
+ <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
4650
+ <word>
4651
+ <xsl:copy-of select="."/>
4652
+ </word>
4653
+ </xsl:for-each>
4654
+
4655
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
4656
+ <xsl:copy-of select="."/>
4657
+ </xsl:for-each>
4658
+
4659
+ </xsl:variable>
4660
+
4661
+ <xsl:for-each select="xalan:nodeset($words)/word">
4662
+ <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
4663
+ <xsl:copy>
4664
+ <xsl:attribute name="id">
4665
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4666
+ </xsl:attribute>
4667
+ <xsl:copy-of select="node()"/>
4668
+ </xsl:copy>
4669
+ </xsl:for-each>
4670
+ </xsl:if>
4671
+ </xsl:copy>
4672
+
4673
+ </xsl:template><xsl:template match="@*|node()" mode="td_text_with_formatting">
4674
+ <xsl:copy>
4675
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4676
+ </xsl:copy>
4677
+ </xsl:template><xsl:template match="*[local-name() = 'stem' or local-name() = 'image']" mode="td_text_with_formatting"/><xsl:template match="*[local-name() = 'keep-together_within-line']/text()" mode="td_text_with_formatting">
4678
+ <xsl:variable name="formatting_tags">
4679
+ <xsl:call-template name="getFormattingTags"/>
4680
+ </xsl:variable>
4681
+ <word>
4682
+ <xsl:call-template name="enclose_text_in_tags">
4683
+ <xsl:with-param name="text" select="normalize-space(.)"/>
4684
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4685
+ </xsl:call-template>
4686
+ </word>
4687
+ </xsl:template><xsl:template match="*[local-name() != 'keep-together_within-line']/text()" mode="td_text_with_formatting">
4688
+
4689
+ <xsl:variable name="td_text" select="."/>
4690
+
4691
+ <xsl:variable name="string_with_added_zerospaces">
4692
+ <xsl:call-template name="add-zero-spaces-java">
4693
+ <xsl:with-param name="text" select="$td_text"/>
4694
+ </xsl:call-template>
4695
+ </xsl:variable>
4696
+
4697
+ <xsl:variable name="formatting_tags">
4698
+ <xsl:call-template name="getFormattingTags"/>
4699
+ </xsl:variable>
4700
+
4701
+ <!-- <word>text</word> -->
4702
+ <xsl:call-template name="tokenize_with_tags">
4703
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4704
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
4705
+ </xsl:call-template>
4706
+ </xsl:template><xsl:template name="getFormattingTags">
4707
+ <tags>
4708
+ <xsl:if test="ancestor::*[local-name() = 'strong']"><tag>strong</tag></xsl:if>
4709
+ <xsl:if test="ancestor::*[local-name() = 'em']"><tag>em</tag></xsl:if>
4710
+ <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
4711
+ <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
4712
+ <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
4713
+ <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
4714
+ </tags>
3825
4715
  </xsl:template><xsl:template name="getLang">
3826
4716
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3827
4717
  <xsl:variable name="language">
@@ -5513,7 +6403,9 @@
5513
6403
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
5514
6404
  </xsl:if>
5515
6405
  <xsl:variable name="simple-table">
5516
- <xsl:call-template name="getSimpleTable"/>
6406
+ <xsl:call-template name="getSimpleTable">
6407
+ <xsl:with-param name="id" select="@id"/>
6408
+ </xsl:call-template>
5517
6409
  </xsl:variable>
5518
6410
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
5519
6411
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
@@ -6464,7 +7356,7 @@
6464
7356
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
6465
7357
  <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
6466
7358
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
6467
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
7359
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
6468
7360
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
6469
7361
  <!-- <row>
6470
7362
  <date>05-07-2013</date>
@@ -7859,4 +8751,40 @@
7859
8751
  <xsl:value-of select="$value"/>
7860
8752
  </xsl:otherwise>
7861
8753
  </xsl:choose>
8754
+ </xsl:template><xsl:template match="*" mode="print_as_xml">
8755
+ <xsl:param name="level">0</xsl:param>
8756
+
8757
+ <fo:block margin-left="{2*$level}mm">
8758
+ <xsl:text>
8759
+ &lt;</xsl:text>
8760
+ <xsl:value-of select="local-name()"/>
8761
+ <xsl:for-each select="@*">
8762
+ <xsl:text> </xsl:text>
8763
+ <xsl:value-of select="local-name()"/>
8764
+ <xsl:text>="</xsl:text>
8765
+ <xsl:value-of select="."/>
8766
+ <xsl:text>"</xsl:text>
8767
+ </xsl:for-each>
8768
+ <xsl:text>&gt;</xsl:text>
8769
+
8770
+ <xsl:if test="not(*)">
8771
+ <fo:inline font-weight="bold"><xsl:value-of select="."/></fo:inline>
8772
+ <xsl:text>&lt;/</xsl:text>
8773
+ <xsl:value-of select="local-name()"/>
8774
+ <xsl:text>&gt;</xsl:text>
8775
+ </xsl:if>
8776
+ </fo:block>
8777
+
8778
+ <xsl:if test="*">
8779
+ <fo:block>
8780
+ <xsl:apply-templates mode="print_as_xml">
8781
+ <xsl:with-param name="level" select="$level + 1"/>
8782
+ </xsl:apply-templates>
8783
+ </fo:block>
8784
+ <fo:block margin-left="{2*$level}mm">
8785
+ <xsl:text>&lt;/</xsl:text>
8786
+ <xsl:value-of select="local-name()"/>
8787
+ <xsl:text>&gt;</xsl:text>
8788
+ </fo:block>
8789
+ </xsl:if>
7862
8790
  </xsl:template></xsl:stylesheet>