metanorma-iso 1.3.21 → 1.3.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +8 -7
  3. data/.github/workflows/ubuntu.yml +8 -7
  4. data/.github/workflows/windows.yml +8 -8
  5. data/Gemfile +2 -0
  6. data/lib/asciidoctor/iso/base.rb +22 -0
  7. data/lib/asciidoctor/iso/biblio.rng +142 -37
  8. data/lib/asciidoctor/iso/cleanup.rb +19 -2
  9. data/lib/asciidoctor/iso/front.rb +19 -72
  10. data/lib/asciidoctor/iso/front_id.rb +196 -0
  11. data/lib/asciidoctor/iso/isodoc.rng +48 -2
  12. data/lib/asciidoctor/iso/isostandard-amd.rng +98 -0
  13. data/lib/asciidoctor/iso/isostandard.rng +17 -1
  14. data/lib/asciidoctor/iso/macros.rb +21 -0
  15. data/lib/asciidoctor/iso/section.rb +18 -32
  16. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +87 -0
  17. data/lib/asciidoctor/iso/validate.rb +41 -21
  18. data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
  19. data/lib/asciidoctor/iso/validate_section.rb +2 -2
  20. data/lib/asciidoctor/iso/validate_style.rb +7 -6
  21. data/lib/isodoc/iso/base_convert.rb +48 -64
  22. data/lib/isodoc/iso/html/header.html +10 -6
  23. data/lib/isodoc/iso/html/html_iso_titlepage.html +27 -18
  24. data/lib/isodoc/iso/html/isodoc.scss +49 -28
  25. data/lib/isodoc/iso/html/scripts.html +23 -21
  26. data/lib/isodoc/iso/html/style-human.scss +25 -2
  27. data/lib/isodoc/iso/html/style-iso.scss +20 -2
  28. data/lib/isodoc/iso/html/word_iso_titlepage.html +23 -2
  29. data/lib/isodoc/iso/html/wordstyle.scss +80 -39
  30. data/lib/isodoc/iso/html_convert.rb +7 -9
  31. data/lib/isodoc/iso/iso.amendment.xsl +4597 -0
  32. data/lib/isodoc/iso/iso.international-standard.xsl +4597 -0
  33. data/lib/isodoc/iso/metadata.rb +74 -44
  34. data/lib/isodoc/iso/pdf_convert.rb +39 -0
  35. data/lib/isodoc/iso/sections.rb +66 -0
  36. data/lib/isodoc/iso/sts_convert.rb +29 -0
  37. data/lib/metanorma-iso.rb +2 -0
  38. data/lib/metanorma/iso/processor.rb +16 -1
  39. data/lib/metanorma/iso/version.rb +1 -1
  40. data/metanorma-iso.gemspec +4 -1
  41. data/spec/asciidoctor-iso/amd_spec.rb +726 -0
  42. data/spec/asciidoctor-iso/base_spec.rb +43 -21
  43. data/spec/asciidoctor-iso/blocks_spec.rb +21 -9
  44. data/spec/asciidoctor-iso/cleanup_spec.rb +203 -175
  45. data/spec/asciidoctor-iso/inline_spec.rb +2 -1
  46. data/spec/asciidoctor-iso/macros_spec.rb +275 -0
  47. data/spec/asciidoctor-iso/refs_spec.rb +7 -4
  48. data/spec/asciidoctor-iso/section_spec.rb +8 -8
  49. data/spec/assets/iso.xml +64 -1
  50. data/spec/isodoc/amd_spec.rb +606 -0
  51. data/spec/isodoc/i18n_spec.rb +12 -20
  52. data/spec/isodoc/inline_spec.rb +2 -2
  53. data/spec/isodoc/iso_spec.rb +1 -1
  54. data/spec/isodoc/metadata_spec.rb +12 -4
  55. data/spec/isodoc/postproc_spec.rb +20 -119
  56. data/spec/isodoc/ref_spec.rb +5 -5
  57. data/spec/isodoc/section_spec.rb +36 -13
  58. data/spec/isodoc/table_spec.rb +22 -22
  59. data/spec/isodoc/terms_spec.rb +2 -2
  60. data/spec/isodoc/xref_spec.rb +19 -19
  61. data/spec/metanorma/processor_spec.rb +2 -2
  62. data/spec/spec_helper.rb +13 -1
  63. metadata +57 -5
  64. data/asciidoctor-iso.gemspec.old +0 -50
@@ -35,6 +35,7 @@ RSpec.describe Asciidoctor::ISO do
35
35
  :docfile: test.adoc
36
36
  :novalid:
37
37
  :no-isobib:
38
+ :no-pdf:
38
39
  INPUT
39
40
  #{BLANK_HDR}
40
41
  <sections/>
@@ -76,7 +77,7 @@ RSpec.describe Asciidoctor::ISO do
76
77
  :workgroup-number_2: 31
77
78
  :workgroup-type_2: C1
78
79
  :secretariat: SECRETARIAT
79
- :docstage: 10
80
+ :docstage: 20
80
81
  :docsubstage: 20
81
82
  :iteration: 3
82
83
  :language: en
@@ -87,6 +88,7 @@ RSpec.describe Asciidoctor::ISO do
87
88
  :title-main-fr: Titre Principal
88
89
  :title-part-fr: Part du Titre
89
90
  :library-ics: 1,2,3
91
+ :copyright-year: 2000
90
92
  INPUT
91
93
  <?xml version="1.0" encoding="UTF-8"?>
92
94
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
@@ -99,9 +101,10 @@ RSpec.describe Asciidoctor::ISO do
99
101
  <title language="fr" format="text/plain" type="title-intro">Introduction Française</title>
100
102
  <title language="fr" format="text/plain" type="title-main">Titre Principal</title>
101
103
  <title language="fr" format="text/plain" type="title-part">Part du Titre</title>
102
- <docidentifier type="iso">ISO/PreNWIP3 1000-1</docidentifier>
103
- <docidentifier type='iso-with-lang'>ISO/PreNWIP3 1000-1 (E)</docidentifier>
104
- <docnumber>1000</docnumber>
104
+ <docidentifier type="iso">ISO/PreWD3 1000-1</docidentifier>
105
+ <docidentifier type='iso-with-lang'>ISO/PreWD3 1000-1(E)</docidentifier>
106
+ <docidentifier type='iso-reference'>ISO/PreWD3 1000-1:2000(E)</docidentifier>
107
+ <docnumber>1000</docnumber>
105
108
  <contributor>
106
109
  <role type="author"/>
107
110
  <organization>
@@ -124,12 +127,12 @@ RSpec.describe Asciidoctor::ISO do
124
127
  <language>en</language>
125
128
  <script>Latn</script>
126
129
  <status>
127
- <stage>10</stage>
130
+ <stage abbreviation="WD">20</stage>
128
131
  <substage>20</substage>
129
132
  <iteration>3</iteration>
130
133
  </status>
131
134
  <copyright>
132
- <from>#{Date.today.year}</from>
135
+ <from>2000</from>
133
136
  <owner>
134
137
  <organization>
135
138
  <name>International Organization for Standardization</name>
@@ -160,6 +163,7 @@ RSpec.describe Asciidoctor::ISO do
160
163
  <structuredidentifier>
161
164
  <project-number part="1">ISO 1000</project-number>
162
165
  </structuredidentifier>
166
+ <stagename>Third working draft</stagename>
163
167
  </ext>
164
168
  </bibdata>
165
169
  <sections/>
@@ -169,7 +173,7 @@ RSpec.describe Asciidoctor::ISO do
169
173
 
170
174
 
171
175
  it "processes complex metadata" do
172
- expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to <<~'OUTPUT'
176
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~'OUTPUT')
173
177
  = Document title
174
178
  Author
175
179
  :docfile: test.adoc
@@ -183,12 +187,14 @@ RSpec.describe Asciidoctor::ISO do
183
187
  :script: Grek
184
188
  :publisher: IEC,IETF,ISO
185
189
  :copyright-year: 2001
190
+ :doctype: technical-report
186
191
  INPUT
187
192
  <?xml version="1.0" encoding="UTF-8"?>
188
193
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
189
194
  <bibdata type="standard">
190
- <docidentifier type="iso">ISO/IEC/IETF 1000-1-1:2001</docidentifier>
191
- <docidentifier type='iso-with-lang'>ISO/IEC/IETF 1000-1-1:2001 (X)</docidentifier>
195
+ <docidentifier type="iso">ISO/IEC/IETF/TR 1000-1-1:2001</docidentifier>
196
+ <docidentifier type='iso-with-lang'>ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
197
+ <docidentifier type='iso-reference'>ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
192
198
  <docidentifier type="iso-tc">2000</docidentifier>
193
199
  <docidentifier type="iso-tc">2003</docidentifier>
194
200
  <docnumber>1000</docnumber>
@@ -235,7 +241,7 @@ RSpec.describe Asciidoctor::ISO do
235
241
  <language>el</language>
236
242
  <script>Grek</script>
237
243
  <status>
238
- <stage>60</stage>
244
+ <stage abbreviation="IS">60</stage>
239
245
  <substage>60</substage>
240
246
  </status>
241
247
  <copyright>
@@ -265,7 +271,7 @@ RSpec.describe Asciidoctor::ISO do
265
271
  </owner>
266
272
  </copyright>
267
273
  <ext>
268
- <doctype>article</doctype>
274
+ <doctype>technical-report</doctype>
269
275
  <editorialgroup>
270
276
  <technical-committee/>
271
277
  <subcommittee/>
@@ -274,6 +280,7 @@ RSpec.describe Asciidoctor::ISO do
274
280
  <structuredidentifier>
275
281
  <project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
276
282
  </structuredidentifier>
283
+ <stagename>International standard</stagename>
277
284
  </ext>
278
285
  </bibdata>
279
286
  <sections/>
@@ -281,7 +288,7 @@ RSpec.describe Asciidoctor::ISO do
281
288
  OUTPUT
282
289
  end
283
290
 
284
- it "defaults substage" do
291
+ it "defaults substage, defines iteration on stage 50, gives stage 50 on technical specification" do
285
292
  expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
286
293
  = Document title
287
294
  Author
@@ -292,11 +299,14 @@ RSpec.describe Asciidoctor::ISO do
292
299
  :docnumber: 1000
293
300
  :docstage: 50
294
301
  :language: fr
302
+ :doctype: technical-specification
303
+ :iteration: 2
295
304
  INPUT
296
305
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
297
306
  <bibdata type="standard">
298
- <docidentifier type="iso">ISO/FDIS 1000</docidentifier>
299
- <docidentifier type='iso-with-lang'>ISO/FDIS 1000 (F)</docidentifier>
307
+ <docidentifier type="iso">ISO/DTS 1000.2</docidentifier>
308
+ <docidentifier type='iso-with-lang'>ISO/DTS 1000.2(F)</docidentifier>
309
+ <docidentifier type='iso-reference'>ISO/DTS 1000.2(F)</docidentifier>
300
310
  <docnumber>1000</docnumber>
301
311
  <contributor>
302
312
  <role type="author"/>
@@ -316,8 +326,9 @@ RSpec.describe Asciidoctor::ISO do
316
326
  <language>fr</language>
317
327
  <script>Latn</script>
318
328
  <status>
319
- <stage>50</stage>
329
+ <stage abbreviation="D">50</stage>
320
330
  <substage>00</substage>
331
+ <iteration>2</iteration>
321
332
  </status>
322
333
  <copyright>
323
334
  <from>#{Date.today.year}</from>
@@ -329,7 +340,7 @@ RSpec.describe Asciidoctor::ISO do
329
340
  </owner>
330
341
  </copyright>
331
342
  <ext>
332
- <doctype>article</doctype>
343
+ <doctype>technical-specification</doctype>
333
344
  <editorialgroup>
334
345
  <technical-committee/>
335
346
  <subcommittee/>
@@ -338,6 +349,7 @@ RSpec.describe Asciidoctor::ISO do
338
349
  <structuredidentifier>
339
350
  <project-number>ISO 1000</project-number>
340
351
  </structuredidentifier>
352
+ <stagename>Final draft</stagename>
341
353
  </ext>
342
354
  </bibdata>
343
355
  <sections/>
@@ -359,7 +371,8 @@ OUTPUT
359
371
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
360
372
  <bibdata type="standard">
361
373
  <docidentifier type="iso">ISO 1000</docidentifier>
362
- <docidentifier type='iso-with-lang'>ISO 1000 (E)</docidentifier>
374
+ <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
375
+ <docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
363
376
  <docnumber>1000</docnumber>
364
377
  <contributor>
365
378
  <role type="author"/>
@@ -379,7 +392,7 @@ OUTPUT
379
392
  <language>en</language>
380
393
  <script>Latn</script>
381
394
  <status>
382
- <stage>60</stage>
395
+ <stage abbreviation="IS">60</stage>
383
396
  <substage>60</substage>
384
397
  </status>
385
398
  <copyright>
@@ -401,6 +414,7 @@ OUTPUT
401
414
  <structuredidentifier>
402
415
  <project-number>ISO 1000</project-number>
403
416
  </structuredidentifier>
417
+ <stagename>International standard</stagename>
404
418
  </ext>
405
419
  </bibdata>
406
420
  <sections/>
@@ -422,8 +436,9 @@ OUTPUT
422
436
  INPUT
423
437
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
424
438
  <bibdata type="standard">
425
- <docidentifier type="iso">ISO/PRF 1000</docidentifier>
426
- <docidentifier type='iso-with-lang'>ISO/PRF 1000 (E)</docidentifier>
439
+ <docidentifier type="iso">ISO 1000</docidentifier>
440
+ <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
441
+ <docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
427
442
  <docnumber>1000</docnumber>
428
443
  <contributor>
429
444
  <role type="author"/>
@@ -443,7 +458,7 @@ OUTPUT
443
458
  <language>en</language>
444
459
  <script>Latn</script>
445
460
  <status>
446
- <stage>60</stage>
461
+ <stage abbreviation="PRF">60</stage>
447
462
  <substage>00</substage>
448
463
  </status>
449
464
  <copyright>
@@ -465,6 +480,7 @@ OUTPUT
465
480
  <structuredidentifier>
466
481
  <project-number>ISO 1000</project-number>
467
482
  </structuredidentifier>
483
+ <stagename>Proof</stagename>
468
484
  </ext>
469
485
  </bibdata>
470
486
  <sections/>
@@ -481,6 +497,7 @@ OUTPUT
481
497
  :docfile: test.adoc
482
498
  :novalid:
483
499
  :no-isobib:
500
+ :no-pdf:
484
501
  INPUT
485
502
  html = File.read("test.html", encoding: "utf-8")
486
503
  expect(html).to match(%r{<script>})
@@ -494,6 +511,7 @@ OUTPUT
494
511
  :docfile: test.adoc
495
512
  :novalid:
496
513
  :no-isobib:
514
+ :no-pdf:
497
515
  INPUT
498
516
  html = File.read("test.html", encoding: "utf-8")
499
517
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
@@ -509,6 +527,7 @@ OUTPUT
509
527
  :docfile: test.adoc
510
528
  :novalid:
511
529
  :no-isobib:
530
+ :no-pdf:
512
531
  INPUT
513
532
  html = File.read("test_alt.html", encoding: "utf-8")
514
533
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
@@ -525,6 +544,7 @@ OUTPUT
525
544
  :novalid:
526
545
  :no-isobib:
527
546
  :script: Hans
547
+ :no-pdf:
528
548
  INPUT
529
549
  html = File.read("test.html", encoding: "utf-8")
530
550
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
@@ -544,6 +564,7 @@ OUTPUT
544
564
  :body-font: Zapf Chancery
545
565
  :header-font: Comic Sans
546
566
  :monospace-font: Andale Mono
567
+ :no-pdf:
547
568
  INPUT
548
569
  html = File.read("test.html", encoding: "utf-8")
549
570
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
@@ -560,6 +581,7 @@ OUTPUT
560
581
  :docfile: test.adoc
561
582
  :novalid:
562
583
  :no-isobib:
584
+ :no-pdf:
563
585
  INPUT
564
586
  word = File.read("test.doc", encoding: "utf-8")
565
587
  html = File.read("test.html", encoding: "utf-8")
@@ -25,8 +25,8 @@ RSpec.describe Asciidoctor::ISO do
25
25
  #{ASCIIDOC_BLANK_HDR}
26
26
  [stem]
27
27
  ++++
28
- r = 1 %
29
- r = 1 %
28
+ r = 1 %
29
+ r = 1 %
30
30
  ++++
31
31
 
32
32
  [stem]
@@ -113,7 +113,7 @@ RSpec.describe Asciidoctor::ISO do
113
113
  <terms id="_" obligation="normative">
114
114
  <title>Terms and definitions</title>
115
115
  #{TERM_BOILERPLATE}
116
- <term id="_">
116
+ <term id="term-term1">
117
117
  <preferred>Term1</preferred>
118
118
  <termnote id="_">
119
119
  <p id="_">This is a note</p>
@@ -223,7 +223,7 @@ RSpec.describe Asciidoctor::ISO do
223
223
  <terms id="_" obligation="normative">
224
224
  <title>Terms and definitions</title>
225
225
  #{TERM_BOILERPLATE}
226
- <term id="_">
226
+ <term id="term-term1">
227
227
  <preferred>Term1</preferred>
228
228
  <termexample id="_">
229
229
  <p id="_">This is an example</p>
@@ -351,7 +351,11 @@ RSpec.describe Asciidoctor::ISO do
351
351
  #{BLANK_HDR}
352
352
  <sections>
353
353
  <quote id="_">
354
- <source type="inline" bibitemid="ISO7301" citeas=""><locality type="section"><referenceFrom>1</referenceFrom></locality></source>
354
+ <source type="inline" bibitemid="ISO7301" citeas="">
355
+ <localityStack>
356
+ <locality type="section"><referenceFrom>1</referenceFrom></locality>
357
+ </localityStack>
358
+ </source>
355
359
  <author>ISO</author>
356
360
  <p id="_">Block quotation</p>
357
361
  </quote>
@@ -424,10 +428,14 @@ RSpec.describe Asciidoctor::ISO do
424
428
  <terms id="_" obligation="normative">
425
429
  <title>Terms and definitions</title>
426
430
  #{TERM_BOILERPLATE}
427
- <term id="_">
431
+ <term id="term-term1">
428
432
  <preferred>Term1</preferred>
429
433
  <termsource status="identical">
430
- <origin bibitemid="ISO2191" type="inline" citeas=""><locality type="section"><referenceFrom>1</referenceFrom></locality></origin>
434
+ <origin bibitemid="ISO2191" type="inline" citeas="">
435
+ <localityStack>
436
+ <locality type="section"><referenceFrom>1</referenceFrom></locality>
437
+ </localityStack>
438
+ </origin>
431
439
  </termsource>
432
440
  </term>
433
441
  </terms>
@@ -451,10 +459,14 @@ RSpec.describe Asciidoctor::ISO do
451
459
  <terms id="_" obligation="normative">
452
460
  <title>Terms and definitions</title>
453
461
  #{TERM_BOILERPLATE}
454
- <term id="_">
462
+ <term id="term-term1">
455
463
  <preferred>Term1</preferred>
456
464
  <termsource status="modified">
457
- <origin bibitemid="ISO2191" type="inline" citeas=""><locality type="section"><referenceFrom>1</referenceFrom></locality></origin>
465
+ <origin bibitemid="ISO2191" type="inline" citeas="">
466
+ <localityStack>
467
+ <locality type="section"><referenceFrom>1</referenceFrom></locality>
468
+ </localityStack>
469
+ </origin>
458
470
  <modification>
459
471
  <p id="_">with adjustments</p>
460
472
  </modification>
@@ -32,7 +32,7 @@ RSpec.describe Asciidoctor::ISO do
32
32
  <terms id="_" obligation="normative">
33
33
  <title>Terms and definitions</title>
34
34
  #{TERM_BOILERPLATE}
35
- <term id="_"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>91</mn></msub></math></stem></admitted>
35
+ <term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>91</mn></msub></math></stem></admitted>
36
36
  <definition><p id="_">Time</p></definition></term>
37
37
  </terms>
38
38
  </sections>
@@ -54,7 +54,7 @@ RSpec.describe Asciidoctor::ISO do
54
54
  <terms id="_" obligation="normative">
55
55
  <title>Terms and definitions</title>
56
56
  #{TERM_BOILERPLATE}
57
- <term id="_">
57
+ <term id="term-tempus">
58
58
  <preferred>Tempus</preferred>
59
59
  <domain>relativity</domain><definition><p id="_"> Time</p></definition>
60
60
  </term>
@@ -90,7 +90,7 @@ RSpec.describe Asciidoctor::ISO do
90
90
  <terms id="_" obligation="normative">
91
91
  <title>Terms and definitions</title>
92
92
  #{TERM_BOILERPLATE}
93
- <term id="_"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><definition><formula id="_">
93
+ <term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><definition><formula id="_">
94
94
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>A</mi></msub></math></stem>
95
95
  </formula><p id="_">This paragraph is extraneous</p></definition>
96
96
  </term>
@@ -118,7 +118,7 @@ RSpec.describe Asciidoctor::ISO do
118
118
  <terms id="_" obligation="normative"><title>Terms and definitions</title>
119
119
 
120
120
  #{TERM_BOILERPLATE}
121
- <term id="_">
121
+ <term id="term-time">
122
122
  <preferred>Time</preferred>
123
123
  <definition><p id="_">This paragraph is extraneous</p></definition>
124
124
  </term></terms>
@@ -189,12 +189,13 @@ RSpec.describe Asciidoctor::ISO do
189
189
  <eref type="inline" bibitemid="iso216" citeas="ISO 216:2001"/>
190
190
  </p>
191
191
  </foreword></preface><sections>
192
- </sections><bibliography><references id="_" obligation="informative">
192
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
193
193
  <title>Normative References</title>
194
194
  <p id="_">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>
195
195
  <bibitem id="iso216" type="standard">
196
196
  <title format="text/plain">Reference</title>
197
197
  <docidentifier>ISO 216:2001</docidentifier>
198
+ <docnumber>216</docnumber>
198
199
  <date type="published">
199
200
  <on>2001</on>
200
201
  </date>
@@ -225,15 +226,19 @@ RSpec.describe Asciidoctor::ISO do
225
226
  <preface><foreword id='_' obligation="informative">
226
227
  <title>Foreword</title>
227
228
  <p id="_">
228
- <eref type="inline" bibitemid="iso216" citeas="ISO 216"><locality type="whole"/><locality type="clause"><referenceFrom>3</referenceFrom></locality><locality type="example"><referenceFrom>9</referenceFrom><referenceTo>11</referenceTo></locality><locality type="locality:prelude"><referenceFrom>33</referenceFrom></locality><locality type="locality:entirety"/>the reference</eref>
229
+ <eref type="inline" bibitemid="iso216" citeas="ISO 216">
230
+ <localityStack>
231
+ <locality type="whole"/><locality type="clause"><referenceFrom>3</referenceFrom></locality><locality type="example"><referenceFrom>9</referenceFrom><referenceTo>11</referenceTo></locality><locality type="locality:prelude"><referenceFrom>33</referenceFrom></locality><locality type="locality:entirety"/>
232
+ </localityStack>the reference</eref>
229
233
  </p>
230
234
  </foreword></preface><sections>
231
- </sections><bibliography><references id="_" obligation="informative">
235
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
232
236
  <title>Normative References</title>
233
237
  <p id="_">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>
234
238
  <bibitem id="iso216" type="standard">
235
239
  <title format="text/plain">Reference</title>
236
240
  <docidentifier>ISO 216</docidentifier>
241
+ <docnumber>216</docnumber>
237
242
  <contributor>
238
243
  <role type="publisher"/>
239
244
  <organization>
@@ -266,11 +271,12 @@ RSpec.describe Asciidoctor::ISO do
266
271
  <eref type="inline" bibitemid="iso216" citeas="ISO 216"/>
267
272
  </p>
268
273
  </foreword></preface><sections>
269
- </sections><bibliography><references id="_" obligation="informative">
274
+ </sections><bibliography><references id="_" obligation="informative" normative="false">
270
275
  <title>Bibliography</title>
271
276
  <bibitem id="iso216" type="standard">
272
277
  <title format="text/plain">Reference</title>
273
278
  <docidentifier>ISO 216</docidentifier>
279
+ <docnumber>216</docnumber>
274
280
  <contributor>
275
281
  <role type="publisher"/>
276
282
  <organization>
@@ -299,10 +305,14 @@ RSpec.describe Asciidoctor::ISO do
299
305
  <terms id="_" obligation="normative">
300
306
  <title>Terms and definitions</title>
301
307
  #{TERM_BOILERPLATE}
302
- <term id="_">
308
+ <term id="term-term1">
303
309
  <preferred>Term1</preferred>
304
310
  <termsource status="identical">
305
- <origin bibitemid="ISO2191" type="inline" citeas=""><locality type="section"><referenceFrom>1</referenceFrom></locality></origin>
311
+ <origin bibitemid="ISO2191" type="inline" citeas="">
312
+ <localityStack>
313
+ <locality type="section"><referenceFrom>1</referenceFrom></locality>
314
+ </localityStack>
315
+ </origin>
306
316
  </termsource>
307
317
  </term>
308
318
  </terms>
@@ -323,11 +333,12 @@ RSpec.describe Asciidoctor::ISO do
323
333
  INPUT
324
334
  #{BLANK_HDR}
325
335
  <sections></sections>
326
- <bibliography><references id="_" obligation="informative"><title>Normative References</title>
336
+ <bibliography><references id="_" obligation="informative" normative="true"><title>Normative References</title>
327
337
  <p id="_">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>
328
338
  <bibitem id="iso216" type="standard">
329
339
  <title format="text/plain">Reference</title>
330
340
  <docidentifier>ISO 216</docidentifier>
341
+ <docnumber>216</docnumber>
331
342
  <contributor>
332
343
  <role type="publisher"/>
333
344
  <organization>
@@ -626,12 +637,13 @@ RSpec.describe Asciidoctor::ISO do
626
637
  <p id="_">Footnote2</p>
627
638
  </fn>
628
639
  </p>
629
- </clause></sections><bibliography><references id="_" obligation="informative">
640
+ </clause></sections><bibliography><references id="_" obligation="informative" normative="true">
630
641
  <title>Normative References</title>
631
642
  <p id="_">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>
632
643
  <bibitem id="iso123" type="standard">
633
644
  <title format="text/plain">Standard</title>
634
645
  <docidentifier>ISO 123:—</docidentifier>
646
+ <docnumber>123</docnumber>
635
647
  <date type="published">
636
648
  <on>–</on>
637
649
  </date>
@@ -741,7 +753,7 @@ RSpec.describe Asciidoctor::ISO do
741
753
  it "reorders references in bibliography, and renumbers citations accordingly" do
742
754
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
743
755
  #{ASCIIDOC_BLANK_HDR}
744
-
756
+
745
757
  == Clause 1
746
758
  <<ref1>>
747
759
  <<ref1a>>
@@ -782,36 +794,46 @@ RSpec.describe Asciidoctor::ISO do
782
794
  * [[[ref17,(A)]]], _Standard 30_
783
795
  INPUT
784
796
  #{BLANK_HDR}
785
- <sections><clause id="_" inline-header="false" obligation="normative">
786
- <title>Clause 1</title>
787
- <p id="_"><eref type="inline" bibitemid="ref1" citeas="ISO 123"/>
788
- <eref type='inline' bibitemid='ref1a' citeas='ISO 123-100'/>
789
- <eref type='inline' bibitemid='ref1b' citeas='ISO/TS 123-1'/>
790
- <eref type="inline" bibitemid="ref2" citeas="ISO/IEC 123"/>
791
- <eref type="inline" bibitemid="ref3" citeas="IEC 123"/>
792
- <eref type="inline" bibitemid="ref4" citeas="GB 123"/>
793
- <eref type="inline" bibitemid="ref5" citeas="[6]"/>
794
- <eref type="inline" bibitemid="ref6" citeas="[B]"/>
795
- <eref type="inline" bibitemid="ref7" citeas="[A]"/>
796
- <xref target="ref8"/>
797
- <xref target="ref9"/>
798
- <eref type="inline" bibitemid="ref10" citeas="ISO/IEC 123"/></p>
799
- </clause>
800
- </sections><bibliography><clause id="_" obligation="informative"><title>Bibliography</title><references id="_" obligation="informative">
801
- <title>Clause 1</title><bibitem id="ref1" type="standard">
802
- <title format="text/plain">Standard ISO 123</title>
803
- <docidentifier>ISO 123</docidentifier>
804
- <contributor>
805
- <role type="publisher"/>
806
- <organization>
807
- <name>International Organization for Standardization</name>
808
- <abbreviation>ISO</abbreviation>
809
- </organization>
810
- </contributor>
811
- </bibitem>
812
- <bibitem id='ref2' type='standard'>
797
+ <sections>
798
+ <clause id='_' inline-header='false' obligation='normative'>
799
+ <title>Clause 1</title>
800
+ <p id='_'>
801
+ <eref type='inline' bibitemid='ref1' citeas='ISO 123'/>
802
+ <eref type='inline' bibitemid='ref1a' citeas='ISO 123-100'/>
803
+ <eref type='inline' bibitemid='ref1b' citeas='ISO/TS 123-1'/>
804
+ <eref type='inline' bibitemid='ref2' citeas='ISO/IEC 123'/>
805
+ <eref type='inline' bibitemid='ref3' citeas='IEC 123'/>
806
+ <eref type='inline' bibitemid='ref4' citeas='GB 123'/>
807
+ <eref type='inline' bibitemid='ref5' citeas='[6]'/>
808
+ <eref type='inline' bibitemid='ref6' citeas='[B]'/>
809
+ <eref type='inline' bibitemid='ref7' citeas='[A]'/>
810
+ <xref target='ref8'/>
811
+ <xref target='ref9'/>
812
+ <eref type='inline' bibitemid='ref10' citeas='ISO/IEC 123'/>
813
+ </p>
814
+ </clause>
815
+ </sections>
816
+ <bibliography>
817
+ <clause id='_' obligation='informative'>
818
+ <title>Bibliography</title>
819
+ <references id='_' obligation='informative' normative="false">
820
+ <title>Clause 1</title>
821
+ <bibitem id='ref1' type='standard'>
822
+ <title format='text/plain'>Standard ISO 123</title>
823
+ <docidentifier>ISO 123</docidentifier>
824
+ <docnumber>123</docnumber>
825
+ <contributor>
826
+ <role type='publisher'/>
827
+ <organization>
828
+ <name>International Organization for Standardization</name>
829
+ <abbreviation>ISO</abbreviation>
830
+ </organization>
831
+ </contributor>
832
+ </bibitem>
833
+ <bibitem id='ref2' type='standard'>
813
834
  <title format='text/plain'>Standard ISO/IEC 123</title>
814
835
  <docidentifier>ISO/IEC 123</docidentifier>
836
+ <docnumber>123</docnumber>
815
837
  <contributor>
816
838
  <role type='publisher'/>
817
839
  <organization>
@@ -827,140 +849,146 @@ RSpec.describe Asciidoctor::ISO do
827
849
  </organization>
828
850
  </contributor>
829
851
  </bibitem>
830
- <bibitem id='ref1b' type='standard'>
831
- <title format='text/plain'>Standard ISO 123</title>
832
- <docidentifier>ISO/TS 123-1</docidentifier>
833
- <contributor>
834
- <role type='publisher'/>
835
- <organization>
836
- <name>International Organization for Standardization</name>
837
- <abbreviation>ISO</abbreviation>
838
- </organization>
839
- </contributor>
840
- <contributor>
841
- <role type='publisher'/>
842
- <organization>
843
- <name>TS</name>
844
- </organization>
845
- </contributor>
846
- </bibitem>
847
- <bibitem id='ref1a' type='standard'>
848
- <title format='text/plain'>Standard ISO 123</title>
849
- <docidentifier>ISO 123-100</docidentifier>
850
- <contributor>
851
- <role type='publisher'/>
852
- <organization>
853
- <name>International Organization for Standardization</name>
854
- <abbreviation>ISO</abbreviation>
855
- </organization>
856
- </contributor>
857
- </bibitem>
858
- <bibitem id="ref3" type="standard">
859
- <title format="text/plain">Standard IEC 123</title>
860
- <docidentifier>IEC 123</docidentifier>
861
- <contributor>
862
- <role type="publisher"/>
863
- <organization>
864
- <name>International Electrotechnical Commission</name>
865
- <abbreviation>IEC</abbreviation>
866
- </organization>
867
- </contributor>
868
- </bibitem><bibitem id="ref5">
869
- <formattedref format="application/x-isodoc+xml">
870
- <em>Standard 10</em>
871
- </formattedref>
872
- <docidentifier type="metanorma">[6]</docidentifier>
873
- </bibitem><bibitem id="ref4">
874
- <formattedref format="application/x-isodoc+xml">
875
- <em>Standard GB 123</em>
876
- </formattedref>
877
- <docidentifier>GB 123</docidentifier>
878
- </bibitem><bibitem id="ref7">
879
- <formattedref format="application/x-isodoc+xml">
880
- <em>Standard 30</em>
881
- </formattedref>
882
- <docidentifier type="metanorma">[A]</docidentifier>
883
- </bibitem><bibitem id="ref6">
884
- <formattedref format="application/x-isodoc+xml">
885
- <em>Standard 20</em>
886
- </formattedref>
887
- <docidentifier type="metanorma">[B]</docidentifier>
888
- </bibitem>
889
-
890
-
891
-
892
-
893
-
894
-
895
-
896
- </references>
897
- <references id="_" obligation="informative">
898
- <bibitem id="ref11" type="standard">
899
- <title format="text/plain">Standard ISO 123</title>
900
- <docidentifier>ISO 123</docidentifier>
901
- <contributor>
902
- <role type="publisher"/>
903
- <organization>
904
- <name>International Organization for Standardization</name>
905
- <abbreviation>ISO</abbreviation>
906
- </organization>
907
- </contributor>
908
- </bibitem><bibitem id="ref10" type="standard">
909
- <title format="text/plain">Standard ISO/IEC 123</title>
910
- <docidentifier>ISO/IEC 123</docidentifier>
911
- <contributor>
912
- <role type="publisher"/>
913
- <organization>
914
- <name>International Organization for Standardization</name>
915
- <abbreviation>ISO</abbreviation>
916
- </organization>
917
- </contributor>
918
- <contributor>
919
- <role type="publisher"/>
920
- <organization>
921
- <name>International Electrotechnical Commission</name>
922
- <abbreviation>IEC</abbreviation>
923
- </organization>
924
- </contributor>
925
- </bibitem><bibitem id="ref13" type="standard">
926
- <title format="text/plain">Standard IEC 123</title>
927
- <docidentifier>IEC 123</docidentifier>
928
- <contributor>
929
- <role type="publisher"/>
930
- <organization>
931
- <name>International Electrotechnical Commission</name>
932
- <abbreviation>IEC</abbreviation>
933
- </organization>
934
- </contributor>
935
- </bibitem><bibitem id="ref15">
936
- <formattedref format="application/x-isodoc+xml">
937
- <em>Standard 10</em>
938
- </formattedref>
939
- <docidentifier type="metanorma">[13]</docidentifier>
940
- </bibitem><bibitem id="ref14">
941
- <formattedref format="application/x-isodoc+xml">
942
- <em>Standard GB 123</em>
943
- </formattedref>
944
- <docidentifier>GB 123</docidentifier>
945
- </bibitem><bibitem id="ref17">
946
- <formattedref format="application/x-isodoc+xml">
947
- <em>Standard 30</em>
948
- </formattedref>
949
- <docidentifier type="metanorma">[A]</docidentifier>
950
- </bibitem><bibitem id="ref16">
951
- <formattedref format="application/x-isodoc+xml">
952
- <em>Standard 20</em>
953
- </formattedref>
954
- <docidentifier type="metanorma">[B]</docidentifier>
955
- </bibitem>
956
-
957
-
958
-
959
-
960
-
961
-
962
-
963
- </references></clause></bibliography>
852
+ <bibitem id='ref1b' type='standard'>
853
+ <title format='text/plain'>Standard ISO 123</title>
854
+ <docidentifier>ISO/TS 123-1</docidentifier>
855
+ <docnumber>123-1</docnumber>
856
+ <contributor>
857
+ <role type='publisher'/>
858
+ <organization>
859
+ <name>International Organization for Standardization</name>
860
+ <abbreviation>ISO</abbreviation>
861
+ </organization>
862
+ </contributor>
863
+ <contributor>
864
+ <role type='publisher'/>
865
+ <organization>
866
+ <name>TS</name>
867
+ </organization>
868
+ </contributor>
869
+ </bibitem>
870
+ <bibitem id='ref1a' type='standard'>
871
+ <title format='text/plain'>Standard ISO 123</title>
872
+ <docidentifier>ISO 123-100</docidentifier>
873
+ <docnumber>123-100</docnumber>
874
+ <contributor>
875
+ <role type='publisher'/>
876
+ <organization>
877
+ <name>International Organization for Standardization</name>
878
+ <abbreviation>ISO</abbreviation>
879
+ </organization>
880
+ </contributor>
881
+ </bibitem>
882
+ <bibitem id='ref3' type='standard'>
883
+ <title format='text/plain'>Standard IEC 123</title>
884
+ <docidentifier>IEC 123</docidentifier>
885
+ <docnumber>123</docnumber>
886
+ <contributor>
887
+ <role type='publisher'/>
888
+ <organization>
889
+ <name>International Electrotechnical Commission</name>
890
+ <abbreviation>IEC</abbreviation>
891
+ </organization>
892
+ </contributor>
893
+ </bibitem>
894
+ <bibitem id='ref5'>
895
+ <formattedref format='application/x-isodoc+xml'>
896
+ <em>Standard 10</em>
897
+ </formattedref>
898
+ <docidentifier type='metanorma'>[6]</docidentifier>
899
+ </bibitem>
900
+ <bibitem id='ref6'>
901
+ <formattedref format='application/x-isodoc+xml'>
902
+ <em>Standard 20</em>
903
+ </formattedref>
904
+ <docidentifier type='metanorma'>[B]</docidentifier>
905
+ </bibitem>
906
+ <bibitem id='ref7'>
907
+ <formattedref format='application/x-isodoc+xml'>
908
+ <em>Standard 30</em>
909
+ </formattedref>
910
+ <docidentifier type='metanorma'>[A]</docidentifier>
911
+ </bibitem>
912
+ <bibitem id='ref4'>
913
+ <formattedref format='application/x-isodoc+xml'>
914
+ <em>Standard GB 123</em>
915
+ </formattedref>
916
+ <docidentifier>GB 123</docidentifier>
917
+ <docnumber>123</docnumber>
918
+ </bibitem>
919
+ </references>
920
+ <references id='_' obligation='informative' normative="false">
921
+ <bibitem id='ref11' type='standard'>
922
+ <title format='text/plain'>Standard ISO 123</title>
923
+ <docidentifier>ISO 123</docidentifier>
924
+ <docnumber>123</docnumber>
925
+ <contributor>
926
+ <role type='publisher'/>
927
+ <organization>
928
+ <name>International Organization for Standardization</name>
929
+ <abbreviation>ISO</abbreviation>
930
+ </organization>
931
+ </contributor>
932
+ </bibitem>
933
+ <bibitem id='ref10' type='standard'>
934
+ <title format='text/plain'>Standard ISO/IEC 123</title>
935
+ <docidentifier>ISO/IEC 123</docidentifier>
936
+ <docnumber>123</docnumber>
937
+ <contributor>
938
+ <role type='publisher'/>
939
+ <organization>
940
+ <name>International Organization for Standardization</name>
941
+ <abbreviation>ISO</abbreviation>
942
+ </organization>
943
+ </contributor>
944
+ <contributor>
945
+ <role type='publisher'/>
946
+ <organization>
947
+ <name>International Electrotechnical Commission</name>
948
+ <abbreviation>IEC</abbreviation>
949
+ </organization>
950
+ </contributor>
951
+ </bibitem>
952
+ <bibitem id='ref13' type='standard'>
953
+ <title format='text/plain'>Standard IEC 123</title>
954
+ <docidentifier>IEC 123</docidentifier>
955
+ <docnumber>123</docnumber>
956
+ <contributor>
957
+ <role type='publisher'/>
958
+ <organization>
959
+ <name>International Electrotechnical Commission</name>
960
+ <abbreviation>IEC</abbreviation>
961
+ </organization>
962
+ </contributor>
963
+ </bibitem>
964
+ <bibitem id='ref15'>
965
+ <formattedref format='application/x-isodoc+xml'>
966
+ <em>Standard 10</em>
967
+ </formattedref>
968
+ <docidentifier type='metanorma'>[13]</docidentifier>
969
+ </bibitem>
970
+ <bibitem id='ref16'>
971
+ <formattedref format='application/x-isodoc+xml'>
972
+ <em>Standard 20</em>
973
+ </formattedref>
974
+ <docidentifier type='metanorma'>[B]</docidentifier>
975
+ </bibitem>
976
+ <bibitem id='ref17'>
977
+ <formattedref format='application/x-isodoc+xml'>
978
+ <em>Standard 30</em>
979
+ </formattedref>
980
+ <docidentifier type='metanorma'>[A]</docidentifier>
981
+ </bibitem>
982
+ <bibitem id='ref14'>
983
+ <formattedref format='application/x-isodoc+xml'>
984
+ <em>Standard GB 123</em>
985
+ </formattedref>
986
+ <docidentifier>GB 123</docidentifier>
987
+ <docnumber>123</docnumber>
988
+ </bibitem>
989
+ </references>
990
+ </clause>
991
+ </bibliography>
964
992
  </iso-standard>
965
993
  OUTPUT
966
994
  end