metanorma-iso 2.1.5 → 2.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -1
  3. data/.github/workflows/release.yml +24 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -2
  5. data/lib/isodoc/iso/html/style-human.scss +39 -1
  6. data/lib/isodoc/iso/html/style-iso.scss +40 -1
  7. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  8. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  9. data/lib/isodoc/iso/i18n-ru.yaml +4 -0
  10. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  11. data/lib/isodoc/iso/init.rb +4 -0
  12. data/lib/isodoc/iso/iso.amendment.xsl +3698 -3060
  13. data/lib/isodoc/iso/iso.international-standard.xsl +3698 -3060
  14. data/lib/isodoc/iso/presentation_xml_convert.rb +22 -6
  15. data/lib/isodoc/iso/word_cleanup.rb +10 -13
  16. data/lib/isodoc/iso/word_dis_convert.rb +1 -1
  17. data/lib/isodoc/iso/xref.rb +35 -4
  18. data/lib/metanorma/iso/base.rb +4 -0
  19. data/lib/metanorma/iso/biblio.rng +8 -5
  20. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  21. data/lib/metanorma/iso/boilerplate-ru.xml +1 -1
  22. data/lib/metanorma/iso/boilerplate.xml +1 -1
  23. data/lib/metanorma/iso/cleanup.rb +5 -1
  24. data/lib/metanorma/iso/front_id.rb +64 -11
  25. data/lib/metanorma/iso/isodoc.rng +6 -1
  26. data/lib/metanorma/iso/reqt.rng +1 -1
  27. data/lib/metanorma/iso/section.rb +5 -0
  28. data/lib/metanorma/iso/validate.rb +3 -2
  29. data/lib/metanorma/iso/version.rb +1 -1
  30. data/lib/metanorma/requirements/modspec.rb +60 -0
  31. data/lib/metanorma/requirements/requirements.rb +16 -0
  32. data/lib/metanorma-iso.rb +2 -1
  33. data/metanorma-iso.gemspec +2 -1
  34. data/spec/assets/iso.adoc +10 -0
  35. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  36. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  37. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  38. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  39. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  40. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  41. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  42. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  43. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  44. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  45. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  46. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  47. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  48. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  49. data/spec/isodoc/postproc_spec.rb +6 -13
  50. data/spec/isodoc/ref_spec.rb +129 -82
  51. data/spec/isodoc/word_dis_spec.rb +9 -13
  52. data/spec/metanorma/amd_spec.rb +0 -10
  53. data/spec/metanorma/base_spec.rb +13 -24
  54. data/spec/metanorma/cleanup_spec.rb +136 -0
  55. data/spec/metanorma/macros_spec.rb +99 -0
  56. data/spec/metanorma/processor_spec.rb +86 -87
  57. data/spec/metanorma/section_spec.rb +2 -2
  58. data/spec/metanorma/validate_spec.rb +41 -40
  59. data/spec/requirements/requirements_spec.rb +1299 -0
  60. data/spec/requirements/xref_spec.rb +1205 -0
  61. data/spec/vcr_cassettes/docrels.yml +385 -0
  62. data/spec/vcr_cassettes/withdrawn_iso.yml +19 -19
  63. metadata +44 -15
  64. data/lib/isodoc/iso/html/htmlstyle.css +0 -47
  65. data/lib/isodoc/iso/html/isodoc-dis.css +0 -4493
  66. data/lib/isodoc/iso/html/isodoc.css +0 -1346
  67. data/lib/isodoc/iso/html/style-human.css +0 -1027
  68. data/lib/isodoc/iso/html/style-iso.css +0 -1053
  69. data/lib/isodoc/iso/html/wordstyle-dis.css +0 -2280
  70. data/lib/isodoc/iso/html/wordstyle.css +0 -1728
@@ -162,7 +162,7 @@ RSpec.describe IsoDoc do
162
162
  <eref bibitemid="ISSN">[2]</eref>
163
163
  <eref bibitemid="ISO16634">ISO 16634:--</eref>
164
164
  <eref bibitemid="ref1">ICC 167</eref>
165
- <eref bibitemid="ref10">[10]</eref>
165
+ <eref bibitemid="ref10">[4]</eref>
166
166
  <eref bibitemid="ref12">Citn</eref>
167
167
  </p>
168
168
  </foreword>
@@ -197,7 +197,7 @@ RSpec.describe IsoDoc do
197
197
  for food and animal feeding stuffs according to the Dumas combustion
198
198
  method</em> (see
199
199
 
200
- <link target="http://www.icc.or.at"/> )
200
+ <link target="http://www.icc.or.at"/> ) [ICC 167]
201
201
  </formattedref>
202
202
  <docidentifier type="ICC">ICC 167</docidentifier>
203
203
  </bibitem>
@@ -209,14 +209,14 @@ RSpec.describe IsoDoc do
209
209
  <references id="_bibliography" normative="false" obligation="informative" displayorder="3">
210
210
  <title depth="1">Bibliography</title>
211
211
  <bibitem id="ISBN" type="book">
212
- <formattedref><em>Chemicals for analytical laboratory use</em>. ISBN.</formattedref>
212
+ <formattedref><em>Chemicals for analytical laboratory use</em>. n.p.: n.d. ISBN.</formattedref>
213
+ <docidentifier type="metanorma-ordinal">[1]</docidentifier>
213
214
  <docidentifier type="ISBN">ISBN</docidentifier>
214
- <docidentifier type="metanorma">[1]</docidentifier>
215
215
  </bibitem>
216
216
  <bibitem id="ISSN" type="journal">
217
- <formattedref><em>Instruments for analytical laboratory use</em>. ISSN.</formattedref>
217
+ <formattedref><em>Instruments for analytical laboratory use</em>. n.d. ISSN.</formattedref>
218
+ <docidentifier type="metanorma-ordinal">[2]</docidentifier>
218
219
  <docidentifier type="ISSN">ISSN</docidentifier>
219
- <docidentifier type="metanorma">[2]</docidentifier>
220
220
  </bibitem>
221
221
  <note>
222
222
  <name>NOTE</name>
@@ -241,16 +241,16 @@ RSpec.describe IsoDoc do
241
241
 
242
242
  <link target="http://www.icc.or.at"/>
243
243
  )</formattedref>
244
- <docidentifier type="metanorma">[10]</docidentifier>
244
+ <docidentifier type="metanorma-ordinal">[4]</docidentifier>
245
245
  </bibitem>
246
246
  <bibitem id="ref11">
247
- <formattedref><em>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</em>.</formattedref>
248
- <docidentifier type='metanorma-ordinal'>[4]</docidentifier>
247
+ <formattedref><em><span class="stddocTitle">Internet Calendaring and Scheduling Core Object Specification (iCalendar)</span></em></formattedref>
248
+ <docidentifier type='metanorma-ordinal'>[5]</docidentifier>
249
249
  <docidentifier type="IETF">IETF RFC 10</docidentifier>
250
250
  </bibitem>
251
251
  <bibitem id="ref12">
252
252
  <formattedref format="application/x-isodoc+xml">CitationWorks. 2019.
253
- <em>How to cite a reference</em>.</formattedref>
253
+ <em>How to cite a reference</em>. [IETF RFC 20]</formattedref>
254
254
  <docidentifier type="metanorma">[Citn]</docidentifier>
255
255
  <docidentifier type="IETF">IETF RFC 20</docidentifier>
256
256
  </bibitem>
@@ -261,76 +261,123 @@ RSpec.describe IsoDoc do
261
261
 
262
262
  html = <<~OUTPUT
263
263
  #{HTML_HDR}
264
- <br/>
265
- <div>
266
- <h1 class="ForewordTitle">Foreword</h1>
267
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
268
- <a href="#ISO712">ISO 712</a>
269
- <a href="#ISBN">[1]</a>
270
- <a href="#ISSN">[2]</a>
271
- <a href="#ISO16634">ISO 16634:--</a>
272
- <a href="#ref1">ICC 167</a>
273
- <a href="#ref10">[10]</a>
274
- <a href="#ref12">Citn</a>
275
- </p>
276
- </div>
277
- <p class="zzSTDTitle1"/>
278
- <div>
279
- <h1>1&#160; Normative References</h1>
280
- <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
281
- <p class="NormRef" id="ISO712">ISO 712,
282
- <i>Cereals and cereal products</i></p>
283
- <p class="NormRef" id="ISO16634">ISO 16634:-- (all parts)
284
- <a class="FootnoteRef" href="#fn:1">
285
- <sup>1</sup></a>,
286
- <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i></p>
287
- <p class="NormRef" id="ISO20483">ISO 20483:2013-2014,
288
- <i>Cereals and pulses</i></p>
289
- <p class="NormRef" id="ref1">ICC 167,
290
- <span style="font-variant:small-caps;">Standard No I.C.C 167</span>
291
- .
292
- <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i>
293
- (see
294
- <a href="http://www.icc.or.at">http://www.icc.or.at</a>
295
- )</p>
296
- <div class="Note">
297
- <p>
298
- <span class="note_label">NOTE</span>&#160; This is an annotation of ISO 20483:2013-2014</p>
299
- </div>
300
- </div>
301
- <br/>
302
- <div>
303
- <h1 class="Section3">Bibliography</h1>
304
- <p class="Biblio" id="ISBN">[1]&#160; <i>Chemicals for analytical laboratory use</i>. ISBN.</p>
305
- <p class="Biblio" id="ISSN">[2]&#160; <i>Instruments for analytical laboratory use</i>. ISSN.</p>
306
- <div class="Note">
307
- <p>
308
- <span class="note_label">NOTE</span>&#160; This is an annotation of document ISSN.</p>
309
- </div>
310
- <div class="Note">
311
- <p>
312
- <span class="note_label">NOTE</span>&#160; This is another annotation of document ISSN.</p>
313
- </div>
314
- <p class="Biblio" id="ISO3696">[3]&#160; ISO 3696,
315
- <i>Water for analytical laboratory use</i></p>
316
- <p class="Biblio" id="ref10">[10]&#160; <span style="font-variant:small-caps;">Standard No I.C.C 167</span>
317
- .
318
- <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i>
319
- (see
320
- <a href="http://www.icc.or.at">http://www.icc.or.at</a>
321
- )</p>
322
- <p class="Biblio" id="ref11">[4]&#160; IETF RFC 10,
323
- <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>.</p>
324
- <p class="Biblio" id="ref12">Citn&#160; IETF RFC 20, CitationWorks. 2019.
325
- <i>How to cite a reference</i>
326
- .</p>
327
- </div>
328
- <aside class="footnote" id="fn:1">
329
- <p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
330
- </aside>
331
- </div>
332
- </body>
333
- </html>
264
+ <br/>
265
+ <div>
266
+ <h1 class='ForewordTitle'>Foreword</h1>
267
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
268
+ <a href='#ISO712'>ISO 712</a>
269
+ <a href='#ISBN'>[1]</a>
270
+ <a href='#ISSN'>[2]</a>
271
+ <a href='#ISO16634'>ISO 16634:--</a>
272
+ <a href='#ref1'>ICC 167</a>
273
+ <a href='#ref10'>[4]</a>
274
+ <a href='#ref12'>Citn</a>
275
+ </p>
276
+ </div>
277
+ <p class='zzSTDTitle1'/>
278
+ <div>
279
+ <h1>1  Normative References</h1>
280
+ <p>
281
+ The following documents are referred to in the text in such a way that
282
+ some or all of their content constitutes requirements of this
283
+ document. For dated references, only the edition cited applies. For
284
+ undated references, the latest edition of the referenced document
285
+ (including any amendments) applies.
286
+ </p>
287
+ <p id='ISO712' class='NormRef'>
288
+ ISO 712,
289
+ <i>Cereals and cereal products</i>
290
+ </p>
291
+ <p id='ISO16634' class='NormRef'>
292
+ ISO 16634:-- (all parts)
293
+ <a class='FootnoteRef' href='#fn:1'>
294
+ <sup>1</sup>
295
+ </a>
296
+ ,
297
+ <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
298
+ </p>
299
+ <p id='ISO20483' class='NormRef'>
300
+ ISO 20483:2013-2014,
301
+ <i>Cereals and pulses</i>
302
+ </p>
303
+ <p id='ref1' class='NormRef'>
304
+ ICC 167,
305
+ <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
306
+ .
307
+ <i>
308
+ Determination of the protein content in cereal and cereal products
309
+ for food and animal feeding stuffs according to the Dumas combustion
310
+ method
311
+ </i>
312
+ (see
313
+ <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
314
+ ) [ICC 167]
315
+ </p>
316
+ <div class='Note'>
317
+ <p>
318
+ <span class='note_label'>NOTE</span>
319
+   This is an annotation of ISO 20483:2013-2014
320
+ </p>
321
+ </div>
322
+ </div>
323
+ <br/>
324
+ <div>
325
+ <h1 class='Section3'>Bibliography</h1>
326
+ <p id='ISBN' class='Biblio'>
327
+ [1] 
328
+ <i>Chemicals for analytical laboratory use</i>
329
+ . n.p.: n.d. ISBN.
330
+ </p>
331
+ <p id='ISSN' class='Biblio'>
332
+ [2] 
333
+ <i>Instruments for analytical laboratory use</i>
334
+ . n.d. ISSN.
335
+ </p>
336
+ <div class='Note'>
337
+ <p>
338
+ <span class='note_label'>NOTE</span>
339
+   This is an annotation of document ISSN.
340
+ </p>
341
+ </div>
342
+ <div class='Note'>
343
+ <p>
344
+ <span class='note_label'>NOTE</span>
345
+   This is another annotation of document ISSN.
346
+ </p>
347
+ </div>
348
+ <p id='ISO3696' class='Biblio'>
349
+ [3]  ISO 3696,
350
+ <i>Water for analytical laboratory use</i>
351
+ </p>
352
+ <p id='ref10' class='Biblio'>
353
+ [4] 
354
+ <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
355
+ .
356
+ <i>
357
+ Determination of the protein content in cereal and cereal products
358
+ for food and animal feeding stuffs according to the Dumas combustion
359
+ method
360
+ </i>
361
+ (see
362
+ <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
363
+ )
364
+ </p>
365
+ <p id='ref11' class='Biblio'>
366
+ [5]  IETF RFC 10,
367
+ <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
368
+ </p>
369
+ <p id='ref12' class='Biblio'>
370
+ Citn  IETF RFC 20, CitationWorks. 2019.
371
+ <i>How to cite a reference</i>
372
+ . [IETF RFC 20]
373
+ </p>
374
+ </div>
375
+ <aside id='fn:1' class='footnote'>
376
+ <p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
377
+ </aside>
378
+ </div>
379
+ </body>
380
+ </html>
334
381
  OUTPUT
335
382
  expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
336
383
  .convert("test", input, true))
@@ -372,14 +419,14 @@ RSpec.describe IsoDoc do
372
419
  <em>
373
420
  <span class='stddocTitle'>IGNF. (IGN France) Registry</span>
374
421
  </em>
375
- [website]. Available from:
422
+ [website]. n.d. Available from:
376
423
  <span class='biburl'>
377
424
  <link target='https://registre.ign.fr/ign/IGNF/'>https://registre.ign.fr/ign/IGNF/</link>
378
425
  </span>
379
426
  .
380
427
  </formattedref>
381
428
  <uri>https://registre.ign.fr/ign/IGNF/</uri>
382
- <docidentifier type='metanorma'>2</docidentifier>
429
+ <docidentifier type='metanorma-ordinal'>[1]</docidentifier>
383
430
  </bibitem>
384
431
  </references>
385
432
  </iso-standard>
@@ -1728,7 +1728,7 @@ RSpec.describe IsoDoc do
1728
1728
  <div class='WordSection3'>
1729
1729
  <p class='zzSTDTitle'>
1730
1730
  Date and time — Representations for information interchange —
1731
- <span style='font-weight:normal'>Part 1</span>
1731
+ <span style='font-weight:normal'>Part 1:</span>
1732
1732
  Basic rules
1733
1733
  </p>
1734
1734
  <div>
@@ -1799,7 +1799,7 @@ RSpec.describe IsoDoc do
1799
1799
  <div class='WordSection3'>
1800
1800
  <p class='zzSTDTitle'>
1801
1801
  Date and time — Representations for information interchange —
1802
- <span style='font-weight:normal'>Part 1</span>
1802
+ <span style='font-weight:normal'>Part 1:</span>
1803
1803
  Basic rules
1804
1804
  <span style='font-weight:normal'> AMENDMENT 1: Technical corrections</span>
1805
1805
  </p>
@@ -1842,11 +1842,9 @@ RSpec.describe IsoDoc do
1842
1842
  <br/>
1843
1843
  CH-1214 Vernier, Geneva, Switzerland
1844
1844
  <br/>
1845
- Tel. + 41 22 749 01 11
1845
+ Phone: +41 22 749 01 11
1846
1846
  <br/>
1847
- Fax + 41 22 749 09 47
1848
- <br/>
1849
- copyright@iso.org
1847
+ Email: copyright@iso.org
1850
1848
  <br/>
1851
1849
  www.iso.org</p>
1852
1850
  </clause>
@@ -1896,9 +1894,8 @@ RSpec.describe IsoDoc do
1896
1894
  </p>
1897
1895
  <p class='zzCopyright'> Ch. de Blandonnet 8 ?~@? CP 401 </p>
1898
1896
  <p class='zzCopyright'> CH-1214 Vernier, Geneva, Switzerland </p>
1899
- <p class='zzCopyright'> Tel. + 41 22 749 01 11 </p>
1900
- <p class='zzCopyright'> Fax + 41 22 749 09 47 </p>
1901
- <p class='zzCopyright'> copyright@iso.org </p>
1897
+ <p class='zzCopyright'> Phone: +41 22 749 01 11 </p>
1898
+ <p class='zzCopyright'> Email: copyright@iso.org </p>
1902
1899
  <p class='zzCopyright'> www.iso.org</p>
1903
1900
  </div>
1904
1901
  </div>
@@ -1935,9 +1932,8 @@ RSpec.describe IsoDoc do
1935
1932
  </p>
1936
1933
  <p class='zzCopyright' style='text-indent:20.15pt;'> Ch. de Blandonnet 8 ?~@? CP 401 </p>
1937
1934
  <p class='zzCopyright' style='text-indent:20.15pt;'> CH-1214 Vernier, Geneva, Switzerland </p>
1938
- <p class='zzCopyright' style='text-indent:20.15pt;'> Tel. + 41 22 749 01 11 </p>
1939
- <p class='zzCopyright' style='text-indent:20.15pt;'> Fax + 41 22 749 09 47 </p>
1940
- <p class='zzCopyright' style='text-indent:20.15pt;'> copyright@iso.org </p>
1935
+ <p class='zzCopyright' style='text-indent:20.15pt;'> Phone: +41 22 749 01 11 </p>
1936
+ <p class='zzCopyright' style='text-indent:20.15pt;'> Email: copyright@iso.org </p>
1941
1937
  <p class='zzCopyright' style='text-indent:20.15pt;'> www.iso.org</p>
1942
1938
  </div>
1943
1939
  </div>
@@ -2045,7 +2041,7 @@ RSpec.describe IsoDoc do
2045
2041
  <a name='ISO712' id='ISO712'/>
2046
2042
  [1]
2047
2043
  <span style='mso-tab-count:1'>  </span>
2048
- ISO/IEC 712-3:2022, ALUFFI, Paolo, ed. (2022).
2044
+ ISO/IEC 712-3:2022, ALUFFI, Paolo, ed. (2022).
2049
2045
  <i>
2050
2046
  Facets of Algebraic Geometry: A Collection in Honor of William Fulton's
2051
2047
  80th Birthday
@@ -174,7 +174,6 @@ RSpec.describe Metanorma::ISO do
174
174
  :title-intro-fr: Introduction Française
175
175
  :title-main-fr: Titre Principal
176
176
  :title-part-fr: Part du Titre
177
- :library-ics: 1,2,3
178
177
  :copyright-year: 2017
179
178
  :updates: ISO 17301-1:2016
180
179
  :created-date: 2016-05-01
@@ -273,15 +272,6 @@ RSpec.describe Metanorma::ISO do
273
272
  <workgroup number="3" type="C">WG</workgroup>
274
273
  <workgroup number="31" type="C1">WG1</workgroup>
275
274
  </approvalgroup>
276
- <ics>
277
- <code>1</code>
278
- </ics>
279
- <ics>
280
- <code>2</code>
281
- </ics>
282
- <ics>
283
- <code>3</code>
284
- </ics>
285
275
  <structuredidentifier>
286
276
  <project-number amendment="1" origyr="2016-05-01" part="1">17301</project-number>
287
277
  </structuredidentifier>
@@ -66,7 +66,6 @@ RSpec.describe Metanorma::ISO do
66
66
  :title-intro-fr: Introduction Française
67
67
  :title-main-fr: Titre Principal
68
68
  :title-part-fr: Part du Titre
69
- :library-ics: 1,2,3
70
69
  :copyright-year: 2000
71
70
  :horizontal: true
72
71
  INPUT
@@ -146,15 +145,6 @@ RSpec.describe Metanorma::ISO do
146
145
  <workgroup number="3a" type="Ca">WGa</workgroup>
147
146
  <workgroup number="31a" type="C1a">WG1a</workgroup>
148
147
  </approvalgroup>
149
- <ics>
150
- <code>1</code>
151
- </ics>
152
- <ics>
153
- <code>2</code>
154
- </ics>
155
- <ics>
156
- <code>3</code>
157
- </ics>
158
148
  <structuredidentifier>
159
149
  <project-number part="1">ISO 1000</project-number>
160
150
  </structuredidentifier>
@@ -940,8 +930,8 @@ RSpec.describe Metanorma::ISO do
940
930
  INPUT
941
931
  expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
942
932
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
943
- <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
944
- <bibdata type='standard'>
933
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
934
+ <bibdata type='standard'>
945
935
  <contributor>
946
936
  <role type='author'/>
947
937
  <organization>
@@ -1009,8 +999,8 @@ RSpec.describe Metanorma::ISO do
1009
999
  <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
1010
1000
  <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex&#8201;&#8212;&#8201;Sampling</title>
1011
1001
  <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
1012
- <title type='title-main' format='text/plain' language='fr' script='Latn'>&#201;chantillonnage</title>
1013
- <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc&#8201;&#8212;&#8201;&#201;chantillonnage</title>
1002
+ <title type='title-main' format='text/plain' language='fr' script='Latn'chantillonnage</title>
1003
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc — Échantillonnage</title>
1014
1004
  <uri type='src'>https://www.iso.org/standard/23281.html</uri>
1015
1005
  <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
1016
1006
  <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
@@ -1037,16 +1027,15 @@ RSpec.describe Metanorma::ISO do
1037
1027
  contained in drums, tank cars or tanks. The procedures may also be
1038
1028
  used for sampling plastics dispersions.
1039
1029
  </abstract>
1040
- <abstract format='text/plain' language='fr' script='Latn'>
1041
- La pr&#233;sente Norme internationale sp&#233;cifie des m&#233;thodes
1042
- d&#8217;&#233;chantillonnage pour des concentr&#233;s de latex de
1043
- caoutchouc naturel et pour &#233;chantillonner des latex de caoutchouc
1044
- synth&#233;tique et des latex artificiels. Elle s&#8217;applique
1045
- &#233;galement &#224; l&#8217;&#233;chantillonnage de latex de
1046
- caoutchouc contenus dans des f&#251;ts, citernes routi&#232;res ou de
1047
- stockage. Le mode op&#233;ratoire peut aussi &#234;tre utilis&#233;
1048
- pour l&#8217;&#233;chantillonnage de dispersions de plastiques.
1049
- </abstract>
1030
+ <abstract format='text/plain' language='fr' script='Latn'>
1031
+ La présente Norme internationale spécifie des méthodes
1032
+ d’échantillonnage pour des concentrés de latex de caoutchouc naturel
1033
+ et pour échantillonner des latex de caoutchouc synthétique et des
1034
+ latex artificiels. Elle sapplique également à l’échantillonnage de
1035
+ latex de caoutchouc contenus dans des fûts, citernes routières ou de
1036
+ stockage. Le mode opératoire peut aussi être utilisé pour
1037
+ l’échantillonnage de dispersions de plastiques.
1038
+ </abstract>
1050
1039
  <status>
1051
1040
  <stage>90</stage>
1052
1041
  <substage>93</substage>
@@ -1505,5 +1505,141 @@ RSpec.describe Metanorma::ISO do
1505
1505
  expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1506
1506
  .to be_equivalent_to xmlpp(output)
1507
1507
  end
1508
+
1509
+ it "does not allows subterms outside of vocabulary document" do
1510
+ input = <<~INPUT
1511
+ = Document title
1512
+ Author
1513
+ :docfile: test.adoc
1514
+ :nodoc:
1515
+ :novalid:
1516
+ :no-isobib:
1517
+
1518
+ == Terms and definitions
1519
+
1520
+ === Term1
1521
+
1522
+ === Term2
1523
+
1524
+ ==== Term2a
1525
+ INPUT
1526
+ output = <<~OUTPUT
1527
+ #{BLANK_HDR}
1528
+ <sections>
1529
+ <clause id='_' obligation='normative'>
1530
+ <title>Terms and definitions</title>
1531
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
1532
+ <p id='_'>
1533
+ ISO and IEC maintain terminology databases for use in standardization at
1534
+ the following addresses:
1535
+ </p>
1536
+ <ul id='_'>
1537
+ <li>
1538
+ <p id='_'>
1539
+ ISO Online browsing platform: available at
1540
+ <link target='https://www.iso.org/obp'/>
1541
+ </p>
1542
+ </li>
1543
+ <li>
1544
+ <p id='_'>
1545
+ IEC Electropedia: available at
1546
+ <link target='https://www.electropedia.org'/>
1547
+ </p>
1548
+ </li>
1549
+ </ul>
1550
+ <term id='term-Term1'>
1551
+ <preferred>
1552
+ <expression>
1553
+ <name>Term1</name>
1554
+ </expression>
1555
+ </preferred>
1556
+ </term>
1557
+ <terms id='_' obligation='normative'>
1558
+ <title>Term2</title>
1559
+ <term id='term-Term2a'>
1560
+ <preferred>
1561
+ <expression>
1562
+ <name>Term2a</name>
1563
+ </expression>
1564
+ </preferred>
1565
+ </term>
1566
+ </terms>
1567
+ </clause>
1568
+ </sections>
1569
+ </iso-standard>
1570
+ OUTPUT
1571
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1572
+ .to be_equivalent_to xmlpp(output)
1573
+ end
1574
+
1575
+ it "allows subterms in vocabulary document" do
1576
+ input = <<~INPUT
1577
+ = Document title
1578
+ Author
1579
+ :docfile: test.adoc
1580
+ :nodoc:
1581
+ :novalid:
1582
+ :no-isobib:
1583
+ :docsubtype: vocabulary
1584
+
1585
+ == Terms and definitions
1586
+
1587
+ === Term1
1588
+
1589
+ === Term2
1590
+
1591
+ ==== Term2a
1592
+ INPUT
1593
+ output = <<~OUTPUT
1594
+ #{BLANK_HDR.sub(%r{</doctype>}, '</doctype><subdoctype>vocabulary</subdoctype>')}
1595
+ <sections>
1596
+ <terms id='_' obligation='normative'>
1597
+ <title>Terms and definitions</title>
1598
+ <p id='_'>
1599
+ ISO and IEC maintain terminology databases for use in standardization at
1600
+ the following addresses:
1601
+ </p>
1602
+ <ul id='_'>
1603
+ <li>
1604
+ <p id='_'>
1605
+ ISO Online browsing platform: available at
1606
+ <link target='https://www.iso.org/obp'/>
1607
+ </p>
1608
+ </li>
1609
+ <li>
1610
+ <p id='_'>
1611
+ IEC Electropedia: available at
1612
+ <link target='https://www.electropedia.org'/>
1613
+ </p>
1614
+ </li>
1615
+ </ul>
1616
+ <term id='term-Term1'>
1617
+ <preferred>
1618
+ <expression>
1619
+ <name>Term1</name>
1620
+ </expression>
1621
+ </preferred>
1622
+ </term>
1623
+ <term id='term-Term2'>
1624
+ <preferred>
1625
+ <expression>
1626
+ <name>Term2</name>
1627
+ </expression>
1628
+ </preferred>
1629
+ <term id='term-Term2a'>
1630
+ <preferred>
1631
+ <expression>
1632
+ <name>Term2a</name>
1633
+ </expression>
1634
+ </preferred>
1635
+ </term>
1636
+ </term>
1637
+ </terms>
1638
+ </sections>
1639
+ </iso-standard>
1640
+ OUTPUT
1641
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1642
+ .to be_equivalent_to xmlpp(output)
1643
+ end
1508
1644
  end
1509
1645
  end