metanorma-iec 2.2.2 → 2.2.4
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/base_convert.rb +9 -9
- data/lib/isodoc/iec/html/html_iec_titlepage.html +1 -1
- data/lib/isodoc/iec/iec.international-standard.xsl +40 -13
- data/lib/metanorma/iec/basicdoc.rng +0 -1
- data/lib/metanorma/iec/biblio.rng +1 -1
- data/lib/metanorma/iec/converter.rb +25 -2
- data/lib/metanorma/iec/front.rb +36 -4
- data/lib/metanorma/iec/isodoc.rng +2 -1
- data/lib/metanorma/iec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa0cb1e4f74a208623ea4afa6ac089d07ef738ab6a5e2b743ba1c9cf874c761f
|
4
|
+
data.tar.gz: 306daf6fb488295282985216c68bd3e27f50c0a9a48d5b44949c9b8a7c793ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff37df74026031b95f8900c82d5ab67ff1e9df40999ddee4f82e35ead8b9f9d4087c67d60db1987889b69e7dce311163fa79b9d0744d8303322e80ea4d50c7e7
|
7
|
+
data.tar.gz: f2969e8aed2645c90fee5e6fafa183ece04729b87827daf62783bc8214a0e37250c0780ad62dd076fa0c19951e1446fd21f770f812d962ea06df42b1962f47db
|
@@ -19,7 +19,7 @@ module IsoDoc
|
|
19
19
|
|
20
20
|
def foreword1(sect, boilerplate, out)
|
21
21
|
out.div **attr_code(id: sect ? sect["id"] : "") do |s|
|
22
|
-
s.h1(
|
22
|
+
s.h1(class: "ForewordTitle") { |h1| h1 << @i18n.foreword }
|
23
23
|
@meta.get[:doctype] == "Amendment" or
|
24
24
|
s.div **attr_code(class: "boilerplate_legal") do |s1|
|
25
25
|
boilerplate&.elements&.each { |e| parse(e, s1) }
|
@@ -29,23 +29,23 @@ module IsoDoc
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def iec_orgname(out)
|
32
|
-
out.p(
|
33
|
-
out.p(
|
34
|
-
out.p(
|
32
|
+
out.p(class: "zzSTDTitle1") { |p| p << @i18n.get["IEC"] }
|
33
|
+
out.p(class: "zzSTDTitle1") { |p| p << "____________" }
|
34
|
+
out.p(class: "zzSTDTitle1") { |p| p << " " }
|
35
35
|
end
|
36
36
|
|
37
37
|
def middle_title(_isoxml, out)
|
38
38
|
title1, title2 = middle_title_parts(out)
|
39
|
-
out.p(
|
39
|
+
out.p(class: "zzSTDTitle1") do |p|
|
40
40
|
p.b { |b| b << title1 }
|
41
41
|
end
|
42
42
|
if title2
|
43
|
-
out.p(
|
44
|
-
out.p(
|
43
|
+
out.p(class: "zzSTDTitle1") { |p| p << " " }
|
44
|
+
out.p(class: "zzSTDTitle2") do |p|
|
45
45
|
p.b { |b| b << title2 }
|
46
46
|
end
|
47
47
|
end
|
48
|
-
out.p(
|
48
|
+
out.p(class: "zzSTDTitle1") { |p| p << " " }
|
49
49
|
end
|
50
50
|
|
51
51
|
def middle_title_parts(_out)
|
@@ -80,7 +80,7 @@ module IsoDoc
|
|
80
80
|
page_break(out)
|
81
81
|
out.div **attr_code(id: node["id"]) do |div|
|
82
82
|
depth = clause_title_depth(node, nil)
|
83
|
-
out.send "h#{depth}",
|
83
|
+
out.send "h#{depth}", class: "zzSTDTitle2" do |p|
|
84
84
|
p.b do |b|
|
85
85
|
node&.at(ns("./title"))&.children&.each { |c2| parse(c2, b) }
|
86
86
|
end
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<p class="coverpage_docnumber">{{ docnumber }}(E) {{ draftinfo }}</p>
|
14
14
|
{% endif %}
|
15
15
|
|
16
|
-
<p class="coverpage_techcommittee">{{
|
16
|
+
<p class="coverpage_techcommittee">{{ editorialgroup }}</p>
|
17
17
|
|
18
18
|
<p class="coverpage_techcommittee"><a
|
19
19
|
name="CVP_Secretariat_Loca">Secretariat</a>: {{ secretariat }}</p>
|
@@ -1697,10 +1697,14 @@
|
|
1697
1697
|
<xsl:element name="{$element-name}">
|
1698
1698
|
<xsl:attribute name="text-align">
|
1699
1699
|
<xsl:choose>
|
1700
|
-
<xsl:when test="@align
|
1700
|
+
<xsl:when test="@align = 'justified'">justify</xsl:when>
|
1701
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
1701
1702
|
<xsl:otherwise>justify</xsl:otherwise>
|
1702
1703
|
</xsl:choose>
|
1703
1704
|
</xsl:attribute>
|
1705
|
+
<xsl:if test="@align = 'indent'">
|
1706
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
1707
|
+
</xsl:if>
|
1704
1708
|
<xsl:attribute name="margin-top">5pt</xsl:attribute>
|
1705
1709
|
<xsl:if test="ancestor::iec:definition">
|
1706
1710
|
<xsl:attribute name="margin-top">1pt</xsl:attribute>
|
@@ -2036,14 +2040,14 @@
|
|
2036
2040
|
BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
|
2037
2041
|
|
2038
2042
|
<!--
|
2039
|
-
<
|
2043
|
+
<metanorma-extension>
|
2040
2044
|
<presentation-metadata>
|
2041
2045
|
<papersize>letter</papersize>
|
2042
2046
|
</presentation-metadata>
|
2043
|
-
</
|
2047
|
+
</metanorma-extension>
|
2044
2048
|
-->
|
2045
2049
|
|
2046
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2050
|
+
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
|
2047
2051
|
<xsl:variable name="papersize_width_">
|
2048
2052
|
<xsl:choose>
|
2049
2053
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -2164,7 +2168,7 @@
|
|
2164
2168
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
2165
2169
|
|
2166
2170
|
<xsl:variable name="title-list-tables">
|
2167
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2171
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
2168
2172
|
<xsl:value-of select="$toc_table_title"/>
|
2169
2173
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
2170
2174
|
<xsl:call-template name="getTitle">
|
@@ -2174,7 +2178,7 @@
|
|
2174
2178
|
</xsl:variable>
|
2175
2179
|
|
2176
2180
|
<xsl:variable name="title-list-figures">
|
2177
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2181
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
2178
2182
|
<xsl:value-of select="$toc_figure_title"/>
|
2179
2183
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
2180
2184
|
<xsl:call-template name="getTitle">
|
@@ -2184,7 +2188,7 @@
|
|
2184
2188
|
</xsl:variable>
|
2185
2189
|
|
2186
2190
|
<xsl:variable name="title-list-recommendations">
|
2187
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2191
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
2188
2192
|
<xsl:value-of select="$toc_requirement_title"/>
|
2189
2193
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
2190
2194
|
<xsl:call-template name="getTitle">
|
@@ -2256,7 +2260,7 @@
|
|
2256
2260
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
2257
2261
|
|
2258
2262
|
<xsl:variable name="additional_fonts_">
|
2259
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
2263
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
2260
2264
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
2261
2265
|
</xsl:for-each>
|
2262
2266
|
</xsl:variable>
|
@@ -3361,10 +3365,10 @@
|
|
3361
3365
|
|
3362
3366
|
<xsl:template name="processTablesFigures_Contents">
|
3363
3367
|
<xsl:param name="always"/>
|
3364
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
3368
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
3365
3369
|
<xsl:call-template name="processTables_Contents"/>
|
3366
3370
|
</xsl:if>
|
3367
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
3371
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
3368
3372
|
<xsl:call-template name="processFigures_Contents"/>
|
3369
3373
|
</xsl:if>
|
3370
3374
|
</xsl:template>
|
@@ -3708,6 +3712,8 @@
|
|
3708
3712
|
<xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
|
3709
3713
|
</xsl:if>
|
3710
3714
|
|
3715
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3716
|
+
|
3711
3717
|
</xsl:element>
|
3712
3718
|
</xsl:variable>
|
3713
3719
|
|
@@ -3852,6 +3858,15 @@
|
|
3852
3858
|
|
3853
3859
|
</xsl:template>
|
3854
3860
|
|
3861
|
+
<xsl:template name="setBordersTableArray">
|
3862
|
+
|
3863
|
+
<xsl:if test="starts-with(@id, 'array_') or starts-with(ancestor::*[local-name() = 'table'][1]/@id, 'array_')">
|
3864
|
+
<!-- array - table without borders -->
|
3865
|
+
<xsl:attribute name="border">none</xsl:attribute>
|
3866
|
+
</xsl:if>
|
3867
|
+
|
3868
|
+
</xsl:template>
|
3869
|
+
|
3855
3870
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
3856
3871
|
<xsl:param name="continued"/>
|
3857
3872
|
<xsl:if test="normalize-space() != ''">
|
@@ -4326,6 +4341,8 @@
|
|
4326
4341
|
<fo:table-row>
|
4327
4342
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
4328
4343
|
|
4344
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4345
|
+
|
4329
4346
|
<!-- fn will be processed inside 'note' processing -->
|
4330
4347
|
|
4331
4348
|
<xsl:if test="../*[local-name()='note']">
|
@@ -4342,6 +4359,7 @@
|
|
4342
4359
|
|
4343
4360
|
<xsl:if test="../*[local-name()='note']">
|
4344
4361
|
<fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
|
4362
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4345
4363
|
<fo:block font-size="1pt"> </fo:block>
|
4346
4364
|
</fo:block-container>
|
4347
4365
|
</xsl:if>
|
@@ -4457,6 +4475,8 @@
|
|
4457
4475
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
4458
4476
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
4459
4477
|
|
4478
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4479
|
+
|
4460
4480
|
<xsl:call-template name="setTableRowAttributes"/>
|
4461
4481
|
|
4462
4482
|
<xsl:apply-templates/>
|
@@ -4480,6 +4500,8 @@
|
|
4480
4500
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
4481
4501
|
</xsl:if>
|
4482
4502
|
|
4503
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4504
|
+
|
4483
4505
|
<xsl:call-template name="setTableRowAttributes"/>
|
4484
4506
|
<xsl:apply-templates/>
|
4485
4507
|
</fo:table-row>
|
@@ -4504,6 +4526,8 @@
|
|
4504
4526
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
4505
4527
|
</xsl:if>
|
4506
4528
|
|
4529
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4530
|
+
|
4507
4531
|
<xsl:if test="$lang = 'ar'">
|
4508
4532
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
4509
4533
|
</xsl:if>
|
@@ -4560,6 +4584,8 @@
|
|
4560
4584
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
4561
4585
|
</xsl:if>
|
4562
4586
|
|
4587
|
+
<xsl:call-template name="setBordersTableArray"/>
|
4588
|
+
|
4563
4589
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
4564
4590
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
4565
4591
|
</xsl:if>
|
@@ -8229,7 +8255,7 @@
|
|
8229
8255
|
<!-- sourcecode -->
|
8230
8256
|
<!-- =============== -->
|
8231
8257
|
|
8232
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
8258
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
8233
8259
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
8234
8260
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
8235
8261
|
|
@@ -10302,8 +10328,8 @@
|
|
10302
10328
|
|
10303
10329
|
<xsl:variable name="toc_level">
|
10304
10330
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
10305
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
10306
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
10331
|
+
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
|
10332
|
+
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
|
10307
10333
|
<xsl:choose>
|
10308
10334
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
10309
10335
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -11294,6 +11320,7 @@
|
|
11294
11320
|
<xsl:choose>
|
11295
11321
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
11296
11322
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
11323
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
11297
11324
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
11298
11325
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
11299
11326
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
@@ -1316,7 +1316,7 @@
|
|
1316
1316
|
<value>commentaryOf</value>
|
1317
1317
|
<value>hasCommentary</value>
|
1318
1318
|
<value>related</value>
|
1319
|
-
<value>
|
1319
|
+
<value>hasComplement</value>
|
1320
1320
|
<value>complementOf</value>
|
1321
1321
|
<value>obsoletes</value>
|
1322
1322
|
<value>obsoletedBy</value>
|
@@ -126,8 +126,8 @@ module Metanorma
|
|
126
126
|
m = /60050-(\d+)/.match(id) or return
|
127
127
|
xmldoc.xpath("//sections/clause/terms/title").each_with_index do |t, i|
|
128
128
|
num = "%02d" % [i + 1]
|
129
|
-
t.next = "<variant-title type='toc'>"\
|
130
|
-
"#{@i18n.section_iev} #{m[1]}-#{num} – "\
|
129
|
+
t.next = "<variant-title type='toc'>" \
|
130
|
+
"#{@i18n.section_iev} #{m[1]}-#{num} – " \
|
131
131
|
"#{t.children.to_xml}</variant-title>"
|
132
132
|
end
|
133
133
|
end
|
@@ -136,6 +136,29 @@ module Metanorma
|
|
136
136
|
attr_code(keep_attrs(node)
|
137
137
|
.merge(id: ::Metanorma::Utils::anchor_or_uuid(node)))
|
138
138
|
end
|
139
|
+
|
140
|
+
# TODO remove when I adopt pubid-iec
|
141
|
+
#
|
142
|
+
def get_id_prefix(xmldoc)
|
143
|
+
xmldoc.xpath("//bibdata/contributor[role/@type = 'publisher']" \
|
144
|
+
"/organization").each_with_object([]) do |x, prefix|
|
145
|
+
x1 = x.at("abbreviation")&.text || x.at("name")&.text
|
146
|
+
#(x1 == "IEC" and prefix.unshift("IEC")) or prefix << x1
|
147
|
+
prefix << x1
|
148
|
+
end
|
149
|
+
end
|
150
|
+
#
|
151
|
+
def docidentifier_cleanup(xmldoc)
|
152
|
+
prefix = get_id_prefix(xmldoc)
|
153
|
+
id = xmldoc.at("//bibdata/docidentifier[@type = 'ISO']") or return
|
154
|
+
id.content = id_prefix(prefix, id)
|
155
|
+
id = xmldoc.at("//bibdata/ext/structuredidentifier/project-number") and
|
156
|
+
id.content = id_prefix(prefix, id)
|
157
|
+
%w(iso-with-lang iso-reference iso-undated).each do |t|
|
158
|
+
id = xmldoc.at("//bibdata/docidentifier[@type = '#{t}']") and
|
159
|
+
id.content = id_prefix(prefix, id)
|
160
|
+
end
|
161
|
+
end
|
139
162
|
end
|
140
163
|
end
|
141
164
|
end
|
data/lib/metanorma/iec/front.rb
CHANGED
@@ -5,7 +5,7 @@ module Metanorma
|
|
5
5
|
publishers = node.attr("publisher") || "IEC"
|
6
6
|
csv_split(publishers)&.each do |p|
|
7
7
|
xml.contributor do |c|
|
8
|
-
c.role
|
8
|
+
c.role type: "author"
|
9
9
|
c.organization do |a|
|
10
10
|
organization(a, p, false, node, !node.attr("publisher"))
|
11
11
|
end
|
@@ -17,7 +17,7 @@ module Metanorma
|
|
17
17
|
publishers = node.attr("publisher") || "IEC"
|
18
18
|
csv_split(publishers)&.each do |p|
|
19
19
|
xml.contributor do |c|
|
20
|
-
c.role
|
20
|
+
c.role type: "publisher"
|
21
21
|
c.organization do |a|
|
22
22
|
organization(a, p, true, node, !node.attr("publisher"))
|
23
23
|
end
|
@@ -51,6 +51,37 @@ module Metanorma
|
|
51
51
|
xml.docidentifier dn, **attr_code(type: "ISO")
|
52
52
|
end
|
53
53
|
|
54
|
+
def add_id_parts(docnum, part, subpart)
|
55
|
+
docnum += "-#{part}" if part
|
56
|
+
docnum += "-#{subpart}" if subpart
|
57
|
+
docnum
|
58
|
+
end
|
59
|
+
|
60
|
+
def id_stage_prefix(docnum, node)
|
61
|
+
stage = get_stage(node)
|
62
|
+
typeabbr = get_typeabbr(node)&.upcase
|
63
|
+
if stage && (stage.to_i < 60)
|
64
|
+
docnum = unpub_stage_prefix(docnum, stage, typeabbr, node)
|
65
|
+
elsif typeabbr == "DIR " then docnum = "#{typeabbr}#{docnum}"
|
66
|
+
elsif typeabbr && !@amd then docnum = "/#{typeabbr}#{docnum}"
|
67
|
+
end
|
68
|
+
docnum
|
69
|
+
end
|
70
|
+
|
71
|
+
def unpub_stage_prefix(docnum, stage, typeabbr, node)
|
72
|
+
abbr = id_stage_abbr(stage, get_substage(node), node)
|
73
|
+
%w(40 50).include?(stage) && i = node.attr("iteration") and
|
74
|
+
itersuffix = ".#{i}"
|
75
|
+
return docnum if abbr.nil? || abbr.empty? # prefixes added in cleanup
|
76
|
+
|
77
|
+
typeabbr = "" if %w(DTS FDTS).include?(abbr.sub(/\s+$/, ""))
|
78
|
+
return "/#{abbr}#{typeabbr} #{docnum}#{itersuffix}" unless @amd
|
79
|
+
|
80
|
+
a = docnum.split(%r{/})
|
81
|
+
a[-1] = "#{abbr}#{a[-1]}#{itersuffix}"
|
82
|
+
a.join("/")
|
83
|
+
end
|
84
|
+
|
54
85
|
def id_edition_suffix(docnum, node)
|
55
86
|
ed = node.attr("edition") || 1
|
56
87
|
docnum += " ED #{ed}"
|
@@ -151,7 +182,7 @@ module Metanorma
|
|
151
182
|
abbr
|
152
183
|
end
|
153
184
|
|
154
|
-
def stage_abbr(stage, _substage)
|
185
|
+
def stage_abbr(stage, _substage, _doctype)
|
155
186
|
return "PPUB" if stage == "60"
|
156
187
|
|
157
188
|
DOC_STAGE[stage.to_sym] || "??"
|
@@ -191,7 +222,8 @@ module Metanorma
|
|
191
222
|
stage = get_stage(node)
|
192
223
|
substage = get_substage(node)
|
193
224
|
xml.status do |s|
|
194
|
-
s.stage stage,
|
225
|
+
s.stage stage,
|
226
|
+
**attr_code(abbreviation: stage_abbr(stage, substage, nil))
|
195
227
|
subst = status_abbrev1(stage, substage, node.attr("iteration"),
|
196
228
|
doctype(node), node.attr("draft"))
|
197
229
|
s.substage substage, **attr_code(abbreviation: subst)
|
@@ -66,6 +66,7 @@
|
|
66
66
|
<value>caution</value>
|
67
67
|
<value>statement</value>
|
68
68
|
<value>editorial</value>
|
69
|
+
<value>box</value>
|
69
70
|
</choice>
|
70
71
|
</define>
|
71
72
|
<define name="index">
|
@@ -1580,7 +1581,7 @@
|
|
1580
1581
|
</element>
|
1581
1582
|
</define>
|
1582
1583
|
<define name="misccontainer">
|
1583
|
-
<element name="
|
1584
|
+
<element name="metanorma-extension">
|
1584
1585
|
<oneOrMore>
|
1585
1586
|
<ref name="AnyElement"/>
|
1586
1587
|
</oneOrMore>
|
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.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|