metanorma-iec 2.1.8.1 → 2.1.9

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: 8212307690191af07b587646aa7c8cc8ba091c1a55d1908bd3851a2b46fc1e7f
4
- data.tar.gz: 94239654f8b267dfd12bc8198235f3c3fe89698ddc9a25cef206893a16bad5ff
3
+ metadata.gz: 28668ccee2ac29c220a4f6e970299bd8f37e106d1d953e4b0c25eeae65f75571
4
+ data.tar.gz: 1c004518604d4ee42e649094c964fd2b29fb42d20cc6eb76e22ed7ad32347f78
5
5
  SHA512:
6
- metadata.gz: ce12487a121517043948f01ad664187803d575d01dfa8450c523f7f50958473e15ee80f623bf9b6c45cf5156421fdfa50af641e8588968ea1c07a5d5b57f033e
7
- data.tar.gz: 7f776f92f93ba2a48007ee558f4dd534212c32f443e9bfd6ec6294cfbd27d5b31f1729e3656256509c89b7504b9097df18e88d39dac1e1fecf3df7937bf98302
6
+ metadata.gz: aff04a6fc9c4fa01f55229716d1e33881c086c027af463e5fe97415cd376e7e511f8a7d84f3b942c512f4a1779427611ac6c82290d56376ea36e048c6afd4b55
7
+ data.tar.gz: 7f659e59700d2e17040f4a92a1a8c1e9df1c64bb5601b5724f50d8e00e3b8ac477039a8adf4c956840c66dac906667d111bdb391f47f87c2f6abf9fcad92ef78
@@ -7807,6 +7807,18 @@
7807
7807
  </xsl:copy>
7808
7808
  </xsl:template>
7809
7809
 
7810
+ <xsl:template match="*[local-name() = 'sub']" mode="contents_item">
7811
+ <xsl:copy>
7812
+ <xsl:apply-templates mode="contents_item"/>
7813
+ </xsl:copy>
7814
+ </xsl:template>
7815
+
7816
+ <xsl:template match="*[local-name() = 'sup']" mode="contents_item">
7817
+ <xsl:copy>
7818
+ <xsl:apply-templates mode="contents_item"/>
7819
+ </xsl:copy>
7820
+ </xsl:template>
7821
+
7810
7822
  <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
7811
7823
  <xsl:copy-of select="."/>
7812
7824
  </xsl:template>
@@ -9263,21 +9275,29 @@
9263
9275
  </xsl:variable>
9264
9276
 
9265
9277
  <xsl:template match="@*|node()" mode="index_add_id">
9278
+ <xsl:param name="docid"/>
9266
9279
  <xsl:copy>
9267
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
9280
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
9281
+ <xsl:with-param name="docid" select="$docid"/>
9282
+ </xsl:apply-templates>
9268
9283
  </xsl:copy>
9269
9284
  </xsl:template>
9270
9285
 
9271
9286
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
9287
+ <xsl:param name="docid"/>
9272
9288
  <xsl:variable name="id">
9273
- <xsl:call-template name="generateIndexXrefId"/>
9289
+ <xsl:call-template name="generateIndexXrefId">
9290
+ <xsl:with-param name="docid" select="$docid"/>
9291
+ </xsl:call-template>
9274
9292
  </xsl:variable>
9275
9293
  <xsl:copy> <!-- add id to xref -->
9276
9294
  <xsl:apply-templates select="@*" mode="index_add_id"/>
9277
9295
  <xsl:attribute name="id">
9278
9296
  <xsl:value-of select="$id"/>
9279
9297
  </xsl:attribute>
9280
- <xsl:apply-templates mode="index_add_id"/>
9298
+ <xsl:apply-templates mode="index_add_id">
9299
+ <xsl:with-param name="docid" select="$docid"/>
9300
+ </xsl:apply-templates>
9281
9301
  </xsl:copy>
9282
9302
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
9283
9303
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -9289,7 +9309,9 @@
9289
9309
  <xsl:attribute name="id">
9290
9310
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
9291
9311
  </xsl:attribute>
9292
- <xsl:apply-templates mode="index_add_id"/>
9312
+ <xsl:apply-templates mode="index_add_id">
9313
+ <xsl:with-param name="docid" select="$docid"/>
9314
+ </xsl:apply-templates>
9293
9315
  </xsl:copy>
9294
9316
  </xsl:if>
9295
9317
  </xsl:template>
@@ -9326,12 +9348,33 @@
9326
9348
  </xsl:when>
9327
9349
  <xsl:when test="self::* and local-name(.) = 'xref'">
9328
9350
  <xsl:variable name="id" select="@id"/>
9329
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
9330
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
9331
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
9332
9351
 
9352
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
9333
9353
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
9334
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
9354
+
9355
+ <xsl:variable name="pages_">
9356
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
9357
+ <xsl:choose>
9358
+ <xsl:when test="@id = $id">
9359
+ <page><xsl:value-of select="."/></page>
9360
+ </xsl:when>
9361
+ <xsl:when test="@id = $id_next">
9362
+ <page_next><xsl:value-of select="."/></page_next>
9363
+ </xsl:when>
9364
+ <xsl:when test="@id = $id_prev">
9365
+ <page_prev><xsl:value-of select="."/></page_prev>
9366
+ </xsl:when>
9367
+ </xsl:choose>
9368
+ </xsl:for-each>
9369
+ </xsl:variable>
9370
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
9371
+
9372
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
9373
+ <xsl:variable name="page" select="$pages/page"/>
9374
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
9375
+ <xsl:variable name="page_next" select="$pages/page_next"/>
9376
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
9377
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
9335
9378
 
9336
9379
  <xsl:choose>
9337
9380
  <!-- 2nd pass -->
@@ -9391,16 +9434,20 @@
9391
9434
  </xsl:template>
9392
9435
 
9393
9436
  <xsl:template name="generateIndexXrefId">
9437
+ <xsl:param name="docid"/>
9438
+
9394
9439
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
9395
9440
 
9396
- <xsl:variable name="docid">
9397
- <xsl:call-template name="getDocumentId"/>
9441
+ <xsl:variable name="docid_curr">
9442
+ <xsl:value-of select="$docid"/>
9443
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
9398
9444
  </xsl:variable>
9445
+
9399
9446
  <xsl:variable name="item_number">
9400
9447
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
9401
9448
  </xsl:variable>
9402
9449
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
9403
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
9450
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
9404
9451
  </xsl:template>
9405
9452
 
9406
9453
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -6,8 +6,8 @@ require_relative "i18n"
6
6
  module IsoDoc
7
7
  module Iec
8
8
  module Init
9
- def metadata_init(lang, script, labels)
10
- @meta = Metadata.new(lang, script, labels)
9
+ def metadata_init(lang, script, locale, labels)
10
+ @meta = Metadata.new(lang, script, locale, labels)
11
11
  end
12
12
 
13
13
  def xref_init(lang, script, _klass, labels, options)
@@ -16,8 +16,9 @@ module IsoDoc
16
16
  labels, options)
17
17
  end
18
18
 
19
- def i18n_init(lang, script, i18nyaml = nil)
20
- @i18n = I18n.new(lang, script, i18nyaml: i18nyaml || @i18nyaml)
19
+ def i18n_init(lang, script, locale, i18nyaml = nil)
20
+ @i18n = I18n.new(lang, script, locale: locale,
21
+ i18nyaml: i18nyaml || @i18nyaml)
21
22
  end
22
23
 
23
24
  def convert1(docxml, filename, dir)
@@ -4,7 +4,7 @@ require "isodoc"
4
4
  module IsoDoc
5
5
  module Iec
6
6
  class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
7
- def i18n_init(lang, script, i18nyaml = nil)
7
+ def i18n_init(lang, script, locale, i18nyaml = nil)
8
8
  super
9
9
  @i18n_lg = {}
10
10
  @i18n_lg["en"] = I18n.new("en", "Latn", i18nyaml: i18nyaml || @i18nyaml)
@@ -18,12 +18,7 @@ module IsoDoc
18
18
  return unless @is_iev
19
19
 
20
20
  if @parse_settings.empty? || @parse_settings[:clauses]
21
- terms_iev_names(docxml)
22
- end
23
- if @parse_settings.empty?
24
- middle_section_asset_names(docxml)
25
- termnote_anchor_names(docxml)
26
- termexample_anchor_names(docxml)
21
+ terms_iev_names(docxml)
27
22
  end
28
23
  end
29
24
 
@@ -73,8 +73,14 @@
73
73
  <text/>
74
74
  </element>
75
75
  </define>
76
- <define name="script">
76
+ <define name="locale">
77
77
  <a:documentation>ISO-639</a:documentation>
78
+ <element name="locale">
79
+ <text/>
80
+ </element>
81
+ </define>
82
+ <define name="script">
83
+ <a:documentation>ISO-3166</a:documentation>
78
84
  <element name="script">
79
85
  <text/>
80
86
  </element>
@@ -93,6 +99,9 @@
93
99
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
100
  <attribute name="language"/>
95
101
  </optional>
102
+ <optional>
103
+ <attribute name="locale"/>
104
+ </optional>
96
105
  <optional>
97
106
  <attribute name="script"/>
98
107
  </optional>
@@ -136,6 +145,9 @@
136
145
  <!-- multiple languages and scripts possible: comma delimit them if so -->
137
146
  <attribute name="language"/>
138
147
  </optional>
148
+ <optional>
149
+ <attribute name="locale"/>
150
+ </optional>
139
151
  <optional>
140
152
  <attribute name="script"/>
141
153
  </optional>
@@ -650,6 +662,9 @@
650
662
  <zeroOrMore>
651
663
  <ref name="language"/>
652
664
  </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="locale"/>
667
+ </zeroOrMore>
653
668
  <zeroOrMore>
654
669
  <ref name="script"/>
655
670
  </zeroOrMore>
@@ -741,6 +756,9 @@
741
756
  <zeroOrMore>
742
757
  <ref name="language"/>
743
758
  </zeroOrMore>
759
+ <zeroOrMore>
760
+ <ref name="locale"/>
761
+ </zeroOrMore>
744
762
  <zeroOrMore>
745
763
  <ref name="script"/>
746
764
  </zeroOrMore>
@@ -854,6 +872,15 @@
854
872
  <optional>
855
873
  <attribute name="type"/>
856
874
  </optional>
875
+ <optional>
876
+ <attribute name="language"/>
877
+ </optional>
878
+ <optional>
879
+ <attribute name="locale"/>
880
+ </optional>
881
+ <optional>
882
+ <attribute name="script"/>
883
+ </optional>
857
884
  <data type="anyURI"/>
858
885
  </define>
859
886
  <define name="DateType">
@@ -882,6 +909,7 @@
882
909
  <value>vote-started</value>
883
910
  <value>vote-ended</value>
884
911
  <value>announced</value>
912
+ <value>stable-until</value>
885
913
  </choice>
886
914
  </define>
887
915
  <define name="bdate">
@@ -930,6 +958,9 @@
930
958
  <optional>
931
959
  <attribute name="language"/>
932
960
  </optional>
961
+ <optional>
962
+ <attribute name="locale"/>
963
+ </optional>
933
964
  <optional>
934
965
  <attribute name="script"/>
935
966
  </optional>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.1.8.1".freeze
3
+ VERSION = "2.1.9".freeze
4
4
  end
5
5
  end
6
6
 
@@ -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.8"
30
+ spec.add_dependency "metanorma-iso", "~> 2.2.0"
31
31
  spec.add_dependency "ruby-jing"
32
32
 
33
33
  spec.add_development_dependency "debug"
@@ -861,7 +861,7 @@ RSpec.describe IsoDoc do
861
861
  <dd language='zh' script='Hans'>
862
862
  <preferred>
863
863
  <strong>&#x4EA7;&#x54C1;</strong>
864
- , &#x3c;&#x5728;&#x53EF;&#x9760;&#x6027;&#x65B9;&#x9762;&#x3e;
864
+ &#xff0c; &#x3c;&#x5728;&#x53EF;&#x9760;&#x6027;&#x65B9;&#x9762;&#x3e;
865
865
  </preferred>
866
866
  </dd>
867
867
  </dl>
@@ -167,12 +167,12 @@ RSpec.describe IsoDoc::Iec do
167
167
  </references><references id="_bibliography" obligation="informative" normative="false" displayorder="3">
168
168
  <title depth="1">Bibliography</title>
169
169
  <bibitem id="ISBN" type="book">
170
- <formattedref><em>Chemicals for analytical laboratory use</em>. n.p.: n.d. ISBN.</formattedref>
170
+ <formattedref><em>Chemicals for analytical laboratory use</em>. n.p.: n.d.</formattedref>
171
171
  <docidentifier type="metanorma-ordinal">[1]</docidentifier>
172
172
  <docidentifier type="ISBN">ISBN</docidentifier>
173
173
  </bibitem>
174
174
  <bibitem id="ISSN" type="journal">
175
- <formattedref><em>Instruments for analytical laboratory use</em>. n.d. ISSN.</formattedref>
175
+ <formattedref><em>Instruments for analytical laboratory use</em>. n.d.</formattedref>
176
176
  <docidentifier type="metanorma-ordinal">[2]</docidentifier>
177
177
  <docidentifier type="ISSN">ISSN</docidentifier>
178
178
  </bibitem>
@@ -271,12 +271,12 @@ RSpec.describe IsoDoc::Iec do
271
271
  <p id='ISBN' class='Biblio'>
272
272
  [1]&#xa0;
273
273
  <i>Chemicals for analytical laboratory use</i>
274
- . n.p.: n.d. ISBN.
274
+ . n.p.: n.d.
275
275
  </p>
276
276
  <p id='ISSN' class='Biblio'>
277
277
  [2]&#xa0;
278
278
  <i>Instruments for analytical laboratory use</i>
279
- . n.d. ISSN.
279
+ . n.d.
280
280
  </p>
281
281
  <div class='Note'>
282
282
  <p>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.8.1
4
+ version: 2.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-07 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.8
19
+ version: 2.2.0
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.1.8
26
+ version: 2.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ruby-jing
29
29
  requirement: !ruby/object:Gem::Requirement