metanorma-bipm 2.1.7 → 2.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1724,8 +1724,18 @@
1724
1724
 
1725
1725
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
1726
1726
 
1727
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
1728
+ true
1729
+ </xsl:variable>
1730
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
1731
+
1727
1732
  <xsl:variable name="isGenerateTableIF_">
1728
- false
1733
+ <xsl:choose>
1734
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
1735
+ <xsl:value-of select="normalize-space($table_if) = 'true'"/>
1736
+ </xsl:when>
1737
+ <xsl:otherwise>false</xsl:otherwise>
1738
+ </xsl:choose>
1729
1739
  </xsl:variable>
1730
1740
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
1731
1741
 
@@ -2348,9 +2358,7 @@
2348
2358
  </xsl:attribute-set>
2349
2359
 
2350
2360
  <xsl:attribute-set name="dt-block-style">
2351
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
2352
-
2353
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
2361
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
2354
2362
 
2355
2363
  </xsl:attribute-set>
2356
2364
 
@@ -3322,6 +3330,7 @@
3322
3330
 
3323
3331
  <xsl:variable name="margin-side">
3324
3332
  <xsl:choose>
3333
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
3325
3334
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3326
3335
  <xsl:otherwise>0</xsl:otherwise>
3327
3336
  </xsl:choose>
@@ -3388,6 +3397,7 @@
3388
3397
  </td>
3389
3398
  </tr>
3390
3399
  -->
3400
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
3391
3401
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
3392
3402
 
3393
3403
  </xsl:when>
@@ -3524,12 +3534,17 @@
3524
3534
  <xsl:template name="calculate-column-widths">
3525
3535
  <xsl:param name="table"/>
3526
3536
  <xsl:param name="cols-count"/>
3527
-
3537
+ <xsl:choose>
3538
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
3539
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
3540
+ </xsl:when>
3541
+ <xsl:otherwise>
3528
3542
  <xsl:call-template name="calculate-column-widths-proportional">
3529
3543
  <xsl:with-param name="cols-count" select="$cols-count"/>
3530
3544
  <xsl:with-param name="table" select="$table"/>
3531
3545
  </xsl:call-template>
3532
-
3546
+ </xsl:otherwise>
3547
+ </xsl:choose>
3533
3548
  </xsl:template>
3534
3549
 
3535
3550
  <!-- ================================================== -->
@@ -3707,6 +3722,7 @@
3707
3722
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
3708
3723
  <!-- ================================================== -->
3709
3724
 
3725
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
3710
3726
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
3711
3727
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
3712
3728
 
@@ -3718,67 +3734,6 @@
3718
3734
 
3719
3735
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
3720
3736
 
3721
- <!-- get current table id -->
3722
- <xsl:variable name="table_id" select="@id"/>
3723
- <!-- find table by id in the file 'table_widths' -->
3724
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
3725
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
3726
-
3727
- <!-- table='<xsl:copy-of select="$table"/>' -->
3728
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
3729
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
3730
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
3731
-
3732
- <xsl:variable name="table_with_cell_widths_">
3733
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
3734
- </xsl:variable>
3735
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
3736
-
3737
- <!-- <xsl:if test="$table_if_debug = 'true'">
3738
- <xsl:copy-of select="$table_with_cell_widths"/>
3739
- </xsl:if> -->
3740
-
3741
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
3742
-
3743
- <xsl:variable name="column_widths_">
3744
- <!-- iteration of columns -->
3745
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
3746
- <xsl:variable name="pos" select="position()"/>
3747
- <column>
3748
- <xsl:attribute name="width_max">
3749
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
3750
- <xsl:sort select="." data-type="number" order="descending"/>
3751
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3752
- </xsl:for-each>
3753
- </xsl:attribute>
3754
- <xsl:attribute name="width_min">
3755
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
3756
- <xsl:sort select="." data-type="number" order="descending"/>
3757
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3758
- </xsl:for-each>
3759
- </xsl:attribute>
3760
- </column>
3761
- </xsl:for-each>
3762
- </xsl:variable>
3763
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
3764
-
3765
- <!-- <column_widths>
3766
- <xsl:copy-of select="$column_widths"/>
3767
- </column_widths> -->
3768
-
3769
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
3770
- <xsl:variable name="table_widths_">
3771
- <table>
3772
- <xsl:attribute name="width_max">
3773
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
3774
- </xsl:attribute>
3775
- <xsl:attribute name="width_min">
3776
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
3777
- </xsl:attribute>
3778
- </table>
3779
- </xsl:variable>
3780
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
3781
-
3782
3737
  <xsl:variable name="page_width">
3783
3738
  <xsl:choose>
3784
3739
  <xsl:when test="$parent_table_page-width != ''">
@@ -3791,16 +3746,13 @@
3791
3746
  </xsl:variable>
3792
3747
 
3793
3748
  <xsl:if test="$table_if_debug = 'true'">
3794
- <table_width>
3795
- <xsl:copy-of select="$table_widths"/>
3796
- </table_width>
3797
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
3749
+ <page_width><xsl:value-of select="$page_width"/></page_width>
3798
3750
  </xsl:if>
3799
3751
 
3800
3752
  <!-- There are three cases: -->
3801
3753
  <xsl:choose>
3802
3754
  <!-- 1. The minimum table width is equal to or wider than the available space -->
3803
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
3755
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
3804
3756
  <!-- call old algorithm -->
3805
3757
  <case1/>
3806
3758
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -3810,10 +3762,10 @@
3810
3762
  </xsl:call-template> -->
3811
3763
  </xsl:when>
3812
3764
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
3813
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
3765
+ <xsl:when test="@width_max &lt;= $page_width">
3814
3766
  <case2/>
3815
3767
  <autolayout/>
3816
- <xsl:for-each select="$column_widths/column/@width_max">
3768
+ <xsl:for-each select="column/@width_max">
3817
3769
  <column divider="100"><xsl:value-of select="."/></column>
3818
3770
  </xsl:for-each>
3819
3771
  </xsl:when>
@@ -3823,19 +3775,19 @@
3823
3775
  For each column, let d be the difference between maximum and minimum width of that column.
3824
3776
  Now set the column's width to the minimum width plus d times W over D.
3825
3777
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
3826
- <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)">
3778
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
3827
3779
  <!-- difference between the available space and the minimum table width -->
3828
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
3780
+ <xsl:variable name="W" select="$page_width - @width_min"/>
3829
3781
  <W><xsl:value-of select="$W"/></W>
3830
3782
  <!-- difference between maximum and minimum width of the table -->
3831
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
3783
+ <xsl:variable name="D" select="@width_max - @width_min"/>
3832
3784
  <D><xsl:value-of select="$D"/></D>
3833
3785
  <case3/>
3834
3786
  <autolayout/>
3835
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
3787
+ <xsl:if test="@width_min &gt;= $page_width">
3836
3788
  <split_keep-within-line>true</split_keep-within-line>
3837
3789
  </xsl:if>
3838
- <xsl:for-each select="$column_widths/column">
3790
+ <xsl:for-each select="column">
3839
3791
  <!-- difference between maximum and minimum width of that column. -->
3840
3792
  <xsl:variable name="d" select="@width_max - @width_min"/>
3841
3793
  <d><xsl:value-of select="$d"/></d>
@@ -3861,23 +3813,39 @@
3861
3813
 
3862
3814
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
3863
3815
 
3816
+ <ancestor_tree>
3817
+ <xsl:for-each select="ancestor::*">
3818
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
3819
+ </xsl:for-each>
3820
+ </ancestor_tree>
3821
+
3864
3822
  <xsl:variable name="parent_table_page-width_">
3865
3823
  <xsl:if test="$parent_table_id != ''">
3866
3824
  <!-- determine column number in the parent table -->
3867
3825
  <xsl:variable name="parent_table_column_number">
3868
3826
  <xsl:choose>
3869
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
3827
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
3828
+ <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>
3870
3829
  <xsl:otherwise> <!-- parent is table -->
3871
3830
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
3872
3831
  </xsl:otherwise>
3873
3832
  </xsl:choose>
3874
3833
  </xsl:variable>
3875
3834
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
3876
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
3835
+
3836
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
3837
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
3838
+ <!-- <xsl:variable name="divider">
3839
+ <xsl:value-of select="$parent_table_column/@divider"/>
3840
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
3841
+ </xsl:variable> -->
3842
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
3877
3843
  </xsl:if>
3878
3844
  </xsl:variable>
3879
3845
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
3880
3846
 
3847
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
3848
+
3881
3849
  <!-- get current table id -->
3882
3850
  <xsl:variable name="table_id" select="@id"/>
3883
3851
 
@@ -3898,50 +3866,6 @@
3898
3866
 
3899
3867
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
3900
3868
 
3901
- <!-- ============================= -->
3902
- <!-- mode: determine_cell_widths-if -->
3903
- <!-- ============================= -->
3904
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
3905
- <xsl:copy>
3906
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
3907
- </xsl:copy>
3908
- </xsl:template>
3909
-
3910
- <xsl:template match="td | th" mode="determine_cell_widths-if">
3911
- <xsl:copy>
3912
- <xsl:copy-of select="@*"/>
3913
-
3914
- <!-- The maximum width is given by the widest line. -->
3915
- <xsl:attribute name="width_max">
3916
- <xsl:for-each select="p_len">
3917
- <xsl:sort select="." data-type="number" order="descending"/>
3918
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3919
- </xsl:for-each>
3920
- </xsl:attribute>
3921
-
3922
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
3923
- <xsl:variable name="width_min">
3924
- <xsl:for-each select="word_len">
3925
- <xsl:sort select="." data-type="number" order="descending"/>
3926
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3927
- </xsl:for-each>
3928
- </xsl:variable>
3929
- <xsl:attribute name="width_min">
3930
- <xsl:value-of select="$width_min"/>
3931
- </xsl:attribute>
3932
-
3933
- <xsl:if test="$width_min = 0">
3934
- <xsl:attribute name="width_min">1</xsl:attribute>
3935
- </xsl:if>
3936
-
3937
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
3938
-
3939
- </xsl:copy>
3940
- </xsl:template>
3941
- <!-- ============================= -->
3942
- <!-- END mode: determine_cell_widths-if -->
3943
- <!-- ============================= -->
3944
-
3945
3869
  <!-- ================================================== -->
3946
3870
  <!-- Calculate column's width based on HTML4 algorithm -->
3947
3871
  <!-- ================================================== -->
@@ -4186,6 +4110,7 @@
4186
4110
  <xsl:when test="$table_or_dl = 'table'">
4187
4111
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
4188
4112
  <fo:table-row number-columns-spanned="{$col_count}">
4113
+ <xsl:copy-of select="../@font-weight"/>
4189
4114
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
4190
4115
  <xsl:call-template name="td"/>
4191
4116
  </fo:table-row>
@@ -4350,7 +4275,7 @@
4350
4275
 
4351
4276
  <xsl:apply-templates/>
4352
4277
 
4353
- <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"/> -->
4278
+ <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"/> -->
4354
4279
 
4355
4280
  </fo:block>
4356
4281
  </fo:table-cell>
@@ -4681,6 +4606,7 @@
4681
4606
  <xsl:template match="*[local-name()='dl']">
4682
4607
  <xsl:variable name="isAdded" select="@added"/>
4683
4608
  <xsl:variable name="isDeleted" select="@deleted"/>
4609
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
4684
4610
  <fo:block-container>
4685
4611
 
4686
4612
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -5228,21 +5154,16 @@
5228
5154
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
5229
5155
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
5230
5156
  <xsl:param name="id"/>
5231
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
5232
5157
  <tr>
5233
5158
  <td>
5234
5159
  <xsl:copy-of select="node()"/>
5235
5160
  </td>
5236
5161
  <td>
5237
-
5238
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5239
-
5240
- <!-- get paragraphs from nested 'dl' -->
5241
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5242
-
5162
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5163
+ <!-- get paragraphs from nested 'dl' -->
5164
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5243
5165
  </td>
5244
5166
  </tr>
5245
-
5246
5167
  </xsl:template>
5247
5168
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
5248
5169
 
@@ -5896,6 +5817,9 @@
5896
5817
  <xsl:variable name="td">
5897
5818
  <xsl:element name="td">
5898
5819
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
5820
+ <xsl:if test="local-name()='th'">
5821
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
5822
+ </xsl:if>
5899
5823
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5900
5824
  <xsl:apply-templates mode="simple-table-colspan"/>
5901
5825
  </xsl:element>
@@ -5908,6 +5832,9 @@
5908
5832
  <xsl:otherwise>
5909
5833
  <xsl:element name="td">
5910
5834
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5835
+ <xsl:if test="local-name()='th'">
5836
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
5837
+ </xsl:if>
5911
5838
  <xsl:apply-templates mode="simple-table-colspan"/>
5912
5839
  </xsl:element>
5913
5840
  </xsl:otherwise>
@@ -6037,8 +5964,14 @@
6037
5964
  <xsl:copy-of select="@*"/>
6038
5965
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
6039
5966
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
5967
+ <xsl:variable name="divide">
5968
+ <xsl:choose>
5969
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
5970
+ <xsl:otherwise>1</xsl:otherwise>
5971
+ </xsl:choose>
5972
+ </xsl:variable>
6040
5973
  <xsl:attribute name="id">
6041
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
5974
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
6042
5975
  </xsl:attribute>
6043
5976
 
6044
5977
  <xsl:for-each select="*[local-name() = 'p']">
@@ -6046,10 +5979,12 @@
6046
5979
  <xsl:copy-of select="@*"/>
6047
5980
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
6048
5981
  <xsl:attribute name="id">
6049
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
5982
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
6050
5983
  </xsl:attribute>
6051
5984
 
6052
- <xsl:copy-of select="node()"/>
5985
+ <!-- <xsl:copy-of select="node()" /> -->
5986
+ <xsl:apply-templates mode="simple-table-noid"/>
5987
+
6053
5988
  </xsl:copy>
6054
5989
  </xsl:for-each>
6055
5990
 
@@ -6078,7 +6013,7 @@
6078
6013
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
6079
6014
  <xsl:copy>
6080
6015
  <xsl:attribute name="id">
6081
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
6016
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
6082
6017
  </xsl:attribute>
6083
6018
  <xsl:copy-of select="node()"/>
6084
6019
  </xsl:copy>
@@ -6087,6 +6022,24 @@
6087
6022
  </xsl:copy>
6088
6023
 
6089
6024
  </xsl:template>
6025
+
6026
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
6027
+ <xsl:copy>
6028
+ <xsl:choose>
6029
+ <xsl:when test="$isGenerateTableIF = 'true'">
6030
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
6031
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
6032
+ <xsl:copy-of select="@id"/>
6033
+ </xsl:if> -->
6034
+ </xsl:when>
6035
+ <xsl:otherwise>
6036
+ <xsl:copy-of select="@*"/>
6037
+ </xsl:otherwise>
6038
+ </xsl:choose>
6039
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
6040
+ </xsl:copy>
6041
+ </xsl:template>
6042
+
6090
6043
  <!-- End mode: simple-table-id -->
6091
6044
  <!-- ===================== -->
6092
6045
  <!-- ===================== -->
@@ -6096,7 +6049,7 @@
6096
6049
  <!-- =============================== -->
6097
6050
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
6098
6051
  <xsl:copy>
6099
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
6052
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
6100
6053
  </xsl:copy>
6101
6054
  </xsl:template>
6102
6055
 
@@ -6210,6 +6163,10 @@
6210
6163
 
6211
6164
  <fo:inline xsl:use-attribute-sets="mathml-style">
6212
6165
 
6166
+ <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 -->
6167
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6168
+ </xsl:if>
6169
+
6213
6170
  <xsl:call-template name="setTrackChangesStyles">
6214
6171
  <xsl:with-param name="isAdded" select="$isAdded"/>
6215
6172
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -8190,15 +8147,12 @@
8190
8147
 
8191
8148
  <xsl:template match="*[local-name()='tr']" mode="requirement">
8192
8149
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
8193
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
8194
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
8195
- </xsl:if>
8196
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
8197
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
8198
- </xsl:if>
8199
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
8200
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
8150
+
8151
+ <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 ')">
8152
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
8153
+
8201
8154
  </xsl:if>
8155
+
8202
8156
  <xsl:apply-templates mode="requirement"/>
8203
8157
  </fo:table-row>
8204
8158
  </xsl:template>
@@ -9717,7 +9671,7 @@
9717
9671
  </tbody>
9718
9672
  </xsl:variable>
9719
9673
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
9720
- <xsl:call-template name="calculate-column-widths">
9674
+ <xsl:call-template name="calculate-column-widths-proportional">
9721
9675
  <xsl:with-param name="cols-count" select="$cols-count"/>
9722
9676
  <xsl:with-param name="table" select="$toc_table_simple"/>
9723
9677
  </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 BIPM
3
- VERSION = "2.1.7".freeze
3
+ VERSION = "2.1.8".freeze
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ require "isodoc/bipm"
5
5
 
6
6
  require "asciidoctor" unless defined? Asciidoctor::Converter
7
7
 
8
- if defined? Metanorma
8
+ if defined? Metanorma::Registry
9
9
  require_relative "metanorma/bipm"
10
10
  Metanorma::Registry.instance.register(Metanorma::BIPM::Processor)
11
11
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
28
28
 
29
29
  spec.add_dependency "metanorma-generic", "~> 2.2.0"
30
- spec.add_dependency "metanorma-iso", "~> 2.1.6"
30
+ spec.add_dependency "metanorma-iso", "~> 2.1.8"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.7
4
+ version: 2.1.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
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.6
33
+ version: 2.1.8
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.1.6
40
+ version: 2.1.8
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +217,7 @@ extensions: []
217
217
  extra_rdoc_files: []
218
218
  files:
219
219
  - ".github/workflows/rake.yml"
220
+ - ".github/workflows/release.yml"
220
221
  - ".gitignore"
221
222
  - ".hound.yml"
222
223
  - ".rubocop.yml"
@@ -237,7 +238,6 @@ files:
237
238
  - lib/isodoc/bipm/doccontrol.rb
238
239
  - lib/isodoc/bipm/html/html_bipm_intro.html
239
240
  - lib/isodoc/bipm/html/html_bipm_titlepage.html
240
- - lib/isodoc/bipm/html/htmlstyle.css
241
241
  - lib/isodoc/bipm/html/htmlstyle.scss
242
242
  - lib/isodoc/bipm/html/logo.png
243
243
  - lib/isodoc/bipm/html/scripts.html
@@ -285,7 +285,7 @@ homepage: https://github.com/metanorma/metanorma-bipm
285
285
  licenses:
286
286
  - BSD-2-Clause
287
287
  metadata: {}
288
- post_install_message:
288
+ post_install_message:
289
289
  rdoc_options: []
290
290
  require_paths:
291
291
  - lib
@@ -300,8 +300,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
300
  - !ruby/object:Gem::Version
301
301
  version: '0'
302
302
  requirements: []
303
- rubygems_version: 3.3.16
304
- signing_key:
303
+ rubygems_version: 3.1.6
304
+ signing_key:
305
305
  specification_version: 4
306
306
  summary: metanorma-bipm lets you write BIPM standards in Metanorma.
307
307
  test_files: []