metanorma-iso 1.3.20 → 1.3.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +10 -10
  3. data/.github/workflows/ubuntu.yml +11 -11
  4. data/.github/workflows/windows.yml +11 -12
  5. data/Gemfile +2 -0
  6. data/README.adoc +3 -2
  7. data/lib/asciidoctor/iso/base.rb +17 -1
  8. data/lib/asciidoctor/iso/biblio.rng +131 -46
  9. data/lib/asciidoctor/iso/cleanup.rb +19 -2
  10. data/lib/asciidoctor/iso/front.rb +116 -17
  11. data/lib/asciidoctor/iso/isodoc.rng +32 -4
  12. data/lib/asciidoctor/iso/isostandard-amd.rng +98 -0
  13. data/lib/asciidoctor/iso/isostandard.rng +10 -0
  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 +90 -0
  17. data/lib/asciidoctor/iso/validate.rb +41 -21
  18. data/lib/asciidoctor/iso/validate_section.rb +2 -2
  19. data/lib/asciidoctor/iso/validate_style.rb +1 -1
  20. data/lib/isodoc/iso/base_convert.rb +57 -41
  21. data/lib/isodoc/iso/html/header.html +5 -5
  22. data/lib/isodoc/iso/html/html_iso_titlepage.html +18 -18
  23. data/lib/isodoc/iso/html/isodoc.scss +28 -28
  24. data/lib/isodoc/iso/html/scripts.html +23 -21
  25. data/lib/isodoc/iso/html/style-human.scss +259 -423
  26. data/lib/isodoc/iso/html/style-iso.scss +151 -382
  27. data/lib/isodoc/iso/html/word_iso_titlepage.html +23 -2
  28. data/lib/isodoc/iso/html/wordstyle.scss +66 -39
  29. data/lib/isodoc/iso/html_convert.rb +7 -9
  30. data/lib/isodoc/iso/iso.international-standard.xsl +4386 -0
  31. data/lib/isodoc/iso/metadata.rb +48 -22
  32. data/lib/isodoc/iso/pdf_convert.rb +32 -0
  33. data/lib/metanorma-iso.rb +1 -0
  34. data/lib/metanorma/iso/processor.rb +13 -1
  35. data/lib/metanorma/iso/version.rb +1 -1
  36. data/spec/asciidoctor-iso/amd_spec.rb +318 -0
  37. data/spec/asciidoctor-iso/base_spec.rb +37 -17
  38. data/spec/asciidoctor-iso/blocks_spec.rb +21 -9
  39. data/spec/asciidoctor-iso/cleanup_spec.rb +203 -175
  40. data/spec/asciidoctor-iso/inline_spec.rb +2 -1
  41. data/spec/asciidoctor-iso/macros_spec.rb +273 -0
  42. data/spec/asciidoctor-iso/refs_spec.rb +7 -4
  43. data/spec/asciidoctor-iso/section_spec.rb +8 -8
  44. data/spec/asciidoctor-iso/validate_spec.rb +1 -1
  45. data/spec/assets/iso.xml +64 -1
  46. data/spec/isodoc/blocks_spec.rb +115 -0
  47. data/spec/isodoc/i18n_spec.rb +12 -20
  48. data/spec/isodoc/inline_spec.rb +2 -2
  49. data/spec/isodoc/iso_spec.rb +1 -1
  50. data/spec/isodoc/metadata_spec.rb +13 -4
  51. data/spec/isodoc/postproc_spec.rb +13 -112
  52. data/spec/isodoc/ref_spec.rb +4 -4
  53. data/spec/isodoc/section_spec.rb +8 -12
  54. data/spec/isodoc/table_spec.rb +24 -24
  55. data/spec/isodoc/terms_spec.rb +2 -2
  56. data/spec/isodoc/xref_spec.rb +19 -19
  57. data/spec/metanorma/processor_spec.rb +2 -2
  58. data/spec/spec_helper.rb +13 -1
  59. metadata +9 -3
  60. 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/>
@@ -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">
@@ -100,7 +102,8 @@ RSpec.describe Asciidoctor::ISO do
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
104
  <docidentifier type="iso">ISO/PreNWIP3 1000-1</docidentifier>
103
- <docidentifier type='iso-with-lang'>ISO/PreNWIP3 1000-1 (E)</docidentifier>
105
+ <docidentifier type='iso-with-lang'>ISO/PreNWIP3 1000-1(E)</docidentifier>
106
+ <docidentifier type='iso-reference'>ISO/PreNWIP3 1000-1:2000(E)</docidentifier>
104
107
  <docnumber>1000</docnumber>
105
108
  <contributor>
106
109
  <role type="author"/>
@@ -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="NWIP">10</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>New work item proposal</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/>
@@ -292,11 +299,13 @@ RSpec.describe Asciidoctor::ISO do
292
299
  :docnumber: 1000
293
300
  :docstage: 50
294
301
  :language: fr
302
+ :doctype: technical-specification
295
303
  INPUT
296
304
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
297
305
  <bibdata type="standard">
298
- <docidentifier type="iso">ISO/FDIS 1000</docidentifier>
299
- <docidentifier type='iso-with-lang'>ISO/FDIS 1000 (F)</docidentifier>
306
+ <docidentifier type="iso">ISO/FDTS TS 1000</docidentifier>
307
+ <docidentifier type='iso-with-lang'>ISO/FDTS TS 1000(F)</docidentifier>
308
+ <docidentifier type='iso-reference'>ISO/FDTS TS 1000(F)</docidentifier>
300
309
  <docnumber>1000</docnumber>
301
310
  <contributor>
302
311
  <role type="author"/>
@@ -316,7 +325,7 @@ RSpec.describe Asciidoctor::ISO do
316
325
  <language>fr</language>
317
326
  <script>Latn</script>
318
327
  <status>
319
- <stage>50</stage>
328
+ <stage abbreviation="FDTS">50</stage>
320
329
  <substage>00</substage>
321
330
  </status>
322
331
  <copyright>
@@ -329,7 +338,7 @@ RSpec.describe Asciidoctor::ISO do
329
338
  </owner>
330
339
  </copyright>
331
340
  <ext>
332
- <doctype>article</doctype>
341
+ <doctype>technical-specification</doctype>
333
342
  <editorialgroup>
334
343
  <technical-committee/>
335
344
  <subcommittee/>
@@ -338,6 +347,7 @@ RSpec.describe Asciidoctor::ISO do
338
347
  <structuredidentifier>
339
348
  <project-number>ISO 1000</project-number>
340
349
  </structuredidentifier>
350
+ <stagename>Final draft technical standard</stagename>
341
351
  </ext>
342
352
  </bibdata>
343
353
  <sections/>
@@ -359,7 +369,8 @@ OUTPUT
359
369
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
360
370
  <bibdata type="standard">
361
371
  <docidentifier type="iso">ISO 1000</docidentifier>
362
- <docidentifier type='iso-with-lang'>ISO 1000 (E)</docidentifier>
372
+ <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
373
+ <docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
363
374
  <docnumber>1000</docnumber>
364
375
  <contributor>
365
376
  <role type="author"/>
@@ -379,7 +390,7 @@ OUTPUT
379
390
  <language>en</language>
380
391
  <script>Latn</script>
381
392
  <status>
382
- <stage>60</stage>
393
+ <stage abbreviation="IS">60</stage>
383
394
  <substage>60</substage>
384
395
  </status>
385
396
  <copyright>
@@ -401,6 +412,7 @@ OUTPUT
401
412
  <structuredidentifier>
402
413
  <project-number>ISO 1000</project-number>
403
414
  </structuredidentifier>
415
+ <stagename>International standard</stagename>
404
416
  </ext>
405
417
  </bibdata>
406
418
  <sections/>
@@ -422,8 +434,9 @@ OUTPUT
422
434
  INPUT
423
435
  <iso-standard xmlns="https://www.metanorma.org/ns/iso">
424
436
  <bibdata type="standard">
425
- <docidentifier type="iso">ISO/PRF 1000</docidentifier>
426
- <docidentifier type='iso-with-lang'>ISO/PRF 1000 (E)</docidentifier>
437
+ <docidentifier type="iso">ISO 1000</docidentifier>
438
+ <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
439
+ <docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
427
440
  <docnumber>1000</docnumber>
428
441
  <contributor>
429
442
  <role type="author"/>
@@ -443,7 +456,7 @@ OUTPUT
443
456
  <language>en</language>
444
457
  <script>Latn</script>
445
458
  <status>
446
- <stage>60</stage>
459
+ <stage abbreviation="PRF">60</stage>
447
460
  <substage>00</substage>
448
461
  </status>
449
462
  <copyright>
@@ -465,6 +478,7 @@ OUTPUT
465
478
  <structuredidentifier>
466
479
  <project-number>ISO 1000</project-number>
467
480
  </structuredidentifier>
481
+ <stagename>Proof</stagename>
468
482
  </ext>
469
483
  </bibdata>
470
484
  <sections/>
@@ -481,6 +495,7 @@ OUTPUT
481
495
  :docfile: test.adoc
482
496
  :novalid:
483
497
  :no-isobib:
498
+ :no-pdf:
484
499
  INPUT
485
500
  html = File.read("test.html", encoding: "utf-8")
486
501
  expect(html).to match(%r{<script>})
@@ -494,6 +509,7 @@ OUTPUT
494
509
  :docfile: test.adoc
495
510
  :novalid:
496
511
  :no-isobib:
512
+ :no-pdf:
497
513
  INPUT
498
514
  html = File.read("test.html", encoding: "utf-8")
499
515
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
@@ -509,6 +525,7 @@ OUTPUT
509
525
  :docfile: test.adoc
510
526
  :novalid:
511
527
  :no-isobib:
528
+ :no-pdf:
512
529
  INPUT
513
530
  html = File.read("test_alt.html", encoding: "utf-8")
514
531
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Space Mono", monospace;]m)
@@ -525,6 +542,7 @@ OUTPUT
525
542
  :novalid:
526
543
  :no-isobib:
527
544
  :script: Hans
545
+ :no-pdf:
528
546
  INPUT
529
547
  html = File.read("test.html", encoding: "utf-8")
530
548
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
@@ -544,6 +562,7 @@ OUTPUT
544
562
  :body-font: Zapf Chancery
545
563
  :header-font: Comic Sans
546
564
  :monospace-font: Andale Mono
565
+ :no-pdf:
547
566
  INPUT
548
567
  html = File.read("test.html", encoding: "utf-8")
549
568
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
@@ -560,6 +579,7 @@ OUTPUT
560
579
  :docfile: test.adoc
561
580
  :novalid:
562
581
  :no-isobib:
582
+ :no-pdf:
563
583
  INPUT
564
584
  word = File.read("test.doc", encoding: "utf-8")
565
585
  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