metanorma-iho 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
 
@@ -1400,9 +1410,8 @@
1400
1410
  </xsl:attribute-set>
1401
1411
 
1402
1412
  <xsl:attribute-set name="dt-block-style">
1403
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
1413
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
1404
1414
 
1405
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
1406
1415
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1407
1416
 
1408
1417
  </xsl:attribute-set>
@@ -2375,6 +2384,7 @@
2375
2384
 
2376
2385
  <xsl:variable name="margin-side">
2377
2386
  <xsl:choose>
2387
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
2378
2388
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2379
2389
  <xsl:otherwise>0</xsl:otherwise>
2380
2390
  </xsl:choose>
@@ -2437,6 +2447,7 @@
2437
2447
  </td>
2438
2448
  </tr>
2439
2449
  -->
2450
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
2440
2451
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2441
2452
 
2442
2453
  </xsl:when>
@@ -2571,12 +2582,17 @@
2571
2582
  <xsl:template name="calculate-column-widths">
2572
2583
  <xsl:param name="table"/>
2573
2584
  <xsl:param name="cols-count"/>
2574
-
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>
2575
2590
  <xsl:call-template name="calculate-column-widths-proportional">
2576
2591
  <xsl:with-param name="cols-count" select="$cols-count"/>
2577
2592
  <xsl:with-param name="table" select="$table"/>
2578
2593
  </xsl:call-template>
2579
-
2594
+ </xsl:otherwise>
2595
+ </xsl:choose>
2580
2596
  </xsl:template>
2581
2597
 
2582
2598
  <!-- ================================================== -->
@@ -2754,6 +2770,7 @@
2754
2770
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
2755
2771
  <!-- ================================================== -->
2756
2772
 
2773
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
2757
2774
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
2758
2775
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2759
2776
 
@@ -2765,67 +2782,6 @@
2765
2782
 
2766
2783
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2767
2784
 
2768
- <!-- get current table id -->
2769
- <xsl:variable name="table_id" select="@id"/>
2770
- <!-- find table by id in the file 'table_widths' -->
2771
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2772
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2773
-
2774
- <!-- table='<xsl:copy-of select="$table"/>' -->
2775
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2776
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2777
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2778
-
2779
- <xsl:variable name="table_with_cell_widths_">
2780
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2781
- </xsl:variable>
2782
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2783
-
2784
- <!-- <xsl:if test="$table_if_debug = 'true'">
2785
- <xsl:copy-of select="$table_with_cell_widths"/>
2786
- </xsl:if> -->
2787
-
2788
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2789
-
2790
- <xsl:variable name="column_widths_">
2791
- <!-- iteration of columns -->
2792
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2793
- <xsl:variable name="pos" select="position()"/>
2794
- <column>
2795
- <xsl:attribute name="width_max">
2796
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2797
- <xsl:sort select="." data-type="number" order="descending"/>
2798
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2799
- </xsl:for-each>
2800
- </xsl:attribute>
2801
- <xsl:attribute name="width_min">
2802
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2803
- <xsl:sort select="." data-type="number" order="descending"/>
2804
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2805
- </xsl:for-each>
2806
- </xsl:attribute>
2807
- </column>
2808
- </xsl:for-each>
2809
- </xsl:variable>
2810
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2811
-
2812
- <!-- <column_widths>
2813
- <xsl:copy-of select="$column_widths"/>
2814
- </column_widths> -->
2815
-
2816
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2817
- <xsl:variable name="table_widths_">
2818
- <table>
2819
- <xsl:attribute name="width_max">
2820
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2821
- </xsl:attribute>
2822
- <xsl:attribute name="width_min">
2823
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2824
- </xsl:attribute>
2825
- </table>
2826
- </xsl:variable>
2827
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2828
-
2829
2785
  <xsl:variable name="page_width">
2830
2786
  <xsl:choose>
2831
2787
  <xsl:when test="$parent_table_page-width != ''">
@@ -2838,16 +2794,13 @@
2838
2794
  </xsl:variable>
2839
2795
 
2840
2796
  <xsl:if test="$table_if_debug = 'true'">
2841
- <table_width>
2842
- <xsl:copy-of select="$table_widths"/>
2843
- </table_width>
2844
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2797
+ <page_width><xsl:value-of select="$page_width"/></page_width>
2845
2798
  </xsl:if>
2846
2799
 
2847
2800
  <!-- There are three cases: -->
2848
2801
  <xsl:choose>
2849
2802
  <!-- 1. The minimum table width is equal to or wider than the available space -->
2850
- <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 -->
2851
2804
  <!-- call old algorithm -->
2852
2805
  <case1/>
2853
2806
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -2857,10 +2810,10 @@
2857
2810
  </xsl:call-template> -->
2858
2811
  </xsl:when>
2859
2812
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2860
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2813
+ <xsl:when test="@width_max &lt;= $page_width">
2861
2814
  <case2/>
2862
2815
  <autolayout/>
2863
- <xsl:for-each select="$column_widths/column/@width_max">
2816
+ <xsl:for-each select="column/@width_max">
2864
2817
  <column divider="100"><xsl:value-of select="."/></column>
2865
2818
  </xsl:for-each>
2866
2819
  </xsl:when>
@@ -2870,19 +2823,19 @@
2870
2823
  For each column, let d be the difference between maximum and minimum width of that column.
2871
2824
  Now set the column's width to the minimum width plus d times W over D.
2872
2825
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2873
- <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)">
2874
2827
  <!-- difference between the available space and the minimum table width -->
2875
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2828
+ <xsl:variable name="W" select="$page_width - @width_min"/>
2876
2829
  <W><xsl:value-of select="$W"/></W>
2877
2830
  <!-- difference between maximum and minimum width of the table -->
2878
- <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"/>
2879
2832
  <D><xsl:value-of select="$D"/></D>
2880
2833
  <case3/>
2881
2834
  <autolayout/>
2882
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2835
+ <xsl:if test="@width_min &gt;= $page_width">
2883
2836
  <split_keep-within-line>true</split_keep-within-line>
2884
2837
  </xsl:if>
2885
- <xsl:for-each select="$column_widths/column">
2838
+ <xsl:for-each select="column">
2886
2839
  <!-- difference between maximum and minimum width of that column. -->
2887
2840
  <xsl:variable name="d" select="@width_max - @width_min"/>
2888
2841
  <d><xsl:value-of select="$d"/></d>
@@ -2908,23 +2861,39 @@
2908
2861
 
2909
2862
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
2910
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
+
2911
2870
  <xsl:variable name="parent_table_page-width_">
2912
2871
  <xsl:if test="$parent_table_id != ''">
2913
2872
  <!-- determine column number in the parent table -->
2914
2873
  <xsl:variable name="parent_table_column_number">
2915
2874
  <xsl:choose>
2916
- <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>
2917
2877
  <xsl:otherwise> <!-- parent is table -->
2918
2878
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
2919
2879
  </xsl:otherwise>
2920
2880
  </xsl:choose>
2921
2881
  </xsl:variable>
2922
2882
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
2923
- <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 -->
2924
2891
  </xsl:if>
2925
2892
  </xsl:variable>
2926
2893
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
2927
2894
 
2895
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
2896
+
2928
2897
  <!-- get current table id -->
2929
2898
  <xsl:variable name="table_id" select="@id"/>
2930
2899
 
@@ -2945,50 +2914,6 @@
2945
2914
 
2946
2915
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
2947
2916
 
2948
- <!-- ============================= -->
2949
- <!-- mode: determine_cell_widths-if -->
2950
- <!-- ============================= -->
2951
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
2952
- <xsl:copy>
2953
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2954
- </xsl:copy>
2955
- </xsl:template>
2956
-
2957
- <xsl:template match="td | th" mode="determine_cell_widths-if">
2958
- <xsl:copy>
2959
- <xsl:copy-of select="@*"/>
2960
-
2961
- <!-- The maximum width is given by the widest line. -->
2962
- <xsl:attribute name="width_max">
2963
- <xsl:for-each select="p_len">
2964
- <xsl:sort select="." data-type="number" order="descending"/>
2965
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2966
- </xsl:for-each>
2967
- </xsl:attribute>
2968
-
2969
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2970
- <xsl:variable name="width_min">
2971
- <xsl:for-each select="word_len">
2972
- <xsl:sort select="." data-type="number" order="descending"/>
2973
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2974
- </xsl:for-each>
2975
- </xsl:variable>
2976
- <xsl:attribute name="width_min">
2977
- <xsl:value-of select="$width_min"/>
2978
- </xsl:attribute>
2979
-
2980
- <xsl:if test="$width_min = 0">
2981
- <xsl:attribute name="width_min">1</xsl:attribute>
2982
- </xsl:if>
2983
-
2984
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2985
-
2986
- </xsl:copy>
2987
- </xsl:template>
2988
- <!-- ============================= -->
2989
- <!-- END mode: determine_cell_widths-if -->
2990
- <!-- ============================= -->
2991
-
2992
2917
  <!-- ================================================== -->
2993
2918
  <!-- Calculate column's width based on HTML4 algorithm -->
2994
2919
  <!-- ================================================== -->
@@ -3179,6 +3104,7 @@
3179
3104
  <xsl:when test="$table_or_dl = 'table'">
3180
3105
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3181
3106
  <fo:table-row number-columns-spanned="{$col_count}">
3107
+ <xsl:copy-of select="../@font-weight"/>
3182
3108
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3183
3109
  <xsl:call-template name="td"/>
3184
3110
  </fo:table-row>
@@ -3325,7 +3251,7 @@
3325
3251
 
3326
3252
  <xsl:apply-templates/>
3327
3253
 
3328
- <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"/> -->
3329
3255
 
3330
3256
  </fo:block>
3331
3257
  </fo:table-cell>
@@ -3651,6 +3577,7 @@
3651
3577
  <xsl:template match="*[local-name()='dl']">
3652
3578
  <xsl:variable name="isAdded" select="@added"/>
3653
3579
  <xsl:variable name="isDeleted" select="@deleted"/>
3580
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
3654
3581
  <fo:block-container>
3655
3582
 
3656
3583
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -4188,21 +4115,16 @@
4188
4115
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
4189
4116
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
4190
4117
  <xsl:param name="id"/>
4191
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4192
4118
  <tr>
4193
4119
  <td>
4194
4120
  <xsl:copy-of select="node()"/>
4195
4121
  </td>
4196
4122
  <td>
4197
-
4198
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4199
-
4200
- <!-- get paragraphs from nested 'dl' -->
4201
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4202
-
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"/>
4203
4126
  </td>
4204
4127
  </tr>
4205
-
4206
4128
  </xsl:template>
4207
4129
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
4208
4130
 
@@ -4854,6 +4776,9 @@
4854
4776
  <xsl:variable name="td">
4855
4777
  <xsl:element name="td">
4856
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>
4857
4782
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4858
4783
  <xsl:apply-templates mode="simple-table-colspan"/>
4859
4784
  </xsl:element>
@@ -4866,6 +4791,9 @@
4866
4791
  <xsl:otherwise>
4867
4792
  <xsl:element name="td">
4868
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>
4869
4797
  <xsl:apply-templates mode="simple-table-colspan"/>
4870
4798
  </xsl:element>
4871
4799
  </xsl:otherwise>
@@ -4995,8 +4923,14 @@
4995
4923
  <xsl:copy-of select="@*"/>
4996
4924
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4997
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>
4998
4932
  <xsl:attribute name="id">
4999
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4933
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5000
4934
  </xsl:attribute>
5001
4935
 
5002
4936
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5004,10 +4938,12 @@
5004
4938
  <xsl:copy-of select="@*"/>
5005
4939
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5006
4940
  <xsl:attribute name="id">
5007
- <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)"/>
5008
4942
  </xsl:attribute>
5009
4943
 
5010
- <xsl:copy-of select="node()"/>
4944
+ <!-- <xsl:copy-of select="node()" /> -->
4945
+ <xsl:apply-templates mode="simple-table-noid"/>
4946
+
5011
4947
  </xsl:copy>
5012
4948
  </xsl:for-each>
5013
4949
 
@@ -5036,7 +4972,7 @@
5036
4972
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5037
4973
  <xsl:copy>
5038
4974
  <xsl:attribute name="id">
5039
- <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)"/>
5040
4976
  </xsl:attribute>
5041
4977
  <xsl:copy-of select="node()"/>
5042
4978
  </xsl:copy>
@@ -5045,6 +4981,24 @@
5045
4981
  </xsl:copy>
5046
4982
 
5047
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
+
5048
5002
  <!-- End mode: simple-table-id -->
5049
5003
  <!-- ===================== -->
5050
5004
  <!-- ===================== -->
@@ -5054,7 +5008,7 @@
5054
5008
  <!-- =============================== -->
5055
5009
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
5056
5010
  <xsl:copy>
5057
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5011
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5058
5012
  </xsl:copy>
5059
5013
  </xsl:template>
5060
5014
 
@@ -5168,6 +5122,10 @@
5168
5122
 
5169
5123
  <fo:inline xsl:use-attribute-sets="mathml-style">
5170
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
+
5171
5129
  <xsl:call-template name="setTrackChangesStyles">
5172
5130
  <xsl:with-param name="isAdded" select="$isAdded"/>
5173
5131
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -7143,15 +7101,12 @@
7143
7101
 
7144
7102
  <xsl:template match="*[local-name()='tr']" mode="requirement">
7145
7103
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
7146
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
7147
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
7148
- </xsl:if>
7149
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
7150
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
7151
- </xsl:if>
7152
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
7153
- <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
+
7154
7108
  </xsl:if>
7109
+
7155
7110
  <xsl:apply-templates mode="requirement"/>
7156
7111
  </fo:table-row>
7157
7112
  </xsl:template>
@@ -8632,7 +8587,7 @@
8632
8587
  </tbody>
8633
8588
  </xsl:variable>
8634
8589
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
8635
- <xsl:call-template name="calculate-column-widths">
8590
+ <xsl:call-template name="calculate-column-widths-proportional">
8636
8591
  <xsl:with-param name="cols-count" select="$cols-count"/>
8637
8592
  <xsl:with-param name="table" select="$toc_table_simple"/>
8638
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.7".freeze
3
+ VERSION = "0.6.8".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.7
4
+ version: 0.6.8
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-24 00:00:00.000000000 Z
11
+ date: 2022-09-06 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"
@@ -190,9 +191,7 @@ files:
190
191
  - lib/isodoc/iho/html/header.html
191
192
  - lib/isodoc/iho/html/html_iho_intro.html
192
193
  - lib/isodoc/iho/html/html_iho_titlepage.html
193
- - lib/isodoc/iho/html/htmlstyle.css
194
194
  - lib/isodoc/iho/html/htmlstyle.scss
195
- - lib/isodoc/iho/html/iho.css
196
195
  - lib/isodoc/iho/html/iho.scss
197
196
  - lib/isodoc/iho/html/image001.png
198
197
  - lib/isodoc/iho/html/image002.png
@@ -202,7 +201,6 @@ files:
202
201
  - lib/isodoc/iho/html/scripts.html
203
202
  - lib/isodoc/iho/html/word_iho_intro.html
204
203
  - lib/isodoc/iho/html/word_iho_titlepage.html
205
- - lib/isodoc/iho/html/wordstyle.css
206
204
  - lib/isodoc/iho/html/wordstyle.scss
207
205
  - lib/isodoc/iho/html_convert.rb
208
206
  - lib/isodoc/iho/i18n-en.yaml
@@ -235,7 +233,7 @@ homepage: https://github.com/metanorma/metanorma-iho
235
233
  licenses:
236
234
  - BSD-2-Clause
237
235
  metadata: {}
238
- post_install_message:
236
+ post_install_message:
239
237
  rdoc_options: []
240
238
  require_paths:
241
239
  - lib
@@ -250,8 +248,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
248
  - !ruby/object:Gem::Version
251
249
  version: '0'
252
250
  requirements: []
253
- rubygems_version: 3.3.16
254
- signing_key:
251
+ rubygems_version: 3.1.6
252
+ signing_key:
255
253
  specification_version: 4
256
254
  summary: metanorma-iho lets you write IHO in AsciiDoc.
257
255
  test_files: []