metanorma-iec 2.1.8.1 → 2.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/iec.international-standard.xsl +59 -12
- data/lib/isodoc/iec/init.rb +5 -4
- data/lib/isodoc/iec/presentation_xml_convert.rb +2 -2
- data/lib/isodoc/iec/xref.rb +1 -6
- data/lib/metanorma/iec/biblio.rng +32 -1
- data/lib/metanorma/iec/isodoc.rng +9 -0
- data/lib/metanorma/iec/isostandard.rng +3 -0
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- data/spec/isodoc/iev_spec.rb +1 -1
- data/spec/isodoc/ref_spec.rb +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba54bd24b1416849f106767c466616f517f80a92a7acb3c3bc4b896372402710
|
4
|
+
data.tar.gz: 8984619f5a422c14ff92fd2190a565b288a3f68a74ff91768887fec205bb787a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b6add14a09ea1e3e16ce212741f92dae1fb5bfa9a5f73dbb6a94b944b54bb4c7a6bdef1154a3ede03ee510b97b3ca91fa59a06987d0f6c6f25204eb093ee2bd
|
7
|
+
data.tar.gz: 9e9647e3a2e3af354e152d2aec5b1a5ba2339f16ae119d354c5067acf175c0294a690d69450823f941dac8a5273770fb6350b2f5436a7e9dc29e001965f62d03
|
@@ -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>
|
@@ -8759,7 +8771,7 @@
|
|
8759
8771
|
<!-- ====== -->
|
8760
8772
|
<!-- eref -->
|
8761
8773
|
<!-- ====== -->
|
8762
|
-
<xsl:template match="*[local-name() = 'eref']">
|
8774
|
+
<xsl:template match="*[local-name() = 'eref']" name="eref">
|
8763
8775
|
<xsl:variable name="current_bibitemid" select="@bibitemid"/>
|
8764
8776
|
<!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
|
8765
8777
|
<xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
|
@@ -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
|
-
|
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
|
-
|
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="
|
9397
|
-
<xsl:
|
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($
|
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">
|
data/lib/isodoc/iec/init.rb
CHANGED
@@ -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,
|
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)
|
@@ -203,7 +203,7 @@ module IsoDoc
|
|
203
203
|
|
204
204
|
def termsource1_iev(elem)
|
205
205
|
while elem&.next_element&.name == "termsource"
|
206
|
-
elem <<
|
206
|
+
elem << "; #{elem.next_element.remove.children.to_xml}"
|
207
207
|
end
|
208
208
|
elem.children = l10n("#{@i18n.source}: #{elem.children.to_xml.strip}")
|
209
209
|
end
|
data/lib/isodoc/iec/xref.rb
CHANGED
@@ -18,12 +18,7 @@ module IsoDoc
|
|
18
18
|
return unless @is_iev
|
19
19
|
|
20
20
|
if @parse_settings.empty? || @parse_settings[:clauses]
|
21
|
-
|
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="
|
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>
|
@@ -205,6 +205,15 @@
|
|
205
205
|
<data type="boolean"/>
|
206
206
|
</attribute>
|
207
207
|
</optional>
|
208
|
+
<optional>
|
209
|
+
<attribute name="style">
|
210
|
+
<choice>
|
211
|
+
<value>basic</value>
|
212
|
+
<value>full</value>
|
213
|
+
<value>short</value>
|
214
|
+
</choice>
|
215
|
+
</attribute>
|
216
|
+
</optional>
|
208
217
|
<ref name="XrefBody"/>
|
209
218
|
</element>
|
210
219
|
</define>
|
data/metanorma-iec.gemspec
CHANGED
@@ -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.
|
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"
|
data/spec/isodoc/iev_spec.rb
CHANGED
@@ -861,7 +861,7 @@ RSpec.describe IsoDoc do
|
|
861
861
|
<dd language='zh' script='Hans'>
|
862
862
|
<preferred>
|
863
863
|
<strong>产品</strong>
|
864
|
-
|
864
|
+
, <在可靠性方面/>
|
865
865
|
</preferred>
|
866
866
|
</dd>
|
867
867
|
</dl>
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -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
|
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
|
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] 
|
273
273
|
<i>Chemicals for analytical laboratory use</i>
|
274
|
-
. n.p.: n.d.
|
274
|
+
. n.p.: n.d.
|
275
275
|
</p>
|
276
276
|
<p id='ISSN' class='Biblio'>
|
277
277
|
[2] 
|
278
278
|
<i>Instruments for analytical laboratory use</i>
|
279
|
-
. n.d.
|
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.
|
4
|
+
version: 2.1.10
|
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-
|
11
|
+
date: 2022-10-10 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.
|
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.
|
26
|
+
version: 2.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-jing
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|