metanorma-iho 0.6.6 → 0.6.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4af6ef284c4a564646a9b84cb3ae8a69a534e939948728a0a6e132e83aa7008
4
- data.tar.gz: 6e14800eab27b7c2febb9a09a99f8ba9036c1c4894ade61d726c697dcaccc200
3
+ metadata.gz: b06efeadd471cd4566f8e63f56d03baaaad4064d06a9d901d1011c4920262d24
4
+ data.tar.gz: c786318604090063a69118a2ff88492e0370c32f74095bb70e13c87865281e48
5
5
  SHA512:
6
- metadata.gz: 35ce6de13b73198e4f6837d1f0223239274aa29113f8122da891f0fdb972e60fb9056ae822231daeac9ae42a6ae824f785ee7a832d491161ea49a4559e812641
7
- data.tar.gz: a9cede9cd799c2e77fc42e1f6439a4edb790d0b8ab434008985ac6a3bb2d4860612967cf15a05df83f7a2eef1a56b8ec14577d08dfa582f04f6a31f19d4e48af
6
+ metadata.gz: 5983451edf0fe0a25fe1ec5a09cb68e6948ddee0a7623473b174a9ca82071c6ab8c19616347d5c482cffcc12d29b0b386dfe7a763d3cb7b6f2449081824a0d35
7
+ data.tar.gz: 23e38baf1a70b6a897fb453b9a43e209ef58757661b3b5abfdde2a051d89d131fac45584b12361fe2d361edd5b0e2a3e3683f7e11f037a6912226992ef0640c2
@@ -10,6 +10,6 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- uses: metanorma/metanorma-build-scripts/.github/workflows/generic-rake.yml@main
13
+ uses: metanorma/ci/.github/workflows/generic-rake.yml@main
14
14
  secrets:
15
15
  pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -0,0 +1,24 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release
4
+
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ next_version:
9
+ description: |
10
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
+ required: true
12
+ default: 'skip'
13
+ push:
14
+ tags: [ v* ]
15
+
16
+ jobs:
17
+ release:
18
+ uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
19
+ with:
20
+ next_version: ${{ github.event.inputs.next_version }}
21
+ secrets:
22
+ rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
23
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
24
+
@@ -790,8 +790,18 @@
790
790
 
791
791
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
792
792
 
793
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
794
+ true
795
+ </xsl:variable>
796
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
797
+
793
798
  <xsl:variable name="isGenerateTableIF_">
794
- false
799
+ <xsl:choose>
800
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
801
+ <xsl:value-of select="normalize-space($table_if) = 'true'"/>
802
+ </xsl:when>
803
+ <xsl:otherwise>false</xsl:otherwise>
804
+ </xsl:choose>
795
805
  </xsl:variable>
796
806
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
797
807
 
@@ -1206,6 +1216,9 @@
1206
1216
  <xsl:attribute-set name="import-style">
1207
1217
  </xsl:attribute-set>
1208
1218
 
1219
+ <xsl:attribute-set name="component-style">
1220
+ </xsl:attribute-set>
1221
+
1209
1222
  <xsl:attribute-set name="recommendation-style">
1210
1223
 
1211
1224
  </xsl:attribute-set>
@@ -1397,9 +1410,8 @@
1397
1410
  </xsl:attribute-set>
1398
1411
 
1399
1412
  <xsl:attribute-set name="dt-block-style">
1400
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1413
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1401
1414
 
1402
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
1403
1415
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1404
1416
 
1405
1417
  </xsl:attribute-set>
@@ -2372,6 +2384,7 @@
2372
2384
 
2373
2385
  <xsl:variable name="margin-side">
2374
2386
  <xsl:choose>
2387
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
2375
2388
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2376
2389
  <xsl:otherwise>0</xsl:otherwise>
2377
2390
  </xsl:choose>
@@ -2434,6 +2447,7 @@
2434
2447
  </td>
2435
2448
  </tr>
2436
2449
  -->
2450
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
2437
2451
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2438
2452
 
2439
2453
  </xsl:when>
@@ -2568,12 +2582,17 @@
2568
2582
  <xsl:template name="calculate-column-widths">
2569
2583
  <xsl:param name="table"/>
2570
2584
  <xsl:param name="cols-count"/>
2571
-
2585
+ <xsl:choose>
2586
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
2587
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
2588
+ </xsl:when>
2589
+ <xsl:otherwise>
2572
2590
  <xsl:call-template name="calculate-column-widths-proportional">
2573
2591
  <xsl:with-param name="cols-count" select="$cols-count"/>
2574
2592
  <xsl:with-param name="table" select="$table"/>
2575
2593
  </xsl:call-template>
2576
-
2594
+ </xsl:otherwise>
2595
+ </xsl:choose>
2577
2596
  </xsl:template>
2578
2597
 
2579
2598
  <!-- ================================================== -->
@@ -2751,6 +2770,7 @@
2751
2770
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
2752
2771
  <!-- ================================================== -->
2753
2772
 
2773
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
2754
2774
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
2755
2775
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2756
2776
 
@@ -2762,67 +2782,6 @@
2762
2782
 
2763
2783
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2764
2784
 
2765
- <!-- get current table id -->
2766
- <xsl:variable name="table_id" select="@id"/>
2767
- <!-- find table by id in the file 'table_widths' -->
2768
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2769
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2770
-
2771
- <!-- table='<xsl:copy-of select="$table"/>' -->
2772
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2773
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2774
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2775
-
2776
- <xsl:variable name="table_with_cell_widths_">
2777
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2778
- </xsl:variable>
2779
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2780
-
2781
- <!-- <xsl:if test="$table_if_debug = 'true'">
2782
- <xsl:copy-of select="$table_with_cell_widths"/>
2783
- </xsl:if> -->
2784
-
2785
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2786
-
2787
- <xsl:variable name="column_widths_">
2788
- <!-- iteration of columns -->
2789
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2790
- <xsl:variable name="pos" select="position()"/>
2791
- <column>
2792
- <xsl:attribute name="width_max">
2793
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2794
- <xsl:sort select="." data-type="number" order="descending"/>
2795
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2796
- </xsl:for-each>
2797
- </xsl:attribute>
2798
- <xsl:attribute name="width_min">
2799
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2800
- <xsl:sort select="." data-type="number" order="descending"/>
2801
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2802
- </xsl:for-each>
2803
- </xsl:attribute>
2804
- </column>
2805
- </xsl:for-each>
2806
- </xsl:variable>
2807
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2808
-
2809
- <!-- <column_widths>
2810
- <xsl:copy-of select="$column_widths"/>
2811
- </column_widths> -->
2812
-
2813
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2814
- <xsl:variable name="table_widths_">
2815
- <table>
2816
- <xsl:attribute name="width_max">
2817
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2818
- </xsl:attribute>
2819
- <xsl:attribute name="width_min">
2820
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2821
- </xsl:attribute>
2822
- </table>
2823
- </xsl:variable>
2824
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2825
-
2826
2785
  <xsl:variable name="page_width">
2827
2786
  <xsl:choose>
2828
2787
  <xsl:when test="$parent_table_page-width != ''">
@@ -2835,16 +2794,13 @@
2835
2794
  </xsl:variable>
2836
2795
 
2837
2796
  <xsl:if test="$table_if_debug = 'true'">
2838
- <table_width>
2839
- <xsl:copy-of select="$table_widths"/>
2840
- </table_width>
2841
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2797
+ <page_width><xsl:value-of select="$page_width"/></page_width>
2842
2798
  </xsl:if>
2843
2799
 
2844
2800
  <!-- There are three cases: -->
2845
2801
  <xsl:choose>
2846
2802
  <!-- 1. The minimum table width is equal to or wider than the available space -->
2847
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2803
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2848
2804
  <!-- call old algorithm -->
2849
2805
  <case1/>
2850
2806
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -2854,10 +2810,10 @@
2854
2810
  </xsl:call-template> -->
2855
2811
  </xsl:when>
2856
2812
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2857
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2813
+ <xsl:when test="@width_max &lt;= $page_width">
2858
2814
  <case2/>
2859
2815
  <autolayout/>
2860
- <xsl:for-each select="$column_widths/column/@width_max">
2816
+ <xsl:for-each select="column/@width_max">
2861
2817
  <column divider="100"><xsl:value-of select="."/></column>
2862
2818
  </xsl:for-each>
2863
2819
  </xsl:when>
@@ -2867,19 +2823,19 @@
2867
2823
  For each column, let d be the difference between maximum and minimum width of that column.
2868
2824
  Now set the column's width to the minimum width plus d times W over D.
2869
2825
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2870
- <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)">
2826
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
2871
2827
  <!-- difference between the available space and the minimum table width -->
2872
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2828
+ <xsl:variable name="W" select="$page_width - @width_min"/>
2873
2829
  <W><xsl:value-of select="$W"/></W>
2874
2830
  <!-- difference between maximum and minimum width of the table -->
2875
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2831
+ <xsl:variable name="D" select="@width_max - @width_min"/>
2876
2832
  <D><xsl:value-of select="$D"/></D>
2877
2833
  <case3/>
2878
2834
  <autolayout/>
2879
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2835
+ <xsl:if test="@width_min &gt;= $page_width">
2880
2836
  <split_keep-within-line>true</split_keep-within-line>
2881
2837
  </xsl:if>
2882
- <xsl:for-each select="$column_widths/column">
2838
+ <xsl:for-each select="column">
2883
2839
  <!-- difference between maximum and minimum width of that column. -->
2884
2840
  <xsl:variable name="d" select="@width_max - @width_min"/>
2885
2841
  <d><xsl:value-of select="$d"/></d>
@@ -2905,23 +2861,39 @@
2905
2861
 
2906
2862
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
2907
2863
 
2864
+ <ancestor_tree>
2865
+ <xsl:for-each select="ancestor::*">
2866
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
2867
+ </xsl:for-each>
2868
+ </ancestor_tree>
2869
+
2908
2870
  <xsl:variable name="parent_table_page-width_">
2909
2871
  <xsl:if test="$parent_table_id != ''">
2910
2872
  <!-- determine column number in the parent table -->
2911
2873
  <xsl:variable name="parent_table_column_number">
2912
2874
  <xsl:choose>
2913
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
2875
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
2876
+ <xsl:when test="(ancestor::*[local-name() = 'dd' or local-name() = 'table' or local-name() = 'dl'])[last()][local-name() = 'dd' or local-name() = 'dl']">2</xsl:when>
2914
2877
  <xsl:otherwise> <!-- parent is table -->
2915
2878
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
2916
2879
  </xsl:otherwise>
2917
2880
  </xsl:choose>
2918
2881
  </xsl:variable>
2919
2882
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
2920
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2883
+
2884
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2885
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
2886
+ <!-- <xsl:variable name="divider">
2887
+ <xsl:value-of select="$parent_table_column/@divider"/>
2888
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
2889
+ </xsl:variable> -->
2890
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
2921
2891
  </xsl:if>
2922
2892
  </xsl:variable>
2923
2893
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
2924
2894
 
2895
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
2896
+
2925
2897
  <!-- get current table id -->
2926
2898
  <xsl:variable name="table_id" select="@id"/>
2927
2899
 
@@ -2942,50 +2914,6 @@
2942
2914
 
2943
2915
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
2944
2916
 
2945
- <!-- ============================= -->
2946
- <!-- mode: determine_cell_widths-if -->
2947
- <!-- ============================= -->
2948
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
2949
- <xsl:copy>
2950
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2951
- </xsl:copy>
2952
- </xsl:template>
2953
-
2954
- <xsl:template match="td | th" mode="determine_cell_widths-if">
2955
- <xsl:copy>
2956
- <xsl:copy-of select="@*"/>
2957
-
2958
- <!-- The maximum width is given by the widest line. -->
2959
- <xsl:attribute name="width_max">
2960
- <xsl:for-each select="p_len">
2961
- <xsl:sort select="." data-type="number" order="descending"/>
2962
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2963
- </xsl:for-each>
2964
- </xsl:attribute>
2965
-
2966
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2967
- <xsl:variable name="width_min">
2968
- <xsl:for-each select="word_len">
2969
- <xsl:sort select="." data-type="number" order="descending"/>
2970
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2971
- </xsl:for-each>
2972
- </xsl:variable>
2973
- <xsl:attribute name="width_min">
2974
- <xsl:value-of select="$width_min"/>
2975
- </xsl:attribute>
2976
-
2977
- <xsl:if test="$width_min = 0">
2978
- <xsl:attribute name="width_min">1</xsl:attribute>
2979
- </xsl:if>
2980
-
2981
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2982
-
2983
- </xsl:copy>
2984
- </xsl:template>
2985
- <!-- ============================= -->
2986
- <!-- END mode: determine_cell_widths-if -->
2987
- <!-- ============================= -->
2988
-
2989
2917
  <!-- ================================================== -->
2990
2918
  <!-- Calculate column's width based on HTML4 algorithm -->
2991
2919
  <!-- ================================================== -->
@@ -3176,6 +3104,7 @@
3176
3104
  <xsl:when test="$table_or_dl = 'table'">
3177
3105
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3178
3106
  <fo:table-row number-columns-spanned="{$col_count}">
3107
+ <xsl:copy-of select="../@font-weight"/>
3179
3108
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3180
3109
  <xsl:call-template name="td"/>
3181
3110
  </fo:table-row>
@@ -3322,7 +3251,7 @@
3322
3251
 
3323
3252
  <xsl:apply-templates/>
3324
3253
 
3325
- <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"/> -->
3254
+ <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"/> -->
3326
3255
 
3327
3256
  </fo:block>
3328
3257
  </fo:table-cell>
@@ -3648,6 +3577,7 @@
3648
3577
  <xsl:template match="*[local-name()='dl']">
3649
3578
  <xsl:variable name="isAdded" select="@added"/>
3650
3579
  <xsl:variable name="isDeleted" select="@deleted"/>
3580
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
3651
3581
  <fo:block-container>
3652
3582
 
3653
3583
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -4185,21 +4115,16 @@
4185
4115
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
4186
4116
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
4187
4117
  <xsl:param name="id"/>
4188
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4189
4118
  <tr>
4190
4119
  <td>
4191
4120
  <xsl:copy-of select="node()"/>
4192
4121
  </td>
4193
4122
  <td>
4194
-
4195
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4196
-
4197
- <!-- get paragraphs from nested 'dl' -->
4198
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4199
-
4123
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4124
+ <!-- get paragraphs from nested 'dl' -->
4125
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4200
4126
  </td>
4201
4127
  </tr>
4202
-
4203
4128
  </xsl:template>
4204
4129
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4205
4130
 
@@ -4851,6 +4776,9 @@
4851
4776
  <xsl:variable name="td">
4852
4777
  <xsl:element name="td">
4853
4778
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
4779
+ <xsl:if test="local-name()='th'">
4780
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4781
+ </xsl:if>
4854
4782
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4855
4783
  <xsl:apply-templates mode="simple-table-colspan"/>
4856
4784
  </xsl:element>
@@ -4863,6 +4791,9 @@
4863
4791
  <xsl:otherwise>
4864
4792
  <xsl:element name="td">
4865
4793
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4794
+ <xsl:if test="local-name()='th'">
4795
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4796
+ </xsl:if>
4866
4797
  <xsl:apply-templates mode="simple-table-colspan"/>
4867
4798
  </xsl:element>
4868
4799
  </xsl:otherwise>
@@ -4992,8 +4923,14 @@
4992
4923
  <xsl:copy-of select="@*"/>
4993
4924
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4994
4925
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4926
+ <xsl:variable name="divide">
4927
+ <xsl:choose>
4928
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
4929
+ <xsl:otherwise>1</xsl:otherwise>
4930
+ </xsl:choose>
4931
+ </xsl:variable>
4995
4932
  <xsl:attribute name="id">
4996
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4933
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
4997
4934
  </xsl:attribute>
4998
4935
 
4999
4936
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5001,10 +4938,12 @@
5001
4938
  <xsl:copy-of select="@*"/>
5002
4939
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5003
4940
  <xsl:attribute name="id">
5004
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4941
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5005
4942
  </xsl:attribute>
5006
4943
 
5007
- <xsl:copy-of select="node()"/>
4944
+ <!-- <xsl:copy-of select="node()" /> -->
4945
+ <xsl:apply-templates mode="simple-table-noid"/>
4946
+
5008
4947
  </xsl:copy>
5009
4948
  </xsl:for-each>
5010
4949
 
@@ -5033,7 +4972,7 @@
5033
4972
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5034
4973
  <xsl:copy>
5035
4974
  <xsl:attribute name="id">
5036
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4975
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5037
4976
  </xsl:attribute>
5038
4977
  <xsl:copy-of select="node()"/>
5039
4978
  </xsl:copy>
@@ -5042,6 +4981,24 @@
5042
4981
  </xsl:copy>
5043
4982
 
5044
4983
  </xsl:template>
4984
+
4985
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
4986
+ <xsl:copy>
4987
+ <xsl:choose>
4988
+ <xsl:when test="$isGenerateTableIF = 'true'">
4989
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
4990
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
4991
+ <xsl:copy-of select="@id"/>
4992
+ </xsl:if> -->
4993
+ </xsl:when>
4994
+ <xsl:otherwise>
4995
+ <xsl:copy-of select="@*"/>
4996
+ </xsl:otherwise>
4997
+ </xsl:choose>
4998
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
4999
+ </xsl:copy>
5000
+ </xsl:template>
5001
+
5045
5002
  <!-- End mode: simple-table-id -->
5046
5003
  <!-- ===================== -->
5047
5004
  <!-- ===================== -->
@@ -5051,7 +5008,7 @@
5051
5008
  <!-- =============================== -->
5052
5009
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
5053
5010
  <xsl:copy>
5054
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5011
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5055
5012
  </xsl:copy>
5056
5013
  </xsl:template>
5057
5014
 
@@ -5165,6 +5122,10 @@
5165
5122
 
5166
5123
  <fo:inline xsl:use-attribute-sets="mathml-style">
5167
5124
 
5125
+ <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
5126
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5127
+ </xsl:if>
5128
+
5168
5129
  <xsl:call-template name="setTrackChangesStyles">
5169
5130
  <xsl:with-param name="isAdded" select="$isAdded"/>
5170
5131
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -7044,41 +7005,47 @@
7044
7005
  </fo:block>
7045
7006
  </xsl:template>
7046
7007
 
7047
- <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
7008
+ <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
7048
7009
  <fo:block xsl:use-attribute-sets="inherit-style">
7049
7010
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
7050
7011
  </fo:block>
7051
7012
  </xsl:template>
7052
7013
 
7053
- <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
7014
+ <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description'] | *[local-name() = 'div'][@type = 'requirement-description'] | *[local-name() = 'div'][@type = 'recommendation-description'] | *[local-name() = 'div'][@type = 'permission-description']">
7054
7015
  <fo:block xsl:use-attribute-sets="description-style">
7055
7016
  <xsl:apply-templates/>
7056
7017
  </fo:block>
7057
7018
  </xsl:template>
7058
7019
 
7059
- <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
7020
+ <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification'] | *[local-name() = 'div'][@type = 'requirement-specification'] | *[local-name() = 'div'][@type = 'recommendation-specification'] | *[local-name() = 'div'][@type = 'permission-specification']">
7060
7021
  <fo:block xsl:use-attribute-sets="specification-style">
7061
7022
  <xsl:apply-templates/>
7062
7023
  </fo:block>
7063
7024
  </xsl:template>
7064
7025
 
7065
- <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
7026
+ <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target'] | *[local-name() = 'div'][@type = 'requirement-measurement-target'] | *[local-name() = 'div'][@type = 'recommendation-measurement-target'] | *[local-name() = 'div'][@type = 'permission-measurement-target']">
7066
7027
  <fo:block xsl:use-attribute-sets="measurement-target-style">
7067
7028
  <xsl:apply-templates/>
7068
7029
  </fo:block>
7069
7030
  </xsl:template>
7070
7031
 
7071
- <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
7032
+ <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification'] | *[local-name() = 'div'][@type = 'requirement-verification'] | *[local-name() = 'div'][@type = 'recommendation-verification'] | *[local-name() = 'div'][@type = 'permission-verification']">
7072
7033
  <fo:block xsl:use-attribute-sets="verification-style">
7073
7034
  <xsl:apply-templates/>
7074
7035
  </fo:block>
7075
7036
  </xsl:template>
7076
7037
 
7077
- <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
7038
+ <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import'] | *[local-name() = 'div'][@type = 'requirement-import'] | *[local-name() = 'div'][@type = 'recommendation-import'] | *[local-name() = 'div'][@type = 'permission-import']">
7078
7039
  <fo:block xsl:use-attribute-sets="import-style">
7079
7040
  <xsl:apply-templates/>
7080
7041
  </fo:block>
7081
7042
  </xsl:template>
7043
+
7044
+ <xsl:template match="*[local-name() = 'div'][starts-with(@type, 'requirement-component')] | *[local-name() = 'div'][starts-with(@type, 'recommendation-component')] | *[local-name() = 'div'][starts-with(@type, 'permission-component')]">
7045
+ <fo:block xsl:use-attribute-sets="component-style">
7046
+ <xsl:apply-templates/>
7047
+ </fo:block>
7048
+ </xsl:template>
7082
7049
  <!-- ========== -->
7083
7050
  <!-- END -->
7084
7051
  <!-- ========== -->
@@ -7134,15 +7101,12 @@
7134
7101
 
7135
7102
  <xsl:template match="*[local-name()='tr']" mode="requirement">
7136
7103
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
7137
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
7138
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
7139
- </xsl:if>
7140
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
7141
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
7142
- </xsl:if>
7143
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
7144
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
7104
+
7105
+ <xsl:if test="parent::*[local-name()='thead'] or starts-with(*[local-name()='td' or local-name()='th'][1], 'Requirement ') or starts-with(*[local-name()='td' or local-name()='th'][1], 'Recommendation ')">
7106
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
7107
+
7145
7108
  </xsl:if>
7109
+
7146
7110
  <xsl:apply-templates mode="requirement"/>
7147
7111
  </fo:table-row>
7148
7112
  </xsl:template>
@@ -8623,7 +8587,7 @@
8623
8587
  </tbody>
8624
8588
  </xsl:variable>
8625
8589
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
8626
- <xsl:call-template name="calculate-column-widths">
8590
+ <xsl:call-template name="calculate-column-widths-proportional">
8627
8591
  <xsl:with-param name="cols-count" select="$cols-count"/>
8628
8592
  <xsl:with-param name="table" select="$toc_table_simple"/>
8629
8593
  </xsl:call-template>
@@ -790,8 +790,18 @@
790
790
 
791
791
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
792
792
 
793
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
794
+ true
795
+ </xsl:variable>
796
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
797
+
793
798
  <xsl:variable name="isGenerateTableIF_">
794
- false
799
+ <xsl:choose>
800
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
801
+ <xsl:value-of select="normalize-space($table_if) = 'true'"/>
802
+ </xsl:when>
803
+ <xsl:otherwise>false</xsl:otherwise>
804
+ </xsl:choose>
795
805
  </xsl:variable>
796
806
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
797
807
 
@@ -1206,6 +1216,9 @@
1206
1216
  <xsl:attribute-set name="import-style">
1207
1217
  </xsl:attribute-set>
1208
1218
 
1219
+ <xsl:attribute-set name="component-style">
1220
+ </xsl:attribute-set>
1221
+
1209
1222
  <xsl:attribute-set name="recommendation-style">
1210
1223
 
1211
1224
  </xsl:attribute-set>
@@ -1397,9 +1410,8 @@
1397
1410
  </xsl:attribute-set>
1398
1411
 
1399
1412
  <xsl:attribute-set name="dt-block-style">
1400
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1413
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1401
1414
 
1402
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
1403
1415
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1404
1416
 
1405
1417
  </xsl:attribute-set>
@@ -2372,6 +2384,7 @@
2372
2384
 
2373
2385
  <xsl:variable name="margin-side">
2374
2386
  <xsl:choose>
2387
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
2375
2388
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2376
2389
  <xsl:otherwise>0</xsl:otherwise>
2377
2390
  </xsl:choose>
@@ -2434,6 +2447,7 @@
2434
2447
  </td>
2435
2448
  </tr>
2436
2449
  -->
2450
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
2437
2451
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2438
2452
 
2439
2453
  </xsl:when>
@@ -2568,12 +2582,17 @@
2568
2582
  <xsl:template name="calculate-column-widths">
2569
2583
  <xsl:param name="table"/>
2570
2584
  <xsl:param name="cols-count"/>
2571
-
2585
+ <xsl:choose>
2586
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
2587
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
2588
+ </xsl:when>
2589
+ <xsl:otherwise>
2572
2590
  <xsl:call-template name="calculate-column-widths-proportional">
2573
2591
  <xsl:with-param name="cols-count" select="$cols-count"/>
2574
2592
  <xsl:with-param name="table" select="$table"/>
2575
2593
  </xsl:call-template>
2576
-
2594
+ </xsl:otherwise>
2595
+ </xsl:choose>
2577
2596
  </xsl:template>
2578
2597
 
2579
2598
  <!-- ================================================== -->
@@ -2751,6 +2770,7 @@
2751
2770
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
2752
2771
  <!-- ================================================== -->
2753
2772
 
2773
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
2754
2774
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
2755
2775
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2756
2776
 
@@ -2762,67 +2782,6 @@
2762
2782
 
2763
2783
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2764
2784
 
2765
- <!-- get current table id -->
2766
- <xsl:variable name="table_id" select="@id"/>
2767
- <!-- find table by id in the file 'table_widths' -->
2768
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2769
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2770
-
2771
- <!-- table='<xsl:copy-of select="$table"/>' -->
2772
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2773
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2774
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2775
-
2776
- <xsl:variable name="table_with_cell_widths_">
2777
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2778
- </xsl:variable>
2779
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2780
-
2781
- <!-- <xsl:if test="$table_if_debug = 'true'">
2782
- <xsl:copy-of select="$table_with_cell_widths"/>
2783
- </xsl:if> -->
2784
-
2785
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2786
-
2787
- <xsl:variable name="column_widths_">
2788
- <!-- iteration of columns -->
2789
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2790
- <xsl:variable name="pos" select="position()"/>
2791
- <column>
2792
- <xsl:attribute name="width_max">
2793
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2794
- <xsl:sort select="." data-type="number" order="descending"/>
2795
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2796
- </xsl:for-each>
2797
- </xsl:attribute>
2798
- <xsl:attribute name="width_min">
2799
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2800
- <xsl:sort select="." data-type="number" order="descending"/>
2801
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2802
- </xsl:for-each>
2803
- </xsl:attribute>
2804
- </column>
2805
- </xsl:for-each>
2806
- </xsl:variable>
2807
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2808
-
2809
- <!-- <column_widths>
2810
- <xsl:copy-of select="$column_widths"/>
2811
- </column_widths> -->
2812
-
2813
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2814
- <xsl:variable name="table_widths_">
2815
- <table>
2816
- <xsl:attribute name="width_max">
2817
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2818
- </xsl:attribute>
2819
- <xsl:attribute name="width_min">
2820
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2821
- </xsl:attribute>
2822
- </table>
2823
- </xsl:variable>
2824
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2825
-
2826
2785
  <xsl:variable name="page_width">
2827
2786
  <xsl:choose>
2828
2787
  <xsl:when test="$parent_table_page-width != ''">
@@ -2835,16 +2794,13 @@
2835
2794
  </xsl:variable>
2836
2795
 
2837
2796
  <xsl:if test="$table_if_debug = 'true'">
2838
- <table_width>
2839
- <xsl:copy-of select="$table_widths"/>
2840
- </table_width>
2841
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2797
+ <page_width><xsl:value-of select="$page_width"/></page_width>
2842
2798
  </xsl:if>
2843
2799
 
2844
2800
  <!-- There are three cases: -->
2845
2801
  <xsl:choose>
2846
2802
  <!-- 1. The minimum table width is equal to or wider than the available space -->
2847
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2803
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2848
2804
  <!-- call old algorithm -->
2849
2805
  <case1/>
2850
2806
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -2854,10 +2810,10 @@
2854
2810
  </xsl:call-template> -->
2855
2811
  </xsl:when>
2856
2812
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2857
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2813
+ <xsl:when test="@width_max &lt;= $page_width">
2858
2814
  <case2/>
2859
2815
  <autolayout/>
2860
- <xsl:for-each select="$column_widths/column/@width_max">
2816
+ <xsl:for-each select="column/@width_max">
2861
2817
  <column divider="100"><xsl:value-of select="."/></column>
2862
2818
  </xsl:for-each>
2863
2819
  </xsl:when>
@@ -2867,19 +2823,19 @@
2867
2823
  For each column, let d be the difference between maximum and minimum width of that column.
2868
2824
  Now set the column's width to the minimum width plus d times W over D.
2869
2825
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2870
- <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)">
2826
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
2871
2827
  <!-- difference between the available space and the minimum table width -->
2872
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2828
+ <xsl:variable name="W" select="$page_width - @width_min"/>
2873
2829
  <W><xsl:value-of select="$W"/></W>
2874
2830
  <!-- difference between maximum and minimum width of the table -->
2875
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2831
+ <xsl:variable name="D" select="@width_max - @width_min"/>
2876
2832
  <D><xsl:value-of select="$D"/></D>
2877
2833
  <case3/>
2878
2834
  <autolayout/>
2879
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2835
+ <xsl:if test="@width_min &gt;= $page_width">
2880
2836
  <split_keep-within-line>true</split_keep-within-line>
2881
2837
  </xsl:if>
2882
- <xsl:for-each select="$column_widths/column">
2838
+ <xsl:for-each select="column">
2883
2839
  <!-- difference between maximum and minimum width of that column. -->
2884
2840
  <xsl:variable name="d" select="@width_max - @width_min"/>
2885
2841
  <d><xsl:value-of select="$d"/></d>
@@ -2905,23 +2861,39 @@
2905
2861
 
2906
2862
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
2907
2863
 
2864
+ <ancestor_tree>
2865
+ <xsl:for-each select="ancestor::*">
2866
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
2867
+ </xsl:for-each>
2868
+ </ancestor_tree>
2869
+
2908
2870
  <xsl:variable name="parent_table_page-width_">
2909
2871
  <xsl:if test="$parent_table_id != ''">
2910
2872
  <!-- determine column number in the parent table -->
2911
2873
  <xsl:variable name="parent_table_column_number">
2912
2874
  <xsl:choose>
2913
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
2875
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
2876
+ <xsl:when test="(ancestor::*[local-name() = 'dd' or local-name() = 'table' or local-name() = 'dl'])[last()][local-name() = 'dd' or local-name() = 'dl']">2</xsl:when>
2914
2877
  <xsl:otherwise> <!-- parent is table -->
2915
2878
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
2916
2879
  </xsl:otherwise>
2917
2880
  </xsl:choose>
2918
2881
  </xsl:variable>
2919
2882
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
2920
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2883
+
2884
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2885
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
2886
+ <!-- <xsl:variable name="divider">
2887
+ <xsl:value-of select="$parent_table_column/@divider"/>
2888
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
2889
+ </xsl:variable> -->
2890
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
2921
2891
  </xsl:if>
2922
2892
  </xsl:variable>
2923
2893
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
2924
2894
 
2895
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
2896
+
2925
2897
  <!-- get current table id -->
2926
2898
  <xsl:variable name="table_id" select="@id"/>
2927
2899
 
@@ -2942,50 +2914,6 @@
2942
2914
 
2943
2915
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
2944
2916
 
2945
- <!-- ============================= -->
2946
- <!-- mode: determine_cell_widths-if -->
2947
- <!-- ============================= -->
2948
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
2949
- <xsl:copy>
2950
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2951
- </xsl:copy>
2952
- </xsl:template>
2953
-
2954
- <xsl:template match="td | th" mode="determine_cell_widths-if">
2955
- <xsl:copy>
2956
- <xsl:copy-of select="@*"/>
2957
-
2958
- <!-- The maximum width is given by the widest line. -->
2959
- <xsl:attribute name="width_max">
2960
- <xsl:for-each select="p_len">
2961
- <xsl:sort select="." data-type="number" order="descending"/>
2962
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2963
- </xsl:for-each>
2964
- </xsl:attribute>
2965
-
2966
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2967
- <xsl:variable name="width_min">
2968
- <xsl:for-each select="word_len">
2969
- <xsl:sort select="." data-type="number" order="descending"/>
2970
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2971
- </xsl:for-each>
2972
- </xsl:variable>
2973
- <xsl:attribute name="width_min">
2974
- <xsl:value-of select="$width_min"/>
2975
- </xsl:attribute>
2976
-
2977
- <xsl:if test="$width_min = 0">
2978
- <xsl:attribute name="width_min">1</xsl:attribute>
2979
- </xsl:if>
2980
-
2981
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2982
-
2983
- </xsl:copy>
2984
- </xsl:template>
2985
- <!-- ============================= -->
2986
- <!-- END mode: determine_cell_widths-if -->
2987
- <!-- ============================= -->
2988
-
2989
2917
  <!-- ================================================== -->
2990
2918
  <!-- Calculate column's width based on HTML4 algorithm -->
2991
2919
  <!-- ================================================== -->
@@ -3176,6 +3104,7 @@
3176
3104
  <xsl:when test="$table_or_dl = 'table'">
3177
3105
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3178
3106
  <fo:table-row number-columns-spanned="{$col_count}">
3107
+ <xsl:copy-of select="../@font-weight"/>
3179
3108
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3180
3109
  <xsl:call-template name="td"/>
3181
3110
  </fo:table-row>
@@ -3322,7 +3251,7 @@
3322
3251
 
3323
3252
  <xsl:apply-templates/>
3324
3253
 
3325
- <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"/> -->
3254
+ <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"/> -->
3326
3255
 
3327
3256
  </fo:block>
3328
3257
  </fo:table-cell>
@@ -3648,6 +3577,7 @@
3648
3577
  <xsl:template match="*[local-name()='dl']">
3649
3578
  <xsl:variable name="isAdded" select="@added"/>
3650
3579
  <xsl:variable name="isDeleted" select="@deleted"/>
3580
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
3651
3581
  <fo:block-container>
3652
3582
 
3653
3583
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -4185,21 +4115,16 @@
4185
4115
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
4186
4116
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
4187
4117
  <xsl:param name="id"/>
4188
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4189
4118
  <tr>
4190
4119
  <td>
4191
4120
  <xsl:copy-of select="node()"/>
4192
4121
  </td>
4193
4122
  <td>
4194
-
4195
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4196
-
4197
- <!-- get paragraphs from nested 'dl' -->
4198
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4199
-
4123
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4124
+ <!-- get paragraphs from nested 'dl' -->
4125
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4200
4126
  </td>
4201
4127
  </tr>
4202
-
4203
4128
  </xsl:template>
4204
4129
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4205
4130
 
@@ -4851,6 +4776,9 @@
4851
4776
  <xsl:variable name="td">
4852
4777
  <xsl:element name="td">
4853
4778
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
4779
+ <xsl:if test="local-name()='th'">
4780
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4781
+ </xsl:if>
4854
4782
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4855
4783
  <xsl:apply-templates mode="simple-table-colspan"/>
4856
4784
  </xsl:element>
@@ -4863,6 +4791,9 @@
4863
4791
  <xsl:otherwise>
4864
4792
  <xsl:element name="td">
4865
4793
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4794
+ <xsl:if test="local-name()='th'">
4795
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4796
+ </xsl:if>
4866
4797
  <xsl:apply-templates mode="simple-table-colspan"/>
4867
4798
  </xsl:element>
4868
4799
  </xsl:otherwise>
@@ -4992,8 +4923,14 @@
4992
4923
  <xsl:copy-of select="@*"/>
4993
4924
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4994
4925
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4926
+ <xsl:variable name="divide">
4927
+ <xsl:choose>
4928
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
4929
+ <xsl:otherwise>1</xsl:otherwise>
4930
+ </xsl:choose>
4931
+ </xsl:variable>
4995
4932
  <xsl:attribute name="id">
4996
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4933
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
4997
4934
  </xsl:attribute>
4998
4935
 
4999
4936
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5001,10 +4938,12 @@
5001
4938
  <xsl:copy-of select="@*"/>
5002
4939
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5003
4940
  <xsl:attribute name="id">
5004
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4941
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5005
4942
  </xsl:attribute>
5006
4943
 
5007
- <xsl:copy-of select="node()"/>
4944
+ <!-- <xsl:copy-of select="node()" /> -->
4945
+ <xsl:apply-templates mode="simple-table-noid"/>
4946
+
5008
4947
  </xsl:copy>
5009
4948
  </xsl:for-each>
5010
4949
 
@@ -5033,7 +4972,7 @@
5033
4972
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5034
4973
  <xsl:copy>
5035
4974
  <xsl:attribute name="id">
5036
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4975
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5037
4976
  </xsl:attribute>
5038
4977
  <xsl:copy-of select="node()"/>
5039
4978
  </xsl:copy>
@@ -5042,6 +4981,24 @@
5042
4981
  </xsl:copy>
5043
4982
 
5044
4983
  </xsl:template>
4984
+
4985
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
4986
+ <xsl:copy>
4987
+ <xsl:choose>
4988
+ <xsl:when test="$isGenerateTableIF = 'true'">
4989
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
4990
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
4991
+ <xsl:copy-of select="@id"/>
4992
+ </xsl:if> -->
4993
+ </xsl:when>
4994
+ <xsl:otherwise>
4995
+ <xsl:copy-of select="@*"/>
4996
+ </xsl:otherwise>
4997
+ </xsl:choose>
4998
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
4999
+ </xsl:copy>
5000
+ </xsl:template>
5001
+
5045
5002
  <!-- End mode: simple-table-id -->
5046
5003
  <!-- ===================== -->
5047
5004
  <!-- ===================== -->
@@ -5051,7 +5008,7 @@
5051
5008
  <!-- =============================== -->
5052
5009
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
5053
5010
  <xsl:copy>
5054
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5011
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5055
5012
  </xsl:copy>
5056
5013
  </xsl:template>
5057
5014
 
@@ -5165,6 +5122,10 @@
5165
5122
 
5166
5123
  <fo:inline xsl:use-attribute-sets="mathml-style">
5167
5124
 
5125
+ <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
5126
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
5127
+ </xsl:if>
5128
+
5168
5129
  <xsl:call-template name="setTrackChangesStyles">
5169
5130
  <xsl:with-param name="isAdded" select="$isAdded"/>
5170
5131
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -7044,41 +7005,47 @@
7044
7005
  </fo:block>
7045
7006
  </xsl:template>
7046
7007
 
7047
- <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
7008
+ <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
7048
7009
  <fo:block xsl:use-attribute-sets="inherit-style">
7049
7010
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
7050
7011
  </fo:block>
7051
7012
  </xsl:template>
7052
7013
 
7053
- <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
7014
+ <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description'] | *[local-name() = 'div'][@type = 'requirement-description'] | *[local-name() = 'div'][@type = 'recommendation-description'] | *[local-name() = 'div'][@type = 'permission-description']">
7054
7015
  <fo:block xsl:use-attribute-sets="description-style">
7055
7016
  <xsl:apply-templates/>
7056
7017
  </fo:block>
7057
7018
  </xsl:template>
7058
7019
 
7059
- <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
7020
+ <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification'] | *[local-name() = 'div'][@type = 'requirement-specification'] | *[local-name() = 'div'][@type = 'recommendation-specification'] | *[local-name() = 'div'][@type = 'permission-specification']">
7060
7021
  <fo:block xsl:use-attribute-sets="specification-style">
7061
7022
  <xsl:apply-templates/>
7062
7023
  </fo:block>
7063
7024
  </xsl:template>
7064
7025
 
7065
- <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
7026
+ <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target'] | *[local-name() = 'div'][@type = 'requirement-measurement-target'] | *[local-name() = 'div'][@type = 'recommendation-measurement-target'] | *[local-name() = 'div'][@type = 'permission-measurement-target']">
7066
7027
  <fo:block xsl:use-attribute-sets="measurement-target-style">
7067
7028
  <xsl:apply-templates/>
7068
7029
  </fo:block>
7069
7030
  </xsl:template>
7070
7031
 
7071
- <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
7032
+ <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification'] | *[local-name() = 'div'][@type = 'requirement-verification'] | *[local-name() = 'div'][@type = 'recommendation-verification'] | *[local-name() = 'div'][@type = 'permission-verification']">
7072
7033
  <fo:block xsl:use-attribute-sets="verification-style">
7073
7034
  <xsl:apply-templates/>
7074
7035
  </fo:block>
7075
7036
  </xsl:template>
7076
7037
 
7077
- <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
7038
+ <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import'] | *[local-name() = 'div'][@type = 'requirement-import'] | *[local-name() = 'div'][@type = 'recommendation-import'] | *[local-name() = 'div'][@type = 'permission-import']">
7078
7039
  <fo:block xsl:use-attribute-sets="import-style">
7079
7040
  <xsl:apply-templates/>
7080
7041
  </fo:block>
7081
7042
  </xsl:template>
7043
+
7044
+ <xsl:template match="*[local-name() = 'div'][starts-with(@type, 'requirement-component')] | *[local-name() = 'div'][starts-with(@type, 'recommendation-component')] | *[local-name() = 'div'][starts-with(@type, 'permission-component')]">
7045
+ <fo:block xsl:use-attribute-sets="component-style">
7046
+ <xsl:apply-templates/>
7047
+ </fo:block>
7048
+ </xsl:template>
7082
7049
  <!-- ========== -->
7083
7050
  <!-- END -->
7084
7051
  <!-- ========== -->
@@ -7134,15 +7101,12 @@
7134
7101
 
7135
7102
  <xsl:template match="*[local-name()='tr']" mode="requirement">
7136
7103
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
7137
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
7138
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
7139
- </xsl:if>
7140
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
7141
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
7142
- </xsl:if>
7143
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
7144
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
7104
+
7105
+ <xsl:if test="parent::*[local-name()='thead'] or starts-with(*[local-name()='td' or local-name()='th'][1], 'Requirement ') or starts-with(*[local-name()='td' or local-name()='th'][1], 'Recommendation ')">
7106
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
7107
+
7145
7108
  </xsl:if>
7109
+
7146
7110
  <xsl:apply-templates mode="requirement"/>
7147
7111
  </fo:table-row>
7148
7112
  </xsl:template>
@@ -8623,7 +8587,7 @@
8623
8587
  </tbody>
8624
8588
  </xsl:variable>
8625
8589
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
8626
- <xsl:call-template name="calculate-column-widths">
8590
+ <xsl:call-template name="calculate-column-widths-proportional">
8627
8591
  <xsl:with-param name="cols-count" select="$cols-count"/>
8628
8592
  <xsl:with-param name="table" select="$toc_table_simple"/>
8629
8593
  </xsl:call-template>
@@ -225,9 +225,9 @@
225
225
  <zeroOrMore>
226
226
  <ref name="forename"/>
227
227
  </zeroOrMore>
228
- <zeroOrMore>
229
- <ref name="initial"/>
230
- </zeroOrMore>
228
+ <optional>
229
+ <ref name="formatted-initials"/>
230
+ </optional>
231
231
  <ref name="surname"/>
232
232
  <zeroOrMore>
233
233
  <ref name="addition"/>
@@ -247,8 +247,8 @@
247
247
  <ref name="LocalizedString"/>
248
248
  </element>
249
249
  </define>
250
- <define name="initial">
251
- <element name="initial">
250
+ <define name="formatted-initials">
251
+ <element name="formatted-initials">
252
252
  <ref name="LocalizedString"/>
253
253
  </element>
254
254
  </define>
@@ -264,6 +264,9 @@
264
264
  </define>
265
265
  <define name="forename">
266
266
  <element name="forename">
267
+ <optional>
268
+ <attribute name="initial"/>
269
+ </optional>
267
270
  <ref name="LocalizedString"/>
268
271
  </element>
269
272
  </define>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.6.6".freeze
3
+ VERSION = "0.6.8.1".freeze
4
4
  end
5
5
  end
data/lib/metanorma-iho.rb CHANGED
@@ -6,8 +6,9 @@ require_relative "isodoc/iho/word_convert"
6
6
  require_relative "isodoc/iho/pdf_convert"
7
7
  require_relative "isodoc/iho/presentation_xml_convert"
8
8
  require_relative "metanorma/iho/version"
9
+ require "metanorma"
9
10
 
10
- if defined? Metanorma
11
+ if defined? Metanorma::Registry
11
12
  require_relative "metanorma/iho"
12
13
  Metanorma::Registry.instance.register(Metanorma::IHO::Processor)
13
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -175,6 +175,7 @@ extensions: []
175
175
  extra_rdoc_files: []
176
176
  files:
177
177
  - ".github/workflows/rake.yml"
178
+ - ".github/workflows/release.yml"
178
179
  - ".gitignore"
179
180
  - ".hound.yml"
180
181
  - ".rubocop.yml"
@@ -235,7 +236,7 @@ homepage: https://github.com/metanorma/metanorma-iho
235
236
  licenses:
236
237
  - BSD-2-Clause
237
238
  metadata: {}
238
- post_install_message:
239
+ post_install_message:
239
240
  rdoc_options: []
240
241
  require_paths:
241
242
  - lib
@@ -250,8 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
251
  - !ruby/object:Gem::Version
251
252
  version: '0'
252
253
  requirements: []
253
- rubygems_version: 3.3.16
254
- signing_key:
254
+ rubygems_version: 3.1.6
255
+ signing_key:
255
256
  specification_version: 4
256
257
  summary: metanorma-iho lets you write IHO in AsciiDoc.
257
258
  test_files: []