metanorma-iso 2.2.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/iso/html/header-dis.html +111 -29
  3. data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
  4. data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
  5. data/lib/isodoc/iso/html/style-human.css +2 -3
  6. data/lib/isodoc/iso/html/style-human.scss +0 -1
  7. data/lib/isodoc/iso/html/style-iso.css +2 -3
  8. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +10 -4
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +10 -4
  11. data/lib/isodoc/iso/i18n-en.yaml +13 -8
  12. data/lib/isodoc/iso/i18n-fr.yaml +9 -3
  13. data/lib/isodoc/iso/i18n-ru.yaml +9 -2
  14. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -2
  15. data/lib/isodoc/iso/iso.amendment.xsl +226 -40
  16. data/lib/isodoc/iso/iso.international-standard.xsl +226 -40
  17. data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
  18. data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
  19. data/lib/isodoc/iso/presentation_xref.rb +10 -7
  20. data/lib/isodoc/iso/sections.rb +1 -1
  21. data/lib/isodoc/iso/word_convert.rb +6 -4
  22. data/lib/isodoc/iso/word_dis_cleanup.rb +24 -3
  23. data/lib/isodoc/iso/word_dis_convert.rb +4 -1
  24. data/lib/metanorma/iso/base.rb +2 -1
  25. data/lib/metanorma/iso/basicdoc.rng +0 -27
  26. data/lib/metanorma/iso/biblio-standoc.rng +164 -0
  27. data/lib/metanorma/iso/biblio.rng +50 -18
  28. data/lib/metanorma/iso/isodoc.rng +68 -206
  29. data/lib/metanorma/iso/isostandard-amd.rng +3 -54
  30. data/lib/metanorma/iso/isostandard-compile.rng +7 -0
  31. data/lib/metanorma/iso/isostandard.rng +1 -195
  32. data/lib/metanorma/iso/relaton-iso.rng +225 -0
  33. data/lib/metanorma/iso/validate.rb +6 -6
  34. data/lib/metanorma/iso/version.rb +1 -1
  35. data/lib/metanorma/requirements/modspec.rb +22 -38
  36. data/metanorma-iso.gemspec +5 -2
  37. metadata +7 -86
  38. data/.github/workflows/rake.yml +0 -15
  39. data/.github/workflows/release.yml +0 -24
  40. data/.github/workflows/ubuntu.yml +0 -41
  41. data/Rakefile +0 -8
  42. data/bin/rspec +0 -17
  43. data/spec/assets/header.html +0 -7
  44. data/spec/assets/html.css +0 -2
  45. data/spec/assets/htmlcover.html +0 -4
  46. data/spec/assets/htmlintro.html +0 -5
  47. data/spec/assets/i18n.yaml +0 -2
  48. data/spec/assets/iso.adoc +0 -10
  49. data/spec/assets/iso.headless.html +0 -33
  50. data/spec/assets/iso.xml +0 -71
  51. data/spec/assets/rice_image1.png +0 -0
  52. data/spec/assets/scripts.html +0 -3
  53. data/spec/assets/std.css +0 -2
  54. data/spec/assets/word.css +0 -2
  55. data/spec/assets/wordcover.html +0 -3
  56. data/spec/assets/wordintro.html +0 -4
  57. data/spec/examples/103_01_02.html +0 -247
  58. data/spec/examples/english.yaml +0 -69
  59. data/spec/examples/iso_123_.xml +0 -45
  60. data/spec/examples/iso_123_all_parts.xml +0 -45
  61. data/spec/examples/iso_123_no_year_note.xml +0 -46
  62. data/spec/examples/iso_124_.xml +0 -41
  63. data/spec/examples/iso_216_.xml +0 -47
  64. data/spec/examples/iso_iec_12382_.xml +0 -48
  65. data/spec/examples/rice.adoc +0 -714
  66. data/spec/examples/rice.preview.html +0 -1870
  67. data/spec/examples/rice.sh +0 -4
  68. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  69. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  70. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  71. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  72. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  73. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  74. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  75. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  76. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  77. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  78. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  79. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  80. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  81. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  82. data/spec/examples/rice_img/rice_image1.png +0 -0
  83. data/spec/examples/rice_img/rice_image2.png +0 -0
  84. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  85. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  86. data/spec/examples/rice_img/rice_image3_3.png +0 -0
  87. data/spec/isodoc/amd_spec.rb +0 -986
  88. data/spec/isodoc/blocks_spec.rb +0 -1174
  89. data/spec/isodoc/i18n_spec.rb +0 -1579
  90. data/spec/isodoc/inline_spec.rb +0 -1060
  91. data/spec/isodoc/iso_spec.rb +0 -255
  92. data/spec/isodoc/metadata_spec.rb +0 -701
  93. data/spec/isodoc/postproc_spec.rb +0 -1089
  94. data/spec/isodoc/ref_spec.rb +0 -439
  95. data/spec/isodoc/section_spec.rb +0 -998
  96. data/spec/isodoc/table_spec.rb +0 -420
  97. data/spec/isodoc/terms_spec.rb +0 -314
  98. data/spec/isodoc/word_dis_spec.rb +0 -2064
  99. data/spec/isodoc/xref_spec.rb +0 -1747
  100. data/spec/metanorma/amd_spec.rb +0 -724
  101. data/spec/metanorma/base_spec.rb +0 -1384
  102. data/spec/metanorma/blank_spec.rb +0 -38
  103. data/spec/metanorma/blocks_spec.rb +0 -624
  104. data/spec/metanorma/cleanup_spec.rb +0 -1645
  105. data/spec/metanorma/inline_spec.rb +0 -203
  106. data/spec/metanorma/lists_spec.rb +0 -197
  107. data/spec/metanorma/macros_spec.rb +0 -99
  108. data/spec/metanorma/processor_spec.rb +0 -161
  109. data/spec/metanorma/refs_spec.rb +0 -672
  110. data/spec/metanorma/section_spec.rb +0 -492
  111. data/spec/metanorma/table_spec.rb +0 -329
  112. data/spec/metanorma/validate_spec.rb +0 -2153
  113. data/spec/relaton/render_spec.rb +0 -568
  114. data/spec/requirements/requirement_components_spec.rb +0 -622
  115. data/spec/requirements/requirements_spec.rb +0 -1681
  116. data/spec/requirements/xref_spec.rb +0 -1211
  117. data/spec/spec_helper.rb +0 -313
  118. data/spec/vcr_cassettes/docrels.yml +0 -385
  119. data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
@@ -1,701 +0,0 @@
1
- require "spec_helper"
2
- require "nokogiri"
3
-
4
- RSpec.describe IsoDoc::Iso::Metadata do
5
- it "processes IsoXML metadata" do
6
- c = IsoDoc::Iso::HtmlConvert.new({})
7
- _ = c.convert_init(<<~"INPUT", "test", false)
8
- <iso-standard xmlns="http://riboseinc.com/isoxml">
9
- INPUT
10
- input = <<~INPUT
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
- <approvalgroup>
86
- <technical-committee number="34a">Food products A</technical-committee>
87
- <subcommittee number="4a">Cereals and pulses A</subcommittee>
88
- <workgroup number="3a">Rice Group A</workgroup>
89
- </approvalgroup>
90
- <structuredidentifier>
91
- <project-number part="1">ISO/PreCD3 17301</project-number>
92
- </structuredidentifier>
93
- <stagename>Committee draft</stagename>
94
- </ext>
95
- </bibdata>
96
- </iso-standard>
97
- INPUT
98
- output = <<~OUTPUT
99
- {:accesseddate=>"2012",
100
- :activateddate=>"2013",
101
- :agency=>"ISO",
102
- :approvalgroup=>["TC 34a", "SC 4a", "WG 3a"],
103
- :createddate=>"2010&#x2013;2011",
104
- :docnumber=>"ISO/PreCD3 17301-1",
105
- :docnumber_lang=>"ISO/PreCD3 17301-1 (E)",
106
- :docnumber_reference=>"ISO/PreCD3 17301-1:2000 (E)",
107
- :docnumeric=>"1730",
108
- :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1: Riz",
109
- :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
110
- :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
111
- :docsubtitlepart=>"Riz",
112
- :docsubtitlepartlabel=>"Partie&#xa0;1",
113
- :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1: Rice",
114
- :doctitleintro=>"Cereals and pulses",
115
- :doctitlemain=>"Specifications and test methods",
116
- :doctitlepart=>"Rice",
117
- :doctitlepartlabel=>"Part&#xa0;1",
118
- :doctype=>"International Standard",
119
- :doctype_display=>"International Standard",
120
- :docyear=>"2016",
121
- :draft=>"0.4",
122
- :draftinfo=>" (draft 0.4, 2016-05-01)",
123
- :edition=>"2",
124
- :editorialgroup=>["TC 34", "SC 4", "WG 3"],
125
- :horizontal=>"true",
126
- :keywords=>["kw2", "kw1"],
127
- :lang=>"en",
128
- :obsoleteddate=>"2014",
129
- :publisheddate=>"2011",
130
- :publisher=>"International Organization for Standardization",
131
- :revdate=>"2016-05-01",
132
- :revdate_monthyear=>"May 2016",
133
- :sc=>"SC 4",
134
- :script=>"Latn",
135
- :secretariat=>"GB",
136
- :stage=>"30",
137
- :stage_int=>30,
138
- :stageabbr=>"CD",
139
- :statusabbr=>"PreCD3",
140
- :substage_int=>"92",
141
- :tc=>"TC 34",
142
- :tc_docnumber=>["17301", "17302"],
143
- :unpublished=>true,
144
- :wg=>"WG 3"}
145
- OUTPUT
146
- expect(metadata(c.info(Nokogiri::XML(input),
147
- nil))).to be_equivalent_to output
148
- end
149
-
150
- it "processes IsoXML metadata #2" do
151
- c = IsoDoc::Iso::HtmlConvert.new({})
152
- _ = c.convert_init(<<~"INPUT", "test", false)
153
- <iso-standard xmlns="http://riboseinc.com/isoxml">
154
- INPUT
155
- input = <<~INPUT
156
- <iso-standard xmlns="http://riboseinc.com/isoxml">
157
- <bibdata type="standard">
158
- <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
159
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
160
- <title type="title-part" language="en" format="text/plain">Rice</title>
161
- <docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
162
- <docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
163
- <docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
164
- <docidentifier type="iso-tc">17301</docidentifier>
165
- <contributor>
166
- <role type="author"/>
167
- <organization>
168
- <name>ISO</name>
169
- </organization>
170
- </contributor>
171
- <contributor>
172
- <role type="publisher"/>
173
- <organization>
174
- <name>International Organization for Standardization</name>
175
- <abbreviation>ISO</abbreviation>
176
- </organization>
177
- </contributor>
178
- <contributor>
179
- <role type="publisher"/>
180
- <organization>
181
- <name>International Electrotechnical Commission</name>
182
- <abbreviation>IEC</abbreviation>
183
- </organization>
184
- </contributor>
185
- <language>en</language>
186
- <script>Latn</script>
187
- <status>
188
- <stage abbreviation="IS">60</stage>
189
- <substage>92</substage>
190
- </status>
191
- <copyright>
192
- <from>2016</from>
193
- <owner>
194
- <organization>
195
- <name>International Organization for Standardization</name>
196
- </organization>
197
- </owner>
198
- </copyright>
199
- <relation type="obsoletes">
200
- <locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
201
- <docidentifier>IEC 8121</docidentifier>
202
- </relation>
203
- <ext>
204
- <doctype>international-standard</doctype>
205
- <editorialgroup>
206
- <technical-committee number="34" type="ABC">Food products</technical-committee>
207
- <subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
208
- <workgroup number="3" type="GHI">Rice Group</workgroup>
209
- </editorialgroup>
210
- <approvalgroup>
211
- <technical-committee number="34" type="ABC">Food products</technical-committee>
212
- <workgroup number="3" type="GHI">Rice Group</workgroup>
213
- </approvalgroup>
214
- <ics><code>1.2.3</code></ics>
215
- <ics><code>1.2.3</code></ics>
216
- <structuredidentifier>
217
- <project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
218
- </strucuredidentifier>
219
- <stagename>International standard</stagename>
220
- </ext>
221
- </bibdata>
222
- </iso-standard>
223
- INPUT
224
- output = <<~OUTPUT
225
- {:agency=>"ISO/IEC",
226
- :approvalgroup=>["ABC 34", "GHI 3"],
227
- :docnumber=>"ISO/IEC/CD 17301-1-3",
228
- :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
229
- :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
230
- :docsubtitlepartlabel=>"Partie&#xa0;1&#x2013;3",
231
- :doctitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
232
- :doctitleintro=>"Cereals and pulses",
233
- :doctitlemain=>"Specifications and test methods",
234
- :doctitlepart=>"Rice",
235
- :doctitlepartlabel=>"Part&#xa0;1&#x2013;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
- :lang=>"en",
242
- :obsoletes=>"IEC 8121",
243
- :obsoletes_part=>"3.1",
244
- :publisher=>"International Organization for Standardization and International Electrotechnical Commission",
245
- :sc=>"DEF 4",
246
- :script=>"Latn",
247
- :stage=>"60",
248
- :stage_int=>60,
249
- :statusabbr=>"IS",
250
- :substage_int=>"92",
251
- :tc=>"ABC 34",
252
- :tc_docnumber=>["17301"],
253
- :unpublished=>false,
254
- :wg=>"GHI 3"}
255
- OUTPUT
256
- expect(metadata(c.info(Nokogiri::XML(input),
257
- nil))).to be_equivalent_to output
258
- end
259
-
260
- it "processes IsoXML metadata in French" do
261
- c = IsoDoc::Iso::HtmlConvert.new({})
262
- _ = c.convert_init(<<~"INPUT", "test", false)
263
- <iso-standard xmlns="http://riboseinc.com/isoxml">
264
- <bibdata>
265
- <language>fr</language>
266
- </bibdata>
267
- </iso-standard>
268
- INPUT
269
- input = <<~INPUT
270
- <iso-standard xmlns="http://riboseinc.com/isoxml">
271
- <bibdata type="standard">
272
- <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
273
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
274
- <title type="title-part" language="en" format="text/plain">Rice</title>
275
- <title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
276
- <title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
277
- <title type="title-part" language="fr" format="text/plain">Riz</title>
278
- <docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
279
- <docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
280
- <docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
281
- <docidentifier type="iso-tc">17301</docidentifier>
282
- <contributor>
283
- <role type="author"/>
284
- <organization>
285
- <name>ISO</name>
286
- </organization>
287
- </contributor>
288
- <contributor>
289
- <role type="publisher"/>
290
- <organization>
291
- <name>International Organization for Standardization</name>
292
- <abbreviation>ISO</abbreviation>
293
- </organization>
294
- </contributor>
295
- <contributor>
296
- <role type="publisher"/>
297
- <organization>
298
- <name>International Electrotechnical Commission</name>
299
- <abbreviation>IEC</abbreviation>
300
- </organization>
301
- </contributor>
302
- <language>fr</language>
303
- <script>Latn</script>
304
- <status>
305
- <stage abbreviation="IS">60</stage>
306
- <substage>92</substage>
307
- </status>
308
- <copyright>
309
- <from>2016</from>
310
- <owner>
311
- <organization>
312
- <name>International Organization for Standardization</name>
313
- </organization>
314
- </owner>
315
- </copyright>
316
- <relation type="obsoletes">
317
- <locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
318
- <docidentifier>IEC 8121</docidentifier>
319
- </relation>
320
- <ext>
321
- <doctype language="">international-standard</doctype>
322
- <doctype language="fr">Standard International</doctype>
323
- <editorialgroup>
324
- <technical-committee number="34" type="ABC">Food products</technical-committee>
325
- <subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
326
- <workgroup number="3" type="GHI">Rice Group</workgroup>
327
- </editorialgroup>
328
- <ics><code>1.2.3</code></ics>
329
- <ics><code>1.2.3</code></ics>
330
- <structuredidentifier>
331
- <project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
332
- </strucuredidentifier>
333
- <stagename>International standard</stagename>
334
- </ext>
335
- </bibdata>
336
- </iso-standard>
337
- INPUT
338
- output = <<~OUTPUT
339
- {:agency=>"ISO/IEC",
340
- :docnumber=>"ISO/IEC/CD 17301-1-3",
341
- :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
342
- :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
343
- :docsubtitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
344
- :docsubtitleintro=>"Cereals and pulses",
345
- :docsubtitlemain=>"Specifications and test methods",
346
- :docsubtitlepart=>"Rice",
347
- :docsubtitlepartlabel=>"Part&#xa0;1&#x2013;3",
348
- :doctitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&#xa0;&#x2014; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&#xa0;&#x2014; Partie&#xa0;1&#x2013;3: Riz",
349
- :doctitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
350
- :doctitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
351
- :doctitlepart=>"Riz",
352
- :doctitlepartlabel=>"Partie&#xa0;1&#x2013;3",
353
- :doctype=>"International Standard",
354
- :doctype_display=>"Standard International",
355
- :docyear=>"2016",
356
- :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
357
- :ics=>"1.2.3, 1.2.3",
358
- :lang=>"fr",
359
- :obsoletes=>"IEC 8121",
360
- :obsoletes_part=>"3.1",
361
- :publisher=>"International Organization for Standardization et International Electrotechnical Commission",
362
- :sc=>"DEF 4",
363
- :script=>"Latn",
364
- :stage=>"60",
365
- :stage_int=>60,
366
- :statusabbr=>"IS",
367
- :substage_int=>"92",
368
- :tc=>"ABC 34",
369
- :tc_docnumber=>["17301"],
370
- :unpublished=>false,
371
- :wg=>"GHI 3"}
372
- OUTPUT
373
- expect(metadata(c.info(Nokogiri::XML(input),
374
- nil))).to be_equivalent_to output
375
- end
376
-
377
- it "processes IsoXML metadata in Russian" do
378
- c = IsoDoc::Iso::HtmlConvert.new({})
379
- _ = c.convert_init(<<~"INPUT", "test", false)
380
- <iso-standard xmlns="http://riboseinc.com/isoxml">
381
- <bibdata>
382
- <language>ru</language>
383
- </bibdata>
384
- </iso-standard>
385
- INPUT
386
- input = <<~INPUT
387
- <iso-standard xmlns="http://riboseinc.com/isoxml">
388
- <bibdata type="standard">
389
- <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
390
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
391
- <title type="title-part" language="en" format="text/plain">Rice</title>
392
- <title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
393
- <title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
394
- <title type="title-part" language="fr" format="text/plain">Riz</title>
395
- <title type="title-intro" language="ru" format="text/plain">Зерновые и бобовые</title>
396
- <title type="title-main" language="ru" format="text/plain">Технические характеристики и методы испытаний</title>
397
- <title type="title-part" language="ru" format="text/plain">Рис</title>
398
- <docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
399
- <docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
400
- <docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
401
- <docidentifier type="iso-tc">17301</docidentifier>
402
- <contributor>
403
- <role type="author"/>
404
- <organization>
405
- <name>ISO</name>
406
- </organization>
407
- </contributor>
408
- <contributor>
409
- <role type="publisher"/>
410
- <organization>
411
- <name>International Organization for Standardization</name>
412
- <abbreviation>ISO</abbreviation>
413
- </organization>
414
- </contributor>
415
- <contributor>
416
- <role type="publisher"/>
417
- <organization>
418
- <name>International Electrotechnical Commission</name>
419
- <abbreviation>IEC</abbreviation>
420
- </organization>
421
- </contributor>
422
- <language>ru</language>
423
- <script>Cyrl</script>
424
- <status>
425
- <stage abbreviation="IS">60</stage>
426
- <substage>92</substage>
427
- </status>
428
- <copyright>
429
- <from>2016</from>
430
- <owner>
431
- <organization>
432
- <name>International Organization for Standardization</name>
433
- </organization>
434
- </owner>
435
- </copyright>
436
- <relation type="obsoletes">
437
- <locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
438
- <docidentifier>IEC 8121</docidentifier>
439
- </relation>
440
- <ext>
441
- <doctype language="">international-standard</doctype>
442
- <doctype language="fr">Standard International</doctype>
443
- <editorialgroup>
444
- <technical-committee number="34" type="ABC">Food products</technical-committee>
445
- <subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
446
- <workgroup number="3" type="GHI">Rice Group</workgroup>
447
- </editorialgroup>
448
- <ics><code>1.2.3</code></ics>
449
- <ics><code>1.2.3</code></ics>
450
- <structuredidentifier>
451
- <project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
452
- </strucuredidentifier>
453
- <stagename>International standard</stagename>
454
- </ext>
455
- </bibdata>
456
- </iso-standard>
457
- INPUT
458
- output = <<~OUTPUT
459
- {:agency=>"ISO/IEC",
460
- :docnumber=>"ISO/IEC/CD 17301-1-3",
461
- :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
462
- :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
463
- :docsubtitle=>"Cereals and pulses&#xa0;&#x2014; Specifications and test methods&#xa0;&#x2014; Part&#xa0;1&#x2013;3: Rice",
464
- :docsubtitleintro=>"Cereals and pulses",
465
- :docsubtitlemain=>"Specifications and test methods",
466
- :docsubtitlepart=>"Rice",
467
- :docsubtitlepartlabel=>"Part&#xa0;1&#x2013;3",
468
- :doctitle=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;&#xa0;&#x2014; &#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;&#xa0;&#x2014; Часть&#xa0;1&#x2013;3: &#x420;&#x438;&#x441;",
469
- :doctitleintro=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;",
470
- :doctitlemain=>"&#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;",
471
- :doctitlepart=>"&#x420;&#x438;&#x441;",
472
- :doctitlepartlabel=>"Часть&#xa0;1&#x2013;3",
473
- :doctype=>"International Standard",
474
- :doctype_display=>"International Standard",
475
- :docyear=>"2016",
476
- :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
477
- :ics=>"1.2.3, 1.2.3",
478
- :lang=>"ru",
479
- :obsoletes=>"IEC 8121",
480
- :obsoletes_part=>"3.1",
481
- :publisher=>"International Organization for Standardization &#x438; International Electrotechnical Commission",
482
- :sc=>"DEF 4",
483
- :script=>"Latn",
484
- :stage=>"60",
485
- :stage_int=>60,
486
- :statusabbr=>"IS",
487
- :substage_int=>"92",
488
- :tc=>"ABC 34",
489
- :tc_docnumber=>["17301"],
490
- :unpublished=>false,
491
- :wg=>"GHI 3"}
492
- OUTPUT
493
- expect(metadata(c.info(Nokogiri::XML(input),
494
- nil))).to be_equivalent_to output
495
- end
496
-
497
- it "warns of missing Secretariat" do
498
- input = <<~INPUT
499
- <iso-standard xmlns="http://riboseinc.com/isoxml">
500
- <bibdata type="standard">
501
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
502
- <status><stage abbreviation="CD">30</stage></status>
503
- <date type="published">2000</date>
504
- <ext>
505
- <editorialgroup>
506
- </editorialgroup>
507
- </ext>
508
- </bibdata>
509
- <sections>
510
- <clause>
511
- <title>Clause 1</title>
512
- </clause>
513
- </sections>
514
- </iso-standard>
515
- INPUT
516
- output = <<~OUTPUT
517
- <sections>
518
- <clause displayorder="1">
519
- <title depth="1">
520
- <review date="#{Date.today}" reviewer="Metanorma" id="_">
521
- <p>
522
- <strong>
523
- Metadata warnings:
524
- <strong/>
525
- <p>Secretariat is missing.</p>
526
- </strong>
527
- </p>
528
- </review>
529
- Clause 1
530
- </title>
531
- </clause>
532
- </sections>
533
- OUTPUT
534
- expect(xmlpp(strip_guid(Nokogiri::XML(
535
- IsoDoc::Iso::PresentationXMLConvert.new({})
536
- .convert("test", input, true),
537
- )
538
- .at("//xmlns:sections").to_xml)))
539
- .to be_equivalent_to xmlpp(output)
540
- end
541
-
542
- it "warns of missing publication date" do
543
- input = <<~INPUT
544
- <iso-standard xmlns="http://riboseinc.com/isoxml">
545
- <bibdata type="standard">
546
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
547
- <status><stage abbreviation="CD">30</stage></status>
548
- <ext>
549
- <editorialgroup>
550
- </editorialgroup>
551
- <secretariat>BSI</secretariat>
552
- </ext>
553
- </bibdata>
554
- <sections>
555
- <clause>
556
- <title>Clause 1</title>
557
- </clause>
558
- </sections>
559
- </iso-standard>
560
- INPUT
561
- output = <<~OUTPUT
562
- <sections>
563
- <clause displayorder="1">
564
- <title depth="1">
565
- <review date="#{Date.today}" reviewer="Metanorma" id="_">
566
- <p>
567
- <strong>
568
- Metadata warnings:
569
- <strong/>
570
- <p>Document date is missing.</p>
571
- </strong>
572
- </p>
573
- </review>
574
- Clause 1
575
- </title>
576
- </clause>
577
- </sections>
578
- OUTPUT
579
- expect(strip_guid(xmlpp(Nokogiri::XML(
580
- IsoDoc::Iso::PresentationXMLConvert.new({})
581
- .convert("test", input, true),
582
- )
583
- .at("//xmlns:sections")
584
- .at("//xmlns:sections").to_xml)))
585
- .to be_equivalent_to xmlpp(output)
586
- end
587
-
588
- it "warns of missing editorial groups" do
589
- input = <<~INPUT
590
- <iso-standard xmlns="http://riboseinc.com/isoxml">
591
- <bibdata type="standard">
592
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
593
- <status><stage abbreviation="CD">30</stage></status>
594
- <date type="published">2000</date>
595
- <ext>
596
- <secretariat>BSI</secretariat>
597
- </ext>
598
- </bibdata>
599
- <sections>
600
- <clause>
601
- <title>Clause 1</title>
602
- </clause>
603
- </sections>
604
- </iso-standard>
605
- INPUT
606
- output = <<~OUTPUT
607
- <sections>
608
- <clause displayorder="1">
609
- <title depth="1">
610
- <review date="#{Date.today}" reviewer="Metanorma" id="_">
611
- <p>
612
- <strong>
613
- Metadata warnings:
614
- <strong/>
615
- <p>Editorial groups are missing.</p>
616
- </strong>
617
- </p>
618
- </review>
619
- Clause 1
620
- </title>
621
- </clause>
622
- </sections>
623
- OUTPUT
624
- expect(strip_guid(xmlpp(Nokogiri::XML(
625
- IsoDoc::Iso::PresentationXMLConvert.new({})
626
- .convert("test", input, true),
627
- )
628
- .at("//xmlns:sections")
629
- .at("//xmlns:sections").to_xml)))
630
- .to be_equivalent_to xmlpp(output)
631
- end
632
-
633
- it "does not warn of missing metadata in compliant document" do
634
- input = <<~INPUT
635
- <iso-standard xmlns="http://riboseinc.com/isoxml">
636
- <bibdata type="standard">
637
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
638
- <status><stage abbreviation="CD">30</stage></status>
639
- <date type="published">2000</date>
640
- <ext>
641
- <editorialgroup>
642
- </editorialgroup>
643
- <secretariat>BSI</secretariat>
644
- </ext>
645
- </bibdata>
646
- <sections>
647
- <clause>
648
- <title>Clause 1</title>
649
- </clause>
650
- </sections>
651
- </iso-standard>
652
- INPUT
653
- output = <<~OUTPUT
654
- <sections>
655
- <clause displayorder='1'>
656
- <title depth='1'>Clause 1</title>
657
- </clause>
658
- </sections>
659
- OUTPUT
660
- expect(strip_guid(xmlpp(Nokogiri::XML(
661
- IsoDoc::Iso::PresentationXMLConvert.new({})
662
- .convert("test", input, true),
663
- )
664
- .at("//xmlns:sections").to_xml)))
665
- .to be_equivalent_to xmlpp(output)
666
- end
667
-
668
- it "does not warn of missing metadata in published document" do
669
- input = <<~INPUT
670
- <iso-standard xmlns="http://riboseinc.com/isoxml">
671
- <bibdata type="standard">
672
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
673
- <status><stage abbreviation="CD">90</stage></status>
674
- <ext>
675
- <editorialgroup>
676
- </editorialgroup>
677
- <secretariat>BSI</secretariat>
678
- </ext>
679
- </bibdata>
680
- <sections>
681
- <clause>
682
- <title>Clause 1</title>
683
- </clause>
684
- </sections>
685
- </iso-standard>
686
- INPUT
687
- output = <<~OUTPUT
688
- <sections>
689
- <clause displayorder='1'>
690
- <title depth='1'>Clause 1</title>
691
- </clause>
692
- </sections>
693
- OUTPUT
694
- expect(strip_guid(xmlpp(Nokogiri::XML(
695
- IsoDoc::Iso::PresentationXMLConvert.new({})
696
- .convert("test", input, true),
697
- )
698
- .at("//xmlns:sections").to_xml)))
699
- .to be_equivalent_to xmlpp(output)
700
- end
701
- end