metanorma-cc 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aabfe31a3db1633ed85d5e6148447e62fa4fcca3f1bd2f247f8255096b225bfe
4
- data.tar.gz: 585246f15ca5e5eb9a54b00c06482da576a28e754eebf51eb7f0fa201fb673b9
3
+ metadata.gz: 9addb36ecc8d1ecba39442e834158ad429cd49fea376d5b8493898c1c5d2811a
4
+ data.tar.gz: 299a019aaa48c9b41de0e09c5eaf9effe2da3b2f6712c010c1c54cfe86773d16
5
5
  SHA512:
6
- metadata.gz: d511e3460ceca5253447539b12c5ea50985a8bf39bc51c96e0f9ec8c5e41a7fe279f41d3e06e4a7371e278c35904fb3e6b2a58aa75a4c6bf590d0777b16d370a
7
- data.tar.gz: 1a4c1d388dc574e46c18b9e42776582883273e6f92f697c83db0542b733c5d670f7479b5a5a65eaf6753c4d85720b62d14ae419d0ed047e0dfa2864552c2310a
6
+ metadata.gz: 2cb26abbc7ca5b7539e5cefd4679a56d257438d1471d052a4ffc6c5d666f6f79cf7132ae96b03aa562e4a0611d08847314a506303e11bb3cc10ebb654f0467b7
7
+ data.tar.gz: 73bacd9658eab6e13961d77b476fd021d37a3ac90cbf535684fa0d0031ea86e9ddde0d023e2bd55f3fe9e81b3f59e4b87cd5425e253d6f954337df1e24893d64
@@ -1094,6 +1094,10 @@
1094
1094
 
1095
1095
  </xsl:attribute-set>
1096
1096
 
1097
+ <xsl:template name="refine_termexample-style">
1098
+
1099
+ </xsl:template>
1100
+
1097
1101
  <xsl:attribute-set name="example-style">
1098
1102
 
1099
1103
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -2169,6 +2173,36 @@
2169
2173
  </xsl:for-each>
2170
2174
  </xsl:template>
2171
2175
 
2176
+ <xsl:template name="processMainSectionsDefault_flatxml">
2177
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2178
+ <xsl:sort select="@displayorder" data-type="number"/>
2179
+ <xsl:variable name="flatxml">
2180
+ <xsl:apply-templates select="." mode="flatxml"/>
2181
+ </xsl:variable>
2182
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2183
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2184
+
2185
+ </xsl:for-each>
2186
+
2187
+ <xsl:for-each select="/*/*[local-name()='annex']">
2188
+ <xsl:sort select="@displayorder" data-type="number"/>
2189
+ <xsl:variable name="flatxml">
2190
+ <xsl:apply-templates select="." mode="flatxml"/>
2191
+ </xsl:variable>
2192
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2193
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2194
+ </xsl:for-each>
2195
+
2196
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2197
+ <xsl:sort select="@displayorder" data-type="number"/>
2198
+ <xsl:variable name="flatxml">
2199
+ <xsl:apply-templates select="." mode="flatxml"/>
2200
+ </xsl:variable>
2201
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2202
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2203
+ </xsl:for-each>
2204
+ </xsl:template>
2205
+
2172
2206
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2173
2207
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2174
2208
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2295,7 +2329,9 @@
2295
2329
  </xsl:template> <!-- license-statement/p -->
2296
2330
 
2297
2331
  <xsl:template match="*[local-name()='legal-statement']">
2332
+ <xsl:param name="isLegacy">false</xsl:param>
2298
2333
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2334
+
2299
2335
  <xsl:apply-templates/>
2300
2336
  </fo:block>
2301
2337
  </xsl:template> <!-- legal-statement -->
@@ -4242,13 +4278,13 @@
4242
4278
  <tr>
4243
4279
  <td>
4244
4280
  <xsl:attribute name="id">
4245
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4281
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4246
4282
  </xsl:attribute>
4247
4283
  <xsl:apply-templates/>
4248
4284
  </td>
4249
4285
  <td>
4250
4286
  <xsl:attribute name="id">
4251
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4287
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4252
4288
  </xsl:attribute>
4253
4289
 
4254
4290
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -4560,13 +4596,14 @@
4560
4596
  <!-- ================= -->
4561
4597
  <!-- Added,deleted text -->
4562
4598
  <!-- ================= -->
4563
- <xsl:template match="*[local-name()='add']" name="tag_add">
4599
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
4564
4600
  <xsl:param name="skip">true</xsl:param>
4565
4601
  <xsl:param name="block">false</xsl:param>
4566
4602
  <xsl:param name="type"/>
4567
4603
  <xsl:param name="text-align"/>
4568
4604
  <xsl:choose>
4569
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4605
+ <xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
4606
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4570
4607
  <xsl:choose>
4571
4608
  <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4572
4609
  <xsl:otherwise>
@@ -4574,12 +4611,32 @@
4574
4611
  <xsl:call-template name="insertTag">
4575
4612
  <xsl:with-param name="type">
4576
4613
  <xsl:choose>
4614
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
4615
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
4577
4616
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4578
4617
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4579
4618
  </xsl:choose>
4580
4619
  </xsl:with-param>
4581
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4582
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4620
+ <xsl:with-param name="kind">
4621
+ <xsl:choose>
4622
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4623
+ <xsl:value-of select="text()"/>
4624
+ </xsl:when>
4625
+ <xsl:otherwise>
4626
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4627
+ </xsl:otherwise>
4628
+ </xsl:choose>
4629
+ </xsl:with-param>
4630
+ <xsl:with-param name="value">
4631
+ <xsl:choose>
4632
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4633
+ <xsl:value-of select="*[local-name() = 'sub']"/>
4634
+ </xsl:when>
4635
+ <xsl:otherwise>
4636
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4637
+ </xsl:otherwise>
4638
+ </xsl:choose>
4639
+ </xsl:with-param>
4583
4640
  </xsl:call-template>
4584
4641
  </xsl:variable>
4585
4642
  <xsl:choose>
@@ -4839,6 +4896,10 @@
4839
4896
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
4840
4897
  </xsl:template>
4841
4898
 
4899
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
4900
+ <xsl:value-of select="."/>
4901
+ </xsl:template>
4902
+
4842
4903
  <!-- ========================= -->
4843
4904
  <!-- END Rich text formatting -->
4844
4905
  <!-- ========================= -->
@@ -5469,7 +5530,7 @@
5469
5530
  </xsl:choose>
5470
5531
  </xsl:variable>
5471
5532
  <xsl:attribute name="id">
5472
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5533
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5473
5534
  </xsl:attribute>
5474
5535
 
5475
5536
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5477,7 +5538,7 @@
5477
5538
  <xsl:copy-of select="@*"/>
5478
5539
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5479
5540
  <xsl:attribute name="id">
5480
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5541
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5481
5542
  </xsl:attribute>
5482
5543
 
5483
5544
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5541,7 +5602,7 @@
5541
5602
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5542
5603
  <xsl:copy>
5543
5604
  <xsl:attribute name="id">
5544
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5605
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5545
5606
  </xsl:attribute>
5546
5607
  <xsl:copy-of select="node()"/>
5547
5608
  </xsl:copy>
@@ -6783,11 +6844,17 @@
6783
6844
  </xsl:when>
6784
6845
  <xsl:otherwise>
6785
6846
 
6847
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
6848
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
6849
+
6786
6850
  <xsl:variable name="element">
6787
6851
  <xsl:choose>
6788
6852
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
6789
6853
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6790
6854
  </xsl:when>
6855
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
6856
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6857
+ </xsl:when>
6791
6858
  <xsl:otherwise>
6792
6859
  <fo:block xsl:use-attribute-sets="image-style">
6793
6860
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -6803,10 +6870,24 @@
6803
6870
  <xsl:copy-of select="@*"/>
6804
6871
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
6805
6872
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6806
- <xsl:if test="$isGenerateTableIF = 'false'">
6807
- <xsl:attribute name="width">100%</xsl:attribute>
6808
- </xsl:if>
6809
- <xsl:attribute name="content-height">100%</xsl:attribute>
6873
+
6874
+ <xsl:choose>
6875
+ <xsl:when test="$image_class = 'corrigenda-tag'">
6876
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
6877
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
6878
+ <xsl:if test="$ancestor_table_cell = 'true'">
6879
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
6880
+ </xsl:if>
6881
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
6882
+ </xsl:when>
6883
+ <xsl:otherwise>
6884
+ <xsl:if test="$isGenerateTableIF = 'false'">
6885
+ <xsl:attribute name="width">100%</xsl:attribute>
6886
+ </xsl:if>
6887
+ <xsl:attribute name="content-height">100%</xsl:attribute>
6888
+ </xsl:otherwise>
6889
+ </xsl:choose>
6890
+
6810
6891
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6811
6892
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
6812
6893
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -8323,7 +8404,7 @@
8323
8404
  <!-- ====== -->
8324
8405
  <xsl:template match="*[local-name() = 'termexample']">
8325
8406
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8326
-
8407
+ <xsl:call-template name="refine_termexample-style"/>
8327
8408
  <xsl:call-template name="setBlockSpanAll"/>
8328
8409
 
8329
8410
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -9018,13 +9099,19 @@
9018
9099
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9019
9100
  </xsl:when>
9020
9101
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
9021
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9102
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9103
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9104
+ </xsl:when>
9105
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9022
9106
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9023
9107
  </xsl:when>
9024
9108
  </xsl:choose>
9025
9109
 
9026
9110
  </xsl:template>
9027
9111
 
9112
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
9113
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
9114
+
9028
9115
  <xsl:template match="*[local-name() = 'name']/text()">
9029
9116
  <!-- 0xA0 to space replacement -->
9030
9117
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -10631,7 +10718,7 @@
10631
10718
 
10632
10719
  <xsl:template name="printEdition">
10633
10720
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
10634
- <xsl:text> </xsl:text>
10721
+
10635
10722
  <xsl:choose>
10636
10723
  <xsl:when test="$edition_i18n != ''">
10637
10724
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -14,7 +14,7 @@ module IsoDoc
14
14
  end
15
15
 
16
16
  def title(isoxml, _out)
17
- main = isoxml&.at(ns("//bibdata/title[@language='en']"))&.text
17
+ main = isoxml.at(ns("//bibdata/title[@language='en']"))&.children&.to_xml
18
18
  set(:doctitle, main)
19
19
  end
20
20
 
@@ -244,6 +244,9 @@
244
244
  <data type="ID"/>
245
245
  </attribute>
246
246
  <attribute name="reviewer"/>
247
+ <optional>
248
+ <attribute name="type"/>
249
+ </optional>
247
250
  <optional>
248
251
  <attribute name="date">
249
252
  <data type="dateTime"/>
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.2.12 -->
20
+ <!-- VERSION v1.3.0 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -146,6 +146,9 @@
146
146
  <data type="boolean"/>
147
147
  </attribute>
148
148
  </optional>
149
+ <optional>
150
+ <attribute name="style"/>
151
+ </optional>
149
152
  <oneOrMore>
150
153
  <ref name="PureTextElement"/>
151
154
  </oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.4.0".freeze
3
+ VERSION = "2.4.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-09 00:00:00.000000000 Z
11
+ date: 2024-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic