metanorma-standoc 1.11.0.1 → 1.11.4

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/lib/asciidoctor/standoc/base.rb +4 -100
  4. data/lib/asciidoctor/standoc/blocks.rb +1 -1
  5. data/lib/asciidoctor/standoc/cleanup.rb +2 -1
  6. data/lib/asciidoctor/standoc/cleanup_block.rb +1 -2
  7. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +28 -20
  8. data/lib/asciidoctor/standoc/cleanup_inline.rb +14 -4
  9. data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +25 -15
  10. data/lib/asciidoctor/standoc/cleanup_reqt.rb +3 -3
  11. data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -2
  12. data/lib/asciidoctor/standoc/cleanup_terms.rb +58 -21
  13. data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +58 -21
  14. data/lib/asciidoctor/standoc/cleanup_text.rb +23 -0
  15. data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +6 -6
  16. data/lib/asciidoctor/standoc/front.rb +13 -9
  17. data/lib/asciidoctor/standoc/inline.rb +13 -11
  18. data/lib/asciidoctor/standoc/isodoc.rng +73 -19
  19. data/lib/asciidoctor/standoc/lists.rb +1 -3
  20. data/lib/asciidoctor/standoc/ref.rb +101 -75
  21. data/lib/asciidoctor/standoc/ref_date_id.rb +30 -1
  22. data/lib/asciidoctor/standoc/ref_sect.rb +16 -6
  23. data/lib/asciidoctor/standoc/render.rb +115 -0
  24. data/lib/asciidoctor/standoc/reqt.rb +1 -1
  25. data/lib/asciidoctor/standoc/section.rb +33 -15
  26. data/lib/asciidoctor/standoc/terms.rb +7 -1
  27. data/lib/asciidoctor/standoc/utils.rb +0 -16
  28. data/lib/asciidoctor/standoc/validate.rb +1 -1
  29. data/lib/isodoc/html/htmlstyle.css +20 -11
  30. data/lib/isodoc/html/htmlstyle.scss +11 -11
  31. data/lib/metanorma/standoc/version.rb +1 -1
  32. data/metanorma-standoc.gemspec +3 -3
  33. data/spec/asciidoctor/base_spec.rb +48 -0
  34. data/spec/asciidoctor/blocks_spec.rb +99 -17
  35. data/spec/asciidoctor/cleanup_blocks_spec.rb +24 -0
  36. data/spec/asciidoctor/cleanup_sections_spec.rb +1 -1
  37. data/spec/asciidoctor/cleanup_spec.rb +6 -6
  38. data/spec/asciidoctor/cleanup_terms_spec.rb +556 -89
  39. data/spec/asciidoctor/datamodel/attributes_table_preprocessor_spec.rb +21 -21
  40. data/spec/asciidoctor/datamodel/diagram_preprocessor_spec.rb +16 -16
  41. data/spec/asciidoctor/inline_spec.rb +174 -5
  42. data/spec/asciidoctor/isobib_cache_spec.rb +4 -8
  43. data/spec/asciidoctor/macros_spec.rb +2 -2
  44. data/spec/asciidoctor/refs_dl_spec.rb +4 -4
  45. data/spec/asciidoctor/refs_spec.rb +889 -495
  46. data/spec/asciidoctor/section_spec.rb +64 -2
  47. data/spec/spec_helper.rb +2 -2
  48. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +182 -182
  49. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
  50. data/spec/vcr_cassettes/isobib_get_123.yml +14 -14
  51. data/spec/vcr_cassettes/isobib_get_123_1.yml +99 -99
  52. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +107 -107
  53. data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -14
  54. data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
  55. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  56. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
  57. metadata +9 -8
@@ -4,7 +4,7 @@ require "relaton_ietf"
4
4
 
5
5
  RSpec.describe Asciidoctor::Standoc do
6
6
  it "processes simple ISO reference" do
7
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
7
+ input = <<~INPUT
8
8
  #{ASCIIDOC_BLANK_HDR}
9
9
  [bibliography]
10
10
  == Normative References
@@ -12,6 +12,7 @@ RSpec.describe Asciidoctor::Standoc do
12
12
  * [[[iso123,ISO 123]]] _Standard_
13
13
  * [[[iso124,(1)ISO 123]]] _Standard_
14
14
  INPUT
15
+ output = <<~OUTPUT
15
16
  #{BLANK_HDR}
16
17
  <sections>
17
18
  </sections><bibliography><references id="_" obligation="informative" normative="true">
@@ -44,10 +45,12 @@ RSpec.describe Asciidoctor::Standoc do
44
45
  </bibliography>
45
46
  </standard-document>
46
47
  OUTPUT
48
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
49
+ .to be_equivalent_to xmlpp(output)
47
50
  end
48
51
 
49
52
  it "processes simple ISO reference with date range" do
50
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
53
+ input = <<~INPUT
51
54
  #{ASCIIDOC_BLANK_HDR}
52
55
  [bibliography]
53
56
  == Normative References
@@ -55,6 +58,7 @@ RSpec.describe Asciidoctor::Standoc do
55
58
  * [[[iso123,ISO 123:1066-1067]]] _Standard_
56
59
  * [[[iso124,(1)ISO 123:1066-1067]]] _Standard_
57
60
  INPUT
61
+ output = <<~OUTPUT
58
62
  #{BLANK_HDR}
59
63
  <sections>
60
64
  </sections><bibliography><references id="_" obligation="informative" normative="true">
@@ -96,6 +100,8 @@ RSpec.describe Asciidoctor::Standoc do
96
100
  </bibliography>
97
101
  </standard-document>
98
102
  OUTPUT
103
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
104
+ .to be_equivalent_to xmlpp(output)
99
105
  end
100
106
 
101
107
  it "repairs simple fetched ISO reference" do
@@ -113,118 +119,122 @@ RSpec.describe Asciidoctor::Standoc do
113
119
  * [[[iso123,ISO 123]]] _Standard_
114
120
  * [[[iso124,(1)ISO 123]]] _Standard_
115
121
  INPUT
116
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
117
- #{BLANK_HDR}
118
- <preface>
119
- <foreword id='_' obligation='informative'>
120
- <title>Foreword</title>
121
- <p id='_'>
122
- <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
123
- <eref type='inline' bibitemid='iso124' citeas='[1]'/>
124
- </p>
125
- </foreword>
126
- </preface>
127
- <sections>
128
- </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
129
- #{NORM_REF_BOILERPLATE}
130
- <bibitem type="standard" id="iso123">
131
- <uri type="src">https://www.iso.org/standard/23281.html</uri>
132
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
133
- <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
134
- <date type="published">
135
- <on>2001</on>
136
- </date>
137
- <contributor>
138
- <role type="publisher"/>
139
- <organization>
140
- <name>International Organization for Standardization</name>
141
- <abbreviation>ISO</abbreviation>
142
- <uri>www.iso.org</uri>
143
- </organization>
144
- </contributor>
145
- <edition>3</edition>
146
- <language>en</language>
147
- <language>fr</language>
148
- <script>Latn</script>
149
- <status>
150
- <stage>Published</stage>
151
- </status>
152
- <copyright>
153
- <from>2001</from>
154
- <owner>
122
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
123
+ .to be_equivalent_to xmlpp(<<~"OUTPUT")
124
+ #{BLANK_HDR}
125
+ <preface>
126
+ <foreword id='_' obligation='informative'>
127
+ <title>Foreword</title>
128
+ <p id='_'>
129
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
130
+ <eref type='inline' bibitemid='iso124' citeas='[1]'/>
131
+ </p>
132
+ </foreword>
133
+ </preface>
134
+ <sections>
135
+ </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
136
+ #{NORM_REF_BOILERPLATE}
137
+ <bibitem type="standard" id="iso123">
138
+ <uri type="src">https://www.iso.org/standard/23281.html</uri>
139
+ <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
140
+ <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
141
+ <date type="published">
142
+ <on>2001</on>
143
+ </date>
144
+ <contributor>
145
+ <role type="publisher"/>
155
146
  <organization>
156
- <name>ISO</name>
157
- <abbreviation/>
147
+ <name>International Organization for Standardization</name>
148
+ <abbreviation>ISO</abbreviation>
149
+ <uri>www.iso.org</uri>
158
150
  </organization>
159
- </owner>
160
- </copyright>
161
- <relation type="obsoletes">
162
- <bibitem type="standard">
163
- <formattedref format="text/plain">ISO 123:1985</formattedref>
164
- </bibitem>
165
- </relation>
166
- <relation type="updates">
167
- <bibitem type="standard">
168
- <formattedref format="text/plain">ISO 123:2001</formattedref>
169
- </bibitem>
170
- </relation>
171
- <docidentifier>ISO 123</docidentifier>
172
- <title><em>Standard</em></title>
173
- </bibitem>
174
- <bibitem type="standard" id="iso124">
175
- <uri type="src">https://www.iso.org/standard/23281.html</uri>
176
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
177
- <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
178
- <date type="published">
179
- <on>2001</on>
180
- </date>
181
- <contributor>
182
- <role type="publisher"/>
183
- <organization>
184
- <name>International Organization for Standardization</name>
185
- <abbreviation>ISO</abbreviation>
186
- <uri>www.iso.org</uri>
187
- </organization>
188
- </contributor>
189
- <edition>3</edition>
190
- <language>en</language>
191
- <language>fr</language>
192
- <script>Latn</script>
193
- <status>
194
- <stage>Published</stage>
195
- </status>
196
- <copyright>
197
- <from>2001</from>
198
- <owner>
151
+ </contributor>
152
+ <edition>3</edition>
153
+ <language>en</language>
154
+ <language>fr</language>
155
+ <script>Latn</script>
156
+ <status>
157
+ <stage>Published</stage>
158
+ </status>
159
+ <copyright>
160
+ <from>2001</from>
161
+ <owner>
162
+ <organization>
163
+ <name>ISO</name>
164
+ <abbreviation/>
165
+ </organization>
166
+ </owner>
167
+ </copyright>
168
+ <relation type="obsoletes">
169
+ <bibitem type="standard">
170
+ <formattedref format="text/plain">ISO 123:1985</formattedref>
171
+ </bibitem>
172
+ </relation>
173
+ <relation type="updates">
174
+ <bibitem type="standard">
175
+ <formattedref format="text/plain">ISO 123:2001</formattedref>
176
+ </bibitem>
177
+ </relation>
178
+ <docidentifier>ISO 123</docidentifier>
179
+ <title><em>Standard</em></title>
180
+ </bibitem>
181
+ <bibitem type="standard" id="iso124">
182
+ <uri type="src">https://www.iso.org/standard/23281.html</uri>
183
+ <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
184
+ <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
185
+ <date type="published">
186
+ <on>2001</on>
187
+ </date>
188
+ <contributor>
189
+ <role type="publisher"/>
199
190
  <organization>
200
- <name>ISO</name>
201
- <abbreviation/>
191
+ <name>International Organization for Standardization</name>
192
+ <abbreviation>ISO</abbreviation>
193
+ <uri>www.iso.org</uri>
202
194
  </organization>
203
- </owner>
204
- </copyright>
205
- <relation type="obsoletes">
206
- <bibitem type="standard">
207
- <formattedref format="text/plain">ISO 123:1985</formattedref>
208
- </bibitem>
209
- </relation>
210
- <relation type="updates">
211
- <bibitem type="standard">
212
- <formattedref format="text/plain">ISO 123:2001</formattedref>
213
- </bibitem>
214
- </relation>
215
- <docidentifier>ISO 123</docidentifier>
216
- <docidentifier type='metanorma'>[1]</docidentifier>
217
- <title><em>Standard</em></title>
218
- </bibitem>
219
- </references></bibliography>
220
- </standard-document>
221
- OUTPUT
222
- expect { Asciidoctor.convert(input, *OPTIONS) }.to output(/ERROR: No document identifier retrieved for ISO 123/).to_stderr
195
+ </contributor>
196
+ <edition>3</edition>
197
+ <language>en</language>
198
+ <language>fr</language>
199
+ <script>Latn</script>
200
+ <status>
201
+ <stage>Published</stage>
202
+ </status>
203
+ <copyright>
204
+ <from>2001</from>
205
+ <owner>
206
+ <organization>
207
+ <name>ISO</name>
208
+ <abbreviation/>
209
+ </organization>
210
+ </owner>
211
+ </copyright>
212
+ <relation type="obsoletes">
213
+ <bibitem type="standard">
214
+ <formattedref format="text/plain">ISO 123:1985</formattedref>
215
+ </bibitem>
216
+ </relation>
217
+ <relation type="updates">
218
+ <bibitem type="standard">
219
+ <formattedref format="text/plain">ISO 123:2001</formattedref>
220
+ </bibitem>
221
+ </relation>
222
+ <docidentifier>ISO 123</docidentifier>
223
+ <docidentifier type='metanorma'>[1]</docidentifier>
224
+ <title><em>Standard</em></title>
225
+ </bibitem>
226
+ </references></bibliography>
227
+ </standard-document>
228
+ OUTPUT
229
+ expect do
230
+ Asciidoctor.convert(input, *OPTIONS)
231
+ end.to output(/ERROR: No document identifier retrieved for ISO 123/)
232
+ .to_stderr
223
233
  end
224
234
 
225
235
  it "fetches simple ISO reference" do
226
236
  VCR.use_cassette "isobib_get_123_1" do
227
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
237
+ input = <<~INPUT
228
238
  #{ISOBIB_BLANK_HDR}
229
239
  [bibliography]
230
240
  == Normative References
@@ -232,124 +242,213 @@ RSpec.describe Asciidoctor::Standoc do
232
242
  * [[[iso123,ISO 123]]] _Standard_
233
243
  * [[[iso124,(1)ISO 123]]] _Standard_
234
244
  INPUT
235
- #{BLANK_HDR}
236
- <sections>
237
-
238
- </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
239
- #{NORM_REF_BOILERPLATE}
240
- <bibitem id='iso123' type='standard'>
241
- <fetched>#{Date.today}</fetched>
242
- <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
243
- <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
244
- <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
245
- <uri type='src'>https://www.iso.org/standard/23281.html</uri>
246
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
247
- <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
248
- <docidentifier type='ISO'>ISO 123:2001</docidentifier>
249
- <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
250
- <docnumber>123</docnumber>
251
- <date type='published'>
252
- <on>2001-05</on>
253
- </date>
254
- <contributor>
255
- <role type='publisher'/>
256
- <organization>
257
- <name>International Organization for Standardization</name>
258
- <abbreviation>ISO</abbreviation>
259
- <uri>www.iso.org</uri>
260
- </organization>
261
- </contributor>
262
- <edition>3</edition>
263
- <language>en</language>
264
- <script>Latn</script>
265
- <abstract format='text/plain' language='en' script='Latn'>
266
- This International Standard specifies procedures for sampling natural
267
- rubber latex concentrate and for sampling synthetic rubber latices and
268
- artificial latices. It is also suitable for sampling rubber latex
269
- contained in drums, tank cars or tanks. The procedures may also be
270
- used for sampling plastics dispersions.
271
- </abstract>
272
- <status>
273
- <stage>90</stage>
274
- <substage>93</substage>
275
- </status>
276
- <copyright>
277
- <from>2001</from>
278
- <owner>
279
- <organization>
280
- <name>ISO</name>
281
- </organization>
282
- </owner>
283
- </copyright>
284
- <relation type='obsoletes'>
285
- <bibitem type='standard'>
286
- <formattedref format='text/plain'>ISO 123:1985</formattedref>
287
- </bibitem>
288
- </relation>
289
- <place>Geneva</place>
290
- </bibitem>
291
- <bibitem id='iso124' type='standard'>
292
- <fetched>#{Date.today}</fetched>
293
- <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
294
- <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
295
- <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
296
- <uri type='src'>https://www.iso.org/standard/23281.html</uri>
297
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
298
- <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
299
- <docidentifier type='ISO'>ISO 123:2001</docidentifier>
300
- <docidentifier type='metanorma'>[1]</docidentifier>
301
- <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
302
- <docnumber>123</docnumber>
303
- <date type='published'>
304
- <on>2001-05</on>
305
- </date>
306
- <contributor>
307
- <role type='publisher'/>
308
- <organization>
309
- <name>International Organization for Standardization</name>
310
- <abbreviation>ISO</abbreviation>
311
- <uri>www.iso.org</uri>
312
- </organization>
313
- </contributor>
314
- <edition>3</edition>
315
- <language>en</language>
316
- <script>Latn</script>
317
- <abstract format='text/plain' language='en' script='Latn'>
318
- This International Standard specifies procedures for sampling natural
319
- rubber latex concentrate and for sampling synthetic rubber latices and
320
- artificial latices. It is also suitable for sampling rubber latex
321
- contained in drums, tank cars or tanks. The procedures may also be
322
- used for sampling plastics dispersions.
323
- </abstract>
324
- <status>
325
- <stage>90</stage>
326
- <substage>93</substage>
327
- </status>
328
- <copyright>
329
- <from>2001</from>
330
- <owner>
331
- <organization>
332
- <name>ISO</name>
333
- </organization>
334
- </owner>
335
- </copyright>
336
- <relation type='obsoletes'>
337
- <bibitem type='standard'>
338
- <formattedref format='text/plain'>ISO 123:1985</formattedref>
339
- </bibitem>
340
- </relation>
341
- <place>Geneva</place>
342
- </bibitem>
343
- </references>
344
- </bibliography>
345
- </standard-document>
245
+ output = <<~OUTPUT
246
+ #{BLANK_HDR}
247
+ <sections>
248
+
249
+ </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
250
+ #{NORM_REF_BOILERPLATE}
251
+ <bibitem id='iso123' type='standard'>
252
+ <fetched/>
253
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
254
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
255
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
256
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
257
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
258
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
259
+ <docidentifier type='ISO'>ISO 123</docidentifier>
260
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
261
+ <docnumber>123</docnumber>
262
+ <contributor>
263
+ <role type='publisher'/>
264
+ <organization>
265
+ <name>International Organization for Standardization</name>
266
+ <abbreviation>ISO</abbreviation>
267
+ <uri>www.iso.org</uri>
268
+ </organization>
269
+ </contributor>
270
+ <edition>3</edition>
271
+ <language>en</language>
272
+ <script>Latn</script>
273
+ <status>
274
+ <stage>90</stage>
275
+ <substage>93</substage>
276
+ </status>
277
+ <copyright>
278
+ <from>2001</from>
279
+ <owner>
280
+ <organization>
281
+ <name>ISO</name>
282
+ </organization>
283
+ </owner>
284
+ </copyright>
285
+ <relation type='obsoletes'>
286
+ <bibitem type='standard'>
287
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
288
+ </bibitem>
289
+ </relation>
290
+ <relation type='instance'>
291
+ <bibitem type='standard'>
292
+ <fetched/>
293
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
294
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
295
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
296
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
297
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
298
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
299
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
300
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
301
+ <docnumber>123</docnumber>
302
+ <date type='published'>
303
+ <on>2001-05</on>
304
+ </date>
305
+ <contributor>
306
+ <role type='publisher'/>
307
+ <organization>
308
+ <name>International Organization for Standardization</name>
309
+ <abbreviation>ISO</abbreviation>
310
+ <uri>www.iso.org</uri>
311
+ </organization>
312
+ </contributor>
313
+ <edition>3</edition>
314
+ <language>en</language>
315
+ <script>Latn</script>
316
+ <abstract format='text/plain' language='en' script='Latn'>
317
+ This International Standard specifies procedures for sampling
318
+ natural rubber latex concentrate and for sampling synthetic rubber
319
+ latices and artificial latices. It is also suitable for sampling
320
+ rubber latex contained in drums, tank cars or tanks. The
321
+ procedures may also be used for sampling plastics dispersions.
322
+ </abstract>
323
+ <status>
324
+ <stage>90</stage>
325
+ <substage>93</substage>
326
+ </status>
327
+ <copyright>
328
+ <from>2001</from>
329
+ <owner>
330
+ <organization>
331
+ <name>ISO</name>
332
+ </organization>
333
+ </owner>
334
+ </copyright>
335
+ <relation type='obsoletes'>
336
+ <bibitem type='standard'>
337
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
338
+ </bibitem>
339
+ </relation>
340
+ <place>Geneva</place>
341
+ </bibitem>
342
+ </relation>
343
+ <place>Geneva</place>
344
+ </bibitem>
345
+ <bibitem id='iso124' type='standard'>
346
+ <fetched/>
347
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
348
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
349
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
350
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
351
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
352
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
353
+ <docidentifier type='ISO'>ISO 123</docidentifier>
354
+ <docidentifier type='metanorma'>[1]</docidentifier>
355
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
356
+ <docnumber>123</docnumber>
357
+ <contributor>
358
+ <role type='publisher'/>
359
+ <organization>
360
+ <name>International Organization for Standardization</name>
361
+ <abbreviation>ISO</abbreviation>
362
+ <uri>www.iso.org</uri>
363
+ </organization>
364
+ </contributor>
365
+ <edition>3</edition>
366
+ <language>en</language>
367
+ <script>Latn</script>
368
+ <status>
369
+ <stage>90</stage>
370
+ <substage>93</substage>
371
+ </status>
372
+ <copyright>
373
+ <from>2001</from>
374
+ <owner>
375
+ <organization>
376
+ <name>ISO</name>
377
+ </organization>
378
+ </owner>
379
+ </copyright>
380
+ <relation type='obsoletes'>
381
+ <bibitem type='standard'>
382
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
383
+ </bibitem>
384
+ </relation>
385
+ <relation type='instance'>
386
+ <bibitem type='standard'>
387
+ <fetched/>
388
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
389
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
390
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
391
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
392
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
393
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
394
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
395
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
396
+ <docnumber>123</docnumber>
397
+ <date type='published'>
398
+ <on>2001-05</on>
399
+ </date>
400
+ <contributor>
401
+ <role type='publisher'/>
402
+ <organization>
403
+ <name>International Organization for Standardization</name>
404
+ <abbreviation>ISO</abbreviation>
405
+ <uri>www.iso.org</uri>
406
+ </organization>
407
+ </contributor>
408
+ <edition>3</edition>
409
+ <language>en</language>
410
+ <script>Latn</script>
411
+ <abstract format='text/plain' language='en' script='Latn'>
412
+ This International Standard specifies procedures for sampling
413
+ natural rubber latex concentrate and for sampling synthetic rubber
414
+ latices and artificial latices. It is also suitable for sampling
415
+ rubber latex contained in drums, tank cars or tanks. The
416
+ procedures may also be used for sampling plastics dispersions.
417
+ </abstract>
418
+ <status>
419
+ <stage>90</stage>
420
+ <substage>93</substage>
421
+ </status>
422
+ <copyright>
423
+ <from>2001</from>
424
+ <owner>
425
+ <organization>
426
+ <name>ISO</name>
427
+ </organization>
428
+ </owner>
429
+ </copyright>
430
+ <relation type='obsoletes'>
431
+ <bibitem type='standard'>
432
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
433
+ </bibitem>
434
+ </relation>
435
+ <place>Geneva</place>
436
+ </bibitem>
437
+ </relation>
438
+ <place>Geneva</place>
439
+ </bibitem>
440
+ </references>
441
+ </bibliography>
442
+ </standard-document>
346
443
  OUTPUT
444
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
445
+ .to be_equivalent_to xmlpp(output)
347
446
  end
348
447
  end
349
448
 
350
449
  it "fetches simple ISO reference in French" do
351
450
  VCR.use_cassette "isobib_get_123_1_fr" do
352
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
451
+ input = <<~INPUT
353
452
  = Document title
354
453
  Author
355
454
  :docfile: test.adoc
@@ -364,138 +463,233 @@ RSpec.describe Asciidoctor::Standoc do
364
463
  * [[[iso123,ISO 123]]] _Standard_
365
464
  * [[[iso124,(1)ISO 123]]] _Standard_
366
465
  INPUT
367
- #{BLANK_HDR.sub(%r{<language>en</language>}, '<language>fr</language>')}
368
- <sections>
369
- </sections><bibliography>
370
- <references id='_' normative='true' obligation='informative'>
371
- <title>Références normatives</title>
372
- <p id='_'>
373
- Les documents suivants cités dans le texte constituent, pour tout ou
374
- partie de leur contenu, des exigences du présent document. Pour les
375
- références datées, seule l’édition citée s’applique. Pour les références
376
- non datées, la dernière édition du document de référence s’applique (y
377
- compris les éventuels amendements).
378
- </p>
379
- <bibitem id='iso123' type='standard'>
380
- <fetched>#{Date.today}</fetched>
466
+ output = <<~OUTPUT
467
+ #{BLANK_HDR.sub(%r{<language>en</language>}, '<language>fr</language>')}
468
+ <sections> </sections>
469
+ <bibliography>
470
+ <references id='_' normative='true' obligation='informative'>
471
+ <title>R&#233;f&#233;rences normatives</title>
472
+ <p id='_'>
473
+ Les documents suivants cit&#233;s dans le texte constituent, pour tout
474
+ ou partie de leur contenu, des exigences du pr&#233;sent document. Pour
475
+ les r&#233;f&#233;rences dat&#233;es, seule l&#8217;&#233;dition
476
+ cit&#233;e s&#8217;applique. Pour les r&#233;f&#233;rences non
477
+ dat&#233;es, la derni&#232;re &#233;dition du document de
478
+ r&#233;f&#233;rence s&#8217;applique (y compris les &#233;ventuels
479
+ amendements).
480
+ </p>
481
+ <bibitem id='iso123' type='standard'>
482
+ <fetched/>
381
483
  <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
382
- <title type='title-main' format='text/plain' language='fr' script='Latn'>&#201;chantillonnage</title>
383
- <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc&#8201;&#8212;&#8201;&#201;chantillonnage</title>
384
- <uri type='src'>https://www.iso.org/standard/23281.html</uri>
385
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
386
- <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
387
- <docidentifier type='ISO'>ISO 123:2001</docidentifier>
388
- <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
389
- <docnumber>123</docnumber>
390
- <date type='published'>
391
- <on>2001-05</on>
392
- </date>
393
- <contributor>
394
- <role type='publisher'/>
395
- <organization>
396
- <name>International Organization for Standardization</name>
397
- <abbreviation>ISO</abbreviation>
398
- <uri>www.iso.org</uri>
399
- </organization>
400
- </contributor>
401
- <edition>3</edition>
402
- <language>en</language>
403
- <language>fr</language>
404
- <script>Latn</script>
405
- <abstract format='text/plain' language='fr' script='Latn'>
406
- La pr&#233;sente Norme internationale sp&#233;cifie des m&#233;thodes
407
- d&#8217;&#233;chantillonnage pour des concentr&#233;s de latex de
408
- caoutchouc naturel et pour &#233;chantillonner des latex de caoutchouc
409
- synth&#233;tique et des latex artificiels. Elle s&#8217;applique
410
- &#233;galement &#224; l&#8217;&#233;chantillonnage de latex de
411
- caoutchouc contenus dans des f&#251;ts, citernes routi&#232;res ou de
412
- stockage. Le mode op&#233;ratoire peut aussi &#234;tre utilis&#233;
413
- pour l&#8217;&#233;chantillonnage de dispersions de plastiques.
414
- </abstract>
415
- <status>
416
- <stage>90</stage>
417
- <substage>93</substage>
418
- </status>
419
- <copyright>
420
- <from>2001</from>
421
- <owner>
422
- <organization>
423
- <name>ISO</name>
424
- </organization>
425
- </owner>
426
- </copyright>
427
- <relation type='obsoletes'>
428
- <bibitem type='standard'>
429
- <formattedref format='text/plain'>ISO 123:1985</formattedref>
430
- </bibitem>
431
- </relation>
432
- <place>Geneva</place>
433
- </bibitem>
434
- <bibitem id='iso124' type='standard'>
435
- <fetched>#{Date.today}</fetched>
436
- <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
437
- <title type='title-main' format='text/plain' language='fr' script='Latn'>&#201;chantillonnage</title>
438
- <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc&#8201;&#8212;&#8201;&#201;chantillonnage</title>
439
- <uri type='src'>https://www.iso.org/standard/23281.html</uri>
440
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
441
- <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
442
- <docidentifier type='ISO'>ISO 123:2001</docidentifier>
443
- <docidentifier type='metanorma'>[1]</docidentifier>
444
- <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
445
- <docnumber>123</docnumber>
446
- <date type='published'>
447
- <on>2001-05</on>
448
- </date>
449
- <contributor>
450
- <role type='publisher'/>
451
- <organization>
452
- <name>International Organization for Standardization</name>
453
- <abbreviation>ISO</abbreviation>
454
- <uri>www.iso.org</uri>
455
- </organization>
456
- </contributor>
457
- <edition>3</edition>
458
- <language>en</language>
459
- <language>fr</language>
460
- <script>Latn</script>
461
- <abstract format='text/plain' language='fr' script='Latn'>
462
- La pr&#233;sente Norme internationale sp&#233;cifie des m&#233;thodes
463
- d&#8217;&#233;chantillonnage pour des concentr&#233;s de latex de
464
- caoutchouc naturel et pour &#233;chantillonner des latex de caoutchouc
465
- synth&#233;tique et des latex artificiels. Elle s&#8217;applique
466
- &#233;galement &#224; l&#8217;&#233;chantillonnage de latex de
467
- caoutchouc contenus dans des f&#251;ts, citernes routi&#232;res ou de
468
- stockage. Le mode op&#233;ratoire peut aussi &#234;tre utilis&#233;
469
- pour l&#8217;&#233;chantillonnage de dispersions de plastiques.
470
- </abstract>
471
- <status>
472
- <stage>90</stage>
473
- <substage>93</substage>
474
- </status>
475
- <copyright>
476
- <from>2001</from>
477
- <owner>
478
- <organization>
479
- <name>ISO</name>
480
- </organization>
481
- </owner>
482
- </copyright>
483
- <relation type='obsoletes'>
484
- <bibitem type='standard'>
485
- <formattedref format='text/plain'>ISO 123:1985</formattedref>
486
- </bibitem>
487
- </relation>
488
- <place>Geneva</place>
489
- </bibitem>
490
- </references>
491
- </bibliography>
492
- </standard-document>
484
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>&#201;chantillonnage</title>
485
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc&#8201;&#8212;&#8201;&#201;chantillonnage</title>
486
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
487
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
488
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
489
+ <docidentifier type='ISO'>ISO 123</docidentifier>
490
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
491
+ <docnumber>123</docnumber>
492
+ <contributor>
493
+ <role type='publisher'/>
494
+ <organization>
495
+ <name>International Organization for Standardization</name>
496
+ <abbreviation>ISO</abbreviation>
497
+ <uri>www.iso.org</uri>
498
+ </organization>
499
+ </contributor>
500
+ <edition>3</edition>
501
+ <language>en</language>
502
+ <language>fr</language>
503
+ <script>Latn</script>
504
+ <status>
505
+ <stage>90</stage>
506
+ <substage>93</substage>
507
+ </status>
508
+ <copyright>
509
+ <from>2001</from>
510
+ <owner>
511
+ <organization>
512
+ <name>ISO</name>
513
+ </organization>
514
+ </owner>
515
+ </copyright>
516
+ <relation type='obsoletes'>
517
+ <bibitem type='standard'>
518
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
519
+ </bibitem>
520
+ </relation>
521
+ <relation type='instance'>
522
+ <bibitem type='standard'>
523
+ <fetched/>
524
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
525
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>&#201;chantillonnage</title>
526
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc&#8201;&#8212;&#8201;&#201;chantillonnage</title>
527
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
528
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
529
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
530
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
531
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
532
+ <docnumber>123</docnumber>
533
+ <date type='published'>
534
+ <on>2001-05</on>
535
+ </date>
536
+ <contributor>
537
+ <role type='publisher'/>
538
+ <organization>
539
+ <name>International Organization for Standardization</name>
540
+ <abbreviation>ISO</abbreviation>
541
+ <uri>www.iso.org</uri>
542
+ </organization>
543
+ </contributor>
544
+ <edition>3</edition>
545
+ <language>en</language>
546
+ <language>fr</language>
547
+ <script>Latn</script>
548
+ <abstract format='text/plain' language='fr' script='Latn'>
549
+ La pr&#233;sente Norme internationale sp&#233;cifie des
550
+ m&#233;thodes d&#8217;&#233;chantillonnage pour des
551
+ concentr&#233;s de latex de caoutchouc naturel et pour
552
+ &#233;chantillonner des latex de caoutchouc synth&#233;tique et
553
+ des latex artificiels. Elle s&#8217;applique &#233;galement &#224;
554
+ l&#8217;&#233;chantillonnage de latex de caoutchouc contenus dans
555
+ des f&#251;ts, citernes routi&#232;res ou de stockage. Le mode
556
+ op&#233;ratoire peut aussi &#234;tre utilis&#233; pour
557
+ l&#8217;&#233;chantillonnage de dispersions de plastiques.
558
+ </abstract>
559
+ <status>
560
+ <stage>90</stage>
561
+ <substage>93</substage>
562
+ </status>
563
+ <copyright>
564
+ <from>2001</from>
565
+ <owner>
566
+ <organization>
567
+ <name>ISO</name>
568
+ </organization>
569
+ </owner>
570
+ </copyright>
571
+ <relation type='obsoletes'>
572
+ <bibitem type='standard'>
573
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
574
+ </bibitem>
575
+ </relation>
576
+ <place>Geneva</place>
577
+ </bibitem>
578
+ </relation>
579
+ <place>Geneva</place>
580
+ </bibitem>
581
+ <bibitem id='iso124' type='standard'>
582
+ <fetched/>
583
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
584
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>&#201;chantillonnage</title>
585
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc&#8201;&#8212;&#8201;&#201;chantillonnage</title>
586
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
587
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
588
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
589
+ <docidentifier type='ISO'>ISO 123</docidentifier>
590
+ <docidentifier type='metanorma'>[1]</docidentifier>
591
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
592
+ <docnumber>123</docnumber>
593
+ <contributor>
594
+ <role type='publisher'/>
595
+ <organization>
596
+ <name>International Organization for Standardization</name>
597
+ <abbreviation>ISO</abbreviation>
598
+ <uri>www.iso.org</uri>
599
+ </organization>
600
+ </contributor>
601
+ <edition>3</edition>
602
+ <language>en</language>
603
+ <language>fr</language>
604
+ <script>Latn</script>
605
+ <status>
606
+ <stage>90</stage>
607
+ <substage>93</substage>
608
+ </status>
609
+ <copyright>
610
+ <from>2001</from>
611
+ <owner>
612
+ <organization>
613
+ <name>ISO</name>
614
+ </organization>
615
+ </owner>
616
+ </copyright>
617
+ <relation type='obsoletes'>
618
+ <bibitem type='standard'>
619
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
620
+ </bibitem>
621
+ </relation>
622
+ <relation type='instance'>
623
+ <bibitem type='standard'>
624
+ <fetched/>
625
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
626
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>&#201;chantillonnage</title>
627
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc&#8201;&#8212;&#8201;&#201;chantillonnage</title>
628
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
629
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
630
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
631
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
632
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:fr</docidentifier>
633
+ <docnumber>123</docnumber>
634
+ <date type='published'>
635
+ <on>2001-05</on>
636
+ </date>
637
+ <contributor>
638
+ <role type='publisher'/>
639
+ <organization>
640
+ <name>International Organization for Standardization</name>
641
+ <abbreviation>ISO</abbreviation>
642
+ <uri>www.iso.org</uri>
643
+ </organization>
644
+ </contributor>
645
+ <edition>3</edition>
646
+ <language>en</language>
647
+ <language>fr</language>
648
+ <script>Latn</script>
649
+ <abstract format='text/plain' language='fr' script='Latn'>
650
+ La pr&#233;sente Norme internationale sp&#233;cifie des
651
+ m&#233;thodes d&#8217;&#233;chantillonnage pour des
652
+ concentr&#233;s de latex de caoutchouc naturel et pour
653
+ &#233;chantillonner des latex de caoutchouc synth&#233;tique et
654
+ des latex artificiels. Elle s&#8217;applique &#233;galement &#224;
655
+ l&#8217;&#233;chantillonnage de latex de caoutchouc contenus dans
656
+ des f&#251;ts, citernes routi&#232;res ou de stockage. Le mode
657
+ op&#233;ratoire peut aussi &#234;tre utilis&#233; pour
658
+ l&#8217;&#233;chantillonnage de dispersions de plastiques.
659
+ </abstract>
660
+ <status>
661
+ <stage>90</stage>
662
+ <substage>93</substage>
663
+ </status>
664
+ <copyright>
665
+ <from>2001</from>
666
+ <owner>
667
+ <organization>
668
+ <name>ISO</name>
669
+ </organization>
670
+ </owner>
671
+ </copyright>
672
+ <relation type='obsoletes'>
673
+ <bibitem type='standard'>
674
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
675
+ </bibitem>
676
+ </relation>
677
+ <place>Geneva</place>
678
+ </bibitem>
679
+ </relation>
680
+ <place>Geneva</place>
681
+ </bibitem>
682
+ </references>
683
+ </bibliography>
684
+ </standard-document>
493
685
  OUTPUT
686
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
687
+ .to be_equivalent_to xmlpp(output)
494
688
  end
495
689
  end
496
690
 
497
691
  it "processes simple IEC reference" do
498
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
692
+ input = <<~INPUT
499
693
  #{ASCIIDOC_BLANK_HDR}
500
694
  [bibliography]
501
695
  == Normative References
@@ -503,6 +697,7 @@ RSpec.describe Asciidoctor::Standoc do
503
697
  * [[[iso123,IEC 123]]] _Standard_
504
698
  * [[[iso124,(1)IEC 123]]] _Standard_
505
699
  INPUT
700
+ output = <<~OUTPUT
506
701
  #{BLANK_HDR}
507
702
  <sections>
508
703
  </sections><bibliography><references id="_" obligation="informative" normative="true">
@@ -535,13 +730,14 @@ RSpec.describe Asciidoctor::Standoc do
535
730
  </bibliography>
536
731
  </standard-document>
537
732
  OUTPUT
733
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
734
+ .to be_equivalent_to xmlpp(output)
538
735
  end
539
736
 
540
737
  it "processes dated ISO reference and joint ISO/IEC references" do
541
- # mock_isobib_get_iec12382
542
- # mock_isobib_get_124
543
- VCR.use_cassette "dated_iso_ref_joint_iso_iec" do
544
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
738
+ VCR.use_cassette("dated_iso_ref_joint_iso_iec",
739
+ match_requests_on: %i[method uri body]) do
740
+ input = <<~INPUT
545
741
  #{ISOBIB_BLANK_HDR}
546
742
  [bibliography]
547
743
  == Normative References
@@ -551,6 +747,7 @@ RSpec.describe Asciidoctor::Standoc do
551
747
  * [[[iso125,(1)ISO/IEC TR 12382:1992]]] _Standard_
552
748
  * [[[iso126,(1)ISO 124:2014]]] _Standard_
553
749
  INPUT
750
+ output = <<~OUTPUT
554
751
  #{BLANK_HDR}
555
752
  <sections>
556
753
 
@@ -558,7 +755,7 @@ RSpec.describe Asciidoctor::Standoc do
558
755
  <title>Normative references</title>
559
756
  #{NORM_REF_BOILERPLATE}
560
757
  <bibitem type="standard" id="iso123">
561
- <fetched>#{Date.today}</fetched>
758
+ <fetched/>
562
759
  <title type="title-main" format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
563
760
  <title type="main" format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
564
761
  <uri type="src">https://www.iso.org/standard/21071.html</uri>
@@ -605,7 +802,7 @@ RSpec.describe Asciidoctor::Standoc do
605
802
  <place>Geneva</place>
606
803
  </bibitem>
607
804
  <bibitem id="iso124" type="standard">
608
- <fetched>#{Date.today}</fetched>
805
+ <fetched/>
609
806
  <title type="title-intro" format="text/plain" language="en" script="Latn">Latex, rubber</title>
610
807
  <title type="title-main" format="text/plain" language="en" script="Latn">Determination of total solids content</title>
611
808
  <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
@@ -650,7 +847,7 @@ RSpec.describe Asciidoctor::Standoc do
650
847
  <place>Geneva</place>
651
848
  </bibitem>
652
849
  <bibitem id="iso125" type="standard">
653
- <fetched>#{Date.today}</fetched>
850
+ <fetched/>
654
851
  <title type="title-main" format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
655
852
  <title type='main' format='text/plain' language='en' script='Latn'>Permuted index of the vocabulary of information technology</title>
656
853
  <uri type="src">https://www.iso.org/standard/21071.html</uri>
@@ -698,7 +895,7 @@ RSpec.describe Asciidoctor::Standoc do
698
895
  <place>Geneva</place>
699
896
  </bibitem>
700
897
  <bibitem id="iso126" type="standard">
701
- <fetched>#{Date.today}</fetched>
898
+ <fetched/>
702
899
  <title type="title-intro" format="text/plain" language="en" script="Latn">Latex, rubber</title>
703
900
  <title type="title-main" format="text/plain" language="en" script="Latn">Determination of total solids content</title>
704
901
  <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
@@ -747,12 +944,14 @@ RSpec.describe Asciidoctor::Standoc do
747
944
  </standard-document>
748
945
 
749
946
  OUTPUT
947
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
948
+ .to be_equivalent_to xmlpp(output)
750
949
  end
751
950
  end
752
951
 
753
952
  it "declines to fetch individual references" do
754
953
  VCR.use_cassette "dated_iso_ref_joint_iso_iec1" do
755
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
954
+ input = <<~INPUT
756
955
  #{ISOBIB_BLANK_HDR}
757
956
  [bibliography]
758
957
  == Normative References
@@ -760,6 +959,7 @@ RSpec.describe Asciidoctor::Standoc do
760
959
  * [[[iso123,nofetch(ISO/IEC TR 12382:1992)]]] _Standard_
761
960
  * [[[iso124,ISO 124:2014]]] _Standard_
762
961
  INPUT
962
+ output = <<~OUTPUT
763
963
  #{BLANK_HDR}
764
964
  <sections>
765
965
 
@@ -774,7 +974,7 @@ RSpec.describe Asciidoctor::Standoc do
774
974
  <docnumber>12382:1992</docnumber>
775
975
  </bibitem>
776
976
  <bibitem id='iso124' type='standard'>
777
- <fetched>#{Date.today}</fetched>
977
+ <fetched/>
778
978
  <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
779
979
  <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
780
980
  <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber — Determination of total solids content</title>
@@ -820,13 +1020,15 @@ RSpec.describe Asciidoctor::Standoc do
820
1020
  </bibitem>
821
1021
  </references></bibliography></standard-document>
822
1022
  OUTPUT
1023
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1024
+ .to be_equivalent_to xmlpp(output)
823
1025
  end
824
1026
  end
825
1027
 
826
1028
  it "processes draft ISO reference" do
827
1029
  # stub_fetch_ref no_year: true, note: "The standard is in press"
828
1030
 
829
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1031
+ input = <<~INPUT
830
1032
  #{ASCIIDOC_BLANK_HDR}
831
1033
  [bibliography]
832
1034
  == Normative References
@@ -836,6 +1038,7 @@ RSpec.describe Asciidoctor::Standoc do
836
1038
  * [[[iso125,ISO 125:&ndash;]]], footnote:[The standard is in press] _Standard_
837
1039
  * [[[iso126,(1)ISO 123:--]]] _Standard_
838
1040
  INPUT
1041
+ output = <<~OUTPUT
839
1042
  #{BLANK_HDR}
840
1043
  <sections>
841
1044
  </sections><bibliography><references id="_" obligation="informative" normative="true">
@@ -904,12 +1107,14 @@ RSpec.describe Asciidoctor::Standoc do
904
1107
  </bibliography>
905
1108
  </standard-document>
906
1109
  OUTPUT
1110
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1111
+ .to be_equivalent_to xmlpp(output)
907
1112
  end
908
1113
 
909
1114
  it "processes all-parts ISO reference" do
910
1115
  # stub_fetch_ref(all_parts: true)
911
1116
 
912
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1117
+ input = <<~INPUT
913
1118
  #{ASCIIDOC_BLANK_HDR}
914
1119
  [bibliography]
915
1120
  == Normative References
@@ -917,6 +1122,7 @@ RSpec.describe Asciidoctor::Standoc do
917
1122
  * [[[iso123,ISO 123:1066 (all parts)]]] _Standard_
918
1123
  * [[[iso124,(1)ISO 123:1066 (all parts)]]] _Standard_
919
1124
  INPUT
1125
+ output = <<~OUTPUT
920
1126
  #{BLANK_HDR}
921
1127
  <sections>
922
1128
  </sections><bibliography><references id="_" obligation="informative" normative="true">
@@ -961,12 +1167,14 @@ RSpec.describe Asciidoctor::Standoc do
961
1167
  </bibliography>
962
1168
  </standard-document>
963
1169
  OUTPUT
1170
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1171
+ .to be_equivalent_to xmlpp(output)
964
1172
  end
965
1173
 
966
1174
  it "processes RFC reference in Normative References" do
967
1175
  # mock_rfcbib_get_rfc8341
968
1176
  VCR.use_cassette "rfcbib_get_rfc8341" do
969
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1177
+ input = <<~INPUT
970
1178
  #{ISOBIB_BLANK_HDR}
971
1179
  [bibliography]
972
1180
  == Normative References
@@ -978,6 +1186,7 @@ RSpec.describe Asciidoctor::Standoc do
978
1186
 
979
1187
  <<iso123>>
980
1188
  INPUT
1189
+ output = <<~OUTPUT
981
1190
  #{BLANK_HDR}
982
1191
  <sections>
983
1192
  <clause id="_" inline-header="false" obligation="normative">
@@ -990,7 +1199,7 @@ RSpec.describe Asciidoctor::Standoc do
990
1199
  <title>Normative references</title>
991
1200
  #{NORM_REF_BOILERPLATE}
992
1201
  <bibitem id='iso123' type='standard'>
993
- <fetched>#{Date.today}</fetched>
1202
+ <fetched/>
994
1203
  <title format='text/plain' language='en' script='Latn'>Network Configuration Access Control Model</title>
995
1204
  <uri type='xml'>
996
1205
  https://raw.githubusercontent.com/relaton/relaton-data-ietf/master/data/reference.RFC.8341.xml
@@ -1051,7 +1260,7 @@ RSpec.describe Asciidoctor::Standoc do
1051
1260
  <place>Fremont, CA</place>
1052
1261
  </bibitem>
1053
1262
  <bibitem id='iso124' type='standard'>
1054
- <fetched>#{Date.today}</fetched>
1263
+ <fetched/>
1055
1264
  <title format='text/plain' language='en' script='Latn'>Network Configuration Access Control Model</title>
1056
1265
  <uri type='xml'>
1057
1266
  https://raw.githubusercontent.com/relaton/relaton-data-ietf/master/data/reference.RFC.8341.xml
@@ -1116,11 +1325,13 @@ RSpec.describe Asciidoctor::Standoc do
1116
1325
  </bibliography>
1117
1326
  </standard-document>
1118
1327
  OUTPUT
1328
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1329
+ .to be_equivalent_to xmlpp(output)
1119
1330
  end
1120
1331
  end
1121
1332
 
1122
1333
  it "processes non-ISO reference in Normative References" do
1123
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1334
+ input = <<~INPUT
1124
1335
  #{ASCIIDOC_BLANK_HDR}
1125
1336
  [bibliography]
1126
1337
  == Normative References
@@ -1128,6 +1339,7 @@ RSpec.describe Asciidoctor::Standoc do
1128
1339
  * [[[iso123,XYZ 123:1066 (all parts)]]] _Standard_
1129
1340
  * [[[iso124,(1)XYZ 123:1066 (all parts)]]] _Standard_
1130
1341
  INPUT
1342
+ output = <<~OUTPUT
1131
1343
  #{BLANK_HDR}
1132
1344
  <sections>
1133
1345
  </sections><bibliography><references id="_" obligation="informative" normative="true">
@@ -1152,10 +1364,12 @@ RSpec.describe Asciidoctor::Standoc do
1152
1364
  </bibliography>
1153
1365
  </standard-document>
1154
1366
  OUTPUT
1367
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1368
+ .to be_equivalent_to xmlpp(output)
1155
1369
  end
1156
1370
 
1157
1371
  it "processes non-ISO reference in Bibliography" do
1158
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1372
+ input = <<~INPUT
1159
1373
  #{ASCIIDOC_BLANK_HDR}
1160
1374
  [bibliography]
1161
1375
  == Bibliography
@@ -1166,6 +1380,7 @@ RSpec.describe Asciidoctor::Standoc do
1166
1380
  * [[[iso126,(A1)]]] _Standard_
1167
1381
  * [[[iso127,(4)XYZ 123:1066 (all parts)]]] _Standard_
1168
1382
  INPUT
1383
+ output = <<~OUTPUT
1169
1384
  #{BLANK_HDR}
1170
1385
  <sections>
1171
1386
  </sections>
@@ -1203,13 +1418,15 @@ RSpec.describe Asciidoctor::Standoc do
1203
1418
  </bibliography>
1204
1419
  </standard-document>
1205
1420
  OUTPUT
1421
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1422
+ .to be_equivalent_to xmlpp(output)
1206
1423
  end
1207
1424
 
1208
1425
  it "process ISO reference without an Internet connection" do
1209
1426
  expect(RelatonIso::IsoBibliography).to receive(:search).with("ISO 123") do
1210
1427
  raise RelatonBib::RequestError.new "getaddrinfo"
1211
1428
  end.at_least :once
1212
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1429
+ input = <<~INPUT
1213
1430
  #{ISOBIB_BLANK_HDR}
1214
1431
  [bibliography]
1215
1432
  == Normative References
@@ -1217,6 +1434,7 @@ RSpec.describe Asciidoctor::Standoc do
1217
1434
  * [[[iso123,ISO 123]]] _Standard_
1218
1435
  * [[[iso124,(1)ISO 123]]] _Standard_
1219
1436
  INPUT
1437
+ output = <<~OUTPUT
1220
1438
  <?xml version="1.0" encoding="UTF-8"?>
1221
1439
  <standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
1222
1440
  <bibdata type="standard">
@@ -1261,10 +1479,12 @@ RSpec.describe Asciidoctor::Standoc do
1261
1479
  </references></bibliography>
1262
1480
  </standard-document>
1263
1481
  OUTPUT
1482
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1483
+ .to be_equivalent_to xmlpp(output)
1264
1484
  end
1265
1485
 
1266
1486
  it "processes repository reference" do
1267
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1487
+ input = <<~INPUT
1268
1488
  #{ISOBIB_BLANK_HDR}
1269
1489
  == Scope
1270
1490
 
@@ -1279,6 +1499,7 @@ RSpec.describe Asciidoctor::Standoc do
1279
1499
  * [[[iso123,repo:(ab/ISO 123)]]] _Standard_
1280
1500
  * [[[iso124,repo:(ab/ISO 124,id)]]] _Standard_
1281
1501
  INPUT
1502
+ output = <<~OUTPUT
1282
1503
  #{BLANK_HDR}
1283
1504
  <sections>
1284
1505
  <clause id='_' type='scope' inline-header='false' obligation='normative'>
@@ -1332,10 +1553,12 @@ RSpec.describe Asciidoctor::Standoc do
1332
1553
  </bibliography>
1333
1554
  </standard-document>
1334
1555
  OUTPUT
1556
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1557
+ .to be_equivalent_to xmlpp(output)
1335
1558
  end
1336
1559
 
1337
1560
  it "processes hyperlink reference, ingest RXL or XML if available" do
1338
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1561
+ input = <<~INPUT
1339
1562
  #{ISOBIB_BLANK_HDR}
1340
1563
  == Scope
1341
1564
 
@@ -1353,6 +1576,7 @@ RSpec.describe Asciidoctor::Standoc do
1353
1576
  * [[[iso123,path:(spec/assets/iso123,ISO 123)]]] _Standard_
1354
1577
  * [[[iso124,path:(a/b.adoc,ISO 124)]]] _Standard_
1355
1578
  INPUT
1579
+ output = <<~OUTPUT
1356
1580
  #{BLANK_HDR}
1357
1581
  <sections>
1358
1582
  <clause id='_' type="scope" inline-header='false' obligation='normative'>
@@ -1403,7 +1627,7 @@ RSpec.describe Asciidoctor::Standoc do
1403
1627
  amendments) applies.
1404
1628
  </p>
1405
1629
  <bibitem id='iso123' type='standard'>
1406
- <fetched>2020-06-12</fetched>
1630
+ <fetched/>
1407
1631
  <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1408
1632
  <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1409
1633
  <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
@@ -1450,7 +1674,7 @@ RSpec.describe Asciidoctor::Standoc do
1450
1674
  </relation>
1451
1675
  <relation type='instance'>
1452
1676
  <bibitem type='standard'>
1453
- <fetched>2020-06-12</fetched>
1677
+ <fetched/>
1454
1678
  <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1455
1679
  <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1456
1680
  <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
@@ -1522,141 +1746,290 @@ RSpec.describe Asciidoctor::Standoc do
1522
1746
  </bibliography>
1523
1747
  </standard-document>
1524
1748
  OUTPUT
1749
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1750
+ .to be_equivalent_to xmlpp(output)
1525
1751
  end
1526
1752
 
1527
1753
  it "overrides normative status of bibliographies" do
1528
- mock_isobib_get_123_no_docid(1)
1529
- mock_isobib_get_123_no_docid_lbl(1)
1530
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1531
- #{ISOBIB_BLANK_HDR}
1532
- [bibliography,normative=false]
1533
- == Normative References
1754
+ # mock_isobib_get_123_no_docid(1)
1755
+ # mock_isobib_get_123_no_docid_lbl(1)
1756
+ VCR.use_cassette "isobib_get_123_1" do
1757
+ input = <<~INPUT
1758
+ #{ISOBIB_BLANK_HDR}
1534
1759
 
1535
- * [[[iso123,ISO 123]]] _Standard_
1760
+ [bibliography,normative=false]
1761
+ == Normative References
1536
1762
 
1537
- [bibliography,normative=true]
1538
- == Bibliography
1763
+ * [[[iso123,ISO 123]]] _Standard_
1539
1764
 
1540
- * [[[iso124,(1)ISO 123]]] _Standard_
1541
- INPUT
1542
- #{BLANK_HDR}
1543
- <sections> </sections>
1544
- <bibliography>
1545
- <references id='_' normative='false' obligation='informative'>
1546
- <title>Bibliography</title>
1547
- <bibitem type='standard' id='iso123'>
1548
- <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1549
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1550
- <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1551
- <date type='published'>
1552
- <on>2001</on>
1553
- </date>
1554
- <contributor>
1555
- <role type='publisher'/>
1556
- <organization>
1557
- <name>International Organization for Standardization</name>
1558
- <abbreviation>ISO</abbreviation>
1559
- <uri>www.iso.org</uri>
1560
- </organization>
1561
- </contributor>
1562
- <edition>3</edition>
1563
- <language>en</language>
1564
- <language>fr</language>
1565
- <script>Latn</script>
1566
- <status>
1567
- <stage>Published</stage>
1568
- </status>
1569
- <copyright>
1570
- <from>2001</from>
1571
- <owner>
1572
- <organization>
1573
- <name>ISO</name>
1574
- <abbreviation/>
1575
- </organization>
1576
- </owner>
1577
- </copyright>
1578
- <relation type='obsoletes'>
1579
- <bibitem type='standard'>
1580
- <formattedref format='text/plain'>ISO 123:1985</formattedref>
1581
- </bibitem>
1582
- </relation>
1583
- <relation type='updates'>
1584
- <bibitem type='standard'>
1585
- <formattedref format='text/plain'>ISO 123:2001</formattedref>
1586
- </bibitem>
1587
- </relation>
1588
- <docidentifier>ISO 123</docidentifier>
1589
- <title>
1590
- <em>Standard</em>
1591
- </title>
1592
- </bibitem>
1593
- </references>
1594
- <references id='_' normative='true' obligation='informative'>
1595
- <title>Normative references</title>
1596
- <p id='_'>
1597
- The following documents are referred to in the text in such a way that
1598
- some or all of their content constitutes requirements of this document.
1599
- For dated references, only the edition cited applies. For undated
1600
- references, the latest edition of the referenced document (including any
1601
- amendments) applies.
1602
- </p>
1603
- <bibitem type='standard' id='iso124'>
1604
- <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1605
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1606
- <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1607
- <date type='published'>
1608
- <on>2001</on>
1609
- </date>
1610
- <contributor>
1611
- <role type='publisher'/>
1612
- <organization>
1613
- <name>International Organization for Standardization</name>
1614
- <abbreviation>ISO</abbreviation>
1615
- <uri>www.iso.org</uri>
1616
- </organization>
1617
- </contributor>
1618
- <edition>3</edition>
1619
- <language>en</language>
1620
- <language>fr</language>
1621
- <script>Latn</script>
1622
- <status>
1623
- <stage>Published</stage>
1624
- </status>
1625
- <copyright>
1626
- <from>2001</from>
1627
- <owner>
1628
- <organization>
1629
- <name>ISO</name>
1630
- <abbreviation/>
1631
- </organization>
1632
- </owner>
1633
- </copyright>
1634
- <relation type='obsoletes'>
1635
- <bibitem type='standard'>
1636
- <formattedref format='text/plain'>ISO 123:1985</formattedref>
1637
- </bibitem>
1638
- </relation>
1639
- <relation type='updates'>
1640
- <bibitem type='standard'>
1641
- <formattedref format='text/plain'>ISO 123:2001</formattedref>
1642
- </bibitem>
1643
- </relation>
1644
- <docidentifier>ISO 123</docidentifier>
1645
- <docidentifier type='metanorma'>[1]</docidentifier>
1646
- <title>
1647
- <em>Standard</em>
1648
- </title>
1649
- </bibitem>
1650
- </references>
1651
- </bibliography>
1652
- </standard-document>
1653
- OUTPUT
1765
+ [bibliography,normative=true]
1766
+ == Bibliography
1767
+
1768
+ * [[[iso124,(1)ISO 123]]] _Standard_
1769
+ INPUT
1770
+ output = <<~OUTPUT
1771
+ #{BLANK_HDR}
1772
+ <sections> </sections>
1773
+ <bibliography>
1774
+ <references id='_' normative='false' obligation='informative'>
1775
+ <title>Bibliography</title>
1776
+ <bibitem id='iso123' type='standard'>
1777
+ <fetched/>
1778
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1779
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1780
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
1781
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1782
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1783
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1784
+ <docidentifier type='ISO'>ISO 123</docidentifier>
1785
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
1786
+ <docnumber>123</docnumber>
1787
+ <contributor>
1788
+ <role type='publisher'/>
1789
+ <organization>
1790
+ <name>International Organization for Standardization</name>
1791
+ <abbreviation>ISO</abbreviation>
1792
+ <uri>www.iso.org</uri>
1793
+ </organization>
1794
+ </contributor>
1795
+ <edition>3</edition>
1796
+ <language>en</language>
1797
+ <script>Latn</script>
1798
+ <status>
1799
+ <stage>90</stage>
1800
+ <substage>93</substage>
1801
+ </status>
1802
+ <copyright>
1803
+ <from>2001</from>
1804
+ <owner>
1805
+ <organization>
1806
+ <name>ISO</name>
1807
+ </organization>
1808
+ </owner>
1809
+ </copyright>
1810
+ <relation type='obsoletes'>
1811
+ <bibitem type='standard'>
1812
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1813
+ </bibitem>
1814
+ </relation>
1815
+ <relation type='instance'>
1816
+ <bibitem type='standard'>
1817
+ <fetched/>
1818
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1819
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1820
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
1821
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1822
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1823
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1824
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
1825
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
1826
+ <docnumber>123</docnumber>
1827
+ <date type='published'>
1828
+ <on>2001-05</on>
1829
+ </date>
1830
+ <contributor>
1831
+ <role type='publisher'/>
1832
+ <organization>
1833
+ <name>International Organization for Standardization</name>
1834
+ <abbreviation>ISO</abbreviation>
1835
+ <uri>www.iso.org</uri>
1836
+ </organization>
1837
+ </contributor>
1838
+ <edition>3</edition>
1839
+ <language>en</language>
1840
+ <script>Latn</script>
1841
+ <abstract format='text/plain' language='en' script='Latn'>
1842
+ This International Standard specifies procedures for sampling
1843
+ natural rubber latex concentrate and for sampling synthetic rubber
1844
+ latices and artificial latices. It is also suitable for sampling
1845
+ rubber latex contained in drums, tank cars or tanks. The
1846
+ procedures may also be used for sampling plastics dispersions.
1847
+ </abstract>
1848
+ <status>
1849
+ <stage>90</stage>
1850
+ <substage>93</substage>
1851
+ </status>
1852
+ <copyright>
1853
+ <from>2001</from>
1854
+ <owner>
1855
+ <organization>
1856
+ <name>ISO</name>
1857
+ </organization>
1858
+ </owner>
1859
+ </copyright>
1860
+ <relation type='obsoletes'>
1861
+ <bibitem type='standard'>
1862
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1863
+ </bibitem>
1864
+ </relation>
1865
+ <place>Geneva</place>
1866
+ </bibitem>
1867
+ </relation>
1868
+ <place>Geneva</place>
1869
+ </bibitem>
1870
+ </references>
1871
+ <references id='_' normative='true' obligation='informative'>
1872
+ <title>Normative references</title>
1873
+ <p id='_'>
1874
+ The following documents are referred to in the text in such a way that
1875
+ some or all of their content constitutes requirements of this document.
1876
+ For dated references, only the edition cited applies. For undated
1877
+ references, the latest edition of the referenced document (including any
1878
+ amendments) applies.
1879
+ </p>
1880
+ <bibitem id='iso124' type='standard'>
1881
+ <fetched/>
1882
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1883
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1884
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
1885
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1886
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1887
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1888
+ <docidentifier type='ISO'>ISO 123</docidentifier>
1889
+ <docidentifier type='metanorma'>[1]</docidentifier>
1890
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
1891
+ <docnumber>123</docnumber>
1892
+ <contributor>
1893
+ <role type='publisher'/>
1894
+ <organization>
1895
+ <name>International Organization for Standardization</name>
1896
+ <abbreviation>ISO</abbreviation>
1897
+ <uri>www.iso.org</uri>
1898
+ </organization>
1899
+ </contributor>
1900
+ <edition>3</edition>
1901
+ <language>en</language>
1902
+ <script>Latn</script>
1903
+ <status>
1904
+ <stage>90</stage>
1905
+ <substage>93</substage>
1906
+ </status>
1907
+ <copyright>
1908
+ <from>2001</from>
1909
+ <owner>
1910
+ <organization>
1911
+ <name>ISO</name>
1912
+ </organization>
1913
+ </owner>
1914
+ </copyright>
1915
+ <relation type='obsoletes'>
1916
+ <bibitem type='standard'>
1917
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1918
+ </bibitem>
1919
+ </relation>
1920
+ <relation type='instance'>
1921
+ <bibitem type='standard'>
1922
+ <fetched/>
1923
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
1924
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1925
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
1926
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1927
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1928
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
1929
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
1930
+ <docidentifier type='URN'>urn:iso:std:iso:123:stage-90.93:ed-3:en</docidentifier>
1931
+ <docnumber>123</docnumber>
1932
+ <date type='published'>
1933
+ <on>2001-05</on>
1934
+ </date>
1935
+ <contributor>
1936
+ <role type='publisher'/>
1937
+ <organization>
1938
+ <name>International Organization for Standardization</name>
1939
+ <abbreviation>ISO</abbreviation>
1940
+ <uri>www.iso.org</uri>
1941
+ </organization>
1942
+ </contributor>
1943
+ <edition>3</edition>
1944
+ <language>en</language>
1945
+ <script>Latn</script>
1946
+ <abstract format='text/plain' language='en' script='Latn'>
1947
+ This International Standard specifies procedures for sampling
1948
+ natural rubber latex concentrate and for sampling synthetic rubber
1949
+ latices and artificial latices. It is also suitable for sampling
1950
+ rubber latex contained in drums, tank cars or tanks. The
1951
+ procedures may also be used for sampling plastics dispersions.
1952
+ </abstract>
1953
+ <status>
1954
+ <stage>90</stage>
1955
+ <substage>93</substage>
1956
+ </status>
1957
+ <copyright>
1958
+ <from>2001</from>
1959
+ <owner>
1960
+ <organization>
1961
+ <name>ISO</name>
1962
+ </organization>
1963
+ </owner>
1964
+ </copyright>
1965
+ <relation type='obsoletes'>
1966
+ <bibitem type='standard'>
1967
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
1968
+ </bibitem>
1969
+ </relation>
1970
+ <place>Geneva</place>
1971
+ </bibitem>
1972
+ </relation>
1973
+ <place>Geneva</place>
1974
+ </bibitem>
1975
+ </references>
1976
+ </bibliography>
1977
+ </standard-document>
1978
+ OUTPUT
1979
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1980
+ .to be_equivalent_to xmlpp(output)
1981
+ end
1982
+ end
1983
+
1984
+ it "processes formatting within bibliographic references" do
1985
+ VCR.use_cassette "isobib_get_123_1" do
1986
+ input = <<~INPUT
1987
+ #{ISOBIB_BLANK_HDR}
1988
+ [bibliography]
1989
+ == Normative References
1990
+
1991
+ * [[[reference,ISO 123]]] _Standard_
1992
+
1993
+ == Section
1994
+
1995
+ <<reference,_reference_>>
1996
+ <<reference,_**reference**_>>
1997
+ <<reference,_A_ stem:[x^2]>>
1998
+ <<reference,_A_ footnote:[_B_]>>
1999
+ <<reference,clause=3.4.2, ISO 9000:2005 footnote:[Superseded by ISO 9000:2015.]>>
2000
+
2001
+ INPUT
2002
+ output = <<~OUTPUT
2003
+ #{BLANK_HDR}
2004
+ <sections>
2005
+ <clause id="_" inline-header="false" obligation="normative">
2006
+ <title>Section</title>
2007
+ <p id="_"><eref type="inline" bibitemid="reference" citeas="ISO 123"><em>reference</em></eref>
2008
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><em><strong>reference</strong></em></eref>
2009
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><em>A</em> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mrow><mi>x</mi></mrow><mrow><mn>2</mn></mrow></msup></math></stem></eref>
2010
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><em>A</em><fn reference="1"><p id="_"><em>B</em></p></fn></eref>
2011
+ <eref type="inline" bibitemid="reference" citeas="ISO 123"><localityStack><locality type="clause"><referenceFrom>3.4.2</referenceFrom></locality></localityStack>ISO 9000:2005<fn reference="2"><p id="_">Superseded by ISO 9000:2015.</p></fn></eref></p>
2012
+ </clause></sections>
2013
+ </standard-document>
2014
+ OUTPUT
2015
+ a = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
2016
+ a.at("//xmlns:bibliography").remove
2017
+ expect((strip_guid(a.to_xml))).to be_equivalent_to(output)
2018
+ end
1654
2019
  end
1655
2020
 
1656
2021
  private
1657
2022
 
1658
2023
  def mock_isobib_get_123
1659
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, {}) do
2024
+ expect(RelatonIso::IsoBibliography).to receive(:get)
2025
+ .with("ISO 123", nil, { code: "ISO 123",
2026
+ lang: "en",
2027
+ match: anything,
2028
+ process: 1,
2029
+ ord: anything,
2030
+ title: "<em>Standard</em>",
2031
+ usrlbl: nil,
2032
+ year: nil }) do
1660
2033
  IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
1661
2034
  <bibitem type=\"standard\" id=\"ISO123\">\n <title format=\"text/plain\" language=\"en\" script=\"Latn\">Rubber latex -- Sampling</title>\n <title format=\"text/plain\" language=\"fr\" script=\"Latn\">Latex de caoutchouc -- ?chantillonnage</title>\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <docidentifier>ISO 123</docidentifier>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status>Published</status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n</bibitem>
1662
2035
  OUTPUT
@@ -1664,7 +2037,15 @@ RSpec.describe Asciidoctor::Standoc do
1664
2037
  end
1665
2038
 
1666
2039
  def mock_isobib_get_123_no_docid(n)
1667
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, { lang: "en", title: "<em>Standard</em>", usrlbl: nil }) do
2040
+ expect(RelatonIso::IsoBibliography).to receive(:get)
2041
+ .with("ISO 123", nil, { code: "ISO 123",
2042
+ lang: "en",
2043
+ match: anything,
2044
+ process: 1,
2045
+ ord: anything,
2046
+ title: "<em>Standard</em>",
2047
+ usrlbl: nil,
2048
+ year: nil }) do
1668
2049
  RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
1669
2050
  <bibitem type=\"standard\" id=\"ISO123\">\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status><stage>Published</stage></status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n<ext></fred></ext></bibitem>
1670
2051
  OUTPUT
@@ -1672,7 +2053,15 @@ RSpec.describe Asciidoctor::Standoc do
1672
2053
  end
1673
2054
 
1674
2055
  def mock_isobib_get_123_no_docid_lbl(n)
1675
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, { lang: "en", title: "<em>Standard</em>", usrlbl: "(1)" }) do
2056
+ expect(RelatonIso::IsoBibliography).to receive(:get)
2057
+ .with("ISO 123", nil, { code: "ISO 123",
2058
+ lang: "en",
2059
+ match: anything,
2060
+ process: 1,
2061
+ ord: anything,
2062
+ title: "<em>Standard</em>",
2063
+ usrlbl: "(1)",
2064
+ year: nil }) do
1676
2065
  RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
1677
2066
  <bibitem type=\"standard\" id=\"ISO123\">\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status><stage>Published</stage></status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n<ext></fred></ext></bibitem>
1678
2067
  OUTPUT
@@ -1680,7 +2069,9 @@ RSpec.describe Asciidoctor::Standoc do
1680
2069
  end
1681
2070
 
1682
2071
  def mock_isobib_get_124
1683
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 124", "2014", {}) do
2072
+ expect(RelatonIso::IsoBibliography).to receive(:get)
2073
+ .with("ISO 124",
2074
+ "2014", anything) do
1684
2075
  IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
1685
2076
  <bibitem type="standard" id="iso124">
1686
2077
  <title format="text/plain" language="en" script="Latn">Latex, rubber -- Determination of total solids content</title>
@@ -1730,7 +2121,9 @@ RSpec.describe Asciidoctor::Standoc do
1730
2121
  end
1731
2122
 
1732
2123
  def mock_isobib_get_iec12382
1733
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO/IEC TR 12382", "1992", {}) do
2124
+ expect(RelatonIso::IsoBibliography).to receive(:get).with(
2125
+ "ISO/IEC TR 12382", "1992", anything
2126
+ ) do
1734
2127
  IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
1735
2128
  <bibitem type="standard" id="iso123">
1736
2129
  <title format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
@@ -1792,7 +2185,8 @@ RSpec.describe Asciidoctor::Standoc do
1792
2185
  end
1793
2186
 
1794
2187
  def mock_rfcbib_get_rfc8341
1795
- expect(IETFBib::RfcBibliography).to receive(:get).with("RFC 8341", nil, {}) do
2188
+ expect(IETFBib::RfcBibliography).to receive(:get).with("RFC 8341", nil,
2189
+ anything) do
1796
2190
  IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
1797
2191
  <bibitem id="RFC8341">
1798
2192
  <title format="text/plain" language="en" script="Latn">Network Configuration Access Control Model</title>