metanorma-iso 1.7.1 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +11 -41
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +6 -2
  5. data/lib/asciidoctor/iso/base.rb +18 -16
  6. data/lib/asciidoctor/iso/biblio.rng +4 -6
  7. data/lib/asciidoctor/iso/cleanup.rb +28 -24
  8. data/lib/asciidoctor/iso/front.rb +26 -16
  9. data/lib/asciidoctor/iso/front_id.rb +30 -25
  10. data/lib/asciidoctor/iso/isodoc.rng +172 -3
  11. data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
  12. data/lib/asciidoctor/iso/isostandard.rng +17 -97
  13. data/lib/asciidoctor/iso/validate.rb +22 -109
  14. data/lib/asciidoctor/iso/validate_image.rb +97 -0
  15. data/lib/asciidoctor/iso/validate_requirements.rb +26 -20
  16. data/lib/asciidoctor/iso/validate_section.rb +39 -20
  17. data/lib/asciidoctor/iso/validate_style.rb +36 -24
  18. data/lib/asciidoctor/iso/validate_title.rb +23 -17
  19. data/lib/isodoc/iso/base_convert.rb +19 -2
  20. data/lib/isodoc/iso/html/style-human.css +7 -0
  21. data/lib/isodoc/iso/html/style-iso.css +7 -0
  22. data/lib/isodoc/iso/html_convert.rb +0 -1
  23. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  24. data/lib/isodoc/iso/i18n-fr.yaml +4 -0
  25. data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
  26. data/lib/isodoc/iso/index.rb +140 -0
  27. data/lib/isodoc/iso/iso.amendment.xsl +1092 -208
  28. data/lib/isodoc/iso/iso.international-standard.xsl +1092 -208
  29. data/lib/isodoc/iso/presentation_xml_convert.rb +45 -37
  30. data/lib/isodoc/iso/word_convert.rb +0 -1
  31. data/lib/isodoc/iso/xref.rb +15 -7
  32. data/lib/metanorma/iso/processor.rb +1 -0
  33. data/lib/metanorma/iso/version.rb +1 -1
  34. data/metanorma-iso.gemspec +8 -8
  35. data/spec/asciidoctor/amd_spec.rb +696 -0
  36. data/spec/asciidoctor/base_spec.rb +733 -0
  37. data/spec/asciidoctor/blocks_spec.rb +527 -0
  38. data/spec/asciidoctor/cleanup_spec.rb +1134 -0
  39. data/spec/asciidoctor/inline_spec.rb +195 -0
  40. data/spec/asciidoctor/lists_spec.rb +197 -0
  41. data/spec/asciidoctor/refs_spec.rb +375 -0
  42. data/spec/asciidoctor/section_spec.rb +393 -0
  43. data/spec/asciidoctor/table_spec.rb +329 -0
  44. data/spec/asciidoctor/validate_spec.rb +1627 -0
  45. data/spec/isodoc/amd_spec.rb +967 -946
  46. data/spec/isodoc/blocks_spec.rb +530 -507
  47. data/spec/isodoc/i18n_spec.rb +953 -911
  48. data/spec/isodoc/inline_spec.rb +355 -293
  49. data/spec/isodoc/iso_spec.rb +338 -314
  50. data/spec/isodoc/metadata_spec.rb +392 -382
  51. data/spec/isodoc/postproc_spec.rb +836 -657
  52. data/spec/isodoc/ref_spec.rb +374 -331
  53. data/spec/isodoc/section_spec.rb +821 -519
  54. data/spec/isodoc/table_spec.rb +472 -411
  55. data/spec/isodoc/terms_spec.rb +209 -185
  56. data/spec/isodoc/xref_spec.rb +1370 -1236
  57. data/spec/metanorma/processor_spec.rb +28 -26
  58. data/spec/spec_helper.rb +178 -193
  59. metadata +65 -66
  60. data/.rubocop.ribose.yml +0 -66
  61. data/lib/isodoc/iso/html/scripts.html +0 -178
  62. data/spec/asciidoctor-iso/amd_spec.rb +0 -694
  63. data/spec/asciidoctor-iso/base_spec.rb +0 -713
  64. data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
  65. data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
  66. data/spec/asciidoctor-iso/inline_spec.rb +0 -170
  67. data/spec/asciidoctor-iso/lists_spec.rb +0 -190
  68. data/spec/asciidoctor-iso/refs_spec.rb +0 -317
  69. data/spec/asciidoctor-iso/section_spec.rb +0 -362
  70. data/spec/asciidoctor-iso/table_spec.rb +0 -313
  71. data/spec/asciidoctor-iso/validate_spec.rb +0 -1621
  72. 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
- arr = c.convert_init(<<~"INPUT", "test", false)
8
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ _ = c.convert_init(<<~"INPUT", "test", false)
8
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
9
9
  INPUT
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 type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
14
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
15
- <title type="title-part" language="en" format="text/plain">Rice</title>
16
- <title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
17
- <title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
18
- <title type="title-part" language="fr" format="text/plain">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"><on>2011</on></date>
26
- <date type="accessed"><on>2012</on></date>
27
- <date type="created"><from>2010</from><to>2011</to></date>
28
- <date type="activated"><on>2013</on></date>
29
- <date type="obsoleted"><on>2014</on></date>
30
- <edition>2</edition>
31
- <version>
32
- <revision-date>2016-05-01</revision-date>
33
- <draft>0.4</draft>
34
- </version>
35
- <contributor>
36
- <role type="author"/>
37
- <organization>
38
- <abbreviation>ISO</abbreviation>
39
- </organization>
40
- </contributor>
41
- <contributor>
42
- <role type="publisher"/>
43
- <organization>
44
- <name>International Organization for Standardization</name>
45
- <abbreviation>ISO</abbreviation>
46
- </organization>
47
- </contributor>
48
- <language>en</language>
49
- <script>Latn</script>
50
- <status>
51
- <stage abbreviation="CD">30</stage>
52
- <substage>92</substage>
53
- <iteration>3</iteration>
54
- </status>
55
- <copyright>
56
- <from>2016</from>
57
- <owner>
58
- <organization>
59
- <abbreviation>ISO</abbreviation>
60
- </organization>
61
- </owner>
62
- </copyright>
63
- <keyword>kw2</keyword>
64
- <keyword>kw1</keyword>
65
- <ext>
66
- <doctype>international-standard</doctype>
67
- <horizontal>true</horizontal>
68
- <editorialgroup>
69
- <technical-committee number="34">Food products</technical-committee>
70
- <subcommittee number="4">Cereals and pulses</subcommittee>
71
- <workgroup number="3">Rice Group</workgroup>
72
- <secretariat>GB</secretariat>
73
- </editorialgroup>
74
- <structuredidentifier>
75
- <project-number part="1">ISO/PreCD3 17301</project-number>
76
- </structuredidentifier>
77
- <stagename>Committee draft</stagename>
78
- </ext>
79
- </bibdata>
80
- </iso-standard>
81
- INPUT
82
- {:accesseddate=>"2012",
83
- :activateddate=>"2013",
84
- :agency=>"ISO",
85
- :circulateddate=>"XXX",
86
- :confirmeddate=>"XXX",
87
- :copieddate=>"XXX",
88
- :createddate=>"2010&ndash;2011",
89
- :docnumber=>"ISO/PreCD3 17301-1",
90
- :docnumber_lang=>"ISO/PreCD3 17301-1 (E)",
91
- :docnumber_reference=>"ISO/PreCD3 17301-1:2000 (E)",
92
- :docnumeric=>"1730",
93
- :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz",
94
- :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
95
- :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
96
- :docsubtitlepart=>"Riz",
97
- :docsubtitlepartlabel=>"Partie&nbsp;1",
98
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice",
99
- :doctitleintro=>"Cereals and pulses",
100
- :doctitlemain=>"Specifications and test methods",
101
- :doctitlepart=>"Rice",
102
- :doctitlepartlabel=>"Part&nbsp;1",
103
- :doctype=>"International Standard",
104
- :doctype_display=>"International Standard",
105
- :docyear=>"2016",
106
- :draft=>"0.4",
107
- :draftinfo=>" (draft 0.4, 2016-05-01)",
108
- :edition=>"2",
109
- :editorialgroup=>["TC 34", "SC 4", "WG 3"],
110
- :horizontal=>"true",
111
- :implementeddate=>"XXX",
112
- :issueddate=>"XXX",
113
- :keywords=>["kw2", "kw1"],
114
- :lang=>"en",
115
- :obsoleteddate=>"2014",
116
- :publisheddate=>"2011",
117
- :publisher=>"International Organization for Standardization",
118
- :receiveddate=>"XXX",
119
- :revdate=>"2016-05-01",
120
- :revdate_monthyear=>"May 2016",
121
- :sc=>"SC 4",
122
- :script=>"Latn",
123
- :secretariat=>"GB",
124
- :stage=>"30",
125
- :stage_int=>30,
126
- :stageabbr=>"CD",
127
- :statusabbr=>"PreCD3",
128
- :tc=>"TC 34",
129
- :tc_docnumber=>["17301", "17302"],
130
- :transmitteddate=>"XXX",
131
- :unchangeddate=>"XXX",
132
- :unpublished=>true,
133
- :updateddate=>"XXX",
134
- :vote_endeddate=>"XXX",
135
- :vote_starteddate=>"XXX",
136
- :wg=>"WG 3"}
137
- OUTPUT
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&ndash;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&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz",
105
+ :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
106
+ :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
107
+ :docsubtitlepart=>"Riz",
108
+ :docsubtitlepartlabel=>"Partie&nbsp;1",
109
+ :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1: Rice",
110
+ :doctitleintro=>"Cereals and pulses",
111
+ :doctitlemain=>"Specifications and test methods",
112
+ :doctitlepart=>"Rice",
113
+ :doctitlepartlabel=>"Part&nbsp;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
- arr = c.convert_init(<<~"INPUT", "test", false)
143
- <iso-standard xmlns="http://riboseinc.com/isoxml">
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
- expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
146
- <iso-standard xmlns="http://riboseinc.com/isoxml">
147
- <bibdata type="standard">
148
- <title>
149
- <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
150
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
151
- <title type="title-part" language="en" format="text/plain">Rice</title>
152
- </title>
153
- <title>
154
- <title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
155
- <title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
156
- <title type="title-part" language="fr" format="text/plain">Riz</title>
157
- </title>
158
- <docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
159
- <docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
160
- <docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
161
- <docidentifier type="iso-tc">17301</docidentifier>
162
- <contributor>
163
- <role type="author"/>
164
- <organization>
165
- <name>ISO</name>
166
- </organization>
167
- </contributor>
168
- <contributor>
169
- <role type="publisher"/>
170
- <organization>
171
- <name>International Organization for Standardization</name>
172
- <abbreviation>ISO</abbreviation>
173
- </organization>
174
- </contributor>
175
- <contributor>
176
- <role type="publisher"/>
177
- <organization>
178
- <name>International Electrotechnical Commission</name>
179
- <abbreviation>IEC</abbreviation>
180
- </organization>
181
- </contributor>
182
- <language>en</language>
183
- <script>Latn</script>
184
- <status>
185
- <stage abbreviation="IS">60</stage>
186
- <substage>92</substage>
187
- </status>
188
- <copyright>
189
- <from>2016</from>
190
- <owner>
191
- <organization>
192
- <name>International Organization for Standardization</name>
193
- </organization>
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&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
227
- :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
228
- :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
229
- :docsubtitlepart=>"Riz",
230
- :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3",
231
- :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
232
- :doctitleintro=>"Cereals and pulses",
233
- :doctitlemain=>"Specifications and test methods",
234
- :doctitlepart=>"Rice",
235
- :doctitlepartlabel=>"Part&nbsp;1&ndash;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&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
238
+ :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
239
+ :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
240
+ :docsubtitlepart=>"Riz",
241
+ :docsubtitlepartlabel=>"Partie&nbsp;1&ndash;3",
242
+ :doctitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
243
+ :doctitleintro=>"Cereals and pulses",
244
+ :doctitlemain=>"Specifications and test methods",
245
+ :doctitlepart=>"Rice",
246
+ :doctitlepartlabel=>"Part&nbsp;1&ndash;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
- arr = c.convert_init(<<~"INPUT", "test", false)
271
- <iso-standard xmlns="http://riboseinc.com/isoxml">
272
- <bibdata>
273
- <language>fr</language>
274
- </bibdata>
275
- </iso-standard>
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
- expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
278
- <iso-standard xmlns="http://riboseinc.com/isoxml">
279
- <bibdata type="standard">
280
- <title>
281
- <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
282
- <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
283
- <title type="title-part" language="en" format="text/plain">Rice</title>
284
- </title>
285
- <title>
286
- <title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
287
- <title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
288
- <title type="title-part" language="fr" format="text/plain">Riz</title>
289
- </title>
290
- <docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
291
- <docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
292
- <docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
293
- <docidentifier type="iso-tc">17301</docidentifier>
294
- <contributor>
295
- <role type="author"/>
296
- <organization>
297
- <name>ISO</name>
298
- </organization>
299
- </contributor>
300
- <contributor>
301
- <role type="publisher"/>
302
- <organization>
303
- <name>International Organization for Standardization</name>
304
- <abbreviation>ISO</abbreviation>
305
- </organization>
306
- </contributor>
307
- <contributor>
308
- <role type="publisher"/>
309
- <organization>
310
- <name>International Electrotechnical Commission</name>
311
- <abbreviation>IEC</abbreviation>
312
- </organization>
313
- </contributor>
314
- <language>fr</language>
315
- <script>Latn</script>
316
- <status>
317
- <stage abbreviation="IS">60</stage>
318
- <substage>92</substage>
319
- </status>
320
- <copyright>
321
- <from>2016</from>
322
- <owner>
323
- <organization>
324
- <name>International Organization for Standardization</name>
325
- </organization>
326
- </owner>
327
- </copyright>
328
- <relation type="obsoletes">
329
- <locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
330
- <docidentifier>IEC 8121</docidentifier>
331
- </relation>
332
- <ext>
333
- <doctype language="">international-standard</doctype>
334
- <doctype language="fr">Standard International</doctype>
335
- <editorialgroup>
336
- <technical-committee number="34" type="ABC">Food products</technical-committee>
337
- <subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
338
- <workgroup number="3" type="GHI">Rice Group</workgroup>
339
- </editorialgroup>
340
- <ics><code>1.2.3</code></ics>
341
- <ics><code>1.2.3</code></ics>
342
- <structuredidentifier>
343
- <project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
344
- </strucuredidentifier>
345
- <stagename>International standard</stagename>
346
- </ext>
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&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
360
- :docsubtitleintro=>"Cereals and pulses",
361
- :docsubtitlemain=>"Specifications and test methods",
362
- :docsubtitlepart=>"Rice",
363
- :docsubtitlepartlabel=>"Part&nbsp;1&ndash;3",
364
- :doctitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
365
- :doctitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
366
- :doctitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
367
- :doctitlepart=>"Riz",
368
- :doctitlepartlabel=>"Partie&nbsp;1&ndash;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&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
371
+ :docsubtitleintro=>"Cereals and pulses",
372
+ :docsubtitlemain=>"Specifications and test methods",
373
+ :docsubtitlepart=>"Rice",
374
+ :docsubtitlepartlabel=>"Part&nbsp;1&ndash;3",
375
+ :doctitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
376
+ :doctitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
377
+ :doctitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
378
+ :doctitlepart=>"Riz",
379
+ :doctitlepartlabel=>"Partie&nbsp;1&ndash;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