metanorma-m3aawg 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -547,6 +547,7 @@
547
547
 
548
548
  <xsl:template match="m3d:p" name="paragraph">
549
549
  <xsl:param name="inline" select="'false'"/>
550
+ <xsl:param name="split_keep-within-line"/>
550
551
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
551
552
  <xsl:variable name="element-name">
552
553
  <xsl:choose>
@@ -567,7 +568,9 @@
567
568
  </xsl:attribute>
568
569
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
569
570
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
570
- <xsl:apply-templates/>
571
+ <xsl:apply-templates>
572
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
573
+ </xsl:apply-templates>
571
574
  </xsl:element>
572
575
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
573
576
  <xsl:choose>
@@ -649,7 +652,9 @@
649
652
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAjUAAAA8CAYAAACehUt5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA99pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLz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XEzqrCButblm2a1xcovbcdtD7QrPwUehc0OOM5l7cmeJtjA6k80mJnbrttzUXiDIMn1WHWVZsUgsYulYcr+7KXlhVZVjVTVElxpxphn6Vltqi9u0m9pgVWf5ey0/sTQYZBDfbXTdb1UI9tFbXdUyCwhX43GS4fKHV6wfDcXkTDOsI4byfPzq2B9pQqc9C9gVKnGxOWF24nYu5cUs1twmr59sCl/WjzU1MAHYIQWw2XqsLZRoRpOjVnMND+1qKFmae8wFgtsG2gHDly5KgAVF5e/pvffrJtf4yoCUBDsrlDD0jZnqdqAtAEtE9GzVJS12NpxxuqwnCspk7vvSewQplRk4CGffKrpLu4WsU2xFMqfgTkuIS+hrErAGQ7eV+RpBtsgMaRI0eOqpNswmSFMlscf1yDdZ5rqVfsk3NFkMJL4HkmbZYabCMMUYsM4wNDz3VFkKzUrNShVr7FUOZ9NShw35f64SwWk60P1I2fJiwW9gDQlGR1cGTSNv0gbYKhLrYvh9WWD5peZ3C5fFLqB3dI7HfDm2YPzqkkhzFChQ+bC2gOAdpwAOpSxzYdOXJUW8m8/VQPKGr7yVHdJbgdKy+GwcowwKvGOsCgFnZZy2jfUtv7DMAXtgDYy4dHFM5Yakzw/AsXBTBqhR3AXAaFzOI7nKfc9pMjR44KTNh+cmc/OaqTRBCxpIbrgO2dVXWoz6DF+ZLJkSNHjuodOZduR44cOXLkyJEDNY4cOXLkyJEjR7WF/O2nDbnvXd9oIzfEjhw5cuTI0W8L1CAA0DauOxw5clQA6khe84PrCkeOHBWS/l+AAQACYD7v73Ou8wAAAABJRU5ErkJggg==</xsl:text>
650
653
  </xsl:variable>
651
654
 
652
- <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">
655
+ <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_">
656
+ false
657
+ </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
653
658
  <xsl:call-template name="getLang"/>
654
659
  </xsl:variable><xsl:variable name="pageWidth_">
655
660
  215.9
@@ -1106,6 +1111,7 @@
1106
1111
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1107
1112
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1108
1113
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1114
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1109
1115
  <xsl:attribute name="display-align">center</xsl:attribute>
1110
1116
 
1111
1117
 
@@ -1124,6 +1130,7 @@
1124
1130
  <xsl:attribute name="display-align">center</xsl:attribute>
1125
1131
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1126
1132
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1133
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1127
1134
 
1128
1135
 
1129
1136
 
@@ -1208,7 +1215,8 @@
1208
1215
  </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1209
1216
 
1210
1217
 
1211
- </xsl:attribute-set><xsl:attribute-set name="dt-style">
1218
+ </xsl:attribute-set><xsl:attribute-set name="dt-cell-style">
1219
+ </xsl:attribute-set><xsl:attribute-set name="dt-block-style">
1212
1220
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1213
1221
 
1214
1222
 
@@ -1220,6 +1228,8 @@
1220
1228
 
1221
1229
 
1222
1230
 
1231
+ </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
1232
+ <xsl:attribute name="padding-left">2mm</xsl:attribute>
1223
1233
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1224
1234
 
1225
1235
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -2056,7 +2066,38 @@
2056
2066
  </xsl:template><xsl:template match="*[local-name()='br']">
2057
2067
  <xsl:value-of select="$linebreak"/>
2058
2068
  </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
2059
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2069
+ <xsl:param name="split_keep-within-line"/>
2070
+
2071
+ <!-- <fo:inline>split_keep-within-line='<xsl:value-of select="$split_keep-within-line"/>'</fo:inline> -->
2072
+ <xsl:choose>
2073
+
2074
+ <xsl:when test="normalize-space($split_keep-within-line) = 'true'">
2075
+ <xsl:variable name="sep">_</xsl:variable>
2076
+ <xsl:variable name="items">
2077
+ <xsl:call-template name="split">
2078
+ <xsl:with-param name="pText" select="."/>
2079
+ <xsl:with-param name="sep" select="$sep"/>
2080
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
2081
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
2082
+ </xsl:call-template>
2083
+ </xsl:variable>
2084
+ <xsl:for-each select="xalan:nodeset($items)/item">
2085
+ <xsl:choose>
2086
+ <xsl:when test=". = $sep">
2087
+ <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2088
+ </xsl:when>
2089
+ <xsl:otherwise>
2090
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2091
+ </xsl:otherwise>
2092
+ </xsl:choose>
2093
+ </xsl:for-each>
2094
+ </xsl:when>
2095
+
2096
+ <xsl:otherwise>
2097
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2098
+ </xsl:otherwise>
2099
+
2100
+ </xsl:choose>
2060
2101
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2061
2102
  <fo:block xsl:use-attribute-sets="copyright-statement-style">
2062
2103
  <xsl:apply-templates/>
@@ -2148,9 +2189,14 @@
2148
2189
 
2149
2190
  <xsl:variable name="table">
2150
2191
 
2151
- <xsl:variable name="simple-table">
2152
- <xsl:call-template name="getSimpleTable"/>
2192
+ <xsl:variable name="simple-table">
2193
+ <xsl:call-template name="getSimpleTable">
2194
+ <xsl:with-param name="id" select="@id"/>
2195
+ </xsl:call-template>
2153
2196
  </xsl:variable>
2197
+ <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2198
+
2199
+ <!-- simple-table=<xsl:copy-of select="$simple-table"/> -->
2154
2200
 
2155
2201
 
2156
2202
  <!-- Display table's name before table as standalone block -->
@@ -2173,7 +2219,23 @@
2173
2219
  </xsl:call-template>
2174
2220
  </xsl:if>
2175
2221
  </xsl:variable>
2176
- <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2222
+ <!-- <xsl:variable name="colwidths" select="xalan:nodeset($colwidths_)"/> -->
2223
+
2224
+ <!-- DEBUG -->
2225
+ <xsl:if test="$table_if_debug = 'true'">
2226
+ <fo:block font-size="60%">
2227
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
2228
+ </fo:block>
2229
+ </xsl:if>
2230
+
2231
+
2232
+ <!-- <xsl:copy-of select="$colwidths"/> -->
2233
+
2234
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
2235
+ DEBUG
2236
+ colwidths=<xsl:copy-of select="$colwidths"/>
2237
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
2238
+
2177
2239
 
2178
2240
 
2179
2241
  <xsl:variable name="margin-side">
@@ -2240,9 +2302,17 @@
2240
2302
  </xsl:element>
2241
2303
  </xsl:variable>
2242
2304
 
2305
+ <xsl:if test="$isGenerateTableIF = 'true'">
2306
+ <!-- to determine start of table -->
2307
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
2308
+ </xsl:if>
2243
2309
 
2244
2310
  <fo:table id="{@id}">
2245
2311
 
2312
+ <xsl:if test="$isGenerateTableIF = 'true'">
2313
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
2314
+ </xsl:if>
2315
+
2246
2316
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2247
2317
  <xsl:attribute name="{local-name()}">
2248
2318
  <xsl:value-of select="."/>
@@ -2256,24 +2326,47 @@
2256
2326
 
2257
2327
 
2258
2328
  <xsl:choose>
2259
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2260
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2261
- <fo:table-column column-width="{@width}"/>
2262
- </xsl:for-each>
2329
+ <xsl:when test="$isGenerateTableIF = 'true'">
2330
+ <!-- generate IF for table widths -->
2331
+ <!-- example:
2332
+ <tr>
2333
+ <td valign="top" align="left" id="tab-symdu_1_1">
2334
+ <p>Symbol</p>
2335
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
2336
+ </td>
2337
+ <td valign="top" align="left" id="tab-symdu_1_2">
2338
+ <p>Description</p>
2339
+ <word id="tab-symdu_1_2_word_1">Description</word>
2340
+ </td>
2341
+ </tr>
2342
+ -->
2343
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2344
+
2263
2345
  </xsl:when>
2264
2346
  <xsl:otherwise>
2265
- <xsl:call-template name="insertTableColumnWidth">
2266
- <xsl:with-param name="colwidths" select="$colwidths"/>
2267
- </xsl:call-template>
2268
- </xsl:otherwise>
2269
- </xsl:choose>
2270
2347
 
2271
- <xsl:choose>
2272
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2273
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2274
- </xsl:when>
2275
- <xsl:otherwise>
2276
- <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 -->
2348
+ <xsl:choose>
2349
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2350
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2351
+ <fo:table-column column-width="{@width}"/>
2352
+ </xsl:for-each>
2353
+ </xsl:when>
2354
+ <xsl:otherwise>
2355
+ <xsl:call-template name="insertTableColumnWidth">
2356
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2357
+ </xsl:call-template>
2358
+ </xsl:otherwise>
2359
+ </xsl:choose>
2360
+
2361
+ <xsl:choose>
2362
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2363
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2364
+ </xsl:when>
2365
+ <xsl:otherwise>
2366
+ <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 -->
2367
+ </xsl:otherwise>
2368
+ </xsl:choose>
2369
+
2277
2370
  </xsl:otherwise>
2278
2371
  </xsl:choose>
2279
2372
 
@@ -2376,11 +2469,22 @@
2376
2469
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2377
2470
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
2378
2471
  </xsl:template><xsl:template name="calculate-column-widths">
2472
+ <xsl:param name="table"/>
2473
+ <xsl:param name="cols-count"/>
2474
+
2475
+ <xsl:call-template name="calculate-column-widths-proportional">
2476
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2477
+ <xsl:with-param name="table" select="$table"/>
2478
+ </xsl:call-template>
2479
+
2480
+ </xsl:template><xsl:template name="calculate-column-widths-proportional">
2379
2481
  <xsl:param name="table"/>
2380
2482
  <xsl:param name="cols-count"/>
2381
2483
  <xsl:param name="curr-col" select="1"/>
2382
2484
  <xsl:param name="width" select="0"/>
2383
2485
 
2486
+ <!-- table=<xsl:copy-of select="$table"/> -->
2487
+
2384
2488
  <xsl:if test="$curr-col &lt;= $cols-count">
2385
2489
  <xsl:variable name="widths">
2386
2490
  <xsl:choose>
@@ -2418,10 +2522,15 @@
2418
2522
  </xsl:for-each>
2419
2523
  </xsl:when>
2420
2524
  <xsl:otherwise>
2421
- <xsl:for-each select="xalan:nodeset($table)/*/tr">
2525
+ <!-- <curr_col><xsl:value-of select="$curr-col"/></curr_col> -->
2526
+
2527
+ <!-- <table><xsl:copy-of select="$table"/></table>
2528
+ -->
2529
+ <xsl:for-each select="xalan:nodeset($table)/*/*[local-name()='tr']">
2422
2530
  <xsl:variable name="td_text">
2423
2531
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2424
2532
  </xsl:variable>
2533
+ <!-- <td_text><xsl:value-of select="$td_text"/></td_text> -->
2425
2534
  <xsl:variable name="words">
2426
2535
  <xsl:variable name="string_with_added_zerospaces">
2427
2536
  <xsl:call-template name="add-zero-spaces-java">
@@ -2436,6 +2545,7 @@
2436
2545
  <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2437
2546
  </xsl:call-template>
2438
2547
  </xsl:variable>
2548
+ <!-- words=<xsl:copy-of select="$words"/> -->
2439
2549
  <xsl:variable name="max_length">
2440
2550
  <xsl:call-template name="max_length">
2441
2551
  <xsl:with-param name="words" select="xalan:nodeset($words)"/>
@@ -2460,6 +2570,8 @@
2460
2570
  </xsl:choose>
2461
2571
  </xsl:variable>
2462
2572
 
2573
+ <!-- widths=<xsl:copy-of select="$widths"/> -->
2574
+
2463
2575
  <column>
2464
2576
  <xsl:for-each select="xalan:nodeset($widths)//width">
2465
2577
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -2468,33 +2580,327 @@
2468
2580
  </xsl:if>
2469
2581
  </xsl:for-each>
2470
2582
  </column>
2471
- <xsl:call-template name="calculate-column-widths">
2583
+ <xsl:call-template name="calculate-column-widths-proportional">
2472
2584
  <xsl:with-param name="cols-count" select="$cols-count"/>
2473
2585
  <xsl:with-param name="curr-col" select="$curr-col +1"/>
2474
2586
  <xsl:with-param name="table" select="$table"/>
2475
2587
  </xsl:call-template>
2476
2588
  </xsl:if>
2477
- </xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
2589
+ </xsl:template><xsl:template match="*[@keep-together.within-line or local-name() = 'keep-together_within-line']/text()" priority="2" mode="td_text">
2478
2590
  <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
2479
2591
  <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
2480
2592
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
2593
+
2594
+ <!-- if all capitals english letters or digits -->
2595
+ <xsl:if test="normalize-space(translate(., concat($upper,'0123456789'), '')) = ''">
2596
+ <xsl:call-template name="repeat">
2597
+ <xsl:with-param name="char" select="'X'"/>
2598
+ <xsl:with-param name="count" select="string-length(normalize-space(.)) * 0.5"/>
2599
+ </xsl:call-template>
2600
+ </xsl:if>
2481
2601
  </xsl:template><xsl:template match="text()" mode="td_text">
2482
2602
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2483
2603
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2484
2604
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2485
2605
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2486
2606
  <xsl:value-of select="@target"/>
2487
- </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2488
- <xsl:variable name="mathml">
2489
- <xsl:for-each select="*">
2490
- <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2491
- <xsl:copy-of select="."/>
2607
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text" name="math_length">
2608
+ <xsl:if test="$isGenerateTableIF = 'false'">
2609
+ <xsl:variable name="mathml_">
2610
+ <xsl:for-each select="*">
2611
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2612
+ <xsl:copy-of select="."/>
2613
+ </xsl:if>
2614
+ </xsl:for-each>
2615
+ </xsl:variable>
2616
+ <xsl:variable name="mathml" select="xalan:nodeset($mathml_)"/>
2617
+
2618
+ <xsl:variable name="math_text">
2619
+ <xsl:value-of select="normalize-space($mathml)"/>
2620
+ <xsl:for-each select="$mathml//@open"><xsl:value-of select="."/></xsl:for-each>
2621
+ <xsl:for-each select="$mathml//@close"><xsl:value-of select="."/></xsl:for-each>
2622
+ </xsl:variable>
2623
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2624
+ </xsl:if>
2625
+ </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
2626
+ <xsl:param name="table"/>
2627
+ <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
2628
+
2629
+ <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
2630
+
2631
+ <!-- In the first pass, line wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. -->
2632
+
2633
+ <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2634
+
2635
+ <!-- get current table id -->
2636
+ <xsl:variable name="table_id" select="@id"/>
2637
+ <!-- find table by id in the file 'table_widths' -->
2638
+ <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2639
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
2640
+
2641
+
2642
+ <!-- table='<xsl:copy-of select="$table"/>' -->
2643
+ <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2644
+ <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2645
+ <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2646
+
2647
+ <xsl:variable name="table_with_cell_widths_">
2648
+ <xsl:choose>
2649
+ <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
2650
+
2651
+ <!-- Example: <column>10</column>
2652
+ <column>11</column>
2653
+ -->
2654
+ <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
2655
+ </xsl:when>
2656
+ <xsl:otherwise>
2657
+ <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
2658
+ </xsl:otherwise>
2659
+ </xsl:choose>
2660
+ </xsl:variable>
2661
+ <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2662
+
2663
+ <xsl:if test="$table_if_debug = 'true'">
2664
+ <xsl:copy-of select="$table_with_cell_widths"/>
2665
+ </xsl:if>
2666
+
2667
+
2668
+ <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2669
+
2670
+ <xsl:variable name="column_widths_">
2671
+ <!-- iteration of columns -->
2672
+ <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2673
+ <xsl:variable name="pos" select="position()"/>
2674
+ <column>
2675
+ <xsl:attribute name="width_max">
2676
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2677
+ <xsl:sort select="." data-type="number" order="descending"/>
2678
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2679
+ </xsl:for-each>
2680
+ </xsl:attribute>
2681
+ <xsl:attribute name="width_min">
2682
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2683
+ <xsl:sort select="." data-type="number" order="descending"/>
2684
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2685
+ </xsl:for-each>
2686
+ </xsl:attribute>
2687
+ </column>
2688
+ </xsl:for-each>
2689
+ </xsl:variable>
2690
+ <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2691
+
2692
+ <!-- <column_widths>
2693
+ <xsl:copy-of select="$column_widths"/>
2694
+ </column_widths> -->
2695
+
2696
+ <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2697
+ <xsl:variable name="table_widths_">
2698
+ <table>
2699
+ <xsl:attribute name="width_max">
2700
+ <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2701
+ </xsl:attribute>
2702
+ <xsl:attribute name="width_min">
2703
+ <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2704
+ </xsl:attribute>
2705
+ </table>
2706
+ </xsl:variable>
2707
+ <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2708
+
2709
+ <xsl:variable name="page_width">
2710
+ <xsl:choose>
2711
+ <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
2712
+ <xsl:otherwise>75</xsl:otherwise>
2713
+ </xsl:choose>
2714
+ </xsl:variable>
2715
+
2716
+ <xsl:if test="$table_if_debug = 'true'">
2717
+ <table_width>
2718
+ <xsl:copy-of select="$table_widths"/>
2719
+ </table_width>
2720
+ <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
2721
+ <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
2722
+ -->
2723
+ <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2724
+ </xsl:if>
2725
+
2726
+
2727
+ <!-- There are three cases: -->
2728
+ <xsl:choose>
2729
+ <!-- 1. The minimum table width is equal to or wider than the available space -->
2730
+ <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2731
+ <!-- call old algorithm -->
2732
+ <case1/>
2733
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
2734
+ <xsl:call-template name="calculate-column-widths-proportional">
2735
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2736
+ <xsl:with-param name="table" select="$table"/>
2737
+ </xsl:call-template>
2738
+ </xsl:when>
2739
+ <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2740
+ <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2741
+ <case2/>
2742
+ <autolayout/>
2743
+ <xsl:for-each select="$column_widths/column/@width_max">
2744
+ <column divider="100"><xsl:value-of select="."/></column>
2745
+ </xsl:for-each>
2746
+ </xsl:when>
2747
+ <!-- 3. The maximum width of the table is greater than the available space, but the minimum table width is smaller.
2748
+ In this case, find the difference between the available space and the minimum table width, lets call it W.
2749
+ Lets also call D the difference between maximum and minimum width of the table.
2750
+ For each column, let d be the difference between maximum and minimum width of that column.
2751
+ Now set the column's width to the minimum width plus d times W over D.
2752
+ This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2753
+ <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)">
2754
+ <!-- difference between the available space and the minimum table width -->
2755
+ <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2756
+ <W><xsl:value-of select="$W"/></W>
2757
+ <!-- difference between maximum and minimum width of the table -->
2758
+ <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2759
+ <D><xsl:value-of select="$D"/></D>
2760
+ <case3/>
2761
+ <autolayout/>
2762
+ <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2763
+ <split_keep-within-line>true</split_keep-within-line>
2492
2764
  </xsl:if>
2765
+ <xsl:for-each select="$column_widths/column">
2766
+ <!-- difference between maximum and minimum width of that column. -->
2767
+ <xsl:variable name="d" select="@width_max - @width_min"/>
2768
+ <d><xsl:value-of select="$d"/></d>
2769
+ <width_min><xsl:value-of select="@width_min"/></width_min>
2770
+ <e><xsl:value-of select="$d * $W div $D"/></e>
2771
+ <!-- set the column's width to the minimum width plus d times W over D. -->
2772
+ <column divider="100">
2773
+ <xsl:value-of select="round(@width_min + $d * $W div $D)"/> <!-- * 10 -->
2774
+ </column>
2775
+ </xsl:for-each>
2776
+
2777
+ </xsl:when>
2778
+ <xsl:otherwise><unknown_case/></xsl:otherwise>
2779
+ </xsl:choose>
2780
+
2781
+
2782
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
2783
+ <xsl:copy>
2784
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
2785
+ </xsl:copy>
2786
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
2787
+ <xsl:copy>
2788
+ <xsl:copy-of select="@*"/>
2789
+
2790
+ <!-- The maximum width is given by the widest line. -->
2791
+ <xsl:variable name="widths_max">
2792
+ <xsl:for-each select=".//*[local-name() = 'p']">
2793
+ <xsl:call-template name="add_width"/>
2794
+ </xsl:for-each>
2795
+ <xsl:if test="not(*[local-name() = 'p'])">
2796
+ <xsl:call-template name="add_width"/>
2797
+ </xsl:if>
2798
+ </xsl:variable>
2799
+ <xsl:variable name="width_max">
2800
+ <xsl:for-each select="xalan:nodeset($widths_max)//width">
2801
+ <xsl:sort select="." data-type="number" order="descending"/>
2802
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2803
+ </xsl:for-each>
2804
+ </xsl:variable>
2805
+ <xsl:attribute name="width_max">
2806
+ <xsl:value-of select="$width_max"/>
2807
+ </xsl:attribute>
2808
+
2809
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2810
+ <!-- To do: image width -->
2811
+ <xsl:variable name="td_text">
2812
+ <xsl:apply-templates select="." mode="td_text"/>
2813
+ </xsl:variable>
2814
+ <xsl:variable name="words">
2815
+ <xsl:variable name="string_with_added_zerospaces">
2816
+ <xsl:call-template name="add-zero-spaces-java">
2817
+ <xsl:with-param name="text" select="$td_text"/>
2818
+ </xsl:call-template>
2819
+ </xsl:variable>
2820
+ <xsl:call-template name="tokenize">
2821
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2822
+ </xsl:call-template>
2823
+ </xsl:variable>
2824
+
2825
+ <xsl:variable name="max_word_length">
2826
+ <xsl:call-template name="max_length">
2827
+ <xsl:with-param name="words" select="xalan:nodeset($words)"/>
2828
+ </xsl:call-template>
2829
+ </xsl:variable>
2830
+ <xsl:variable name="width_min">
2831
+ <xsl:value-of select="$max_word_length"/>
2832
+ </xsl:variable>
2833
+ <xsl:attribute name="width_min">
2834
+ <xsl:value-of select="$width_min"/>
2835
+ </xsl:attribute>
2836
+ <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
2837
+ <xsl:if test="$width_min &gt; $width_max">
2838
+ <xsl:attribute name="width_max">
2839
+ <xsl:value-of select="$width_min"/>
2840
+ </xsl:attribute>
2841
+ </xsl:if>
2842
+ <xsl:if test="$width_min = 0">
2843
+ <xsl:attribute name="width_min">1</xsl:attribute>
2844
+ </xsl:if>
2845
+
2846
+ <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
2847
+
2848
+ </xsl:copy>
2849
+ </xsl:template><xsl:template name="add_width">
2850
+ <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
2851
+ <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
2852
+
2853
+ <xsl:variable name="p_text_len">
2854
+ <xsl:choose>
2855
+ <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
2856
+ <xsl:value-of select="$p_text_len_ * 1.5"/>
2857
+ </xsl:when>
2858
+ <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
2859
+ </xsl:choose>
2860
+ </xsl:variable>
2861
+
2862
+ <xsl:variable name="math_addon_text">
2863
+ <xsl:for-each select=".//*[local-name() = 'math']">
2864
+ <xsl:apply-templates mode="td_text"/>
2493
2865
  </xsl:for-each>
2494
2866
  </xsl:variable>
2867
+ <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
2495
2868
 
2496
- <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2497
- <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2869
+ <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
2870
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
2871
+ <xsl:copy>
2872
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2873
+ </xsl:copy>
2874
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths-if">
2875
+ <xsl:copy>
2876
+ <xsl:copy-of select="@*"/>
2877
+
2878
+ <!-- The maximum width is given by the widest line. -->
2879
+ <xsl:attribute name="width_max">
2880
+ <xsl:for-each select="p_len">
2881
+ <xsl:sort select="." data-type="number" order="descending"/>
2882
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2883
+ </xsl:for-each>
2884
+ </xsl:attribute>
2885
+
2886
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2887
+ <xsl:variable name="width_min">
2888
+ <xsl:for-each select="word_len">
2889
+ <xsl:sort select="." data-type="number" order="descending"/>
2890
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2891
+ </xsl:for-each>
2892
+ </xsl:variable>
2893
+ <xsl:attribute name="width_min">
2894
+ <xsl:value-of select="$width_min"/>
2895
+ </xsl:attribute>
2896
+
2897
+ <xsl:if test="$width_min = 0">
2898
+ <xsl:attribute name="width_min">1</xsl:attribute>
2899
+ </xsl:if>
2900
+
2901
+ <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2902
+
2903
+ </xsl:copy>
2498
2904
  </xsl:template><xsl:template match="*[local-name()='thead']">
2499
2905
  <xsl:param name="cols-count"/>
2500
2906
  <fo:table-header>
@@ -2579,6 +2985,7 @@
2579
2985
  </xsl:for-each>
2580
2986
  </xsl:when>
2581
2987
  <xsl:otherwise>
2988
+ <!-- $colwidths=<xsl:copy-of select="$colwidths"/> -->
2582
2989
  <xsl:call-template name="insertTableColumnWidth">
2583
2990
  <xsl:with-param name="colwidths" select="$colwidths"/>
2584
2991
  </xsl:call-template>
@@ -2658,6 +3065,52 @@
2658
3065
 
2659
3066
  </fo:table-body>
2660
3067
 
3068
+ </xsl:template><xsl:template match="/" mode="process_table-if">
3069
+ <xsl:param name="table_or_dl">table</xsl:param>
3070
+ <xsl:apply-templates mode="process_table-if">
3071
+ <xsl:with-param name="table_or_dl" select="$table_or_dl"/>
3072
+ </xsl:apply-templates>
3073
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="process_table-if">
3074
+ <xsl:param name="table_or_dl">table</xsl:param>
3075
+
3076
+ <fo:table-body>
3077
+ <xsl:for-each select="*[local-name() = 'tr']">
3078
+ <xsl:variable name="col_count" select="count(*)"/>
3079
+
3080
+ <!-- iteration for each tr/td -->
3081
+
3082
+ <xsl:choose>
3083
+ <xsl:when test="$table_or_dl = 'table'">
3084
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3085
+ <fo:table-row number-columns-spanned="{$col_count}">
3086
+ <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3087
+ <xsl:call-template name="td"/>
3088
+ </fo:table-row>
3089
+ </xsl:for-each>
3090
+ </xsl:when>
3091
+ <xsl:otherwise> <!-- $table_or_dl = 'dl' -->
3092
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']">
3093
+ <xsl:variable name="is_dt" select="position() = 1"/>
3094
+
3095
+ <xsl:for-each select="*">
3096
+ <!-- <test><xsl:copy-of select="."/></test> -->
3097
+ <fo:table-row number-columns-spanned="{$col_count}">
3098
+ <xsl:choose>
3099
+ <xsl:when test="$is_dt">
3100
+ <xsl:call-template name="insert_dt_cell"/>
3101
+ </xsl:when>
3102
+ <xsl:otherwise>
3103
+ <xsl:call-template name="insert_dd_cell"/>
3104
+ </xsl:otherwise>
3105
+ </xsl:choose>
3106
+ </fo:table-row>
3107
+ </xsl:for-each>
3108
+ </xsl:for-each>
3109
+ </xsl:otherwise>
3110
+ </xsl:choose>
3111
+
3112
+ </xsl:for-each>
3113
+ </fo:table-body>
2661
3114
  </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2662
3115
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2663
3116
 
@@ -2744,7 +3197,7 @@
2744
3197
  </xsl:choose>
2745
3198
  </xsl:attribute>
2746
3199
  </xsl:if>
2747
- </xsl:template><xsl:template match="*[local-name()='td']">
3200
+ </xsl:template><xsl:template match="*[local-name()='td']" name="td">
2748
3201
  <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2749
3202
  <xsl:call-template name="setTextAlignment">
2750
3203
  <xsl:with-param name="default">left</xsl:with-param>
@@ -2778,11 +3231,24 @@
2778
3231
 
2779
3232
  <xsl:call-template name="setTableCellAttributes"/>
2780
3233
 
3234
+ <xsl:if test="$isGenerateTableIF = 'true'">
3235
+ <xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
3236
+ <xsl:attribute name="text-align">left</xsl:attribute>
3237
+ </xsl:if>
3238
+
2781
3239
  <fo:block>
2782
3240
 
3241
+ <xsl:if test="$isGenerateTableIF = 'true'">
3242
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3243
+ </xsl:if>
3244
+
3245
+
2783
3246
 
2784
3247
 
2785
3248
  <xsl:apply-templates/>
3249
+
3250
+ <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"/> -->
3251
+
2786
3252
  </fo:block>
2787
3253
  </fo:table-cell>
2788
3254
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
@@ -2979,9 +3445,9 @@
2979
3445
  <!-- current hierarchy is 'figure' element -->
2980
3446
  <xsl:variable name="following_dl_colwidths">
2981
3447
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2982
- <xsl:variable name="html-table">
2983
- <xsl:variable name="doc_ns">
2984
-
3448
+ <xsl:variable name="simple-table">
3449
+ <!-- <xsl:variable name="doc_ns">
3450
+ <xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
2985
3451
  </xsl:variable>
2986
3452
  <xsl:variable name="ns">
2987
3453
  <xsl:choose>
@@ -2992,7 +3458,7 @@
2992
3458
  <xsl:value-of select="substring-before(name(/*), '-')"/>
2993
3459
  </xsl:otherwise>
2994
3460
  </xsl:choose>
2995
- </xsl:variable>
3461
+ </xsl:variable> -->
2996
3462
 
2997
3463
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2998
3464
  <tbody>
@@ -3003,7 +3469,7 @@
3003
3469
 
3004
3470
  <xsl:call-template name="calculate-column-widths">
3005
3471
  <xsl:with-param name="cols-count" select="2"/>
3006
- <xsl:with-param name="table" select="$html-table"/>
3472
+ <xsl:with-param name="table" select="$simple-table"/>
3007
3473
  </xsl:call-template>
3008
3474
 
3009
3475
  </xsl:if>
@@ -3183,7 +3649,18 @@
3183
3649
 
3184
3650
 
3185
3651
 
3652
+
3653
+ <xsl:if test="$isGenerateTableIF = 'true'">
3654
+ <!-- to determine start of table -->
3655
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
3656
+ </xsl:if>
3657
+
3186
3658
  <fo:table width="95%" table-layout="fixed">
3659
+
3660
+ <xsl:if test="$isGenerateTableIF = 'true'">
3661
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
3662
+ </xsl:if>
3663
+
3187
3664
 
3188
3665
  <xsl:choose>
3189
3666
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
@@ -3192,52 +3669,130 @@
3192
3669
 
3193
3670
  </xsl:when>
3194
3671
  </xsl:choose>
3195
- <!-- create virtual html table for dl/[dt and dd] -->
3196
- <xsl:variable name="html-table">
3197
- <xsl:variable name="doc_ns">
3672
+
3673
+
3674
+ <xsl:choose>
3675
+ <xsl:when test="$isGenerateTableIF = 'true'">
3676
+ <!-- generate IF for table widths -->
3677
+ <!-- example:
3678
+ <tr>
3679
+ <td valign="top" align="left" id="tab-symdu_1_1">
3680
+ <p>Symbol</p>
3681
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
3682
+ </td>
3683
+ <td valign="top" align="left" id="tab-symdu_1_2">
3684
+ <p>Description</p>
3685
+ <word id="tab-symdu_1_2_word_1">Description</word>
3686
+ </td>
3687
+ </tr>
3688
+ -->
3198
3689
 
3199
- </xsl:variable>
3200
- <xsl:variable name="ns">
3201
- <xsl:choose>
3202
- <xsl:when test="normalize-space($doc_ns) != ''">
3203
- <xsl:value-of select="normalize-space($doc_ns)"/>
3204
- </xsl:when>
3205
- <xsl:otherwise>
3206
- <xsl:value-of select="substring-before(name(/*), '-')"/>
3207
- </xsl:otherwise>
3208
- </xsl:choose>
3209
- </xsl:variable>
3210
- <tbody>
3211
- <xsl:apply-templates mode="dl"/>
3212
- </tbody>
3213
- </xsl:variable>
3214
- <!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
3215
- <xsl:variable name="colwidths">
3216
- <xsl:call-template name="calculate-column-widths">
3217
- <xsl:with-param name="cols-count" select="2"/>
3218
- <xsl:with-param name="table" select="$html-table"/>
3219
- </xsl:call-template>
3220
- </xsl:variable>
3221
- <!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
3222
- <xsl:variable name="maxlength_dt">
3223
- <xsl:call-template name="getMaxLength_dt"/>
3224
- </xsl:variable>
3225
- <xsl:variable name="isContainsKeepTogetherTag_">
3226
- false
3227
- </xsl:variable>
3228
- <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3229
- <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3230
- <xsl:call-template name="setColumnWidth_dl">
3231
- <xsl:with-param name="colwidths" select="$colwidths"/>
3232
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3233
- <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3234
- </xsl:call-template>
3690
+ <!-- create virtual html table for dl/[dt and dd] -->
3691
+ <xsl:variable name="simple-table">
3692
+
3693
+ <xsl:variable name="dl_table">
3694
+ <tbody>
3695
+ <xsl:apply-templates mode="dl_if">
3696
+ <xsl:with-param name="id" select="@id"/>
3697
+ </xsl:apply-templates>
3698
+ </tbody>
3699
+ </xsl:variable>
3700
+
3701
+ <!-- dl_table='<xsl:copy-of select="$dl_table"/>' -->
3702
+
3703
+ <!-- Step: replace <br/> to <p>...</p> -->
3704
+ <xsl:variable name="table_without_br">
3705
+ <xsl:apply-templates select="xalan:nodeset($dl_table)" mode="table-without-br"/>
3706
+ </xsl:variable>
3707
+
3708
+ <!-- table_without_br='<xsl:copy-of select="$table_without_br"/>' -->
3709
+
3710
+ <!-- Step: add id to each cell -->
3711
+ <!-- add <word>...</word> for each word, image, math -->
3712
+ <xsl:variable name="simple-table-id">
3713
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-id">
3714
+ <xsl:with-param name="id" select="@id"/>
3715
+ </xsl:apply-templates>
3716
+ </xsl:variable>
3717
+
3718
+ <!-- simple-table-id='<xsl:copy-of select="$simple-table-id"/>' -->
3719
+
3720
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
3721
+
3722
+ </xsl:variable>
3723
+
3724
+ <!-- DEBUG: simple-table<xsl:copy-of select="$simple-table"/> -->
3725
+
3726
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if">
3727
+ <xsl:with-param name="table_or_dl">dl</xsl:with-param>
3728
+ </xsl:apply-templates>
3729
+
3730
+ </xsl:when>
3731
+ <xsl:otherwise>
3235
3732
 
3236
- <fo:table-body>
3237
- <xsl:apply-templates>
3238
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3239
- </xsl:apply-templates>
3240
- </fo:table-body>
3733
+ <xsl:variable name="simple-table">
3734
+
3735
+ <xsl:variable name="dl_table">
3736
+ <tbody>
3737
+ <xsl:apply-templates mode="dl">
3738
+ <xsl:with-param name="id" select="@id"/>
3739
+ </xsl:apply-templates>
3740
+ </tbody>
3741
+ </xsl:variable>
3742
+
3743
+ <xsl:copy-of select="$dl_table"/>
3744
+ </xsl:variable>
3745
+
3746
+ <xsl:variable name="colwidths">
3747
+ <xsl:call-template name="calculate-column-widths">
3748
+ <xsl:with-param name="cols-count" select="2"/>
3749
+ <xsl:with-param name="table" select="$simple-table"/>
3750
+ </xsl:call-template>
3751
+ </xsl:variable>
3752
+
3753
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
3754
+ DEBUG
3755
+ colwidths=<xsl:copy-of select="$colwidths"/>
3756
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
3757
+
3758
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3759
+
3760
+ <xsl:variable name="maxlength_dt">
3761
+ <xsl:call-template name="getMaxLength_dt"/>
3762
+ </xsl:variable>
3763
+
3764
+ <xsl:variable name="isContainsKeepTogetherTag_">
3765
+ false
3766
+ </xsl:variable>
3767
+ <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3768
+ <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3769
+
3770
+
3771
+ <xsl:call-template name="setColumnWidth_dl">
3772
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3773
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3774
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3775
+ </xsl:call-template>
3776
+
3777
+ <fo:table-body>
3778
+
3779
+ <!-- DEBUG -->
3780
+ <xsl:if test="$table_if_debug = 'true'">
3781
+ <fo:table-row>
3782
+ <fo:table-cell number-columns-spanned="2" font-size="60%">
3783
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
3784
+ </fo:table-cell>
3785
+ </fo:table-row>
3786
+ </xsl:if>
3787
+
3788
+ <xsl:apply-templates>
3789
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3790
+ <xsl:with-param name="split_keep-within-line" select="xalan:nodeset($colwidths)/split_keep-within-line"/>
3791
+ </xsl:apply-templates>
3792
+
3793
+ </fo:table-body>
3794
+ </xsl:otherwise>
3795
+ </xsl:choose>
3241
3796
  </fo:table>
3242
3797
  </fo:block>
3243
3798
  </fo:block>
@@ -3248,6 +3803,9 @@
3248
3803
  <xsl:param name="colwidths"/>
3249
3804
  <xsl:param name="maxlength_dt"/>
3250
3805
  <xsl:param name="isContainsKeepTogetherTag"/>
3806
+
3807
+ <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
3808
+
3251
3809
  <xsl:choose>
3252
3810
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3253
3811
  <fo:table-column column-width="50%"/>
@@ -3255,6 +3813,11 @@
3255
3813
  </xsl:when>
3256
3814
  <xsl:otherwise>
3257
3815
  <xsl:choose>
3816
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
3817
+ <xsl:call-template name="insertTableColumnWidth">
3818
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3819
+ </xsl:call-template>
3820
+ </xsl:when>
3258
3821
  <xsl:when test="$isContainsKeepTogetherTag">
3259
3822
  <xsl:call-template name="insertTableColumnWidth">
3260
3823
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -3299,13 +3862,19 @@
3299
3862
  </xsl:choose>
3300
3863
  </xsl:template><xsl:template name="insertTableColumnWidth">
3301
3864
  <xsl:param name="colwidths"/>
3865
+
3302
3866
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
3303
3867
  <xsl:choose>
3304
3868
  <xsl:when test=". = 1 or . = 0">
3305
3869
  <fo:table-column column-width="proportional-column-width(2)"/>
3306
3870
  </xsl:when>
3307
3871
  <xsl:otherwise>
3308
- <fo:table-column column-width="proportional-column-width({.})"/>
3872
+ <!-- <fo:table-column column-width="proportional-column-width({.})"/> -->
3873
+ <xsl:variable name="divider">
3874
+ <xsl:value-of select="@divider"/>
3875
+ <xsl:if test="not(@divider)">1</xsl:if>
3876
+ </xsl:variable>
3877
+ <fo:table-column column-width="proportional-column-width({round(. div $divider)})"/>
3309
3878
  </xsl:otherwise>
3310
3879
  </xsl:choose>
3311
3880
  </xsl:for-each>
@@ -3367,11 +3936,19 @@
3367
3936
  </fo:table-cell>
3368
3937
  </fo:table-row>
3369
3938
  </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
3939
+ <xsl:param name="id"/>
3940
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3370
3941
  <tr>
3371
3942
  <td>
3943
+ <xsl:attribute name="id">
3944
+ <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
3945
+ </xsl:attribute>
3372
3946
  <xsl:apply-templates/>
3373
3947
  </td>
3374
3948
  <td>
3949
+ <xsl:attribute name="id">
3950
+ <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
3951
+ </xsl:attribute>
3375
3952
 
3376
3953
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3377
3954
  <xsl:with-param name="process">true</xsl:with-param>
@@ -3382,50 +3959,122 @@
3382
3959
 
3383
3960
  </xsl:template><xsl:template match="*[local-name()='dt']">
3384
3961
  <xsl:param name="key_iso"/>
3962
+ <xsl:param name="split_keep-within-line"/>
3385
3963
 
3386
3964
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
3387
- <fo:table-cell>
3965
+ <xsl:call-template name="insert_dt_cell">
3966
+ <xsl:with-param name="key_iso" select="$key_iso"/>
3967
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3968
+ </xsl:call-template>
3969
+ <xsl:for-each select="following-sibling::*[local-name()='dd'][1]">
3970
+ <xsl:call-template name="insert_dd_cell">
3971
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3972
+ </xsl:call-template>
3973
+ </xsl:for-each>
3974
+ </fo:table-row>
3975
+ </xsl:template><xsl:template name="insert_dt_cell">
3976
+ <xsl:param name="key_iso"/>
3977
+ <xsl:param name="split_keep-within-line"/>
3978
+ <fo:table-cell xsl:use-attribute-sets="dt-cell-style">
3979
+
3980
+ <xsl:if test="$isGenerateTableIF = 'true'">
3981
+ <!-- border is mandatory, to calculate real width -->
3982
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
3983
+ <xsl:attribute name="text-align">left</xsl:attribute>
3984
+ </xsl:if>
3985
+
3986
+
3987
+ <fo:block xsl:use-attribute-sets="dt-block-style">
3988
+ <xsl:copy-of select="@id"/>
3989
+
3990
+ <xsl:if test="normalize-space($key_iso) = 'true'">
3991
+ <xsl:attribute name="margin-top">0</xsl:attribute>
3992
+ </xsl:if>
3993
+
3994
+
3995
+
3996
+ <xsl:apply-templates>
3997
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
3998
+ </xsl:apply-templates>
3999
+
4000
+ <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"/> -->
4001
+
4002
+ </fo:block>
4003
+ </fo:table-cell>
4004
+ </xsl:template><xsl:template name="insert_dd_cell">
4005
+ <xsl:param name="split_keep-within-line"/>
4006
+ <fo:table-cell xsl:use-attribute-sets="dd-cell-style">
4007
+
4008
+ <xsl:if test="$isGenerateTableIF = 'true'">
4009
+ <!-- border is mandatory, to calculate real width -->
4010
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4011
+ </xsl:if>
4012
+
4013
+ <fo:block>
4014
+
4015
+ <xsl:if test="$isGenerateTableIF = 'true'">
4016
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4017
+ </xsl:if>
4018
+
3388
4019
 
3389
- <fo:block xsl:use-attribute-sets="dt-style">
3390
- <xsl:copy-of select="@id"/>
3391
-
3392
- <xsl:if test="normalize-space($key_iso) = 'true'">
3393
- <xsl:attribute name="margin-top">0</xsl:attribute>
3394
- </xsl:if>
3395
-
3396
-
3397
-
3398
- <xsl:apply-templates/>
3399
- </fo:block>
3400
- </fo:table-cell>
3401
- <fo:table-cell>
3402
- <fo:block>
3403
-
3404
4020
 
3405
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3406
- <xsl:with-param name="process">true</xsl:with-param>
3407
- </xsl:apply-templates>
3408
- </fo:block>
3409
- </fo:table-cell>
3410
- </fo:table-row>
4021
+ <xsl:choose>
4022
+ <xsl:when test="$isGenerateTableIF = 'true'">
4023
+ <xsl:apply-templates> <!-- following-sibling::*[local-name()='dd'][1] -->
4024
+ <xsl:with-param name="process">true</xsl:with-param>
4025
+ </xsl:apply-templates>
4026
+ </xsl:when>
4027
+ <xsl:otherwise>
4028
+ <xsl:apply-templates select="."> <!-- following-sibling::*[local-name()='dd'][1] -->
4029
+ <xsl:with-param name="process">true</xsl:with-param>
4030
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4031
+ </xsl:apply-templates>
4032
+ </xsl:otherwise>
4033
+
4034
+ </xsl:choose>
4035
+
4036
+ <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"/> -->
4037
+
4038
+ </fo:block>
4039
+ </fo:table-cell>
3411
4040
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3412
4041
  <xsl:apply-templates/>
3413
4042
  </xsl:template><xsl:template match="*[local-name()='dd']">
3414
4043
  <xsl:param name="process">false</xsl:param>
4044
+ <xsl:param name="split_keep-within-line"/>
3415
4045
  <xsl:if test="$process = 'true'">
3416
4046
  <xsl:apply-templates select="@language"/>
3417
- <xsl:apply-templates/>
4047
+ <xsl:apply-templates>
4048
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4049
+ </xsl:apply-templates>
3418
4050
  </xsl:if>
3419
4051
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3420
4052
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3421
- </xsl:template><xsl:template match="*[local-name()='em']">
4053
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl_if">
4054
+ <xsl:param name="id"/>
4055
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4056
+ <tr>
4057
+ <td>
4058
+ <xsl:copy-of select="node()"/>
4059
+ </td>
4060
+ <td>
4061
+
4062
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
4063
+
4064
+ </td>
4065
+ </tr>
4066
+
4067
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
3422
4068
  <fo:inline font-style="italic">
3423
4069
  <xsl:apply-templates/>
3424
4070
  </fo:inline>
3425
4071
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
4072
+ <xsl:param name="split_keep-within-line"/>
3426
4073
  <fo:inline font-weight="bold">
3427
4074
 
3428
- <xsl:apply-templates/>
4075
+ <xsl:apply-templates>
4076
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4077
+ </xsl:apply-templates>
3429
4078
  </fo:inline>
3430
4079
  </xsl:template><xsl:template match="*[local-name()='padding']">
3431
4080
  <fo:inline padding-right="{@value}"> </fo:inline>
@@ -3631,6 +4280,10 @@
3631
4280
  <xsl:param name="text"/>
3632
4281
  <xsl:param name="separator" select="' '"/>
3633
4282
  <xsl:choose>
4283
+
4284
+ <xsl:when test="$isGenerateTableIF = 'true' and not(contains($text, $separator))">
4285
+ <word><xsl:value-of select="normalize-space($text)"/></word>
4286
+ </xsl:when>
3634
4287
  <xsl:when test="not(contains($text, $separator))">
3635
4288
  <word>
3636
4289
  <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
@@ -3675,13 +4328,66 @@
3675
4328
  </xsl:when>
3676
4329
  <xsl:otherwise>
3677
4330
  <word>
3678
- <xsl:value-of select="string-length(normalize-space(substring-before($text, $separator)))"/>
4331
+ <xsl:variable name="word" select="normalize-space(substring-before($text, $separator))"/>
4332
+ <xsl:choose>
4333
+ <xsl:when test="$isGenerateTableIF = 'true'">
4334
+ <xsl:value-of select="$word"/>
4335
+ </xsl:when>
4336
+ <xsl:otherwise>
4337
+ <xsl:value-of select="string-length($word)"/>
4338
+ </xsl:otherwise>
4339
+ </xsl:choose>
3679
4340
  </word>
3680
4341
  <xsl:call-template name="tokenize">
3681
4342
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
3682
4343
  </xsl:call-template>
3683
4344
  </xsl:otherwise>
3684
4345
  </xsl:choose>
4346
+ </xsl:template><xsl:template name="tokenize_with_tags">
4347
+ <xsl:param name="tags"/>
4348
+ <xsl:param name="text"/>
4349
+ <xsl:param name="separator" select="' '"/>
4350
+ <xsl:choose>
4351
+
4352
+ <xsl:when test="not(contains($text, $separator))">
4353
+ <word>
4354
+ <xsl:call-template name="enclose_text_in_tags">
4355
+ <xsl:with-param name="text" select="normalize-space($text)"/>
4356
+ <xsl:with-param name="tags" select="$tags"/>
4357
+ </xsl:call-template>
4358
+ </word>
4359
+ </xsl:when>
4360
+ <xsl:otherwise>
4361
+ <word>
4362
+ <xsl:call-template name="enclose_text_in_tags">
4363
+ <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
4364
+ <xsl:with-param name="tags" select="$tags"/>
4365
+ </xsl:call-template>
4366
+ </word>
4367
+ <xsl:call-template name="tokenize_with_tags">
4368
+ <xsl:with-param name="text" select="substring-after($text, $separator)"/>
4369
+ </xsl:call-template>
4370
+ </xsl:otherwise>
4371
+ </xsl:choose>
4372
+ </xsl:template><xsl:template name="enclose_text_in_tags">
4373
+ <xsl:param name="text"/>
4374
+ <xsl:param name="tags"/>
4375
+ <xsl:param name="num">1</xsl:param> <!-- default (start) value -->
4376
+
4377
+ <xsl:variable name="tag_name" select="normalize-space(xalan:nodeset($tags)//tag[$num])"/>
4378
+
4379
+ <xsl:choose>
4380
+ <xsl:when test="$tag_name = ''"><xsl:value-of select="$text"/></xsl:when>
4381
+ <xsl:otherwise>
4382
+ <xsl:element name="{$tag_name}">
4383
+ <xsl:call-template name="enclose_text_in_tags">
4384
+ <xsl:with-param name="text" select="$text"/>
4385
+ <xsl:with-param name="tags" select="$tags"/>
4386
+ <xsl:with-param name="num" select="$num + 1"/>
4387
+ </xsl:call-template>
4388
+ </xsl:element>
4389
+ </xsl:otherwise>
4390
+ </xsl:choose>
3685
4391
  </xsl:template><xsl:template name="max_length">
3686
4392
  <xsl:param name="words"/>
3687
4393
  <xsl:for-each select="$words//word">
@@ -3782,12 +4488,19 @@
3782
4488
  </xsl:otherwise>
3783
4489
  </xsl:choose>
3784
4490
  </xsl:template><xsl:template name="getSimpleTable">
4491
+ <xsl:param name="id"/>
4492
+
3785
4493
  <xsl:variable name="simple-table">
3786
4494
 
4495
+ <!-- Step 0. replace <br/> to <p>...</p> -->
4496
+ <xsl:variable name="table_without_br">
4497
+ <xsl:apply-templates mode="table-without-br"/>
4498
+ </xsl:variable>
4499
+
3787
4500
  <!-- Step 1. colspan processing -->
3788
4501
  <xsl:variable name="simple-table-colspan">
3789
4502
  <tbody>
3790
- <xsl:apply-templates mode="simple-table-colspan"/>
4503
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-colspan"/>
3791
4504
  </tbody>
3792
4505
  </xsl:variable>
3793
4506
 
@@ -3796,10 +4509,67 @@
3796
4509
  <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
3797
4510
  </xsl:variable>
3798
4511
 
3799
- <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3800
-
4512
+ <!-- Step 3: add id to each cell -->
4513
+ <!-- add <word>...</word> for each word, image, math -->
4514
+ <xsl:variable name="simple-table-id">
4515
+ <xsl:apply-templates select="xalan:nodeset($simple-table-rowspan)" mode="simple-table-id">
4516
+ <xsl:with-param name="id" select="$id"/>
4517
+ </xsl:apply-templates>
4518
+ </xsl:variable>
4519
+
4520
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
4521
+
3801
4522
  </xsl:variable>
3802
4523
  <xsl:copy-of select="$simple-table"/>
4524
+ </xsl:template><xsl:template match="@*|node()" mode="table-without-br">
4525
+ <xsl:copy>
4526
+ <xsl:apply-templates select="@*|node()" mode="table-without-br"/>
4527
+ </xsl:copy>
4528
+ </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">
4529
+ <xsl:copy>
4530
+ <xsl:copy-of select="@*"/>
4531
+ <p>
4532
+ <xsl:copy-of select="node()"/>
4533
+ </p>
4534
+ </xsl:copy>
4535
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td'][*[local-name()='br']]" mode="table-without-br">
4536
+ <xsl:copy>
4537
+ <xsl:copy-of select="@*"/>
4538
+ <xsl:for-each select="*[local-name()='br']">
4539
+ <xsl:variable name="current_id" select="generate-id()"/>
4540
+ <p>
4541
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4542
+ <xsl:copy-of select="."/>
4543
+ </xsl:for-each>
4544
+ </p>
4545
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4546
+ <p>
4547
+ <xsl:for-each select="following-sibling::node()">
4548
+ <xsl:copy-of select="."/>
4549
+ </xsl:for-each>
4550
+ </p>
4551
+ </xsl:if>
4552
+ </xsl:for-each>
4553
+ </xsl:copy>
4554
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p'][*[local-name()='br']]" mode="table-without-br">
4555
+ <xsl:for-each select="*[local-name()='br']">
4556
+ <xsl:variable name="current_id" select="generate-id()"/>
4557
+ <p>
4558
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4559
+ <xsl:copy-of select="."/>
4560
+ </xsl:for-each>
4561
+ </p>
4562
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4563
+ <p>
4564
+ <xsl:for-each select="following-sibling::node()">
4565
+ <xsl:copy-of select="."/>
4566
+ </xsl:for-each>
4567
+ </p>
4568
+ </xsl:if>
4569
+ </xsl:for-each>
4570
+ </xsl:template><xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
4571
+ <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
4572
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
3803
4573
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3804
4574
  <xsl:apply-templates mode="simple-table-colspan"/>
3805
4575
  </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">
@@ -3889,6 +4659,126 @@
3889
4659
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
3890
4660
  <xsl:with-param name="previousRow" select="$newRow"/>
3891
4661
  </xsl:apply-templates>
4662
+ </xsl:template><xsl:template match="/" mode="simple-table-id">
4663
+ <xsl:param name="id"/>
4664
+ <xsl:variable name="id_prefixed" select="concat('table_if_',$id)"/> <!-- table id prefixed by 'table_if_' to simple search in IF -->
4665
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4666
+ <xsl:with-param name="id" select="$id_prefixed"/>
4667
+ </xsl:apply-templates>
4668
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-id">
4669
+ <xsl:param name="id"/>
4670
+ <xsl:copy>
4671
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4672
+ <xsl:with-param name="id" select="$id"/>
4673
+ </xsl:apply-templates>
4674
+ </xsl:copy>
4675
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="simple-table-id">
4676
+ <xsl:param name="id"/>
4677
+ <xsl:copy>
4678
+ <xsl:copy-of select="@*"/>
4679
+ <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
4680
+ <xsl:apply-templates select="node()" mode="simple-table-id">
4681
+ <xsl:with-param name="id" select="$id"/>
4682
+ </xsl:apply-templates>
4683
+ </xsl:copy>
4684
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
4685
+ <xsl:param name="id"/>
4686
+ <xsl:copy>
4687
+ <xsl:copy-of select="@*"/>
4688
+ <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4689
+ <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4690
+ <xsl:attribute name="id">
4691
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4692
+ </xsl:attribute>
4693
+
4694
+ <xsl:for-each select="*[local-name() = 'p']">
4695
+ <xsl:copy>
4696
+ <xsl:copy-of select="@*"/>
4697
+ <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
4698
+ <xsl:attribute name="id">
4699
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4700
+ </xsl:attribute>
4701
+
4702
+ <xsl:copy-of select="node()"/>
4703
+ </xsl:copy>
4704
+ </xsl:for-each>
4705
+
4706
+
4707
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- split each paragraph to words, image, math -->
4708
+
4709
+ <xsl:variable name="td_text">
4710
+ <xsl:apply-templates select="." mode="td_text_with_formatting"/>
4711
+ </xsl:variable>
4712
+
4713
+ <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
4714
+
4715
+ <xsl:variable name="words">
4716
+ <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
4717
+ <word>
4718
+ <xsl:copy-of select="."/>
4719
+ </word>
4720
+ </xsl:for-each>
4721
+
4722
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
4723
+ <xsl:copy-of select="."/>
4724
+ </xsl:for-each>
4725
+
4726
+ </xsl:variable>
4727
+
4728
+ <xsl:for-each select="xalan:nodeset($words)/word">
4729
+ <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
4730
+ <xsl:copy>
4731
+ <xsl:attribute name="id">
4732
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4733
+ </xsl:attribute>
4734
+ <xsl:copy-of select="node()"/>
4735
+ </xsl:copy>
4736
+ </xsl:for-each>
4737
+ </xsl:if>
4738
+ </xsl:copy>
4739
+
4740
+ </xsl:template><xsl:template match="@*|node()" mode="td_text_with_formatting">
4741
+ <xsl:copy>
4742
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4743
+ </xsl:copy>
4744
+ </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">
4745
+ <xsl:variable name="formatting_tags">
4746
+ <xsl:call-template name="getFormattingTags"/>
4747
+ </xsl:variable>
4748
+ <word>
4749
+ <xsl:call-template name="enclose_text_in_tags">
4750
+ <xsl:with-param name="text" select="normalize-space(.)"/>
4751
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4752
+ </xsl:call-template>
4753
+ </word>
4754
+ </xsl:template><xsl:template match="*[local-name() != 'keep-together_within-line']/text()" mode="td_text_with_formatting">
4755
+
4756
+ <xsl:variable name="td_text" select="."/>
4757
+
4758
+ <xsl:variable name="string_with_added_zerospaces">
4759
+ <xsl:call-template name="add-zero-spaces-java">
4760
+ <xsl:with-param name="text" select="$td_text"/>
4761
+ </xsl:call-template>
4762
+ </xsl:variable>
4763
+
4764
+ <xsl:variable name="formatting_tags">
4765
+ <xsl:call-template name="getFormattingTags"/>
4766
+ </xsl:variable>
4767
+
4768
+ <!-- <word>text</word> -->
4769
+ <xsl:call-template name="tokenize_with_tags">
4770
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4771
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
4772
+ </xsl:call-template>
4773
+ </xsl:template><xsl:template name="getFormattingTags">
4774
+ <tags>
4775
+ <xsl:if test="ancestor::*[local-name() = 'strong']"><tag>strong</tag></xsl:if>
4776
+ <xsl:if test="ancestor::*[local-name() = 'em']"><tag>em</tag></xsl:if>
4777
+ <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
4778
+ <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
4779
+ <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
4780
+ <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
4781
+ </tags>
3892
4782
  </xsl:template><xsl:template name="getLang">
3893
4783
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3894
4784
  <xsl:variable name="language">
@@ -5582,7 +6472,9 @@
5582
6472
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
5583
6473
  </xsl:if>
5584
6474
  <xsl:variable name="simple-table">
5585
- <xsl:call-template name="getSimpleTable"/>
6475
+ <xsl:call-template name="getSimpleTable">
6476
+ <xsl:with-param name="id" select="@id"/>
6477
+ </xsl:call-template>
5586
6478
  </xsl:variable>
5587
6479
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
5588
6480
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
@@ -6542,7 +7434,7 @@
6542
7434
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
6543
7435
  <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
6544
7436
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
6545
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
7437
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
6546
7438
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
6547
7439
  <!-- <row>
6548
7440
  <date>05-07-2013</date>
@@ -7890,4 +8782,40 @@
7890
8782
  <xsl:value-of select="$value"/>
7891
8783
  </xsl:otherwise>
7892
8784
  </xsl:choose>
8785
+ </xsl:template><xsl:template match="*" mode="print_as_xml">
8786
+ <xsl:param name="level">0</xsl:param>
8787
+
8788
+ <fo:block margin-left="{2*$level}mm">
8789
+ <xsl:text>
8790
+ &lt;</xsl:text>
8791
+ <xsl:value-of select="local-name()"/>
8792
+ <xsl:for-each select="@*">
8793
+ <xsl:text> </xsl:text>
8794
+ <xsl:value-of select="local-name()"/>
8795
+ <xsl:text>="</xsl:text>
8796
+ <xsl:value-of select="."/>
8797
+ <xsl:text>"</xsl:text>
8798
+ </xsl:for-each>
8799
+ <xsl:text>&gt;</xsl:text>
8800
+
8801
+ <xsl:if test="not(*)">
8802
+ <fo:inline font-weight="bold"><xsl:value-of select="."/></fo:inline>
8803
+ <xsl:text>&lt;/</xsl:text>
8804
+ <xsl:value-of select="local-name()"/>
8805
+ <xsl:text>&gt;</xsl:text>
8806
+ </xsl:if>
8807
+ </fo:block>
8808
+
8809
+ <xsl:if test="*">
8810
+ <fo:block>
8811
+ <xsl:apply-templates mode="print_as_xml">
8812
+ <xsl:with-param name="level" select="$level + 1"/>
8813
+ </xsl:apply-templates>
8814
+ </fo:block>
8815
+ <fo:block margin-left="{2*$level}mm">
8816
+ <xsl:text>&lt;/</xsl:text>
8817
+ <xsl:value-of select="local-name()"/>
8818
+ <xsl:text>&gt;</xsl:text>
8819
+ </fo:block>
8820
+ </xsl:if>
7893
8821
  </xsl:template></xsl:stylesheet>