metanorma-iec 2.1.7 → 2.1.8

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: 4afce5e220b03c361d1e929740e285055336eab64aa92a0856365a7ad85211af
4
- data.tar.gz: a8a7ffc0585f3c39ad6987df9480ee8d8141262ab3f9abab6000677dcf2892b3
3
+ metadata.gz: 0e527d84c01c2fec15944e1fd17ab3f2fbb26f89d709e4cdcb16469976a1ff56
4
+ data.tar.gz: de81afc3ff72dcc616e0ca0a58c771215b0ccca07f0f0ddefef7925bc34d07bc
5
5
  SHA512:
6
- metadata.gz: b3b5db6bd6b3c2066e0c241accb161ec82a43776bb5837436ad5597524abe4a12dcbe70b7d9ad74dba3e19f0c3b2cdd12502da27ad501679f1838cff9a787626
7
- data.tar.gz: ed78bec4055ad094af71ceb2593d0463910f97960aa33efc66197b19e7c85482d3d27b7079c1aab8d3408be711bdaf715b97eb2649fff2e12c3a587651fb0343
6
+ metadata.gz: 9b27a083093bacd9bb02bd57968f228be5261a49667c98452b51509f492d465ae2cdc18f87c4fc6fef0c3f1067a4a2122aad9ab4fc57d07923b650b8dceb6421
7
+ data.tar.gz: b500e4f510aaa241426bef0a2520c87faa136194e710213cc82f70e86dbb54d0da29c3d42bcf123f8cf57ae6521e433f7b870e87e6e51c8170ff03cd2d447969
@@ -10,6 +10,6 @@ on:
10
10
 
11
11
  jobs:
12
12
  notify:
13
- uses: metanorma/metanorma-build-scripts/.github/workflows/mn-processor-rake.yml@main
13
+ uses: metanorma/ci/.github/workflows/mn-processor-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
+
@@ -18,7 +18,7 @@
18
18
  <p class="coverpage_techcommittee"><a
19
19
  name="CVP_Secretariat_Loca">Secretariat</a>: {{ secretariat }}</p>
20
20
 
21
- <div class="doctitle-en"><div><span class="title">{{ doctitleintro }}{% if doctitleintro and doctitlemain %} &mdash; {% endif %}</span><span class="subtitle">{{ doctitlemain }}{% if doctitlemain and doctitlepart %} &mdash;{% endif %}</span>
21
+ <div class="doctitle-en"><div><span class="title">{{ doctitleintro }}{% if doctitleintro and doctitlemain %} &#x2014; {% endif %}</span><span class="subtitle">{{ doctitlemain }}{% if doctitlemain and doctitlepart %} &#x2014;{% endif %}</span>
22
22
  {% if doctitlepart %}
23
23
  </div><div class="doctitle-part">
24
24
  {% if doctitlepartlabel %}<span class="partlabel">{{ doctitlepartlabel }}: </span>{% endif %}
@@ -26,7 +26,7 @@ name="CVP_Secretariat_Loca">Secretariat</a>: {{ secretariat }}</p>
26
26
  {% endif %}
27
27
  </div></div>
28
28
 
29
- <div class="doctitle-fr"><div><span class="title">{{ docsubtitleintro }}{% if docsubtitleintro and docsubtitlemain %} &mdash; {% endif %}</span><span class="subtitle">{{ docsubtitlemain }}{% if docsubtitlemain and docsubtitlepart %} &mdash;{% endif %}</span>
29
+ <div class="doctitle-fr"><div><span class="title">{{ docsubtitleintro }}{% if docsubtitleintro and docsubtitlemain %} &#x2014; {% endif %}</span><span class="subtitle">{{ docsubtitlemain }}{% if docsubtitlemain and docsubtitlepart %} &#x2014;{% endif %}</span>
30
30
  {% if docsubtitlepart %}
31
31
  </div><div>
32
32
  {% if docsubtitlepartlabel %}<span class="partlabel">{{ docsubtitlepartlabel }}: </span>{% endif %}
@@ -1944,8 +1944,18 @@
1944
1944
 
1945
1945
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
1946
1946
 
1947
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
1948
+ true
1949
+ </xsl:variable>
1950
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
1951
+
1947
1952
  <xsl:variable name="isGenerateTableIF_">
1948
- false
1953
+ <xsl:choose>
1954
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
1955
+ <xsl:value-of select="normalize-space($table_if) = 'true'"/>
1956
+ </xsl:when>
1957
+ <xsl:otherwise>false</xsl:otherwise>
1958
+ </xsl:choose>
1949
1959
  </xsl:variable>
1950
1960
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
1951
1961
 
@@ -2583,9 +2593,7 @@
2583
2593
  </xsl:attribute-set>
2584
2594
 
2585
2595
  <xsl:attribute-set name="dt-block-style">
2586
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
2587
-
2588
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
2596
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
2589
2597
 
2590
2598
  </xsl:attribute-set>
2591
2599
 
@@ -3568,6 +3576,7 @@
3568
3576
 
3569
3577
  <xsl:variable name="margin-side">
3570
3578
  <xsl:choose>
3579
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
3571
3580
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3572
3581
  <xsl:otherwise>0</xsl:otherwise>
3573
3582
  </xsl:choose>
@@ -3640,6 +3649,7 @@
3640
3649
  </td>
3641
3650
  </tr>
3642
3651
  -->
3652
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
3643
3653
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
3644
3654
 
3645
3655
  </xsl:when>
@@ -3774,12 +3784,17 @@
3774
3784
  <xsl:template name="calculate-column-widths">
3775
3785
  <xsl:param name="table"/>
3776
3786
  <xsl:param name="cols-count"/>
3777
-
3787
+ <xsl:choose>
3788
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
3789
+ <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
3790
+ </xsl:when>
3791
+ <xsl:otherwise>
3778
3792
  <xsl:call-template name="calculate-column-widths-proportional">
3779
3793
  <xsl:with-param name="cols-count" select="$cols-count"/>
3780
3794
  <xsl:with-param name="table" select="$table"/>
3781
3795
  </xsl:call-template>
3782
-
3796
+ </xsl:otherwise>
3797
+ </xsl:choose>
3783
3798
  </xsl:template>
3784
3799
 
3785
3800
  <!-- ================================================== -->
@@ -3957,6 +3972,7 @@
3957
3972
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
3958
3973
  <!-- ================================================== -->
3959
3974
 
3975
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
3960
3976
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
3961
3977
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
3962
3978
 
@@ -3968,67 +3984,6 @@
3968
3984
 
3969
3985
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
3970
3986
 
3971
- <!-- get current table id -->
3972
- <xsl:variable name="table_id" select="@id"/>
3973
- <!-- find table by id in the file 'table_widths' -->
3974
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
3975
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
3976
-
3977
- <!-- table='<xsl:copy-of select="$table"/>' -->
3978
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
3979
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
3980
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
3981
-
3982
- <xsl:variable name="table_with_cell_widths_">
3983
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
3984
- </xsl:variable>
3985
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
3986
-
3987
- <!-- <xsl:if test="$table_if_debug = 'true'">
3988
- <xsl:copy-of select="$table_with_cell_widths"/>
3989
- </xsl:if> -->
3990
-
3991
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
3992
-
3993
- <xsl:variable name="column_widths_">
3994
- <!-- iteration of columns -->
3995
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
3996
- <xsl:variable name="pos" select="position()"/>
3997
- <column>
3998
- <xsl:attribute name="width_max">
3999
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
4000
- <xsl:sort select="." data-type="number" order="descending"/>
4001
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4002
- </xsl:for-each>
4003
- </xsl:attribute>
4004
- <xsl:attribute name="width_min">
4005
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
4006
- <xsl:sort select="." data-type="number" order="descending"/>
4007
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4008
- </xsl:for-each>
4009
- </xsl:attribute>
4010
- </column>
4011
- </xsl:for-each>
4012
- </xsl:variable>
4013
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
4014
-
4015
- <!-- <column_widths>
4016
- <xsl:copy-of select="$column_widths"/>
4017
- </column_widths> -->
4018
-
4019
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
4020
- <xsl:variable name="table_widths_">
4021
- <table>
4022
- <xsl:attribute name="width_max">
4023
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
4024
- </xsl:attribute>
4025
- <xsl:attribute name="width_min">
4026
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
4027
- </xsl:attribute>
4028
- </table>
4029
- </xsl:variable>
4030
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
4031
-
4032
3987
  <xsl:variable name="page_width">
4033
3988
  <xsl:choose>
4034
3989
  <xsl:when test="$parent_table_page-width != ''">
@@ -4041,16 +3996,13 @@
4041
3996
  </xsl:variable>
4042
3997
 
4043
3998
  <xsl:if test="$table_if_debug = 'true'">
4044
- <table_width>
4045
- <xsl:copy-of select="$table_widths"/>
4046
- </table_width>
4047
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
3999
+ <page_width><xsl:value-of select="$page_width"/></page_width>
4048
4000
  </xsl:if>
4049
4001
 
4050
4002
  <!-- There are three cases: -->
4051
4003
  <xsl:choose>
4052
4004
  <!-- 1. The minimum table width is equal to or wider than the available space -->
4053
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
4005
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
4054
4006
  <!-- call old algorithm -->
4055
4007
  <case1/>
4056
4008
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -4060,10 +4012,10 @@
4060
4012
  </xsl:call-template> -->
4061
4013
  </xsl:when>
4062
4014
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
4063
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
4015
+ <xsl:when test="@width_max &lt;= $page_width">
4064
4016
  <case2/>
4065
4017
  <autolayout/>
4066
- <xsl:for-each select="$column_widths/column/@width_max">
4018
+ <xsl:for-each select="column/@width_max">
4067
4019
  <column divider="100"><xsl:value-of select="."/></column>
4068
4020
  </xsl:for-each>
4069
4021
  </xsl:when>
@@ -4073,19 +4025,19 @@
4073
4025
  For each column, let d be the difference between maximum and minimum width of that column.
4074
4026
  Now set the column's width to the minimum width plus d times W over D.
4075
4027
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
4076
- <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)">
4028
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
4077
4029
  <!-- difference between the available space and the minimum table width -->
4078
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
4030
+ <xsl:variable name="W" select="$page_width - @width_min"/>
4079
4031
  <W><xsl:value-of select="$W"/></W>
4080
4032
  <!-- difference between maximum and minimum width of the table -->
4081
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
4033
+ <xsl:variable name="D" select="@width_max - @width_min"/>
4082
4034
  <D><xsl:value-of select="$D"/></D>
4083
4035
  <case3/>
4084
4036
  <autolayout/>
4085
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
4037
+ <xsl:if test="@width_min &gt;= $page_width">
4086
4038
  <split_keep-within-line>true</split_keep-within-line>
4087
4039
  </xsl:if>
4088
- <xsl:for-each select="$column_widths/column">
4040
+ <xsl:for-each select="column">
4089
4041
  <!-- difference between maximum and minimum width of that column. -->
4090
4042
  <xsl:variable name="d" select="@width_max - @width_min"/>
4091
4043
  <d><xsl:value-of select="$d"/></d>
@@ -4111,23 +4063,39 @@
4111
4063
 
4112
4064
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
4113
4065
 
4066
+ <ancestor_tree>
4067
+ <xsl:for-each select="ancestor::*">
4068
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
4069
+ </xsl:for-each>
4070
+ </ancestor_tree>
4071
+
4114
4072
  <xsl:variable name="parent_table_page-width_">
4115
4073
  <xsl:if test="$parent_table_id != ''">
4116
4074
  <!-- determine column number in the parent table -->
4117
4075
  <xsl:variable name="parent_table_column_number">
4118
4076
  <xsl:choose>
4119
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
4077
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
4078
+ <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>
4120
4079
  <xsl:otherwise> <!-- parent is table -->
4121
4080
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
4122
4081
  </xsl:otherwise>
4123
4082
  </xsl:choose>
4124
4083
  </xsl:variable>
4125
4084
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
4126
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
4085
+
4086
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
4087
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
4088
+ <!-- <xsl:variable name="divider">
4089
+ <xsl:value-of select="$parent_table_column/@divider"/>
4090
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
4091
+ </xsl:variable> -->
4092
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
4127
4093
  </xsl:if>
4128
4094
  </xsl:variable>
4129
4095
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
4130
4096
 
4097
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
4098
+
4131
4099
  <!-- get current table id -->
4132
4100
  <xsl:variable name="table_id" select="@id"/>
4133
4101
 
@@ -4148,50 +4116,6 @@
4148
4116
 
4149
4117
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
4150
4118
 
4151
- <!-- ============================= -->
4152
- <!-- mode: determine_cell_widths-if -->
4153
- <!-- ============================= -->
4154
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
4155
- <xsl:copy>
4156
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
4157
- </xsl:copy>
4158
- </xsl:template>
4159
-
4160
- <xsl:template match="td | th" mode="determine_cell_widths-if">
4161
- <xsl:copy>
4162
- <xsl:copy-of select="@*"/>
4163
-
4164
- <!-- The maximum width is given by the widest line. -->
4165
- <xsl:attribute name="width_max">
4166
- <xsl:for-each select="p_len">
4167
- <xsl:sort select="." data-type="number" order="descending"/>
4168
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4169
- </xsl:for-each>
4170
- </xsl:attribute>
4171
-
4172
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
4173
- <xsl:variable name="width_min">
4174
- <xsl:for-each select="word_len">
4175
- <xsl:sort select="." data-type="number" order="descending"/>
4176
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4177
- </xsl:for-each>
4178
- </xsl:variable>
4179
- <xsl:attribute name="width_min">
4180
- <xsl:value-of select="$width_min"/>
4181
- </xsl:attribute>
4182
-
4183
- <xsl:if test="$width_min = 0">
4184
- <xsl:attribute name="width_min">1</xsl:attribute>
4185
- </xsl:if>
4186
-
4187
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
4188
-
4189
- </xsl:copy>
4190
- </xsl:template>
4191
- <!-- ============================= -->
4192
- <!-- END mode: determine_cell_widths-if -->
4193
- <!-- ============================= -->
4194
-
4195
4119
  <!-- ================================================== -->
4196
4120
  <!-- Calculate column's width based on HTML4 algorithm -->
4197
4121
  <!-- ================================================== -->
@@ -4392,6 +4316,7 @@
4392
4316
  <xsl:when test="$table_or_dl = 'table'">
4393
4317
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
4394
4318
  <fo:table-row number-columns-spanned="{$col_count}">
4319
+ <xsl:copy-of select="../@font-weight"/>
4395
4320
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
4396
4321
  <xsl:call-template name="td"/>
4397
4322
  </fo:table-row>
@@ -4547,7 +4472,7 @@
4547
4472
 
4548
4473
  <xsl:apply-templates/>
4549
4474
 
4550
- <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"/> -->
4475
+ <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"/> -->
4551
4476
 
4552
4477
  </fo:block>
4553
4478
  </fo:table-cell>
@@ -4878,6 +4803,7 @@
4878
4803
  <xsl:template match="*[local-name()='dl']">
4879
4804
  <xsl:variable name="isAdded" select="@added"/>
4880
4805
  <xsl:variable name="isDeleted" select="@deleted"/>
4806
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
4881
4807
  <fo:block-container>
4882
4808
 
4883
4809
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -5426,21 +5352,16 @@
5426
5352
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
5427
5353
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
5428
5354
  <xsl:param name="id"/>
5429
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
5430
5355
  <tr>
5431
5356
  <td>
5432
5357
  <xsl:copy-of select="node()"/>
5433
5358
  </td>
5434
5359
  <td>
5435
-
5436
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5437
-
5438
- <!-- get paragraphs from nested 'dl' -->
5439
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5440
-
5360
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5361
+ <!-- get paragraphs from nested 'dl' -->
5362
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5441
5363
  </td>
5442
5364
  </tr>
5443
-
5444
5365
  </xsl:template>
5445
5366
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
5446
5367
 
@@ -6093,6 +6014,9 @@
6093
6014
  <xsl:variable name="td">
6094
6015
  <xsl:element name="td">
6095
6016
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6017
+ <xsl:if test="local-name()='th'">
6018
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6019
+ </xsl:if>
6096
6020
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6097
6021
  <xsl:apply-templates mode="simple-table-colspan"/>
6098
6022
  </xsl:element>
@@ -6105,6 +6029,9 @@
6105
6029
  <xsl:otherwise>
6106
6030
  <xsl:element name="td">
6107
6031
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6032
+ <xsl:if test="local-name()='th'">
6033
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6034
+ </xsl:if>
6108
6035
  <xsl:apply-templates mode="simple-table-colspan"/>
6109
6036
  </xsl:element>
6110
6037
  </xsl:otherwise>
@@ -6234,8 +6161,14 @@
6234
6161
  <xsl:copy-of select="@*"/>
6235
6162
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
6236
6163
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
6164
+ <xsl:variable name="divide">
6165
+ <xsl:choose>
6166
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
6167
+ <xsl:otherwise>1</xsl:otherwise>
6168
+ </xsl:choose>
6169
+ </xsl:variable>
6237
6170
  <xsl:attribute name="id">
6238
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
6171
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
6239
6172
  </xsl:attribute>
6240
6173
 
6241
6174
  <xsl:for-each select="*[local-name() = 'p']">
@@ -6243,10 +6176,12 @@
6243
6176
  <xsl:copy-of select="@*"/>
6244
6177
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
6245
6178
  <xsl:attribute name="id">
6246
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
6179
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
6247
6180
  </xsl:attribute>
6248
6181
 
6249
- <xsl:copy-of select="node()"/>
6182
+ <!-- <xsl:copy-of select="node()" /> -->
6183
+ <xsl:apply-templates mode="simple-table-noid"/>
6184
+
6250
6185
  </xsl:copy>
6251
6186
  </xsl:for-each>
6252
6187
 
@@ -6275,7 +6210,7 @@
6275
6210
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
6276
6211
  <xsl:copy>
6277
6212
  <xsl:attribute name="id">
6278
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
6213
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
6279
6214
  </xsl:attribute>
6280
6215
  <xsl:copy-of select="node()"/>
6281
6216
  </xsl:copy>
@@ -6284,6 +6219,24 @@
6284
6219
  </xsl:copy>
6285
6220
 
6286
6221
  </xsl:template>
6222
+
6223
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
6224
+ <xsl:copy>
6225
+ <xsl:choose>
6226
+ <xsl:when test="$isGenerateTableIF = 'true'">
6227
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
6228
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
6229
+ <xsl:copy-of select="@id"/>
6230
+ </xsl:if> -->
6231
+ </xsl:when>
6232
+ <xsl:otherwise>
6233
+ <xsl:copy-of select="@*"/>
6234
+ </xsl:otherwise>
6235
+ </xsl:choose>
6236
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
6237
+ </xsl:copy>
6238
+ </xsl:template>
6239
+
6287
6240
  <!-- End mode: simple-table-id -->
6288
6241
  <!-- ===================== -->
6289
6242
  <!-- ===================== -->
@@ -6293,7 +6246,7 @@
6293
6246
  <!-- =============================== -->
6294
6247
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
6295
6248
  <xsl:copy>
6296
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
6249
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
6297
6250
  </xsl:copy>
6298
6251
  </xsl:template>
6299
6252
 
@@ -6407,6 +6360,10 @@
6407
6360
 
6408
6361
  <fo:inline xsl:use-attribute-sets="mathml-style">
6409
6362
 
6363
+ <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 -->
6364
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6365
+ </xsl:if>
6366
+
6410
6367
  <xsl:call-template name="setTrackChangesStyles">
6411
6368
  <xsl:with-param name="isAdded" select="$isAdded"/>
6412
6369
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -8396,15 +8353,12 @@
8396
8353
 
8397
8354
  <xsl:template match="*[local-name()='tr']" mode="requirement">
8398
8355
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
8399
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
8400
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
8401
- </xsl:if>
8402
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
8403
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
8404
- </xsl:if>
8405
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
8406
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
8356
+
8357
+ <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 ')">
8358
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
8359
+
8407
8360
  </xsl:if>
8361
+
8408
8362
  <xsl:apply-templates mode="requirement"/>
8409
8363
  </fo:table-row>
8410
8364
  </xsl:template>
@@ -9931,7 +9885,7 @@
9931
9885
  </tbody>
9932
9886
  </xsl:variable>
9933
9887
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
9934
- <xsl:call-template name="calculate-column-widths">
9888
+ <xsl:call-template name="calculate-column-widths-proportional">
9935
9889
  <xsl:with-param name="cols-count" select="$cols-count"/>
9936
9890
  <xsl:with-param name="table" select="$toc_table_simple"/>
9937
9891
  </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,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.1.7".freeze
3
+ VERSION = "2.1.8".freeze
4
4
  end
5
5
  end
6
6
 
data/lib/metanorma-iec.rb CHANGED
@@ -7,8 +7,9 @@ require "isodoc/iec/pdf_convert"
7
7
  require "isodoc/iec/presentation_xml_convert"
8
8
  require "isodoc/iec/metadata"
9
9
  require "isodoc/iec/xref"
10
+ require "metanorma"
10
11
 
11
- if defined? Metanorma
12
+ if defined? Metanorma::Registry
12
13
  require_relative "metanorma/iec"
13
14
  Metanorma::Registry.instance.register(Metanorma::Iec::Processor)
14
15
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
29
29
 
30
- spec.add_dependency "metanorma-iso", "~> 2.1.6"
30
+ spec.add_dependency "metanorma-iso", "~> 2.1.8"
31
31
  spec.add_dependency "ruby-jing"
32
32
 
33
33
  spec.add_development_dependency "debug"