metanorma-iso 1.7.1 → 1.8.1
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 +4 -4
- data/.github/workflows/rake.yml +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/iso/base.rb +18 -16
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +28 -24
- data/lib/asciidoctor/iso/front.rb +26 -16
- data/lib/asciidoctor/iso/front_id.rb +30 -25
- data/lib/asciidoctor/iso/isodoc.rng +172 -3
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +17 -97
- data/lib/asciidoctor/iso/validate.rb +22 -109
- data/lib/asciidoctor/iso/validate_image.rb +97 -0
- data/lib/asciidoctor/iso/validate_requirements.rb +26 -20
- data/lib/asciidoctor/iso/validate_section.rb +39 -20
- data/lib/asciidoctor/iso/validate_style.rb +36 -24
- data/lib/asciidoctor/iso/validate_title.rb +23 -17
- data/lib/isodoc/iso/base_convert.rb +19 -2
- data/lib/isodoc/iso/html/style-human.css +7 -0
- data/lib/isodoc/iso/html/style-iso.css +7 -0
- data/lib/isodoc/iso/html_convert.rb +0 -1
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1092 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +1092 -208
- data/lib/isodoc/iso/presentation_xml_convert.rb +45 -37
- data/lib/isodoc/iso/word_convert.rb +0 -1
- data/lib/isodoc/iso/xref.rb +15 -7
- data/lib/metanorma/iso/processor.rb +1 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +8 -8
- data/spec/asciidoctor/amd_spec.rb +696 -0
- data/spec/asciidoctor/base_spec.rb +733 -0
- data/spec/asciidoctor/blocks_spec.rb +527 -0
- data/spec/asciidoctor/cleanup_spec.rb +1134 -0
- data/spec/asciidoctor/inline_spec.rb +195 -0
- data/spec/asciidoctor/lists_spec.rb +197 -0
- data/spec/asciidoctor/refs_spec.rb +375 -0
- data/spec/asciidoctor/section_spec.rb +393 -0
- data/spec/asciidoctor/table_spec.rb +329 -0
- data/spec/asciidoctor/validate_spec.rb +1627 -0
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +836 -657
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +821 -519
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +178 -193
- metadata +65 -66
- data/.rubocop.ribose.yml +0 -66
- data/lib/isodoc/iso/html/scripts.html +0 -178
- data/spec/asciidoctor-iso/amd_spec.rb +0 -694
- data/spec/asciidoctor-iso/base_spec.rb +0 -713
- data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
- data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
- data/spec/asciidoctor-iso/inline_spec.rb +0 -170
- data/spec/asciidoctor-iso/lists_spec.rb +0 -190
- data/spec/asciidoctor-iso/refs_spec.rb +0 -317
- data/spec/asciidoctor-iso/section_spec.rb +0 -362
- data/spec/asciidoctor-iso/table_spec.rb +0 -313
- data/spec/asciidoctor-iso/validate_spec.rb +0 -1621
- data/spec/assets/xref_error.adoc +0 -7
@@ -4,398 +4,408 @@ require "nokogiri"
|
|
4
4
|
RSpec.describe IsoDoc::Iso::Metadata do
|
5
5
|
it "processes IsoXML metadata" do
|
6
6
|
c = IsoDoc::Iso::HtmlConvert.new({})
|
7
|
-
|
8
|
-
|
7
|
+
_ = c.convert_init(<<~"INPUT", "test", false)
|
8
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
9
9
|
INPUT
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
</
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
</
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
103
|
-
:
|
104
|
-
:
|
105
|
-
:
|
106
|
-
:
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
110
|
-
:
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
122
|
-
:
|
123
|
-
:
|
124
|
-
:
|
125
|
-
:
|
126
|
-
:
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
:
|
135
|
-
:
|
136
|
-
:
|
137
|
-
|
10
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
11
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
12
|
+
<bibdata type="standard">
|
13
|
+
<title format="text/plain" language="en" type="title-intro">Cereals and pulses</title>
|
14
|
+
<title format="text/plain" language="en" type="title-main">Specifications and test methods</title>
|
15
|
+
<title format="text/plain" language="en" type="title-part">Rice</title>
|
16
|
+
<title format="text/plain" language="fr" type="title-intro">Céréales et légumineuses</title>
|
17
|
+
<title format="text/plain" language="fr" type="title-main">Spécification et méthodes d'essai</title>
|
18
|
+
<title format="text/plain" language="fr" type="title-part">Riz</title>
|
19
|
+
<docidentifier type="ISO">ISO/PreCD3 17301-1</docidentifier>
|
20
|
+
<docidentifier type="iso-with-lang">ISO/PreCD3 17301-1 (E)</docidentifier>
|
21
|
+
<docidentifier type="iso-reference">ISO/PreCD3 17301-1:2000 (E)</docidentifier>
|
22
|
+
<docidentifier type="iso-tc">17301</docidentifier>
|
23
|
+
<docidentifier type="iso-tc">17302</docidentifier>
|
24
|
+
<docnumber>1730</docnumber>
|
25
|
+
<date type="published">
|
26
|
+
<on>2011</on>
|
27
|
+
</date>
|
28
|
+
<date type="accessed">
|
29
|
+
<on>2012</on>
|
30
|
+
</date>
|
31
|
+
<date type="created">
|
32
|
+
<from>2010</from>
|
33
|
+
<to>2011</to>
|
34
|
+
</date>
|
35
|
+
<date type="activated">
|
36
|
+
<on>2013</on>
|
37
|
+
</date>
|
38
|
+
<date type="obsoleted">
|
39
|
+
<on>2014</on>
|
40
|
+
</date>
|
41
|
+
<edition>2</edition>
|
42
|
+
<version>
|
43
|
+
<revision-date>2016-05-01</revision-date>
|
44
|
+
<draft>0.4</draft>
|
45
|
+
</version>
|
46
|
+
<contributor>
|
47
|
+
<role type="author"/>
|
48
|
+
<organization>
|
49
|
+
<abbreviation>ISO</abbreviation>
|
50
|
+
</organization>
|
51
|
+
</contributor>
|
52
|
+
<contributor>
|
53
|
+
<role type="publisher"/>
|
54
|
+
<organization>
|
55
|
+
<name>International Organization for Standardization</name>
|
56
|
+
<abbreviation>ISO</abbreviation>
|
57
|
+
</organization>
|
58
|
+
</contributor>
|
59
|
+
<language>en</language>
|
60
|
+
<script>Latn</script>
|
61
|
+
<status>
|
62
|
+
<stage abbreviation="CD">30</stage>
|
63
|
+
<substage>92</substage>
|
64
|
+
<iteration>3</iteration>
|
65
|
+
</status>
|
66
|
+
<copyright>
|
67
|
+
<from>2016</from>
|
68
|
+
<owner>
|
69
|
+
<organization>
|
70
|
+
<abbreviation>ISO</abbreviation>
|
71
|
+
</organization>
|
72
|
+
</owner>
|
73
|
+
</copyright>
|
74
|
+
<keyword>kw2</keyword>
|
75
|
+
<keyword>kw1</keyword>
|
76
|
+
<ext>
|
77
|
+
<doctype>international-standard</doctype>
|
78
|
+
<horizontal>true</horizontal>
|
79
|
+
<editorialgroup>
|
80
|
+
<technical-committee number="34">Food products</technical-committee>
|
81
|
+
<subcommittee number="4">Cereals and pulses</subcommittee>
|
82
|
+
<workgroup number="3">Rice Group</workgroup>
|
83
|
+
<secretariat>GB</secretariat>
|
84
|
+
</editorialgroup>
|
85
|
+
<structuredidentifier>
|
86
|
+
<project-number part="1">ISO/PreCD3 17301</project-number>
|
87
|
+
</structuredidentifier>
|
88
|
+
<stagename>Committee draft</stagename>
|
89
|
+
</ext>
|
90
|
+
</bibdata>
|
91
|
+
</iso-standard>
|
92
|
+
INPUT
|
93
|
+
{:accesseddate=>"2012",
|
94
|
+
:activateddate=>"2013",
|
95
|
+
:agency=>"ISO",
|
96
|
+
:circulateddate=>"XXX",
|
97
|
+
:confirmeddate=>"XXX",
|
98
|
+
:copieddate=>"XXX",
|
99
|
+
:createddate=>"2010–2011",
|
100
|
+
:docnumber=>"ISO/PreCD3 17301-1",
|
101
|
+
:docnumber_lang=>"ISO/PreCD3 17301-1 (E)",
|
102
|
+
:docnumber_reference=>"ISO/PreCD3 17301-1:2000 (E)",
|
103
|
+
:docnumeric=>"1730",
|
104
|
+
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1: Riz",
|
105
|
+
:docsubtitleintro=>"Céréales et légumineuses",
|
106
|
+
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
107
|
+
:docsubtitlepart=>"Riz",
|
108
|
+
:docsubtitlepartlabel=>"Partie 1",
|
109
|
+
:doctitle=>"Cereals and pulses — Specifications and test methods — Part 1: Rice",
|
110
|
+
:doctitleintro=>"Cereals and pulses",
|
111
|
+
:doctitlemain=>"Specifications and test methods",
|
112
|
+
:doctitlepart=>"Rice",
|
113
|
+
:doctitlepartlabel=>"Part 1",
|
114
|
+
:doctype=>"International Standard",
|
115
|
+
:doctype_display=>"International Standard",
|
116
|
+
:docyear=>"2016",
|
117
|
+
:draft=>"0.4",
|
118
|
+
:draftinfo=>" (draft 0.4, 2016-05-01)",
|
119
|
+
:edition=>"2",
|
120
|
+
:editorialgroup=>["TC 34", "SC 4", "WG 3"],
|
121
|
+
:horizontal=>"true",
|
122
|
+
:implementeddate=>"XXX",
|
123
|
+
:issueddate=>"XXX",
|
124
|
+
:keywords=>["kw2", "kw1"],
|
125
|
+
:lang=>"en",
|
126
|
+
:obsoleteddate=>"2014",
|
127
|
+
:publisheddate=>"2011",
|
128
|
+
:publisher=>"International Organization for Standardization",
|
129
|
+
:receiveddate=>"XXX",
|
130
|
+
:revdate=>"2016-05-01",
|
131
|
+
:revdate_monthyear=>"May 2016",
|
132
|
+
:sc=>"SC 4",
|
133
|
+
:script=>"Latn",
|
134
|
+
:secretariat=>"GB",
|
135
|
+
:stage=>"30",
|
136
|
+
:stage_int=>30,
|
137
|
+
:stageabbr=>"CD",
|
138
|
+
:statusabbr=>"PreCD3",
|
139
|
+
:tc=>"TC 34",
|
140
|
+
:tc_docnumber=>["17301", "17302"],
|
141
|
+
:transmitteddate=>"XXX",
|
142
|
+
:unchangeddate=>"XXX",
|
143
|
+
:unpublished=>true,
|
144
|
+
:updateddate=>"XXX",
|
145
|
+
:vote_endeddate=>"XXX",
|
146
|
+
:vote_starteddate=>"XXX",
|
147
|
+
:wg=>"WG 3"}
|
148
|
+
OUTPUT
|
138
149
|
end
|
139
150
|
|
140
151
|
it "processes IsoXML metadata #2" do
|
141
152
|
c = IsoDoc::Iso::HtmlConvert.new({})
|
142
|
-
|
143
|
-
|
153
|
+
_ = c.convert_init(<<~"INPUT", "test", false)
|
154
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
155
|
+
INPUT
|
156
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
157
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
158
|
+
<bibdata type="standard">
|
159
|
+
<title>
|
160
|
+
<title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
|
161
|
+
<title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
|
162
|
+
<title type="title-part" language="en" format="text/plain">Rice</title>
|
163
|
+
</title>
|
164
|
+
<title>
|
165
|
+
<title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
|
166
|
+
<title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
|
167
|
+
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
168
|
+
</title>
|
169
|
+
<docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
|
170
|
+
<docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
171
|
+
<docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
172
|
+
<docidentifier type="iso-tc">17301</docidentifier>
|
173
|
+
<contributor>
|
174
|
+
<role type="author"/>
|
175
|
+
<organization>
|
176
|
+
<name>ISO</name>
|
177
|
+
</organization>
|
178
|
+
</contributor>
|
179
|
+
<contributor>
|
180
|
+
<role type="publisher"/>
|
181
|
+
<organization>
|
182
|
+
<name>International Organization for Standardization</name>
|
183
|
+
<abbreviation>ISO</abbreviation>
|
184
|
+
</organization>
|
185
|
+
</contributor>
|
186
|
+
<contributor>
|
187
|
+
<role type="publisher"/>
|
188
|
+
<organization>
|
189
|
+
<name>International Electrotechnical Commission</name>
|
190
|
+
<abbreviation>IEC</abbreviation>
|
191
|
+
</organization>
|
192
|
+
</contributor>
|
193
|
+
<language>en</language>
|
194
|
+
<script>Latn</script>
|
195
|
+
<status>
|
196
|
+
<stage abbreviation="IS">60</stage>
|
197
|
+
<substage>92</substage>
|
198
|
+
</status>
|
199
|
+
<copyright>
|
200
|
+
<from>2016</from>
|
201
|
+
<owner>
|
202
|
+
<organization>
|
203
|
+
<name>International Organization for Standardization</name>
|
204
|
+
</organization>
|
205
|
+
</owner>
|
206
|
+
</copyright>
|
207
|
+
<relation type="obsoletes">
|
208
|
+
<locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
|
209
|
+
<docidentifier>IEC 8121</docidentifier>
|
210
|
+
</relation>
|
211
|
+
<ext>
|
212
|
+
<doctype>international-standard</doctype>
|
213
|
+
<editorialgroup>
|
214
|
+
<technical-committee number="34" type="ABC">Food products</technical-committee>
|
215
|
+
<subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
|
216
|
+
<workgroup number="3" type="GHI">Rice Group</workgroup>
|
217
|
+
</editorialgroup>
|
218
|
+
<ics><code>1.2.3</code></ics>
|
219
|
+
<ics><code>1.2.3</code></ics>
|
220
|
+
<structuredidentifier>
|
221
|
+
<project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
|
222
|
+
</strucuredidentifier>
|
223
|
+
<stagename>International standard</stagename>
|
224
|
+
</ext>
|
225
|
+
</bibdata>
|
226
|
+
</iso-standard>
|
144
227
|
INPUT
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
</owner>
|
195
|
-
</copyright>
|
196
|
-
<relation type="obsoletes">
|
197
|
-
<locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
|
198
|
-
<docidentifier>IEC 8121</docidentifier>
|
199
|
-
</relation>
|
200
|
-
<ext>
|
201
|
-
<doctype>international-standard</doctype>
|
202
|
-
<editorialgroup>
|
203
|
-
<technical-committee number="34" type="ABC">Food products</technical-committee>
|
204
|
-
<subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
|
205
|
-
<workgroup number="3" type="GHI">Rice Group</workgroup>
|
206
|
-
</editorialgroup>
|
207
|
-
<ics><code>1.2.3</code></ics>
|
208
|
-
<ics><code>1.2.3</code></ics>
|
209
|
-
<structuredidentifier>
|
210
|
-
<project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
|
211
|
-
</strucuredidentifier>
|
212
|
-
<stagename>International standard</stagename>
|
213
|
-
</ext>
|
214
|
-
</bibdata>
|
215
|
-
</iso-standard>
|
216
|
-
INPUT
|
217
|
-
{:accesseddate=>"XXX",
|
218
|
-
:agency=>"ISO/IEC",
|
219
|
-
:circulateddate=>"XXX",
|
220
|
-
:confirmeddate=>"XXX",
|
221
|
-
:copieddate=>"XXX",
|
222
|
-
:createddate=>"XXX",
|
223
|
-
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
224
|
-
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
225
|
-
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
226
|
-
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
227
|
-
:docsubtitleintro=>"Céréales et légumineuses",
|
228
|
-
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
229
|
-
:docsubtitlepart=>"Riz",
|
230
|
-
:docsubtitlepartlabel=>"Partie 1–3",
|
231
|
-
:doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
232
|
-
:doctitleintro=>"Cereals and pulses",
|
233
|
-
:doctitlemain=>"Specifications and test methods",
|
234
|
-
:doctitlepart=>"Rice",
|
235
|
-
:doctitlepartlabel=>"Part 1–3",
|
236
|
-
:doctype=>"International Standard",
|
237
|
-
:doctype_display=>"International Standard",
|
238
|
-
:docyear=>"2016",
|
239
|
-
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
240
|
-
:ics=>"1.2.3, 1.2.3",
|
241
|
-
:implementeddate=>"XXX",
|
242
|
-
:issueddate=>"XXX",
|
243
|
-
:lang=>"en",
|
244
|
-
:obsoleteddate=>"XXX",
|
245
|
-
:obsoletes=>"IEC 8121",
|
246
|
-
:obsoletes_part=>"3.1",
|
247
|
-
:publisheddate=>"XXX",
|
248
|
-
:publisher=>"International Organization for Standardization and International Electrotechnical Commission",
|
249
|
-
:receiveddate=>"XXX",
|
250
|
-
:sc=>"DEF 4",
|
251
|
-
:script=>"Latn",
|
252
|
-
:secretariat=>"XXX",
|
253
|
-
:stage=>"60",
|
254
|
-
:stage_int=>60,
|
255
|
-
:statusabbr=>"IS",
|
256
|
-
:tc=>"ABC 34",
|
257
|
-
:tc_docnumber=>["17301"],
|
258
|
-
:transmitteddate=>"XXX",
|
259
|
-
:unchangeddate=>"XXX",
|
260
|
-
:unpublished=>false,
|
261
|
-
:updateddate=>"XXX",
|
262
|
-
:vote_endeddate=>"XXX",
|
263
|
-
:vote_starteddate=>"XXX",
|
264
|
-
:wg=>"GHI 3"}
|
265
|
-
OUTPUT
|
228
|
+
{:accesseddate=>"XXX",
|
229
|
+
:agency=>"ISO/IEC",
|
230
|
+
:circulateddate=>"XXX",
|
231
|
+
:confirmeddate=>"XXX",
|
232
|
+
:copieddate=>"XXX",
|
233
|
+
:createddate=>"XXX",
|
234
|
+
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
235
|
+
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
236
|
+
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
237
|
+
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
238
|
+
:docsubtitleintro=>"Céréales et légumineuses",
|
239
|
+
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
240
|
+
:docsubtitlepart=>"Riz",
|
241
|
+
:docsubtitlepartlabel=>"Partie 1–3",
|
242
|
+
:doctitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
243
|
+
:doctitleintro=>"Cereals and pulses",
|
244
|
+
:doctitlemain=>"Specifications and test methods",
|
245
|
+
:doctitlepart=>"Rice",
|
246
|
+
:doctitlepartlabel=>"Part 1–3",
|
247
|
+
:doctype=>"International Standard",
|
248
|
+
:doctype_display=>"International Standard",
|
249
|
+
:docyear=>"2016",
|
250
|
+
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
251
|
+
:ics=>"1.2.3, 1.2.3",
|
252
|
+
:implementeddate=>"XXX",
|
253
|
+
:issueddate=>"XXX",
|
254
|
+
:lang=>"en",
|
255
|
+
:obsoleteddate=>"XXX",
|
256
|
+
:obsoletes=>"IEC 8121",
|
257
|
+
:obsoletes_part=>"3.1",
|
258
|
+
:publisheddate=>"XXX",
|
259
|
+
:publisher=>"International Organization for Standardization and International Electrotechnical Commission",
|
260
|
+
:receiveddate=>"XXX",
|
261
|
+
:sc=>"DEF 4",
|
262
|
+
:script=>"Latn",
|
263
|
+
:secretariat=>"XXX",
|
264
|
+
:stage=>"60",
|
265
|
+
:stage_int=>60,
|
266
|
+
:statusabbr=>"IS",
|
267
|
+
:tc=>"ABC 34",
|
268
|
+
:tc_docnumber=>["17301"],
|
269
|
+
:transmitteddate=>"XXX",
|
270
|
+
:unchangeddate=>"XXX",
|
271
|
+
:unpublished=>false,
|
272
|
+
:updateddate=>"XXX",
|
273
|
+
:vote_endeddate=>"XXX",
|
274
|
+
:vote_starteddate=>"XXX",
|
275
|
+
:wg=>"GHI 3"}
|
276
|
+
OUTPUT
|
266
277
|
end
|
267
278
|
|
268
279
|
it "processes IsoXML metadata in French" do
|
269
280
|
c = IsoDoc::Iso::HtmlConvert.new({})
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
281
|
+
_ = c.convert_init(<<~"INPUT", "test", false)
|
282
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
283
|
+
<bibdata>
|
284
|
+
<language>fr</language>
|
285
|
+
</bibdata>
|
286
|
+
</iso-standard>
|
276
287
|
INPUT
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
</bibdata>
|
348
|
-
</iso-standard>
|
349
|
-
INPUT
|
350
|
-
{:accesseddate=>"XXX",
|
351
|
-
:agency=>"ISO/IEC",
|
352
|
-
:circulateddate=>"XXX",
|
353
|
-
:confirmeddate=>"XXX",
|
354
|
-
:copieddate=>"XXX",
|
355
|
-
:createddate=>"XXX",
|
356
|
-
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
357
|
-
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
358
|
-
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
359
|
-
:docsubtitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
360
|
-
:docsubtitleintro=>"Cereals and pulses",
|
361
|
-
:docsubtitlemain=>"Specifications and test methods",
|
362
|
-
:docsubtitlepart=>"Rice",
|
363
|
-
:docsubtitlepartlabel=>"Part 1–3",
|
364
|
-
:doctitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
365
|
-
:doctitleintro=>"Céréales et légumineuses",
|
366
|
-
:doctitlemain=>"Spécification et méthodes d'essai",
|
367
|
-
:doctitlepart=>"Riz",
|
368
|
-
:doctitlepartlabel=>"Partie 1–3",
|
369
|
-
:doctype=>"International Standard",
|
370
|
-
:doctype_display=>"Standard International",
|
371
|
-
:docyear=>"2016",
|
372
|
-
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
373
|
-
:ics=>"1.2.3, 1.2.3",
|
374
|
-
:implementeddate=>"XXX",
|
375
|
-
:issueddate=>"XXX",
|
376
|
-
:lang=>"fr",
|
377
|
-
:obsoleteddate=>"XXX",
|
378
|
-
:obsoletes=>"IEC 8121",
|
379
|
-
:obsoletes_part=>"3.1",
|
380
|
-
:publisheddate=>"XXX",
|
381
|
-
:publisher=>"International Organization for Standardization et International Electrotechnical Commission",
|
382
|
-
:receiveddate=>"XXX",
|
383
|
-
:sc=>"DEF 4",
|
384
|
-
:script=>"Latn",
|
385
|
-
:secretariat=>"XXX",
|
386
|
-
:stage=>"60",
|
387
|
-
:stage_int=>60,
|
388
|
-
:statusabbr=>"IS",
|
389
|
-
:tc=>"ABC 34",
|
390
|
-
:tc_docnumber=>["17301"],
|
391
|
-
:transmitteddate=>"XXX",
|
392
|
-
:unchangeddate=>"XXX",
|
393
|
-
:unpublished=>false,
|
394
|
-
:updateddate=>"XXX",
|
395
|
-
:vote_endeddate=>"XXX",
|
396
|
-
:vote_starteddate=>"XXX",
|
397
|
-
:wg=>"GHI 3"}
|
398
|
-
OUTPUT
|
288
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
289
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
290
|
+
<bibdata type="standard">
|
291
|
+
<title>
|
292
|
+
<title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
|
293
|
+
<title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
|
294
|
+
<title type="title-part" language="en" format="text/plain">Rice</title>
|
295
|
+
</title>
|
296
|
+
<title>
|
297
|
+
<title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
|
298
|
+
<title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
|
299
|
+
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
300
|
+
</title>
|
301
|
+
<docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
|
302
|
+
<docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
303
|
+
<docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
304
|
+
<docidentifier type="iso-tc">17301</docidentifier>
|
305
|
+
<contributor>
|
306
|
+
<role type="author"/>
|
307
|
+
<organization>
|
308
|
+
<name>ISO</name>
|
309
|
+
</organization>
|
310
|
+
</contributor>
|
311
|
+
<contributor>
|
312
|
+
<role type="publisher"/>
|
313
|
+
<organization>
|
314
|
+
<name>International Organization for Standardization</name>
|
315
|
+
<abbreviation>ISO</abbreviation>
|
316
|
+
</organization>
|
317
|
+
</contributor>
|
318
|
+
<contributor>
|
319
|
+
<role type="publisher"/>
|
320
|
+
<organization>
|
321
|
+
<name>International Electrotechnical Commission</name>
|
322
|
+
<abbreviation>IEC</abbreviation>
|
323
|
+
</organization>
|
324
|
+
</contributor>
|
325
|
+
<language>fr</language>
|
326
|
+
<script>Latn</script>
|
327
|
+
<status>
|
328
|
+
<stage abbreviation="IS">60</stage>
|
329
|
+
<substage>92</substage>
|
330
|
+
</status>
|
331
|
+
<copyright>
|
332
|
+
<from>2016</from>
|
333
|
+
<owner>
|
334
|
+
<organization>
|
335
|
+
<name>International Organization for Standardization</name>
|
336
|
+
</organization>
|
337
|
+
</owner>
|
338
|
+
</copyright>
|
339
|
+
<relation type="obsoletes">
|
340
|
+
<locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
|
341
|
+
<docidentifier>IEC 8121</docidentifier>
|
342
|
+
</relation>
|
343
|
+
<ext>
|
344
|
+
<doctype language="">international-standard</doctype>
|
345
|
+
<doctype language="fr">Standard International</doctype>
|
346
|
+
<editorialgroup>
|
347
|
+
<technical-committee number="34" type="ABC">Food products</technical-committee>
|
348
|
+
<subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
|
349
|
+
<workgroup number="3" type="GHI">Rice Group</workgroup>
|
350
|
+
</editorialgroup>
|
351
|
+
<ics><code>1.2.3</code></ics>
|
352
|
+
<ics><code>1.2.3</code></ics>
|
353
|
+
<structuredidentifier>
|
354
|
+
<project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
|
355
|
+
</strucuredidentifier>
|
356
|
+
<stagename>International standard</stagename>
|
357
|
+
</ext>
|
358
|
+
</bibdata>
|
359
|
+
</iso-standard>
|
360
|
+
INPUT
|
361
|
+
{:accesseddate=>"XXX",
|
362
|
+
:agency=>"ISO/IEC",
|
363
|
+
:circulateddate=>"XXX",
|
364
|
+
:confirmeddate=>"XXX",
|
365
|
+
:copieddate=>"XXX",
|
366
|
+
:createddate=>"XXX",
|
367
|
+
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
368
|
+
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
369
|
+
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
370
|
+
:docsubtitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
371
|
+
:docsubtitleintro=>"Cereals and pulses",
|
372
|
+
:docsubtitlemain=>"Specifications and test methods",
|
373
|
+
:docsubtitlepart=>"Rice",
|
374
|
+
:docsubtitlepartlabel=>"Part 1–3",
|
375
|
+
:doctitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
376
|
+
:doctitleintro=>"Céréales et légumineuses",
|
377
|
+
:doctitlemain=>"Spécification et méthodes d'essai",
|
378
|
+
:doctitlepart=>"Riz",
|
379
|
+
:doctitlepartlabel=>"Partie 1–3",
|
380
|
+
:doctype=>"International Standard",
|
381
|
+
:doctype_display=>"Standard International",
|
382
|
+
:docyear=>"2016",
|
383
|
+
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
384
|
+
:ics=>"1.2.3, 1.2.3",
|
385
|
+
:implementeddate=>"XXX",
|
386
|
+
:issueddate=>"XXX",
|
387
|
+
:lang=>"fr",
|
388
|
+
:obsoleteddate=>"XXX",
|
389
|
+
:obsoletes=>"IEC 8121",
|
390
|
+
:obsoletes_part=>"3.1",
|
391
|
+
:publisheddate=>"XXX",
|
392
|
+
:publisher=>"International Organization for Standardization et International Electrotechnical Commission",
|
393
|
+
:receiveddate=>"XXX",
|
394
|
+
:sc=>"DEF 4",
|
395
|
+
:script=>"Latn",
|
396
|
+
:secretariat=>"XXX",
|
397
|
+
:stage=>"60",
|
398
|
+
:stage_int=>60,
|
399
|
+
:statusabbr=>"IS",
|
400
|
+
:tc=>"ABC 34",
|
401
|
+
:tc_docnumber=>["17301"],
|
402
|
+
:transmitteddate=>"XXX",
|
403
|
+
:unchangeddate=>"XXX",
|
404
|
+
:unpublished=>false,
|
405
|
+
:updateddate=>"XXX",
|
406
|
+
:vote_endeddate=>"XXX",
|
407
|
+
:vote_starteddate=>"XXX",
|
408
|
+
:wg=>"GHI 3"}
|
409
|
+
OUTPUT
|
399
410
|
end
|
400
|
-
|
401
411
|
end
|