metanorma-iho 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -560,6 +560,7 @@
560
560
 
561
561
  <xsl:template match="iho:p" name="paragraph">
562
562
  <xsl:param name="inline" select="'false'"/>
563
+ <xsl:param name="split_keep-within-line"/>
563
564
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
564
565
  <xsl:variable name="element-name">
565
566
  <xsl:choose>
@@ -594,7 +595,9 @@
594
595
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
595
596
  </xsl:if>
596
597
 
597
- <xsl:apply-templates/>
598
+ <xsl:apply-templates>
599
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
600
+ </xsl:apply-templates>
598
601
  </xsl:element>
599
602
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
600
603
  <fo:block margin-bottom="12pt">
@@ -777,7 +780,9 @@
777
780
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAN8AAADfCAIAAAD5m5F7AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAh1QAAIdUBBJy0nQAAPjlJREFUeAHtXQdAFEcX5qhH772IgIAgxYLYFRV7773EEjWWaKImplmS2BKT2BVjr9hFxN4bghRBpYn03nvn//aWW5cDkagcd//NxXB7uzNv3rz3zZs37S2noryoqqJQSoojRT5EAiImAdmqiqKyklSCThHTC2GHkoAsTwwwnMR2EkCInASkRY4jwhCRAF8CBJ18SZBv0ZMAQafo6YRwxJcAQSdfEuRb9CRA0Cl6OiEc8SVA0MmXBPkWPQkQdIqeTghHfAkQdPIlQb5FTwIEnaKnE8IRXwIEnXxJkG/RkwBBp+jphHDElwBBJ18S5Fv0JEDQKXo6IRzxJUDQyZcE+RY9CRB0ip5OCEd8CRB08iVBvkVPAgSdoqcTwhFfAgSdfEmQb9GTAEGn6OmEcMSXAEEnXxLkW/QkQNApejohHPElQNDJlwT5Fj0JEHSKnk4IR3wJEHTyJUG+RU8C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bEsUrQKXEqF6MKE3SKkbIkjlWCTolTuRhVmKBTjJQlcawSdEqcysWowgSdYqQsiWOVoFPiVC5GFSboFCNlSRyrBJ0Sp3IxqjBBpxgpS+JYJeiUOJWLUYUJOsVIWRLHKkGnxKlcjCpM0ClGypI4Vgk6JU7lYlRhgk4xUpbEsUrQKXEqF6MKE3SKkbIkjlWCTolTuRhVmKBTjJQlcawSdEqcysWowgSdYqQsiWP1f5V8zYCHJlYcAAAAAElFTkSuQmCC</xsl:text>
778
781
  </xsl:variable>
779
782
 
780
- <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">
783
+ <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_">
784
+ false
785
+ </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
781
786
  <xsl:call-template name="getLang"/>
782
787
  </xsl:variable><xsl:variable name="pageWidth_">
783
788
  210
@@ -1239,6 +1244,7 @@
1239
1244
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1240
1245
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1241
1246
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1247
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1242
1248
  <xsl:attribute name="display-align">center</xsl:attribute>
1243
1249
 
1244
1250
 
@@ -1257,6 +1263,7 @@
1257
1263
  <xsl:attribute name="display-align">center</xsl:attribute>
1258
1264
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1259
1265
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1266
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1260
1267
 
1261
1268
 
1262
1269
 
@@ -1345,7 +1352,8 @@
1345
1352
  </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1346
1353
 
1347
1354
 
1348
- </xsl:attribute-set><xsl:attribute-set name="dt-style">
1355
+ </xsl:attribute-set><xsl:attribute-set name="dt-cell-style">
1356
+ </xsl:attribute-set><xsl:attribute-set name="dt-block-style">
1349
1357
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1350
1358
 
1351
1359
 
@@ -1360,6 +1368,8 @@
1360
1368
 
1361
1369
 
1362
1370
 
1371
+ </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
1372
+ <xsl:attribute name="padding-left">2mm</xsl:attribute>
1363
1373
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1364
1374
 
1365
1375
 
@@ -2209,7 +2219,38 @@
2209
2219
  </xsl:template><xsl:template match="*[local-name()='br']">
2210
2220
  <xsl:value-of select="$linebreak"/>
2211
2221
  </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
2212
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2222
+ <xsl:param name="split_keep-within-line"/>
2223
+
2224
+ <!-- <fo:inline>split_keep-within-line='<xsl:value-of select="$split_keep-within-line"/>'</fo:inline> -->
2225
+ <xsl:choose>
2226
+
2227
+ <xsl:when test="normalize-space($split_keep-within-line) = 'true'">
2228
+ <xsl:variable name="sep">_</xsl:variable>
2229
+ <xsl:variable name="items">
2230
+ <xsl:call-template name="split">
2231
+ <xsl:with-param name="pText" select="."/>
2232
+ <xsl:with-param name="sep" select="$sep"/>
2233
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
2234
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
2235
+ </xsl:call-template>
2236
+ </xsl:variable>
2237
+ <xsl:for-each select="xalan:nodeset($items)/item">
2238
+ <xsl:choose>
2239
+ <xsl:when test=". = $sep">
2240
+ <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2241
+ </xsl:when>
2242
+ <xsl:otherwise>
2243
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2244
+ </xsl:otherwise>
2245
+ </xsl:choose>
2246
+ </xsl:for-each>
2247
+ </xsl:when>
2248
+
2249
+ <xsl:otherwise>
2250
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2251
+ </xsl:otherwise>
2252
+
2253
+ </xsl:choose>
2213
2254
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2214
2255
  <fo:block xsl:use-attribute-sets="copyright-statement-style">
2215
2256
  <xsl:apply-templates/>
@@ -2301,9 +2342,14 @@
2301
2342
 
2302
2343
  <xsl:variable name="table">
2303
2344
 
2304
- <xsl:variable name="simple-table">
2305
- <xsl:call-template name="getSimpleTable"/>
2345
+ <xsl:variable name="simple-table">
2346
+ <xsl:call-template name="getSimpleTable">
2347
+ <xsl:with-param name="id" select="@id"/>
2348
+ </xsl:call-template>
2306
2349
  </xsl:variable>
2350
+ <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2351
+
2352
+ <!-- simple-table=<xsl:copy-of select="$simple-table"/> -->
2307
2353
 
2308
2354
 
2309
2355
  <!-- Display table's name before table as standalone block -->
@@ -2326,7 +2372,23 @@
2326
2372
  </xsl:call-template>
2327
2373
  </xsl:if>
2328
2374
  </xsl:variable>
2329
- <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2375
+ <!-- <xsl:variable name="colwidths" select="xalan:nodeset($colwidths_)"/> -->
2376
+
2377
+ <!-- DEBUG -->
2378
+ <xsl:if test="$table_if_debug = 'true'">
2379
+ <fo:block font-size="60%">
2380
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
2381
+ </fo:block>
2382
+ </xsl:if>
2383
+
2384
+
2385
+ <!-- <xsl:copy-of select="$colwidths"/> -->
2386
+
2387
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
2388
+ DEBUG
2389
+ colwidths=<xsl:copy-of select="$colwidths"/>
2390
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
2391
+
2330
2392
 
2331
2393
 
2332
2394
  <xsl:variable name="margin-side">
@@ -2387,9 +2449,17 @@
2387
2449
  </xsl:element>
2388
2450
  </xsl:variable>
2389
2451
 
2452
+ <xsl:if test="$isGenerateTableIF = 'true'">
2453
+ <!-- to determine start of table -->
2454
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
2455
+ </xsl:if>
2390
2456
 
2391
2457
  <fo:table id="{@id}">
2392
2458
 
2459
+ <xsl:if test="$isGenerateTableIF = 'true'">
2460
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
2461
+ </xsl:if>
2462
+
2393
2463
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2394
2464
  <xsl:attribute name="{local-name()}">
2395
2465
  <xsl:value-of select="."/>
@@ -2403,24 +2473,47 @@
2403
2473
 
2404
2474
 
2405
2475
  <xsl:choose>
2406
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2407
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2408
- <fo:table-column column-width="{@width}"/>
2409
- </xsl:for-each>
2476
+ <xsl:when test="$isGenerateTableIF = 'true'">
2477
+ <!-- generate IF for table widths -->
2478
+ <!-- example:
2479
+ <tr>
2480
+ <td valign="top" align="left" id="tab-symdu_1_1">
2481
+ <p>Symbol</p>
2482
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
2483
+ </td>
2484
+ <td valign="top" align="left" id="tab-symdu_1_2">
2485
+ <p>Description</p>
2486
+ <word id="tab-symdu_1_2_word_1">Description</word>
2487
+ </td>
2488
+ </tr>
2489
+ -->
2490
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2491
+
2410
2492
  </xsl:when>
2411
2493
  <xsl:otherwise>
2412
- <xsl:call-template name="insertTableColumnWidth">
2413
- <xsl:with-param name="colwidths" select="$colwidths"/>
2414
- </xsl:call-template>
2415
- </xsl:otherwise>
2416
- </xsl:choose>
2417
2494
 
2418
- <xsl:choose>
2419
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2420
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2421
- </xsl:when>
2422
- <xsl:otherwise>
2423
- <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 -->
2495
+ <xsl:choose>
2496
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2497
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2498
+ <fo:table-column column-width="{@width}"/>
2499
+ </xsl:for-each>
2500
+ </xsl:when>
2501
+ <xsl:otherwise>
2502
+ <xsl:call-template name="insertTableColumnWidth">
2503
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2504
+ </xsl:call-template>
2505
+ </xsl:otherwise>
2506
+ </xsl:choose>
2507
+
2508
+ <xsl:choose>
2509
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2510
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2511
+ </xsl:when>
2512
+ <xsl:otherwise>
2513
+ <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 -->
2514
+ </xsl:otherwise>
2515
+ </xsl:choose>
2516
+
2424
2517
  </xsl:otherwise>
2425
2518
  </xsl:choose>
2426
2519
 
@@ -2523,11 +2616,22 @@
2523
2616
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2524
2617
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
2525
2618
  </xsl:template><xsl:template name="calculate-column-widths">
2619
+ <xsl:param name="table"/>
2620
+ <xsl:param name="cols-count"/>
2621
+
2622
+ <xsl:call-template name="calculate-column-widths-proportional">
2623
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2624
+ <xsl:with-param name="table" select="$table"/>
2625
+ </xsl:call-template>
2626
+
2627
+ </xsl:template><xsl:template name="calculate-column-widths-proportional">
2526
2628
  <xsl:param name="table"/>
2527
2629
  <xsl:param name="cols-count"/>
2528
2630
  <xsl:param name="curr-col" select="1"/>
2529
2631
  <xsl:param name="width" select="0"/>
2530
2632
 
2633
+ <!-- table=<xsl:copy-of select="$table"/> -->
2634
+
2531
2635
  <xsl:if test="$curr-col &lt;= $cols-count">
2532
2636
  <xsl:variable name="widths">
2533
2637
  <xsl:choose>
@@ -2565,10 +2669,15 @@
2565
2669
  </xsl:for-each>
2566
2670
  </xsl:when>
2567
2671
  <xsl:otherwise>
2568
- <xsl:for-each select="xalan:nodeset($table)/*/tr">
2672
+ <!-- <curr_col><xsl:value-of select="$curr-col"/></curr_col> -->
2673
+
2674
+ <!-- <table><xsl:copy-of select="$table"/></table>
2675
+ -->
2676
+ <xsl:for-each select="xalan:nodeset($table)/*/*[local-name()='tr']">
2569
2677
  <xsl:variable name="td_text">
2570
2678
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2571
2679
  </xsl:variable>
2680
+ <!-- <td_text><xsl:value-of select="$td_text"/></td_text> -->
2572
2681
  <xsl:variable name="words">
2573
2682
  <xsl:variable name="string_with_added_zerospaces">
2574
2683
  <xsl:call-template name="add-zero-spaces-java">
@@ -2583,6 +2692,7 @@
2583
2692
  <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2584
2693
  </xsl:call-template>
2585
2694
  </xsl:variable>
2695
+ <!-- words=<xsl:copy-of select="$words"/> -->
2586
2696
  <xsl:variable name="max_length">
2587
2697
  <xsl:call-template name="max_length">
2588
2698
  <xsl:with-param name="words" select="xalan:nodeset($words)"/>
@@ -2607,6 +2717,8 @@
2607
2717
  </xsl:choose>
2608
2718
  </xsl:variable>
2609
2719
 
2720
+ <!-- widths=<xsl:copy-of select="$widths"/> -->
2721
+
2610
2722
  <column>
2611
2723
  <xsl:for-each select="xalan:nodeset($widths)//width">
2612
2724
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -2615,33 +2727,327 @@
2615
2727
  </xsl:if>
2616
2728
  </xsl:for-each>
2617
2729
  </column>
2618
- <xsl:call-template name="calculate-column-widths">
2730
+ <xsl:call-template name="calculate-column-widths-proportional">
2619
2731
  <xsl:with-param name="cols-count" select="$cols-count"/>
2620
2732
  <xsl:with-param name="curr-col" select="$curr-col +1"/>
2621
2733
  <xsl:with-param name="table" select="$table"/>
2622
2734
  </xsl:call-template>
2623
2735
  </xsl:if>
2624
- </xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
2736
+ </xsl:template><xsl:template match="*[@keep-together.within-line or local-name() = 'keep-together_within-line']/text()" priority="2" mode="td_text">
2625
2737
  <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
2626
2738
  <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
2627
2739
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
2740
+
2741
+ <!-- if all capitals english letters or digits -->
2742
+ <xsl:if test="normalize-space(translate(., concat($upper,'0123456789'), '')) = ''">
2743
+ <xsl:call-template name="repeat">
2744
+ <xsl:with-param name="char" select="'X'"/>
2745
+ <xsl:with-param name="count" select="string-length(normalize-space(.)) * 0.5"/>
2746
+ </xsl:call-template>
2747
+ </xsl:if>
2628
2748
  </xsl:template><xsl:template match="text()" mode="td_text">
2629
2749
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2630
2750
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2631
2751
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2632
2752
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2633
2753
  <xsl:value-of select="@target"/>
2634
- </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2635
- <xsl:variable name="mathml">
2636
- <xsl:for-each select="*">
2637
- <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2638
- <xsl:copy-of select="."/>
2754
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text" name="math_length">
2755
+ <xsl:if test="$isGenerateTableIF = 'false'">
2756
+ <xsl:variable name="mathml_">
2757
+ <xsl:for-each select="*">
2758
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2759
+ <xsl:copy-of select="."/>
2760
+ </xsl:if>
2761
+ </xsl:for-each>
2762
+ </xsl:variable>
2763
+ <xsl:variable name="mathml" select="xalan:nodeset($mathml_)"/>
2764
+
2765
+ <xsl:variable name="math_text">
2766
+ <xsl:value-of select="normalize-space($mathml)"/>
2767
+ <xsl:for-each select="$mathml//@open"><xsl:value-of select="."/></xsl:for-each>
2768
+ <xsl:for-each select="$mathml//@close"><xsl:value-of select="."/></xsl:for-each>
2769
+ </xsl:variable>
2770
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2771
+ </xsl:if>
2772
+ </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
2773
+ <xsl:param name="table"/>
2774
+ <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
2775
+
2776
+ <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
2777
+
2778
+ <!-- In the first pass, line wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. -->
2779
+
2780
+ <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2781
+
2782
+ <!-- get current table id -->
2783
+ <xsl:variable name="table_id" select="@id"/>
2784
+ <!-- find table by id in the file 'table_widths' -->
2785
+ <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2786
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
2787
+
2788
+
2789
+ <!-- table='<xsl:copy-of select="$table"/>' -->
2790
+ <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2791
+ <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2792
+ <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2793
+
2794
+ <xsl:variable name="table_with_cell_widths_">
2795
+ <xsl:choose>
2796
+ <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
2797
+
2798
+ <!-- Example: <column>10</column>
2799
+ <column>11</column>
2800
+ -->
2801
+ <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
2802
+ </xsl:when>
2803
+ <xsl:otherwise>
2804
+ <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
2805
+ </xsl:otherwise>
2806
+ </xsl:choose>
2807
+ </xsl:variable>
2808
+ <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2809
+
2810
+ <xsl:if test="$table_if_debug = 'true'">
2811
+ <xsl:copy-of select="$table_with_cell_widths"/>
2812
+ </xsl:if>
2813
+
2814
+
2815
+ <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2816
+
2817
+ <xsl:variable name="column_widths_">
2818
+ <!-- iteration of columns -->
2819
+ <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2820
+ <xsl:variable name="pos" select="position()"/>
2821
+ <column>
2822
+ <xsl:attribute name="width_max">
2823
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2824
+ <xsl:sort select="." data-type="number" order="descending"/>
2825
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2826
+ </xsl:for-each>
2827
+ </xsl:attribute>
2828
+ <xsl:attribute name="width_min">
2829
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2830
+ <xsl:sort select="." data-type="number" order="descending"/>
2831
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2832
+ </xsl:for-each>
2833
+ </xsl:attribute>
2834
+ </column>
2835
+ </xsl:for-each>
2836
+ </xsl:variable>
2837
+ <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2838
+
2839
+ <!-- <column_widths>
2840
+ <xsl:copy-of select="$column_widths"/>
2841
+ </column_widths> -->
2842
+
2843
+ <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2844
+ <xsl:variable name="table_widths_">
2845
+ <table>
2846
+ <xsl:attribute name="width_max">
2847
+ <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2848
+ </xsl:attribute>
2849
+ <xsl:attribute name="width_min">
2850
+ <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2851
+ </xsl:attribute>
2852
+ </table>
2853
+ </xsl:variable>
2854
+ <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2855
+
2856
+ <xsl:variable name="page_width">
2857
+ <xsl:choose>
2858
+ <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
2859
+ <xsl:otherwise>75</xsl:otherwise>
2860
+ </xsl:choose>
2861
+ </xsl:variable>
2862
+
2863
+ <xsl:if test="$table_if_debug = 'true'">
2864
+ <table_width>
2865
+ <xsl:copy-of select="$table_widths"/>
2866
+ </table_width>
2867
+ <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
2868
+ <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
2869
+ -->
2870
+ <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2871
+ </xsl:if>
2872
+
2873
+
2874
+ <!-- There are three cases: -->
2875
+ <xsl:choose>
2876
+ <!-- 1. The minimum table width is equal to or wider than the available space -->
2877
+ <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2878
+ <!-- call old algorithm -->
2879
+ <case1/>
2880
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
2881
+ <xsl:call-template name="calculate-column-widths-proportional">
2882
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2883
+ <xsl:with-param name="table" select="$table"/>
2884
+ </xsl:call-template>
2885
+ </xsl:when>
2886
+ <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2887
+ <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2888
+ <case2/>
2889
+ <autolayout/>
2890
+ <xsl:for-each select="$column_widths/column/@width_max">
2891
+ <column divider="100"><xsl:value-of select="."/></column>
2892
+ </xsl:for-each>
2893
+ </xsl:when>
2894
+ <!-- 3. The maximum width of the table is greater than the available space, but the minimum table width is smaller.
2895
+ In this case, find the difference between the available space and the minimum table width, lets call it W.
2896
+ Lets also call D the difference between maximum and minimum width of the table.
2897
+ For each column, let d be the difference between maximum and minimum width of that column.
2898
+ Now set the column's width to the minimum width plus d times W over D.
2899
+ This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2900
+ <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)">
2901
+ <!-- difference between the available space and the minimum table width -->
2902
+ <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2903
+ <W><xsl:value-of select="$W"/></W>
2904
+ <!-- difference between maximum and minimum width of the table -->
2905
+ <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2906
+ <D><xsl:value-of select="$D"/></D>
2907
+ <case3/>
2908
+ <autolayout/>
2909
+ <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2910
+ <split_keep-within-line>true</split_keep-within-line>
2911
+ </xsl:if>
2912
+ <xsl:for-each select="$column_widths/column">
2913
+ <!-- difference between maximum and minimum width of that column. -->
2914
+ <xsl:variable name="d" select="@width_max - @width_min"/>
2915
+ <d><xsl:value-of select="$d"/></d>
2916
+ <width_min><xsl:value-of select="@width_min"/></width_min>
2917
+ <e><xsl:value-of select="$d * $W div $D"/></e>
2918
+ <!-- set the column's width to the minimum width plus d times W over D. -->
2919
+ <column divider="100">
2920
+ <xsl:value-of select="round(@width_min + $d * $W div $D)"/> <!-- * 10 -->
2921
+ </column>
2922
+ </xsl:for-each>
2923
+
2924
+ </xsl:when>
2925
+ <xsl:otherwise><unknown_case/></xsl:otherwise>
2926
+ </xsl:choose>
2927
+
2928
+
2929
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
2930
+ <xsl:copy>
2931
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
2932
+ </xsl:copy>
2933
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
2934
+ <xsl:copy>
2935
+ <xsl:copy-of select="@*"/>
2936
+
2937
+ <!-- The maximum width is given by the widest line. -->
2938
+ <xsl:variable name="widths_max">
2939
+ <xsl:for-each select=".//*[local-name() = 'p']">
2940
+ <xsl:call-template name="add_width"/>
2941
+ </xsl:for-each>
2942
+ <xsl:if test="not(*[local-name() = 'p'])">
2943
+ <xsl:call-template name="add_width"/>
2639
2944
  </xsl:if>
2945
+ </xsl:variable>
2946
+ <xsl:variable name="width_max">
2947
+ <xsl:for-each select="xalan:nodeset($widths_max)//width">
2948
+ <xsl:sort select="." data-type="number" order="descending"/>
2949
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2950
+ </xsl:for-each>
2951
+ </xsl:variable>
2952
+ <xsl:attribute name="width_max">
2953
+ <xsl:value-of select="$width_max"/>
2954
+ </xsl:attribute>
2955
+
2956
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2957
+ <!-- To do: image width -->
2958
+ <xsl:variable name="td_text">
2959
+ <xsl:apply-templates select="." mode="td_text"/>
2960
+ </xsl:variable>
2961
+ <xsl:variable name="words">
2962
+ <xsl:variable name="string_with_added_zerospaces">
2963
+ <xsl:call-template name="add-zero-spaces-java">
2964
+ <xsl:with-param name="text" select="$td_text"/>
2965
+ </xsl:call-template>
2966
+ </xsl:variable>
2967
+ <xsl:call-template name="tokenize">
2968
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2969
+ </xsl:call-template>
2970
+ </xsl:variable>
2971
+
2972
+ <xsl:variable name="max_word_length">
2973
+ <xsl:call-template name="max_length">
2974
+ <xsl:with-param name="words" select="xalan:nodeset($words)"/>
2975
+ </xsl:call-template>
2976
+ </xsl:variable>
2977
+ <xsl:variable name="width_min">
2978
+ <xsl:value-of select="$max_word_length"/>
2979
+ </xsl:variable>
2980
+ <xsl:attribute name="width_min">
2981
+ <xsl:value-of select="$width_min"/>
2982
+ </xsl:attribute>
2983
+ <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
2984
+ <xsl:if test="$width_min &gt; $width_max">
2985
+ <xsl:attribute name="width_max">
2986
+ <xsl:value-of select="$width_min"/>
2987
+ </xsl:attribute>
2988
+ </xsl:if>
2989
+ <xsl:if test="$width_min = 0">
2990
+ <xsl:attribute name="width_min">1</xsl:attribute>
2991
+ </xsl:if>
2992
+
2993
+ <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
2994
+
2995
+ </xsl:copy>
2996
+ </xsl:template><xsl:template name="add_width">
2997
+ <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
2998
+ <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
2999
+
3000
+ <xsl:variable name="p_text_len">
3001
+ <xsl:choose>
3002
+ <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
3003
+ <xsl:value-of select="$p_text_len_ * 1.5"/>
3004
+ </xsl:when>
3005
+ <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
3006
+ </xsl:choose>
3007
+ </xsl:variable>
3008
+
3009
+ <xsl:variable name="math_addon_text">
3010
+ <xsl:for-each select=".//*[local-name() = 'math']">
3011
+ <xsl:apply-templates mode="td_text"/>
2640
3012
  </xsl:for-each>
2641
3013
  </xsl:variable>
3014
+ <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
2642
3015
 
2643
- <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2644
- <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
3016
+ <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
3017
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
3018
+ <xsl:copy>
3019
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
3020
+ </xsl:copy>
3021
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths-if">
3022
+ <xsl:copy>
3023
+ <xsl:copy-of select="@*"/>
3024
+
3025
+ <!-- The maximum width is given by the widest line. -->
3026
+ <xsl:attribute name="width_max">
3027
+ <xsl:for-each select="p_len">
3028
+ <xsl:sort select="." data-type="number" order="descending"/>
3029
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3030
+ </xsl:for-each>
3031
+ </xsl:attribute>
3032
+
3033
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
3034
+ <xsl:variable name="width_min">
3035
+ <xsl:for-each select="word_len">
3036
+ <xsl:sort select="." data-type="number" order="descending"/>
3037
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3038
+ </xsl:for-each>
3039
+ </xsl:variable>
3040
+ <xsl:attribute name="width_min">
3041
+ <xsl:value-of select="$width_min"/>
3042
+ </xsl:attribute>
3043
+
3044
+ <xsl:if test="$width_min = 0">
3045
+ <xsl:attribute name="width_min">1</xsl:attribute>
3046
+ </xsl:if>
3047
+
3048
+ <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
3049
+
3050
+ </xsl:copy>
2645
3051
  </xsl:template><xsl:template match="*[local-name()='thead']">
2646
3052
  <xsl:param name="cols-count"/>
2647
3053
  <fo:table-header>
@@ -2726,6 +3132,7 @@
2726
3132
  </xsl:for-each>
2727
3133
  </xsl:when>
2728
3134
  <xsl:otherwise>
3135
+ <!-- $colwidths=<xsl:copy-of select="$colwidths"/> -->
2729
3136
  <xsl:call-template name="insertTableColumnWidth">
2730
3137
  <xsl:with-param name="colwidths" select="$colwidths"/>
2731
3138
  </xsl:call-template>
@@ -2805,6 +3212,52 @@
2805
3212
 
2806
3213
  </fo:table-body>
2807
3214
 
3215
+ </xsl:template><xsl:template match="/" mode="process_table-if">
3216
+ <xsl:param name="table_or_dl">table</xsl:param>
3217
+ <xsl:apply-templates mode="process_table-if">
3218
+ <xsl:with-param name="table_or_dl" select="$table_or_dl"/>
3219
+ </xsl:apply-templates>
3220
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="process_table-if">
3221
+ <xsl:param name="table_or_dl">table</xsl:param>
3222
+
3223
+ <fo:table-body>
3224
+ <xsl:for-each select="*[local-name() = 'tr']">
3225
+ <xsl:variable name="col_count" select="count(*)"/>
3226
+
3227
+ <!-- iteration for each tr/td -->
3228
+
3229
+ <xsl:choose>
3230
+ <xsl:when test="$table_or_dl = 'table'">
3231
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3232
+ <fo:table-row number-columns-spanned="{$col_count}">
3233
+ <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3234
+ <xsl:call-template name="td"/>
3235
+ </fo:table-row>
3236
+ </xsl:for-each>
3237
+ </xsl:when>
3238
+ <xsl:otherwise> <!-- $table_or_dl = 'dl' -->
3239
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']">
3240
+ <xsl:variable name="is_dt" select="position() = 1"/>
3241
+
3242
+ <xsl:for-each select="*">
3243
+ <!-- <test><xsl:copy-of select="."/></test> -->
3244
+ <fo:table-row number-columns-spanned="{$col_count}">
3245
+ <xsl:choose>
3246
+ <xsl:when test="$is_dt">
3247
+ <xsl:call-template name="insert_dt_cell"/>
3248
+ </xsl:when>
3249
+ <xsl:otherwise>
3250
+ <xsl:call-template name="insert_dd_cell"/>
3251
+ </xsl:otherwise>
3252
+ </xsl:choose>
3253
+ </fo:table-row>
3254
+ </xsl:for-each>
3255
+ </xsl:for-each>
3256
+ </xsl:otherwise>
3257
+ </xsl:choose>
3258
+
3259
+ </xsl:for-each>
3260
+ </fo:table-body>
2808
3261
  </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2809
3262
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2810
3263
 
@@ -2891,7 +3344,7 @@
2891
3344
  </xsl:choose>
2892
3345
  </xsl:attribute>
2893
3346
  </xsl:if>
2894
- </xsl:template><xsl:template match="*[local-name()='td']">
3347
+ </xsl:template><xsl:template match="*[local-name()='td']" name="td">
2895
3348
  <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2896
3349
  <xsl:call-template name="setTextAlignment">
2897
3350
  <xsl:with-param name="default">left</xsl:with-param>
@@ -2925,11 +3378,24 @@
2925
3378
 
2926
3379
  <xsl:call-template name="setTableCellAttributes"/>
2927
3380
 
3381
+ <xsl:if test="$isGenerateTableIF = 'true'">
3382
+ <xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
3383
+ <xsl:attribute name="text-align">left</xsl:attribute>
3384
+ </xsl:if>
3385
+
2928
3386
  <fo:block>
2929
3387
 
3388
+ <xsl:if test="$isGenerateTableIF = 'true'">
3389
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3390
+ </xsl:if>
3391
+
3392
+
2930
3393
 
2931
3394
 
2932
3395
  <xsl:apply-templates/>
3396
+
3397
+ <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"/> -->
3398
+
2933
3399
  </fo:block>
2934
3400
  </fo:table-cell>
2935
3401
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
@@ -3126,9 +3592,9 @@
3126
3592
  <!-- current hierarchy is 'figure' element -->
3127
3593
  <xsl:variable name="following_dl_colwidths">
3128
3594
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
3129
- <xsl:variable name="html-table">
3130
- <xsl:variable name="doc_ns">
3131
-
3595
+ <xsl:variable name="simple-table">
3596
+ <!-- <xsl:variable name="doc_ns">
3597
+ <xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
3132
3598
  </xsl:variable>
3133
3599
  <xsl:variable name="ns">
3134
3600
  <xsl:choose>
@@ -3139,7 +3605,7 @@
3139
3605
  <xsl:value-of select="substring-before(name(/*), '-')"/>
3140
3606
  </xsl:otherwise>
3141
3607
  </xsl:choose>
3142
- </xsl:variable>
3608
+ </xsl:variable> -->
3143
3609
 
3144
3610
  <xsl:for-each select="*[local-name() = 'dl'][1]">
3145
3611
  <tbody>
@@ -3150,7 +3616,7 @@
3150
3616
 
3151
3617
  <xsl:call-template name="calculate-column-widths">
3152
3618
  <xsl:with-param name="cols-count" select="2"/>
3153
- <xsl:with-param name="table" select="$html-table"/>
3619
+ <xsl:with-param name="table" select="$simple-table"/>
3154
3620
  </xsl:call-template>
3155
3621
 
3156
3622
  </xsl:if>
@@ -3334,7 +3800,18 @@
3334
3800
  <xsl:attribute name="margin-left">-3.5mm</xsl:attribute>
3335
3801
 
3336
3802
 
3803
+
3804
+ <xsl:if test="$isGenerateTableIF = 'true'">
3805
+ <!-- to determine start of table -->
3806
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
3807
+ </xsl:if>
3808
+
3337
3809
  <fo:table width="95%" table-layout="fixed">
3810
+
3811
+ <xsl:if test="$isGenerateTableIF = 'true'">
3812
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
3813
+ </xsl:if>
3814
+
3338
3815
 
3339
3816
  <xsl:choose>
3340
3817
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
@@ -3343,52 +3820,130 @@
3343
3820
 
3344
3821
  </xsl:when>
3345
3822
  </xsl:choose>
3346
- <!-- create virtual html table for dl/[dt and dd] -->
3347
- <xsl:variable name="html-table">
3348
- <xsl:variable name="doc_ns">
3823
+
3824
+
3825
+ <xsl:choose>
3826
+ <xsl:when test="$isGenerateTableIF = 'true'">
3827
+ <!-- generate IF for table widths -->
3828
+ <!-- example:
3829
+ <tr>
3830
+ <td valign="top" align="left" id="tab-symdu_1_1">
3831
+ <p>Symbol</p>
3832
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
3833
+ </td>
3834
+ <td valign="top" align="left" id="tab-symdu_1_2">
3835
+ <p>Description</p>
3836
+ <word id="tab-symdu_1_2_word_1">Description</word>
3837
+ </td>
3838
+ </tr>
3839
+ -->
3349
3840
 
3350
- </xsl:variable>
3351
- <xsl:variable name="ns">
3352
- <xsl:choose>
3353
- <xsl:when test="normalize-space($doc_ns) != ''">
3354
- <xsl:value-of select="normalize-space($doc_ns)"/>
3355
- </xsl:when>
3356
- <xsl:otherwise>
3357
- <xsl:value-of select="substring-before(name(/*), '-')"/>
3358
- </xsl:otherwise>
3359
- </xsl:choose>
3360
- </xsl:variable>
3361
- <tbody>
3362
- <xsl:apply-templates mode="dl"/>
3363
- </tbody>
3364
- </xsl:variable>
3365
- <!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
3366
- <xsl:variable name="colwidths">
3367
- <xsl:call-template name="calculate-column-widths">
3368
- <xsl:with-param name="cols-count" select="2"/>
3369
- <xsl:with-param name="table" select="$html-table"/>
3370
- </xsl:call-template>
3371
- </xsl:variable>
3372
- <!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
3373
- <xsl:variable name="maxlength_dt">
3374
- <xsl:call-template name="getMaxLength_dt"/>
3375
- </xsl:variable>
3376
- <xsl:variable name="isContainsKeepTogetherTag_">
3377
- false
3378
- </xsl:variable>
3379
- <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3380
- <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3381
- <xsl:call-template name="setColumnWidth_dl">
3382
- <xsl:with-param name="colwidths" select="$colwidths"/>
3383
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3384
- <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3385
- </xsl:call-template>
3841
+ <!-- create virtual html table for dl/[dt and dd] -->
3842
+ <xsl:variable name="simple-table">
3843
+
3844
+ <xsl:variable name="dl_table">
3845
+ <tbody>
3846
+ <xsl:apply-templates mode="dl_if">
3847
+ <xsl:with-param name="id" select="@id"/>
3848
+ </xsl:apply-templates>
3849
+ </tbody>
3850
+ </xsl:variable>
3851
+
3852
+ <!-- dl_table='<xsl:copy-of select="$dl_table"/>' -->
3853
+
3854
+ <!-- Step: replace <br/> to <p>...</p> -->
3855
+ <xsl:variable name="table_without_br">
3856
+ <xsl:apply-templates select="xalan:nodeset($dl_table)" mode="table-without-br"/>
3857
+ </xsl:variable>
3858
+
3859
+ <!-- table_without_br='<xsl:copy-of select="$table_without_br"/>' -->
3860
+
3861
+ <!-- Step: add id to each cell -->
3862
+ <!-- add <word>...</word> for each word, image, math -->
3863
+ <xsl:variable name="simple-table-id">
3864
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-id">
3865
+ <xsl:with-param name="id" select="@id"/>
3866
+ </xsl:apply-templates>
3867
+ </xsl:variable>
3868
+
3869
+ <!-- simple-table-id='<xsl:copy-of select="$simple-table-id"/>' -->
3870
+
3871
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
3872
+
3873
+ </xsl:variable>
3874
+
3875
+ <!-- DEBUG: simple-table<xsl:copy-of select="$simple-table"/> -->
3876
+
3877
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if">
3878
+ <xsl:with-param name="table_or_dl">dl</xsl:with-param>
3879
+ </xsl:apply-templates>
3880
+
3881
+ </xsl:when>
3882
+ <xsl:otherwise>
3386
3883
 
3387
- <fo:table-body>
3388
- <xsl:apply-templates>
3389
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3390
- </xsl:apply-templates>
3391
- </fo:table-body>
3884
+ <xsl:variable name="simple-table">
3885
+
3886
+ <xsl:variable name="dl_table">
3887
+ <tbody>
3888
+ <xsl:apply-templates mode="dl">
3889
+ <xsl:with-param name="id" select="@id"/>
3890
+ </xsl:apply-templates>
3891
+ </tbody>
3892
+ </xsl:variable>
3893
+
3894
+ <xsl:copy-of select="$dl_table"/>
3895
+ </xsl:variable>
3896
+
3897
+ <xsl:variable name="colwidths">
3898
+ <xsl:call-template name="calculate-column-widths">
3899
+ <xsl:with-param name="cols-count" select="2"/>
3900
+ <xsl:with-param name="table" select="$simple-table"/>
3901
+ </xsl:call-template>
3902
+ </xsl:variable>
3903
+
3904
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
3905
+ DEBUG
3906
+ colwidths=<xsl:copy-of select="$colwidths"/>
3907
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
3908
+
3909
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3910
+
3911
+ <xsl:variable name="maxlength_dt">
3912
+ <xsl:call-template name="getMaxLength_dt"/>
3913
+ </xsl:variable>
3914
+
3915
+ <xsl:variable name="isContainsKeepTogetherTag_">
3916
+ false
3917
+ </xsl:variable>
3918
+ <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3919
+ <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3920
+
3921
+
3922
+ <xsl:call-template name="setColumnWidth_dl">
3923
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3924
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3925
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3926
+ </xsl:call-template>
3927
+
3928
+ <fo:table-body>
3929
+
3930
+ <!-- DEBUG -->
3931
+ <xsl:if test="$table_if_debug = 'true'">
3932
+ <fo:table-row>
3933
+ <fo:table-cell number-columns-spanned="2" font-size="60%">
3934
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
3935
+ </fo:table-cell>
3936
+ </fo:table-row>
3937
+ </xsl:if>
3938
+
3939
+ <xsl:apply-templates>
3940
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3941
+ <xsl:with-param name="split_keep-within-line" select="xalan:nodeset($colwidths)/split_keep-within-line"/>
3942
+ </xsl:apply-templates>
3943
+
3944
+ </fo:table-body>
3945
+ </xsl:otherwise>
3946
+ </xsl:choose>
3392
3947
  </fo:table>
3393
3948
  </fo:block>
3394
3949
  </fo:block>
@@ -3399,6 +3954,9 @@
3399
3954
  <xsl:param name="colwidths"/>
3400
3955
  <xsl:param name="maxlength_dt"/>
3401
3956
  <xsl:param name="isContainsKeepTogetherTag"/>
3957
+
3958
+ <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
3959
+
3402
3960
  <xsl:choose>
3403
3961
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3404
3962
  <fo:table-column column-width="50%"/>
@@ -3406,6 +3964,11 @@
3406
3964
  </xsl:when>
3407
3965
  <xsl:otherwise>
3408
3966
  <xsl:choose>
3967
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
3968
+ <xsl:call-template name="insertTableColumnWidth">
3969
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3970
+ </xsl:call-template>
3971
+ </xsl:when>
3409
3972
  <xsl:when test="$isContainsKeepTogetherTag">
3410
3973
  <xsl:call-template name="insertTableColumnWidth">
3411
3974
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -3450,13 +4013,19 @@
3450
4013
  </xsl:choose>
3451
4014
  </xsl:template><xsl:template name="insertTableColumnWidth">
3452
4015
  <xsl:param name="colwidths"/>
4016
+
3453
4017
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
3454
4018
  <xsl:choose>
3455
4019
  <xsl:when test=". = 1 or . = 0">
3456
4020
  <fo:table-column column-width="proportional-column-width(2)"/>
3457
4021
  </xsl:when>
3458
4022
  <xsl:otherwise>
3459
- <fo:table-column column-width="proportional-column-width({.})"/>
4023
+ <!-- <fo:table-column column-width="proportional-column-width({.})"/> -->
4024
+ <xsl:variable name="divider">
4025
+ <xsl:value-of select="@divider"/>
4026
+ <xsl:if test="not(@divider)">1</xsl:if>
4027
+ </xsl:variable>
4028
+ <fo:table-column column-width="proportional-column-width({round(. div $divider)})"/>
3460
4029
  </xsl:otherwise>
3461
4030
  </xsl:choose>
3462
4031
  </xsl:for-each>
@@ -3518,11 +4087,19 @@
3518
4087
  </fo:table-cell>
3519
4088
  </fo:table-row>
3520
4089
  </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
4090
+ <xsl:param name="id"/>
4091
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3521
4092
  <tr>
3522
4093
  <td>
4094
+ <xsl:attribute name="id">
4095
+ <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4096
+ </xsl:attribute>
3523
4097
  <xsl:apply-templates/>
3524
4098
  </td>
3525
4099
  <td>
4100
+ <xsl:attribute name="id">
4101
+ <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4102
+ </xsl:attribute>
3526
4103
 
3527
4104
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3528
4105
  <xsl:with-param name="process">true</xsl:with-param>
@@ -3533,50 +4110,122 @@
3533
4110
 
3534
4111
  </xsl:template><xsl:template match="*[local-name()='dt']">
3535
4112
  <xsl:param name="key_iso"/>
4113
+ <xsl:param name="split_keep-within-line"/>
3536
4114
 
3537
4115
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
3538
- <fo:table-cell>
4116
+ <xsl:call-template name="insert_dt_cell">
4117
+ <xsl:with-param name="key_iso" select="$key_iso"/>
4118
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4119
+ </xsl:call-template>
4120
+ <xsl:for-each select="following-sibling::*[local-name()='dd'][1]">
4121
+ <xsl:call-template name="insert_dd_cell">
4122
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4123
+ </xsl:call-template>
4124
+ </xsl:for-each>
4125
+ </fo:table-row>
4126
+ </xsl:template><xsl:template name="insert_dt_cell">
4127
+ <xsl:param name="key_iso"/>
4128
+ <xsl:param name="split_keep-within-line"/>
4129
+ <fo:table-cell xsl:use-attribute-sets="dt-cell-style">
4130
+
4131
+ <xsl:if test="$isGenerateTableIF = 'true'">
4132
+ <!-- border is mandatory, to calculate real width -->
4133
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4134
+ <xsl:attribute name="text-align">left</xsl:attribute>
4135
+ </xsl:if>
4136
+
4137
+
4138
+ <fo:block xsl:use-attribute-sets="dt-block-style">
4139
+ <xsl:copy-of select="@id"/>
4140
+
4141
+ <xsl:if test="normalize-space($key_iso) = 'true'">
4142
+ <xsl:attribute name="margin-top">0</xsl:attribute>
4143
+ </xsl:if>
4144
+
4145
+
4146
+
4147
+ <xsl:apply-templates>
4148
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4149
+ </xsl:apply-templates>
4150
+
4151
+ <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"/> -->
4152
+
4153
+ </fo:block>
4154
+ </fo:table-cell>
4155
+ </xsl:template><xsl:template name="insert_dd_cell">
4156
+ <xsl:param name="split_keep-within-line"/>
4157
+ <fo:table-cell xsl:use-attribute-sets="dd-cell-style">
4158
+
4159
+ <xsl:if test="$isGenerateTableIF = 'true'">
4160
+ <!-- border is mandatory, to calculate real width -->
4161
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4162
+ </xsl:if>
4163
+
4164
+ <fo:block>
4165
+
4166
+ <xsl:if test="$isGenerateTableIF = 'true'">
4167
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4168
+ </xsl:if>
4169
+
3539
4170
 
3540
- <fo:block xsl:use-attribute-sets="dt-style">
3541
- <xsl:copy-of select="@id"/>
3542
-
3543
- <xsl:if test="normalize-space($key_iso) = 'true'">
3544
- <xsl:attribute name="margin-top">0</xsl:attribute>
3545
- </xsl:if>
3546
-
3547
-
3548
-
3549
- <xsl:apply-templates/>
3550
- </fo:block>
3551
- </fo:table-cell>
3552
- <fo:table-cell>
3553
- <fo:block>
3554
-
3555
4171
 
3556
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3557
- <xsl:with-param name="process">true</xsl:with-param>
3558
- </xsl:apply-templates>
3559
- </fo:block>
3560
- </fo:table-cell>
3561
- </fo:table-row>
4172
+ <xsl:choose>
4173
+ <xsl:when test="$isGenerateTableIF = 'true'">
4174
+ <xsl:apply-templates> <!-- following-sibling::*[local-name()='dd'][1] -->
4175
+ <xsl:with-param name="process">true</xsl:with-param>
4176
+ </xsl:apply-templates>
4177
+ </xsl:when>
4178
+ <xsl:otherwise>
4179
+ <xsl:apply-templates select="."> <!-- following-sibling::*[local-name()='dd'][1] -->
4180
+ <xsl:with-param name="process">true</xsl:with-param>
4181
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4182
+ </xsl:apply-templates>
4183
+ </xsl:otherwise>
4184
+
4185
+ </xsl:choose>
4186
+
4187
+ <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"/> -->
4188
+
4189
+ </fo:block>
4190
+ </fo:table-cell>
3562
4191
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3563
4192
  <xsl:apply-templates/>
3564
4193
  </xsl:template><xsl:template match="*[local-name()='dd']">
3565
4194
  <xsl:param name="process">false</xsl:param>
4195
+ <xsl:param name="split_keep-within-line"/>
3566
4196
  <xsl:if test="$process = 'true'">
3567
4197
  <xsl:apply-templates select="@language"/>
3568
- <xsl:apply-templates/>
4198
+ <xsl:apply-templates>
4199
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4200
+ </xsl:apply-templates>
3569
4201
  </xsl:if>
3570
4202
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3571
4203
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3572
- </xsl:template><xsl:template match="*[local-name()='em']">
4204
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl_if">
4205
+ <xsl:param name="id"/>
4206
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4207
+ <tr>
4208
+ <td>
4209
+ <xsl:copy-of select="node()"/>
4210
+ </td>
4211
+ <td>
4212
+
4213
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
4214
+
4215
+ </td>
4216
+ </tr>
4217
+
4218
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
3573
4219
  <fo:inline font-style="italic">
3574
4220
  <xsl:apply-templates/>
3575
4221
  </fo:inline>
3576
4222
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
4223
+ <xsl:param name="split_keep-within-line"/>
3577
4224
  <fo:inline font-weight="bold">
3578
4225
 
3579
- <xsl:apply-templates/>
4226
+ <xsl:apply-templates>
4227
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4228
+ </xsl:apply-templates>
3580
4229
  </fo:inline>
3581
4230
  </xsl:template><xsl:template match="*[local-name()='padding']">
3582
4231
  <fo:inline padding-right="{@value}"> </fo:inline>
@@ -3777,6 +4426,10 @@
3777
4426
  <xsl:param name="text"/>
3778
4427
  <xsl:param name="separator" select="' '"/>
3779
4428
  <xsl:choose>
4429
+
4430
+ <xsl:when test="$isGenerateTableIF = 'true' and not(contains($text, $separator))">
4431
+ <word><xsl:value-of select="normalize-space($text)"/></word>
4432
+ </xsl:when>
3780
4433
  <xsl:when test="not(contains($text, $separator))">
3781
4434
  <word>
3782
4435
  <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
@@ -3821,13 +4474,66 @@
3821
4474
  </xsl:when>
3822
4475
  <xsl:otherwise>
3823
4476
  <word>
3824
- <xsl:value-of select="string-length(normalize-space(substring-before($text, $separator)))"/>
4477
+ <xsl:variable name="word" select="normalize-space(substring-before($text, $separator))"/>
4478
+ <xsl:choose>
4479
+ <xsl:when test="$isGenerateTableIF = 'true'">
4480
+ <xsl:value-of select="$word"/>
4481
+ </xsl:when>
4482
+ <xsl:otherwise>
4483
+ <xsl:value-of select="string-length($word)"/>
4484
+ </xsl:otherwise>
4485
+ </xsl:choose>
3825
4486
  </word>
3826
4487
  <xsl:call-template name="tokenize">
3827
4488
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
3828
4489
  </xsl:call-template>
3829
4490
  </xsl:otherwise>
3830
4491
  </xsl:choose>
4492
+ </xsl:template><xsl:template name="tokenize_with_tags">
4493
+ <xsl:param name="tags"/>
4494
+ <xsl:param name="text"/>
4495
+ <xsl:param name="separator" select="' '"/>
4496
+ <xsl:choose>
4497
+
4498
+ <xsl:when test="not(contains($text, $separator))">
4499
+ <word>
4500
+ <xsl:call-template name="enclose_text_in_tags">
4501
+ <xsl:with-param name="text" select="normalize-space($text)"/>
4502
+ <xsl:with-param name="tags" select="$tags"/>
4503
+ </xsl:call-template>
4504
+ </word>
4505
+ </xsl:when>
4506
+ <xsl:otherwise>
4507
+ <word>
4508
+ <xsl:call-template name="enclose_text_in_tags">
4509
+ <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
4510
+ <xsl:with-param name="tags" select="$tags"/>
4511
+ </xsl:call-template>
4512
+ </word>
4513
+ <xsl:call-template name="tokenize_with_tags">
4514
+ <xsl:with-param name="text" select="substring-after($text, $separator)"/>
4515
+ </xsl:call-template>
4516
+ </xsl:otherwise>
4517
+ </xsl:choose>
4518
+ </xsl:template><xsl:template name="enclose_text_in_tags">
4519
+ <xsl:param name="text"/>
4520
+ <xsl:param name="tags"/>
4521
+ <xsl:param name="num">1</xsl:param> <!-- default (start) value -->
4522
+
4523
+ <xsl:variable name="tag_name" select="normalize-space(xalan:nodeset($tags)//tag[$num])"/>
4524
+
4525
+ <xsl:choose>
4526
+ <xsl:when test="$tag_name = ''"><xsl:value-of select="$text"/></xsl:when>
4527
+ <xsl:otherwise>
4528
+ <xsl:element name="{$tag_name}">
4529
+ <xsl:call-template name="enclose_text_in_tags">
4530
+ <xsl:with-param name="text" select="$text"/>
4531
+ <xsl:with-param name="tags" select="$tags"/>
4532
+ <xsl:with-param name="num" select="$num + 1"/>
4533
+ </xsl:call-template>
4534
+ </xsl:element>
4535
+ </xsl:otherwise>
4536
+ </xsl:choose>
3831
4537
  </xsl:template><xsl:template name="max_length">
3832
4538
  <xsl:param name="words"/>
3833
4539
  <xsl:for-each select="$words//word">
@@ -3928,12 +4634,19 @@
3928
4634
  </xsl:otherwise>
3929
4635
  </xsl:choose>
3930
4636
  </xsl:template><xsl:template name="getSimpleTable">
4637
+ <xsl:param name="id"/>
4638
+
3931
4639
  <xsl:variable name="simple-table">
3932
4640
 
4641
+ <!-- Step 0. replace <br/> to <p>...</p> -->
4642
+ <xsl:variable name="table_without_br">
4643
+ <xsl:apply-templates mode="table-without-br"/>
4644
+ </xsl:variable>
4645
+
3933
4646
  <!-- Step 1. colspan processing -->
3934
4647
  <xsl:variable name="simple-table-colspan">
3935
4648
  <tbody>
3936
- <xsl:apply-templates mode="simple-table-colspan"/>
4649
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-colspan"/>
3937
4650
  </tbody>
3938
4651
  </xsl:variable>
3939
4652
 
@@ -3942,10 +4655,67 @@
3942
4655
  <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
3943
4656
  </xsl:variable>
3944
4657
 
3945
- <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3946
-
4658
+ <!-- Step 3: add id to each cell -->
4659
+ <!-- add <word>...</word> for each word, image, math -->
4660
+ <xsl:variable name="simple-table-id">
4661
+ <xsl:apply-templates select="xalan:nodeset($simple-table-rowspan)" mode="simple-table-id">
4662
+ <xsl:with-param name="id" select="$id"/>
4663
+ </xsl:apply-templates>
4664
+ </xsl:variable>
4665
+
4666
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
4667
+
3947
4668
  </xsl:variable>
3948
4669
  <xsl:copy-of select="$simple-table"/>
4670
+ </xsl:template><xsl:template match="@*|node()" mode="table-without-br">
4671
+ <xsl:copy>
4672
+ <xsl:apply-templates select="@*|node()" mode="table-without-br"/>
4673
+ </xsl:copy>
4674
+ </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">
4675
+ <xsl:copy>
4676
+ <xsl:copy-of select="@*"/>
4677
+ <p>
4678
+ <xsl:copy-of select="node()"/>
4679
+ </p>
4680
+ </xsl:copy>
4681
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td'][*[local-name()='br']]" mode="table-without-br">
4682
+ <xsl:copy>
4683
+ <xsl:copy-of select="@*"/>
4684
+ <xsl:for-each select="*[local-name()='br']">
4685
+ <xsl:variable name="current_id" select="generate-id()"/>
4686
+ <p>
4687
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4688
+ <xsl:copy-of select="."/>
4689
+ </xsl:for-each>
4690
+ </p>
4691
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4692
+ <p>
4693
+ <xsl:for-each select="following-sibling::node()">
4694
+ <xsl:copy-of select="."/>
4695
+ </xsl:for-each>
4696
+ </p>
4697
+ </xsl:if>
4698
+ </xsl:for-each>
4699
+ </xsl:copy>
4700
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p'][*[local-name()='br']]" mode="table-without-br">
4701
+ <xsl:for-each select="*[local-name()='br']">
4702
+ <xsl:variable name="current_id" select="generate-id()"/>
4703
+ <p>
4704
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4705
+ <xsl:copy-of select="."/>
4706
+ </xsl:for-each>
4707
+ </p>
4708
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4709
+ <p>
4710
+ <xsl:for-each select="following-sibling::node()">
4711
+ <xsl:copy-of select="."/>
4712
+ </xsl:for-each>
4713
+ </p>
4714
+ </xsl:if>
4715
+ </xsl:for-each>
4716
+ </xsl:template><xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
4717
+ <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
4718
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
3949
4719
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3950
4720
  <xsl:apply-templates mode="simple-table-colspan"/>
3951
4721
  </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">
@@ -4035,6 +4805,126 @@
4035
4805
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
4036
4806
  <xsl:with-param name="previousRow" select="$newRow"/>
4037
4807
  </xsl:apply-templates>
4808
+ </xsl:template><xsl:template match="/" mode="simple-table-id">
4809
+ <xsl:param name="id"/>
4810
+ <xsl:variable name="id_prefixed" select="concat('table_if_',$id)"/> <!-- table id prefixed by 'table_if_' to simple search in IF -->
4811
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4812
+ <xsl:with-param name="id" select="$id_prefixed"/>
4813
+ </xsl:apply-templates>
4814
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-id">
4815
+ <xsl:param name="id"/>
4816
+ <xsl:copy>
4817
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4818
+ <xsl:with-param name="id" select="$id"/>
4819
+ </xsl:apply-templates>
4820
+ </xsl:copy>
4821
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="simple-table-id">
4822
+ <xsl:param name="id"/>
4823
+ <xsl:copy>
4824
+ <xsl:copy-of select="@*"/>
4825
+ <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
4826
+ <xsl:apply-templates select="node()" mode="simple-table-id">
4827
+ <xsl:with-param name="id" select="$id"/>
4828
+ </xsl:apply-templates>
4829
+ </xsl:copy>
4830
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
4831
+ <xsl:param name="id"/>
4832
+ <xsl:copy>
4833
+ <xsl:copy-of select="@*"/>
4834
+ <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4835
+ <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4836
+ <xsl:attribute name="id">
4837
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4838
+ </xsl:attribute>
4839
+
4840
+ <xsl:for-each select="*[local-name() = 'p']">
4841
+ <xsl:copy>
4842
+ <xsl:copy-of select="@*"/>
4843
+ <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
4844
+ <xsl:attribute name="id">
4845
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4846
+ </xsl:attribute>
4847
+
4848
+ <xsl:copy-of select="node()"/>
4849
+ </xsl:copy>
4850
+ </xsl:for-each>
4851
+
4852
+
4853
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- split each paragraph to words, image, math -->
4854
+
4855
+ <xsl:variable name="td_text">
4856
+ <xsl:apply-templates select="." mode="td_text_with_formatting"/>
4857
+ </xsl:variable>
4858
+
4859
+ <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
4860
+
4861
+ <xsl:variable name="words">
4862
+ <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
4863
+ <word>
4864
+ <xsl:copy-of select="."/>
4865
+ </word>
4866
+ </xsl:for-each>
4867
+
4868
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
4869
+ <xsl:copy-of select="."/>
4870
+ </xsl:for-each>
4871
+
4872
+ </xsl:variable>
4873
+
4874
+ <xsl:for-each select="xalan:nodeset($words)/word">
4875
+ <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
4876
+ <xsl:copy>
4877
+ <xsl:attribute name="id">
4878
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4879
+ </xsl:attribute>
4880
+ <xsl:copy-of select="node()"/>
4881
+ </xsl:copy>
4882
+ </xsl:for-each>
4883
+ </xsl:if>
4884
+ </xsl:copy>
4885
+
4886
+ </xsl:template><xsl:template match="@*|node()" mode="td_text_with_formatting">
4887
+ <xsl:copy>
4888
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4889
+ </xsl:copy>
4890
+ </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">
4891
+ <xsl:variable name="formatting_tags">
4892
+ <xsl:call-template name="getFormattingTags"/>
4893
+ </xsl:variable>
4894
+ <word>
4895
+ <xsl:call-template name="enclose_text_in_tags">
4896
+ <xsl:with-param name="text" select="normalize-space(.)"/>
4897
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4898
+ </xsl:call-template>
4899
+ </word>
4900
+ </xsl:template><xsl:template match="*[local-name() != 'keep-together_within-line']/text()" mode="td_text_with_formatting">
4901
+
4902
+ <xsl:variable name="td_text" select="."/>
4903
+
4904
+ <xsl:variable name="string_with_added_zerospaces">
4905
+ <xsl:call-template name="add-zero-spaces-java">
4906
+ <xsl:with-param name="text" select="$td_text"/>
4907
+ </xsl:call-template>
4908
+ </xsl:variable>
4909
+
4910
+ <xsl:variable name="formatting_tags">
4911
+ <xsl:call-template name="getFormattingTags"/>
4912
+ </xsl:variable>
4913
+
4914
+ <!-- <word>text</word> -->
4915
+ <xsl:call-template name="tokenize_with_tags">
4916
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4917
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
4918
+ </xsl:call-template>
4919
+ </xsl:template><xsl:template name="getFormattingTags">
4920
+ <tags>
4921
+ <xsl:if test="ancestor::*[local-name() = 'strong']"><tag>strong</tag></xsl:if>
4922
+ <xsl:if test="ancestor::*[local-name() = 'em']"><tag>em</tag></xsl:if>
4923
+ <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
4924
+ <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
4925
+ <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
4926
+ <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
4927
+ </tags>
4038
4928
  </xsl:template><xsl:template name="getLang">
4039
4929
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4040
4930
  <xsl:variable name="language">
@@ -5726,7 +6616,9 @@
5726
6616
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
5727
6617
  </xsl:if>
5728
6618
  <xsl:variable name="simple-table">
5729
- <xsl:call-template name="getSimpleTable"/>
6619
+ <xsl:call-template name="getSimpleTable">
6620
+ <xsl:with-param name="id" select="@id"/>
6621
+ </xsl:call-template>
5730
6622
  </xsl:variable>
5731
6623
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
5732
6624
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
@@ -6674,7 +7566,7 @@
6674
7566
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
6675
7567
  <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
6676
7568
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
6677
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
7569
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
6678
7570
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
6679
7571
  <!-- <row>
6680
7572
  <date>05-07-2013</date>
@@ -8088,4 +8980,40 @@
8088
8980
  <xsl:value-of select="$value"/>
8089
8981
  </xsl:otherwise>
8090
8982
  </xsl:choose>
8983
+ </xsl:template><xsl:template match="*" mode="print_as_xml">
8984
+ <xsl:param name="level">0</xsl:param>
8985
+
8986
+ <fo:block margin-left="{2*$level}mm">
8987
+ <xsl:text>
8988
+ &lt;</xsl:text>
8989
+ <xsl:value-of select="local-name()"/>
8990
+ <xsl:for-each select="@*">
8991
+ <xsl:text> </xsl:text>
8992
+ <xsl:value-of select="local-name()"/>
8993
+ <xsl:text>="</xsl:text>
8994
+ <xsl:value-of select="."/>
8995
+ <xsl:text>"</xsl:text>
8996
+ </xsl:for-each>
8997
+ <xsl:text>&gt;</xsl:text>
8998
+
8999
+ <xsl:if test="not(*)">
9000
+ <fo:inline font-weight="bold"><xsl:value-of select="."/></fo:inline>
9001
+ <xsl:text>&lt;/</xsl:text>
9002
+ <xsl:value-of select="local-name()"/>
9003
+ <xsl:text>&gt;</xsl:text>
9004
+ </xsl:if>
9005
+ </fo:block>
9006
+
9007
+ <xsl:if test="*">
9008
+ <fo:block>
9009
+ <xsl:apply-templates mode="print_as_xml">
9010
+ <xsl:with-param name="level" select="$level + 1"/>
9011
+ </xsl:apply-templates>
9012
+ </fo:block>
9013
+ <fo:block margin-left="{2*$level}mm">
9014
+ <xsl:text>&lt;/</xsl:text>
9015
+ <xsl:value-of select="local-name()"/>
9016
+ <xsl:text>&gt;</xsl:text>
9017
+ </fo:block>
9018
+ </xsl:if>
8091
9019
  </xsl:template></xsl:stylesheet>