metanorma-iso 1.3.25 → 1.3.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/iso/base.rb +6 -0
  3. data/lib/asciidoctor/iso/biblio.rng +13 -3
  4. data/lib/asciidoctor/iso/front.rb +3 -155
  5. data/lib/asciidoctor/iso/front_id.rb +196 -0
  6. data/lib/asciidoctor/iso/isodoc.rng +17 -1
  7. data/lib/asciidoctor/iso/isostandard.rng +7 -1
  8. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +5 -8
  9. data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
  10. data/lib/asciidoctor/iso/validate_style.rb +6 -5
  11. data/lib/isodoc/iso/base_convert.rb +1 -33
  12. data/lib/isodoc/iso/html/header.html +5 -1
  13. data/lib/isodoc/iso/html/html_iso_titlepage.html +9 -0
  14. data/lib/isodoc/iso/html/isodoc.scss +21 -0
  15. data/lib/isodoc/iso/html/style-human.scss +5 -1
  16. data/lib/isodoc/iso/html/style-iso.scss +5 -1
  17. data/lib/isodoc/iso/html/word_iso_titlepage.html +4 -4
  18. data/lib/isodoc/iso/html/wordstyle.scss +20 -6
  19. data/lib/isodoc/iso/iso.amendment.xsl +4597 -0
  20. data/lib/isodoc/iso/iso.international-standard.xsl +494 -283
  21. data/lib/isodoc/iso/metadata.rb +30 -26
  22. data/lib/isodoc/iso/pdf_convert.rb +9 -2
  23. data/lib/isodoc/iso/sections.rb +66 -0
  24. data/lib/isodoc/iso/sts_convert.rb +29 -0
  25. data/lib/metanorma-iso.rb +1 -0
  26. data/lib/metanorma/iso/processor.rb +4 -1
  27. data/lib/metanorma/iso/version.rb +1 -1
  28. data/metanorma-iso.gemspec +4 -1
  29. data/spec/asciidoctor-iso/amd_spec.rb +412 -4
  30. data/spec/asciidoctor-iso/base_spec.rb +15 -13
  31. data/spec/asciidoctor-iso/macros_spec.rb +15 -13
  32. data/spec/isodoc/amd_spec.rb +606 -0
  33. data/spec/isodoc/metadata_spec.rb +4 -2
  34. data/spec/isodoc/postproc_spec.rb +8 -8
  35. data/spec/isodoc/ref_spec.rb +1 -1
  36. data/spec/isodoc/section_spec.rb +28 -1
  37. data/spec/metanorma/processor_spec.rb +1 -1
  38. metadata +51 -4
@@ -6,14 +6,14 @@ module IsoDoc
6
6
  def initialize(lang, script, labels)
7
7
  super
8
8
  @metadata = {
9
- tc: "XXXX",
10
- sc: "XXXX",
11
- wg: "XXXX",
12
- editorialgroup: [],
13
- secretariat: "XXXX",
14
- obsoletes: nil,
15
- obsoletes_part: nil
16
- }
9
+ tc: "XXXX",
10
+ sc: "XXXX",
11
+ wg: "XXXX",
12
+ editorialgroup: [],
13
+ secretariat: "XXXX",
14
+ obsoletes: nil,
15
+ obsoletes_part: nil
16
+ }
17
17
  end
18
18
 
19
19
  def status_abbrev(stage, substage, iter, draft, doctype)
@@ -22,7 +22,9 @@ module IsoDoc
22
22
  stage = "DTS" if stage == "DIS"
23
23
  stage = "FDTS" if stage == "FDIS"
24
24
  end
25
- stage += iter if iter
25
+ if %w(PWI NWIP WD CD).include?(stage)
26
+ stage += iter if iter
27
+ end
26
28
  stage = "Pre" + stage if draft =~ /^0\./
27
29
  stage
28
30
  end
@@ -116,15 +118,23 @@ module IsoDoc
116
118
  main
117
119
  end
118
120
 
121
+ def title_nums(isoxml)
122
+ [isoxml.at(ns("//bibdata//project-number/@part")),
123
+ isoxml.at(ns("//bibdata//project-number/@subpart")),
124
+ isoxml.at(ns("//bibdata//project-number/@amendment")),
125
+ isoxml.at(ns("//bibdata//project-number/@corrigendum"))]
126
+ end
127
+
128
+ def title_parts(isoxml, lang)
129
+ [isoxml.at(ns("//bibdata//title[@type='title-intro' and @language='#{lang}']")),
130
+ isoxml.at(ns("//bibdata//title[@type='title-main' and @language='#{lang}']")),
131
+ isoxml.at(ns("//bibdata//title[@type='title-part' and @language='#{lang}']")),
132
+ isoxml.at(ns("//bibdata//title[@type='title-amd' and @language='#{lang}']"))]
133
+ end
134
+
119
135
  def title(isoxml, _out)
120
- intro = isoxml.at(ns("//bibdata//title[@type='title-intro' and @language='en']"))
121
- main = isoxml.at(ns("//bibdata//title[@type='title-main' and @language='en']"))
122
- part = isoxml.at(ns("//bibdata//title[@type='title-part' and @language='en']"))
123
- partnumber = isoxml.at(ns("//bibdata//project-number/@part"))
124
- subpartnumber = isoxml.at(ns("//bibdata//project-number/@subpart"))
125
- amdnumber = isoxml.at(ns("//bibdata//project-number/@amendment"))
126
- corrnumber = isoxml.at(ns("//bibdata//project-number/@corrigendum"))
127
- amd = isoxml.at(ns("//bibdata//title[@type='title-amd' and @language='en']"))
136
+ intro, main, part, amd = title_parts(isoxml, "en")
137
+ partnumber, subpartnumber, amdnumber, corrnumber = title_nums(isoxml)
128
138
 
129
139
  set(:doctitlemain, @c.encode(main ? main.text : "", :hexadecimal))
130
140
  main = compose_title(main, intro, part, partnumber, subpartnumber, "en")
@@ -138,14 +148,8 @@ module IsoDoc
138
148
  end
139
149
 
140
150
  def subtitle(isoxml, _out)
141
- intro = isoxml.at(ns("//bibdata//title[@type='title-intro' and @language='fr']"))
142
- main = isoxml.at(ns("//bibdata//title[@type='title-main' and @language='fr']"))
143
- part = isoxml.at(ns("//bibdata//title[@type='title-part' and @language='fr']"))
144
- partnumber = isoxml.at(ns("//bibdata//project-number/@part"))
145
- subpartnumber = isoxml.at(ns("//bibdata//project-number/@subpart"))
146
- amdnumber = isoxml.at(ns("//bibdata//project-number/@amendment"))
147
- corrnumber = isoxml.at(ns("//bibdata//project-number/@corrigendum"))
148
- amd = isoxml.at(ns("//bibdata//title[@type='title-amd' and @language='fr']"))
151
+ intro, main, part, amd = title_parts(isoxml, "fr")
152
+ partnumber, subpartnumber, amdnumber, corrnumber = title_nums(isoxml)
149
153
 
150
154
  set(:docsubtitlemain, @c.encode(main ? main.text : "", :hexadecimal))
151
155
  main = compose_title(main, intro, part, partnumber, subpartnumber, "fr")
@@ -206,7 +210,7 @@ module IsoDoc
206
210
  super
207
211
  ics = []
208
212
  isoxml.xpath(ns("//bibdata/ext/ics/code")).each { |i| ics << i.text }
209
- set(:ics, ics.empty? ? "XXX" : ics.join(", "))
213
+ set(:ics, ics.empty? ? nil : ics.join(", "))
210
214
  end
211
215
  end
212
216
  end
@@ -13,6 +13,14 @@ module IsoDoc
13
13
  super
14
14
  end
15
15
 
16
+ def pdf_stylesheet(docxml)
17
+ case doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
18
+ when "amendment", "technical-corrigendum" then "itu.recommendation-annex.xsl"
19
+ else
20
+ "iso.international-standard.xsl"
21
+ end
22
+ end
23
+
16
24
  def convert(filename, file = nil, debug = false)
17
25
  file = File.read(filename, encoding: "utf-8") if file.nil?
18
26
  docxml, outname_html, dir = convert_init(file, filename, debug)
@@ -23,8 +31,7 @@ module IsoDoc
23
31
  end
24
32
  FileUtils.rm_rf dir
25
33
  ::Metanorma::Output::XslfoPdf.new.convert(
26
- filename, outname_html + ".pdf",
27
- File.join(@libdir, "iso.international-standard.xsl"))
34
+ filename, outname_html + ".pdf", File.join(@libdir, pdf_stylesheet(docxml)))
28
35
  end
29
36
  end
30
37
  end
@@ -0,0 +1,66 @@
1
+ module IsoDoc
2
+ module Iso
3
+ module BaseConvert
4
+ def middle_title(out)
5
+ middle_title_main(out)
6
+ middle_title_amd(out)
7
+ end
8
+
9
+ def middle_title_main(out)
10
+ out.p(**{ class: "zzSTDTitle1" }) do |p|
11
+ p << @meta.get[:doctitleintro]
12
+ p << " &mdash; " if @meta.get[:doctitleintro] && @meta.get[:doctitlemain]
13
+ p << @meta.get[:doctitlemain]
14
+ p << " &mdash; " if @meta.get[:doctitlemain] && @meta.get[:doctitlepart]
15
+ end
16
+ a = @meta.get[:doctitlepart] and out.p(**{ class: "zzSTDTitle2" }) do |p|
17
+ b = @meta.get[:doctitlepartlabel] and p << "#{b}: "
18
+ p << "<br/><b>#{a}</b>"
19
+ end
20
+ end
21
+
22
+ def middle_title_amd(out)
23
+ a = @meta.get[:doctitleamdlabel] and out.p(**{ class: "zzSTDTitle2" }) do |p|
24
+ p << a
25
+ a = @meta.get[:doctitleamd] and p << ": #{a}"
26
+ end
27
+ a = @meta.get[:doctitlecorrlabel] and out.p(**{ class: "zzSTDTitle2" }) do |p|
28
+ p << a
29
+ end
30
+ end
31
+
32
+ def annex(isoxml, out)
33
+ @amd and @suppressheadingnumbers = @oldsuppressheadingnumbers
34
+ super
35
+ @amd and @suppressheadingnumbers = true
36
+ end
37
+
38
+ def introduction(isoxml, out)
39
+ f = isoxml.at(ns("//introduction")) || return
40
+ num = f.at(ns(".//clause")) ? "0" : nil
41
+ title_attr = { class: "IntroTitle" }
42
+ page_break(out)
43
+ out.div **{ class: "Section3", id: f["id"] } do |div|
44
+ clause_name(num, @introduction_lbl, div, title_attr)
45
+ f.elements.each do |e|
46
+ parse(e, div) unless e.name == "title"
47
+ end
48
+ end
49
+ end
50
+
51
+ def foreword(isoxml, out)
52
+ f = isoxml.at(ns("//foreword")) || return
53
+ page_break(out)
54
+ out.div **attr_code(id: f["id"]) do |s|
55
+ s.h1(**{ class: "ForewordTitle" }) { |h1| h1 << @foreword_lbl }
56
+ f.elements.each { |e| parse(e, s) unless e.name == "title" }
57
+ end
58
+ end
59
+
60
+ def clause_parse_title(node, div, c1, out)
61
+ return inline_header_title(out, node, c1) if c1.nil?
62
+ super
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,29 @@
1
+ require "isodoc"
2
+ require "mn2sts"
3
+
4
+ module IsoDoc
5
+ module Iso
6
+
7
+ # A {Converter} implementation that generates HTML output, and a document
8
+ # schema encapsulation of the document for validation
9
+ #
10
+ class StsConvert < IsoDoc::XslfoPdfConvert
11
+ def initialize(options)
12
+ @libdir = File.dirname(__FILE__)
13
+ end
14
+
15
+ def convert(filename, file = nil, debug = false)
16
+ file = File.read(filename, encoding: "utf-8") if file.nil?
17
+ docxml, outname_html, dir = convert_init(file, filename, debug)
18
+ /\.xml$/.match(filename) or
19
+ filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
20
+ f.write file
21
+ f.path
22
+ end
23
+ FileUtils.rm_rf dir
24
+ Mn2sts.convert(filename, outname_html + ".sts.xml")
25
+ end
26
+ end
27
+ end
28
+ end
29
+
@@ -4,6 +4,7 @@ require_relative "metanorma/iso/version"
4
4
  require_relative "isodoc/iso/html_convert"
5
5
  require_relative "isodoc/iso/word_convert"
6
6
  require_relative "isodoc/iso/pdf_convert"
7
+ require_relative "isodoc/iso/sts_convert"
7
8
  require "asciidoctor/extensions"
8
9
 
9
10
  if defined? Metanorma
@@ -24,7 +24,8 @@ module Metanorma
24
24
  html: "html",
25
25
  html_alt: "alt.html",
26
26
  doc: "doc",
27
- pdf: "pdf"
27
+ pdf: "pdf",
28
+ sts: "sts.xml"
28
29
  )
29
30
  end
30
31
 
@@ -46,6 +47,8 @@ module Metanorma
46
47
  IsoDoc::Iso::WordConvert.new(options).convert(outname, isodoc_node)
47
48
  when :pdf
48
49
  IsoDoc::Iso::PdfConvert.new(options).convert(outname, isodoc_node)
50
+ when :sts
51
+ IsoDoc::Iso::StsConvert.new(options).convert(outname, isodoc_node)
49
52
  else
50
53
  super
51
54
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "1.3.25".freeze
3
+ VERSION = "1.3.26".freeze
4
4
  end
5
5
  end
@@ -31,7 +31,10 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency "ruby-jing"
33
33
  spec.add_dependency "isodoc", "~> 1.0.0"
34
- spec.add_dependency "metanorma-standoc", "~> 1.3.0"
34
+ spec.add_dependency "metanorma-standoc", "~> 1.4.0"
35
+ spec.add_dependency "tokenizer", "~> 0.3.0"
36
+ spec.add_dependency "twitter_cldr"
37
+ spec.add_dependency "mn2sts", "~> 1.2.0"
35
38
 
36
39
  spec.add_development_dependency "byebug"
37
40
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -241,9 +241,9 @@ OUTPUT
241
241
  d’échantillon et recommandations relatives aux conditions d’entreposage et
242
242
  de transport
243
243
  </title>
244
- <docidentifier type='iso'>ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
245
- <docidentifier type='iso-with-lang'>ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
246
- <docidentifier type='iso-reference'>ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
244
+ <docidentifier type='iso'>ISO 17301-1:2016/PreNP Amd 1</docidentifier>
245
+ <docidentifier type='iso-with-lang'>ISO 17301-1:2016/PreNP Amd 1(E)</docidentifier>
246
+ <docidentifier type='iso-reference'>ISO 17301-1:2016/PreNP Amd 1:2017(E)</docidentifier>
247
247
  <docnumber>17301</docnumber>
248
248
  <date type='created'>
249
249
  <on>2016-05-01</on>
@@ -270,7 +270,7 @@ OUTPUT
270
270
  <language>en</language>
271
271
  <script>Latn</script>
272
272
  <status>
273
- <stage abbreviation='NWIP'>10</stage>
273
+ <stage abbreviation='NP'>10</stage>
274
274
  <substage>20</substage>
275
275
  <iteration>3</iteration>
276
276
  </status>
@@ -315,4 +315,412 @@ OUTPUT
315
315
  OUTPUT
316
316
  end
317
317
 
318
+ it "processes metadata, amendment" do
319
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
320
+ = Document title
321
+ Author
322
+ :docfile: test.adoc
323
+ :nodoc:
324
+ :novalid:
325
+ :no-isobib:
326
+ :docnumber: 17301
327
+ :partnumber: 1
328
+ :doctype: amendment
329
+ :docstage: 30
330
+ :updates: ISO 17301-1:2030
331
+ :amendment-number: 1
332
+ INPUT
333
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
334
+ <bibdata type='standard'>
335
+ <docidentifier type='iso'>ISO 17301-1:2030/CD Amd 1</docidentifier>
336
+ <docidentifier type='iso-with-lang'>ISO 17301-1:2030/CD Amd 1(E)</docidentifier>
337
+ <docidentifier type='iso-reference'>ISO 17301-1:2030/CD Amd 1(E)</docidentifier>
338
+ <docnumber>17301</docnumber>
339
+ <contributor>
340
+ <role type='author'/>
341
+ <organization>
342
+ <name>International Organization for Standardization</name>
343
+ <abbreviation>ISO</abbreviation>
344
+ </organization>
345
+ </contributor>
346
+ <contributor>
347
+ <role type='publisher'/>
348
+ <organization>
349
+ <name>International Organization for Standardization</name>
350
+ <abbreviation>ISO</abbreviation>
351
+ </organization>
352
+ </contributor>
353
+ <language>en</language>
354
+ <script>Latn</script>
355
+ <status>
356
+ <stage abbreviation='CD'>30</stage>
357
+ <substage>00</substage>
358
+ </status>
359
+ <copyright>
360
+ <from>2020</from>
361
+ <owner>
362
+ <organization>
363
+ <name>International Organization for Standardization</name>
364
+ <abbreviation>ISO</abbreviation>
365
+ </organization>
366
+ </owner>
367
+ </copyright>
368
+ <ext>
369
+ <doctype>amendment</doctype>
370
+ <editorialgroup>
371
+ <technical-committee/>
372
+ <subcommittee/>
373
+ <workgroup/>
374
+ </editorialgroup>
375
+ <structuredidentifier>
376
+ <project-number part='1' amendment='1'>17301</project-number>
377
+ </structuredidentifier>
378
+ <stagename>Committee draft</stagename>
379
+ </ext>
380
+ </bibdata>
381
+ <sections/>
382
+ </iso-standard>
383
+ OUTPUT
384
+ end
385
+
386
+ it "processes metadata, amendment" do
387
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
388
+ = Document title
389
+ Author
390
+ :docfile: test.adoc
391
+ :nodoc:
392
+ :novalid:
393
+ :no-isobib:
394
+ :docnumber: 17301
395
+ :partnumber: 1
396
+ :doctype: amendment
397
+ :docstage: 40
398
+ :updates: ISO 17301-1:2030
399
+ :amendment-number: 1
400
+ INPUT
401
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
402
+ <bibdata type='standard'>
403
+ <docidentifier type='iso'>ISO 17301-1:2030/DAmd 1</docidentifier>
404
+ <docidentifier type='iso-with-lang'>ISO 17301-1:2030/DAmd 1(E)</docidentifier>
405
+ <docidentifier type='iso-reference'>ISO 17301-1:2030/DAmd 1(E)</docidentifier>
406
+ <docnumber>17301</docnumber>
407
+ <contributor>
408
+ <role type='author'/>
409
+ <organization>
410
+ <name>International Organization for Standardization</name>
411
+ <abbreviation>ISO</abbreviation>
412
+ </organization>
413
+ </contributor>
414
+ <contributor>
415
+ <role type='publisher'/>
416
+ <organization>
417
+ <name>International Organization for Standardization</name>
418
+ <abbreviation>ISO</abbreviation>
419
+ </organization>
420
+ </contributor>
421
+ <language>en</language>
422
+ <script>Latn</script>
423
+ <status>
424
+ <stage abbreviation='D'>40</stage>
425
+ <substage>00</substage>
426
+ </status>
427
+ <copyright>
428
+ <from>2020</from>
429
+ <owner>
430
+ <organization>
431
+ <name>International Organization for Standardization</name>
432
+ <abbreviation>ISO</abbreviation>
433
+ </organization>
434
+ </owner>
435
+ </copyright>
436
+ <ext>
437
+ <doctype>amendment</doctype>
438
+ <editorialgroup>
439
+ <technical-committee/>
440
+ <subcommittee/>
441
+ <workgroup/>
442
+ </editorialgroup>
443
+ <structuredidentifier>
444
+ <project-number part='1' amendment='1'>17301</project-number>
445
+ </structuredidentifier>
446
+ <stagename>Draft</stagename>
447
+ </ext>
448
+ </bibdata>
449
+ <sections/>
450
+ </iso-standard>
451
+ OUTPUT
452
+ end
453
+
454
+ it "processes metadata, amendment" do
455
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
456
+ = Document title
457
+ Author
458
+ :docfile: test.adoc
459
+ :nodoc:
460
+ :novalid:
461
+ :no-isobib:
462
+ :docnumber: 17301
463
+ :partnumber: 1
464
+ :doctype: amendment
465
+ :updates: ISO 17301-1:2030
466
+ :amendment-number: 1
467
+ INPUT
468
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
469
+ <bibdata type='standard'>
470
+ <docidentifier type='iso'>ISO 17301-1:2030/Amd 1</docidentifier>
471
+ <docidentifier type='iso-with-lang'>ISO 17301-1:2030/Amd 1(E)</docidentifier>
472
+ <docidentifier type='iso-reference'>ISO 17301-1:2030/Amd 1(E)</docidentifier>
473
+ <docnumber>17301</docnumber>
474
+ <contributor>
475
+ <role type='author'/>
476
+ <organization>
477
+ <name>International Organization for Standardization</name>
478
+ <abbreviation>ISO</abbreviation>
479
+ </organization>
480
+ </contributor>
481
+ <contributor>
482
+ <role type='publisher'/>
483
+ <organization>
484
+ <name>International Organization for Standardization</name>
485
+ <abbreviation>ISO</abbreviation>
486
+ </organization>
487
+ </contributor>
488
+ <language>en</language>
489
+ <script>Latn</script>
490
+ <status>
491
+ <stage abbreviation='IS'>60</stage>
492
+ <substage>60</substage>
493
+ </status>
494
+ <copyright>
495
+ <from>2020</from>
496
+ <owner>
497
+ <organization>
498
+ <name>International Organization for Standardization</name>
499
+ <abbreviation>ISO</abbreviation>
500
+ </organization>
501
+ </owner>
502
+ </copyright>
503
+ <ext>
504
+ <doctype>amendment</doctype>
505
+ <editorialgroup>
506
+ <technical-committee/>
507
+ <subcommittee/>
508
+ <workgroup/>
509
+ </editorialgroup>
510
+ <structuredidentifier>
511
+ <project-number part='1' amendment='1'>17301</project-number>
512
+ </structuredidentifier>
513
+ <stagename>International standard</stagename>
514
+ </ext>
515
+ </bibdata>
516
+ <sections/>
517
+ </iso-standard>
518
+ OUTPUT
519
+ end
520
+
521
+ it "processes metadata, corrigendum" do
522
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
523
+ = Document title
524
+ Author
525
+ :docfile: test.adoc
526
+ :nodoc:
527
+ :novalid:
528
+ :no-isobib:
529
+ :docnumber: 17301
530
+ :partnumber: 1
531
+ :doctype: technical-corrigendum
532
+ :docstage: 30
533
+ :updates: ISO 17301-1:2030
534
+ :corrigendum-number: 3
535
+ INPUT
536
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
537
+ <bibdata type='standard'>
538
+ <docidentifier type='iso'>ISO 17301-1:2030/CD Cor.3</docidentifier>
539
+ <docidentifier type='iso-with-lang'>ISO 17301-1:2030/CD Cor.3(E)</docidentifier>
540
+ <docidentifier type='iso-reference'>ISO 17301-1:2030/CD Cor.3(E)</docidentifier>
541
+ <docnumber>17301</docnumber>
542
+ <contributor>
543
+ <role type='author'/>
544
+ <organization>
545
+ <name>International Organization for Standardization</name>
546
+ <abbreviation>ISO</abbreviation>
547
+ </organization>
548
+ </contributor>
549
+ <contributor>
550
+ <role type='publisher'/>
551
+ <organization>
552
+ <name>International Organization for Standardization</name>
553
+ <abbreviation>ISO</abbreviation>
554
+ </organization>
555
+ </contributor>
556
+ <language>en</language>
557
+ <script>Latn</script>
558
+ <status>
559
+ <stage abbreviation='CD'>30</stage>
560
+ <substage>00</substage>
561
+ </status>
562
+ <copyright>
563
+ <from>2020</from>
564
+ <owner>
565
+ <organization>
566
+ <name>International Organization for Standardization</name>
567
+ <abbreviation>ISO</abbreviation>
568
+ </organization>
569
+ </owner>
570
+ </copyright>
571
+ <ext>
572
+ <doctype>technical-corrigendum</doctype>
573
+ <editorialgroup>
574
+ <technical-committee/>
575
+ <subcommittee/>
576
+ <workgroup/>
577
+ </editorialgroup>
578
+ <structuredidentifier>
579
+ <project-number part='1' corrigendum='3'>17301</project-number>
580
+ </structuredidentifier>
581
+ <stagename>Committee draft</stagename>
582
+ </ext>
583
+ </bibdata>
584
+ <sections/>
585
+ </iso-standard>
586
+ OUTPUT
587
+ end
588
+
589
+ it "processes metadata, corrigendum" do
590
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
591
+ = Document title
592
+ Author
593
+ :docfile: test.adoc
594
+ :nodoc:
595
+ :novalid:
596
+ :no-isobib:
597
+ :docnumber: 17301
598
+ :partnumber: 1
599
+ :doctype: technical-corrigendum
600
+ :docstage: 50
601
+ :updates: ISO 17301-1:2030
602
+ :corrigendum-number: 3
603
+ INPUT
604
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
605
+ <bibdata type='standard'>
606
+ <docidentifier type='iso'>ISO 17301-1:2030/FDCor.3</docidentifier>
607
+ <docidentifier type='iso-with-lang'>ISO 17301-1:2030/FDCor.3(E)</docidentifier>
608
+ <docidentifier type='iso-reference'>ISO 17301-1:2030/FDCor.3(E)</docidentifier>
609
+ <docnumber>17301</docnumber>
610
+ <contributor>
611
+ <role type='author'/>
612
+ <organization>
613
+ <name>International Organization for Standardization</name>
614
+ <abbreviation>ISO</abbreviation>
615
+ </organization>
616
+ </contributor>
617
+ <contributor>
618
+ <role type='publisher'/>
619
+ <organization>
620
+ <name>International Organization for Standardization</name>
621
+ <abbreviation>ISO</abbreviation>
622
+ </organization>
623
+ </contributor>
624
+ <language>en</language>
625
+ <script>Latn</script>
626
+ <status>
627
+ <stage abbreviation='FD'>50</stage>
628
+ <substage>00</substage>
629
+ </status>
630
+ <copyright>
631
+ <from>2020</from>
632
+ <owner>
633
+ <organization>
634
+ <name>International Organization for Standardization</name>
635
+ <abbreviation>ISO</abbreviation>
636
+ </organization>
637
+ </owner>
638
+ </copyright>
639
+ <ext>
640
+ <doctype>technical-corrigendum</doctype>
641
+ <editorialgroup>
642
+ <technical-committee/>
643
+ <subcommittee/>
644
+ <workgroup/>
645
+ </editorialgroup>
646
+ <structuredidentifier>
647
+ <project-number part='1' corrigendum='3'>17301</project-number>
648
+ </structuredidentifier>
649
+ <stagename>Final draft</stagename>
650
+ </ext>
651
+ </bibdata>
652
+ <sections/>
653
+ </iso-standard>
654
+ OUTPUT
655
+ end
656
+
657
+ it "processes metadata, corrigendum" do
658
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
659
+ = Document title
660
+ Author
661
+ :docfile: test.adoc
662
+ :nodoc:
663
+ :novalid:
664
+ :no-isobib:
665
+ :docnumber: 17301
666
+ :partnumber: 1
667
+ :doctype: technical-corrigendum
668
+ :updates: ISO 17301-1:2030
669
+ :corrigendum-number: 3
670
+ INPUT
671
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
672
+ <bibdata type='standard'>
673
+ <docidentifier type='iso'>ISO 17301-1:2030/Cor.3</docidentifier>
674
+ <docidentifier type='iso-with-lang'>ISO 17301-1:2030/Cor.3(E)</docidentifier>
675
+ <docidentifier type='iso-reference'>ISO 17301-1:2030/Cor.3(E)</docidentifier>
676
+ <docnumber>17301</docnumber>
677
+ <contributor>
678
+ <role type='author'/>
679
+ <organization>
680
+ <name>International Organization for Standardization</name>
681
+ <abbreviation>ISO</abbreviation>
682
+ </organization>
683
+ </contributor>
684
+ <contributor>
685
+ <role type='publisher'/>
686
+ <organization>
687
+ <name>International Organization for Standardization</name>
688
+ <abbreviation>ISO</abbreviation>
689
+ </organization>
690
+ </contributor>
691
+ <language>en</language>
692
+ <script>Latn</script>
693
+ <status>
694
+ <stage abbreviation='IS'>60</stage>
695
+ <substage>60</substage>
696
+ </status>
697
+ <copyright>
698
+ <from>2020</from>
699
+ <owner>
700
+ <organization>
701
+ <name>International Organization for Standardization</name>
702
+ <abbreviation>ISO</abbreviation>
703
+ </organization>
704
+ </owner>
705
+ </copyright>
706
+ <ext>
707
+ <doctype>technical-corrigendum</doctype>
708
+ <editorialgroup>
709
+ <technical-committee/>
710
+ <subcommittee/>
711
+ <workgroup/>
712
+ </editorialgroup>
713
+ <structuredidentifier>
714
+ <project-number part='1' corrigendum='3'>17301</project-number>
715
+ </structuredidentifier>
716
+ <stagename>International standard</stagename>
717
+ </ext>
718
+ </bibdata>
719
+ <sections/>
720
+ </iso-standard>
721
+ OUTPUT
722
+ end
723
+
724
+
725
+
318
726
  end