metanorma-csa 2.4.0 → 2.4.2

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: 4bc590d65850c7513f158d112241ec0ec5b1e301828280a8b8ee5199a22fc497
4
- data.tar.gz: a9a2a83a72c4f40f8097fe06eaa6891c011c0523c82dce55ee5fb8c0f480860d
3
+ metadata.gz: b5bef565529ba8c3d376a169c0593757f0be8e0f51a876ef8043aa08127728df
4
+ data.tar.gz: 47c1ae2636d2c8d0a954694480afe9f998d08afce3eb0626ae9e6f423e583ec4
5
5
  SHA512:
6
- metadata.gz: c42d7ae483db7e718253e7356f3b689cb83c89dbebd6cb8d494292868fb318121194c9a6a54a46b6b08c87f5ee61956545129f40538d3c9710daa9851cd3111f
7
- data.tar.gz: 40a3e0f3820f2f381543bb95ce4b470650f6ee9721ee2f10535b7acc8dae0ebf3e964e3e8a94a497725731efe82815e419cce42f37ef0c546a7314effbd19716
6
+ metadata.gz: 83bcf0f50b66cf1893a1de62f51e1fbcbe77a3703f6071d7be60d7968e6fdc28b772551062a781e3e1b9231aa6e16f190a00137765e60fd83dec2712c5d5e2dd
7
+ data.tar.gz: 8d50516c5236e27df948c97cf6e7c36a9182df9e1d51c9fbf382fd1a7c8392978425de3d210d825edf2268976af3c0edc4e35bc3528045f5b821b2fd69addbb7
@@ -1093,6 +1093,10 @@
1093
1093
 
1094
1094
  </xsl:attribute-set>
1095
1095
 
1096
+ <xsl:template name="refine_termexample-style">
1097
+
1098
+ </xsl:template>
1099
+
1096
1100
  <xsl:attribute-set name="example-style">
1097
1101
 
1098
1102
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -2185,6 +2189,36 @@
2185
2189
  </xsl:for-each>
2186
2190
  </xsl:template>
2187
2191
 
2192
+ <xsl:template name="processMainSectionsDefault_flatxml">
2193
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2194
+ <xsl:sort select="@displayorder" data-type="number"/>
2195
+ <xsl:variable name="flatxml">
2196
+ <xsl:apply-templates select="." mode="flatxml"/>
2197
+ </xsl:variable>
2198
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2199
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2200
+
2201
+ </xsl:for-each>
2202
+
2203
+ <xsl:for-each select="/*/*[local-name()='annex']">
2204
+ <xsl:sort select="@displayorder" data-type="number"/>
2205
+ <xsl:variable name="flatxml">
2206
+ <xsl:apply-templates select="." mode="flatxml"/>
2207
+ </xsl:variable>
2208
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2209
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2210
+ </xsl:for-each>
2211
+
2212
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2213
+ <xsl:sort select="@displayorder" data-type="number"/>
2214
+ <xsl:variable name="flatxml">
2215
+ <xsl:apply-templates select="." mode="flatxml"/>
2216
+ </xsl:variable>
2217
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2218
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2219
+ </xsl:for-each>
2220
+ </xsl:template>
2221
+
2188
2222
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2189
2223
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2190
2224
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2311,7 +2345,9 @@
2311
2345
  </xsl:template> <!-- license-statement/p -->
2312
2346
 
2313
2347
  <xsl:template match="*[local-name()='legal-statement']">
2348
+ <xsl:param name="isLegacy">false</xsl:param>
2314
2349
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2350
+
2315
2351
  <xsl:apply-templates/>
2316
2352
  </fo:block>
2317
2353
  </xsl:template> <!-- legal-statement -->
@@ -4256,13 +4292,13 @@
4256
4292
  <tr>
4257
4293
  <td>
4258
4294
  <xsl:attribute name="id">
4259
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4295
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4260
4296
  </xsl:attribute>
4261
4297
  <xsl:apply-templates/>
4262
4298
  </td>
4263
4299
  <td>
4264
4300
  <xsl:attribute name="id">
4265
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4301
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4266
4302
  </xsl:attribute>
4267
4303
 
4268
4304
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -4573,13 +4609,14 @@
4573
4609
  <!-- ================= -->
4574
4610
  <!-- Added,deleted text -->
4575
4611
  <!-- ================= -->
4576
- <xsl:template match="*[local-name()='add']" name="tag_add">
4612
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
4577
4613
  <xsl:param name="skip">true</xsl:param>
4578
4614
  <xsl:param name="block">false</xsl:param>
4579
4615
  <xsl:param name="type"/>
4580
4616
  <xsl:param name="text-align"/>
4581
4617
  <xsl:choose>
4582
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4618
+ <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
4619
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4583
4620
  <xsl:choose>
4584
4621
  <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>
4585
4622
  <xsl:otherwise>
@@ -4587,12 +4624,32 @@
4587
4624
  <xsl:call-template name="insertTag">
4588
4625
  <xsl:with-param name="type">
4589
4626
  <xsl:choose>
4627
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
4628
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
4590
4629
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4591
4630
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4592
4631
  </xsl:choose>
4593
4632
  </xsl:with-param>
4594
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4595
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4633
+ <xsl:with-param name="kind">
4634
+ <xsl:choose>
4635
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4636
+ <xsl:value-of select="text()"/>
4637
+ </xsl:when>
4638
+ <xsl:otherwise>
4639
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4640
+ </xsl:otherwise>
4641
+ </xsl:choose>
4642
+ </xsl:with-param>
4643
+ <xsl:with-param name="value">
4644
+ <xsl:choose>
4645
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4646
+ <xsl:value-of select="*[local-name() = 'sub']"/>
4647
+ </xsl:when>
4648
+ <xsl:otherwise>
4649
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4650
+ </xsl:otherwise>
4651
+ </xsl:choose>
4652
+ </xsl:with-param>
4596
4653
  </xsl:call-template>
4597
4654
  </xsl:variable>
4598
4655
  <xsl:choose>
@@ -4852,6 +4909,10 @@
4852
4909
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
4853
4910
  </xsl:template>
4854
4911
 
4912
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
4913
+ <xsl:value-of select="."/>
4914
+ </xsl:template>
4915
+
4855
4916
  <!-- ========================= -->
4856
4917
  <!-- END Rich text formatting -->
4857
4918
  <!-- ========================= -->
@@ -5482,7 +5543,7 @@
5482
5543
  </xsl:choose>
5483
5544
  </xsl:variable>
5484
5545
  <xsl:attribute name="id">
5485
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5546
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5486
5547
  </xsl:attribute>
5487
5548
 
5488
5549
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5490,7 +5551,7 @@
5490
5551
  <xsl:copy-of select="@*"/>
5491
5552
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5492
5553
  <xsl:attribute name="id">
5493
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5554
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5494
5555
  </xsl:attribute>
5495
5556
 
5496
5557
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5554,7 +5615,7 @@
5554
5615
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5555
5616
  <xsl:copy>
5556
5617
  <xsl:attribute name="id">
5557
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5618
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5558
5619
  </xsl:attribute>
5559
5620
  <xsl:copy-of select="node()"/>
5560
5621
  </xsl:copy>
@@ -6800,11 +6861,17 @@
6800
6861
  </xsl:when>
6801
6862
  <xsl:otherwise>
6802
6863
 
6864
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
6865
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
6866
+
6803
6867
  <xsl:variable name="element">
6804
6868
  <xsl:choose>
6805
6869
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
6806
6870
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6807
6871
  </xsl:when>
6872
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
6873
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6874
+ </xsl:when>
6808
6875
  <xsl:otherwise>
6809
6876
  <fo:block xsl:use-attribute-sets="image-style">
6810
6877
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -6820,10 +6887,24 @@
6820
6887
  <xsl:copy-of select="@*"/>
6821
6888
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
6822
6889
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6823
- <xsl:if test="$isGenerateTableIF = 'false'">
6824
- <xsl:attribute name="width">100%</xsl:attribute>
6825
- </xsl:if>
6826
- <xsl:attribute name="content-height">100%</xsl:attribute>
6890
+
6891
+ <xsl:choose>
6892
+ <xsl:when test="$image_class = 'corrigenda-tag'">
6893
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
6894
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
6895
+ <xsl:if test="$ancestor_table_cell = 'true'">
6896
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
6897
+ </xsl:if>
6898
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
6899
+ </xsl:when>
6900
+ <xsl:otherwise>
6901
+ <xsl:if test="$isGenerateTableIF = 'false'">
6902
+ <xsl:attribute name="width">100%</xsl:attribute>
6903
+ </xsl:if>
6904
+ <xsl:attribute name="content-height">100%</xsl:attribute>
6905
+ </xsl:otherwise>
6906
+ </xsl:choose>
6907
+
6827
6908
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6828
6909
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
6829
6910
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -8339,7 +8420,7 @@
8339
8420
  <!-- ====== -->
8340
8421
  <xsl:template match="*[local-name() = 'termexample']">
8341
8422
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8342
-
8423
+ <xsl:call-template name="refine_termexample-style"/>
8343
8424
  <xsl:call-template name="setBlockSpanAll"/>
8344
8425
 
8345
8426
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -9027,13 +9108,19 @@
9027
9108
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9028
9109
  </xsl:when>
9029
9110
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
9030
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9111
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9112
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9113
+ </xsl:when>
9114
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9031
9115
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9032
9116
  </xsl:when>
9033
9117
  </xsl:choose>
9034
9118
 
9035
9119
  </xsl:template>
9036
9120
 
9121
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
9122
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
9123
+
9037
9124
  <xsl:template match="*[local-name() = 'name']/text()">
9038
9125
  <!-- 0xA0 to space replacement -->
9039
9126
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -10616,7 +10703,7 @@
10616
10703
 
10617
10704
  <xsl:template name="printEdition">
10618
10705
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
10619
- <xsl:text> </xsl:text>
10706
+
10620
10707
  <xsl:choose>
10621
10708
  <xsl:when test="$edition_i18n != ''">
10622
10709
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'isodoc'
3
+ require "isodoc"
4
4
 
5
5
  module IsoDoc
6
6
  module Csa
@@ -12,7 +12,8 @@ module IsoDoc
12
12
  end
13
13
 
14
14
  def title(isoxml, _out)
15
- main = isoxml&.at(ns("//bibdata/title[@language='en']"))&.text
15
+ main = isoxml.at(ns("//bibdata/title[@language='en']"))
16
+ &.children&.to_xml
16
17
  set(:doctitle, main)
17
18
  end
18
19
 
@@ -39,8 +40,8 @@ module IsoDoc
39
40
  end
40
41
 
41
42
  def nonauth_roles(isoxml, persons)
42
- roles = isoxml.xpath(ns("//bibdata/contributor[person]/role/@type")).
43
- inject([]) { |m, t| m << t.value }.reject { |i| i == "author" }
43
+ roles = isoxml.xpath(ns("//bibdata/contributor[person]/role/@type"))
44
+ .inject([]) { |m, t| m << t.value }.reject { |i| i == "author" }
44
45
  roles.uniq.sort.each do |r|
45
46
  n = isoxml.xpath(ns("//bibdata/contributor[role/@type = '#{r}']"\
46
47
  "/person"))
@@ -51,12 +52,13 @@ module IsoDoc
51
52
 
52
53
  def auth_roles(isoxml, persons)
53
54
  roles = isoxml.xpath(ns("//bibdata/contributor[person]/"\
54
- "role[@type = 'author']/description")).
55
- inject([]) { |m, t| m << t.text }
55
+ "role[@type = 'author']/description"))
56
+ .inject([]) { |m, t| m << t.text }
56
57
  roles.uniq.sort.each do |r|
57
58
  n = isoxml.xpath(
58
- ns("//bibdata/contributor[role/@type = 'author']"\
59
- "[xmlns:role/description = '#{r}']/person"))
59
+ ns("//bibdata/contributor[role/@type = 'author']"\
60
+ "[xmlns:role/description = '#{r}']/person"),
61
+ )
60
62
  n.empty? or persons[r] = extract_person_names_affiliations(n)
61
63
  end
62
64
  persons
@@ -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 Csa
3
- VERSION = "2.4.0".freeze
3
+ VERSION = "2.4.2".freeze
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.6.0"
32
+ spec.add_dependency "metanorma-generic", "~> 2.6.1"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
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
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.6.0
19
+ version: 2.6.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.6.0
26
+ version: 2.6.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement