metanorma-iso 1.5.8 → 1.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +66 -0
  3. data/README.adoc +5 -6
  4. data/lib/asciidoctor/iso/base.rb +5 -0
  5. data/lib/asciidoctor/iso/basicdoc.rng +4 -11
  6. data/lib/asciidoctor/iso/boilerplate-fr.xml +40 -0
  7. data/lib/asciidoctor/iso/boilerplate.xml +1 -0
  8. data/lib/asciidoctor/iso/cleanup.rb +38 -0
  9. data/lib/asciidoctor/iso/front.rb +14 -15
  10. data/lib/asciidoctor/iso/isodoc.rng +27 -50
  11. data/lib/asciidoctor/iso/isostandard.rng +16 -1
  12. data/lib/asciidoctor/iso/validate.rb +1 -1
  13. data/lib/asciidoctor/iso/validate_section.rb +9 -0
  14. data/lib/isodoc/iso/base_convert.rb +2 -1
  15. data/lib/isodoc/iso/html/header.html +12 -24
  16. data/lib/isodoc/iso/html/htmlstyle.css +1 -1
  17. data/lib/isodoc/iso/html/htmlstyle.scss +1 -1
  18. data/lib/isodoc/iso/html/isodoc.css +42 -42
  19. data/lib/isodoc/iso/html/isodoc.scss +42 -42
  20. data/lib/isodoc/iso/html/style-human.css +14 -10
  21. data/lib/isodoc/iso/html/style-human.scss +7 -7
  22. data/lib/isodoc/iso/html/style-iso.css +12 -8
  23. data/lib/isodoc/iso/html/style-iso.scss +5 -5
  24. data/lib/isodoc/iso/html/wordstyle.css +67 -67
  25. data/lib/isodoc/iso/html/wordstyle.scss +67 -67
  26. data/lib/isodoc/iso/html_convert.rb +4 -0
  27. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  28. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  29. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  30. data/lib/isodoc/iso/i18n.rb +10 -11
  31. data/lib/isodoc/iso/iso.amendment.xsl +739 -141
  32. data/lib/isodoc/iso/iso.international-standard.xsl +739 -141
  33. data/lib/isodoc/iso/metadata.rb +20 -19
  34. data/lib/isodoc/iso/word_convert.rb +4 -0
  35. data/lib/isodoc/iso/xref.rb +10 -0
  36. data/lib/metanorma/iso/fonts_manifest.yaml +6 -0
  37. data/lib/metanorma/iso/processor.rb +0 -9
  38. data/lib/metanorma/iso/version.rb +1 -1
  39. data/metanorma-iso.gemspec +2 -2
  40. data/spec/asciidoctor-iso/amd_spec.rb +7 -7
  41. data/spec/asciidoctor-iso/base_spec.rb +146 -18
  42. data/spec/asciidoctor-iso/blocks_spec.rb +1 -1
  43. data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
  44. data/spec/asciidoctor-iso/lists_spec.rb +6 -6
  45. data/spec/asciidoctor-iso/refs_spec.rb +174 -143
  46. data/spec/asciidoctor-iso/section_spec.rb +5 -0
  47. data/spec/asciidoctor-iso/validate_spec.rb +52 -15
  48. data/spec/assets/xref_error.adoc +7 -0
  49. data/spec/isodoc/amd_spec.rb +191 -17
  50. data/spec/isodoc/blocks_spec.rb +2 -1
  51. data/spec/isodoc/i18n_spec.rb +13 -13
  52. data/spec/isodoc/inline_spec.rb +2 -2
  53. data/spec/isodoc/iso_spec.rb +2 -2
  54. data/spec/isodoc/metadata_spec.rb +172 -19
  55. data/spec/isodoc/postproc_spec.rb +3 -3
  56. data/spec/isodoc/ref_spec.rb +5 -5
  57. data/spec/isodoc/section_spec.rb +22 -2
  58. data/spec/isodoc/table_spec.rb +1 -1
  59. data/spec/isodoc/terms_spec.rb +1 -1
  60. data/spec/isodoc/xref_spec.rb +23 -11
  61. data/spec/metanorma/processor_spec.rb +1 -1
  62. data/spec/spec_helper.rb +22 -2
  63. metadata +10 -9
  64. data/.github/workflows/macos.yml +0 -41
  65. data/.github/workflows/ubuntu.yml +0 -45
  66. data/.github/workflows/windows.yml +0 -43
@@ -2,6 +2,26 @@ require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
4
  RSpec.describe Asciidoctor::ISO do
5
+ context "when xref_error.adoc compilation" do
6
+ around do |example|
7
+ FileUtils.rm_f "spec/assets/xref_error.err"
8
+ example.run
9
+ Dir["spec/assets/xref_error*"].each do |file|
10
+ next if file.match?(/adoc$/)
11
+
12
+ FileUtils.rm_f(file)
13
+ end
14
+ end
15
+
16
+ it "generates error file" do
17
+ expect do
18
+ Metanorma::Compile
19
+ .new
20
+ .compile("spec/assets/xref_error.adoc", type: "iso")
21
+ end.to(change { File.exist?("spec/assets/xref_error.err") }
22
+ .from(false).to(true))
23
+ end
24
+ end
5
25
 
6
26
  it "Warns of missing scope" do
7
27
  FileUtils.rm_f "test.err"
@@ -182,6 +202,23 @@ it "Warns of illegal script" do
182
202
  expect(File.read("test.err")).to include "pizza is not a recognised script"
183
203
  end
184
204
 
205
+ it "warns that technical report may contain requirement" do
206
+ FileUtils.rm_f "test.err"
207
+ Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
208
+ = Document title
209
+ Author
210
+ :docfile: test.adoc
211
+ :nodoc:
212
+ :no-isobib:
213
+ :doctype: technical-report
214
+
215
+ == Random clause
216
+
217
+ The widget is required not to be larger than 15 cm.
218
+ INPUT
219
+ expect(File.read("test.err")).to include "Technical Report clause may contain requirement"
220
+ end
221
+
185
222
 
186
223
  it "warns that introduction may contain requirement" do
187
224
  FileUtils.rm_f "test.err"
@@ -332,7 +369,7 @@ it "warns that undated reference has locality" do
332
369
  FileUtils.rm_f "test.err"
333
370
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
334
371
  #{VALIDATING_BLANK_HDR}
335
-
372
+
336
373
  == Scope
337
374
  <<iso123,clause=1>>
338
375
 
@@ -417,7 +454,7 @@ it "warns that Scope contains subclauses" do
417
454
  #{VALIDATING_BLANK_HDR}
418
455
 
419
456
  == Scope
420
-
457
+
421
458
  === Scope subclause
422
459
  INPUT
423
460
  expect(File.read("test.err")).to include "Scope contains subclauses: should be succinct"
@@ -427,7 +464,7 @@ end
427
464
  it "warns that Table should have title" do
428
465
  FileUtils.rm_f "test.err"
429
466
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
430
- #{VALIDATING_BLANK_HDR}
467
+ #{VALIDATING_BLANK_HDR}
431
468
 
432
469
  |===
433
470
  |a |b |c
@@ -439,7 +476,7 @@ end
439
476
  it "gives Style warning if number not broken up in threes" do
440
477
  FileUtils.rm_f "test.err"
441
478
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
442
- #{VALIDATING_BLANK_HDR}
479
+ #{VALIDATING_BLANK_HDR}
443
480
 
444
481
  == Clause
445
482
  12121
@@ -450,7 +487,7 @@ end
450
487
  it "gives No style warning if number not broken up in threes is ISO reference" do
451
488
  FileUtils.rm_f "test.err"
452
489
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
453
- #{VALIDATING_BLANK_HDR}
490
+ #{VALIDATING_BLANK_HDR}
454
491
 
455
492
  == Clause
456
493
  ISO 12121
@@ -461,7 +498,7 @@ end
461
498
  it "Style warning if decimal point" do
462
499
  FileUtils.rm_f "test.err"
463
500
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
464
- #{VALIDATING_BLANK_HDR}
501
+ #{VALIDATING_BLANK_HDR}
465
502
 
466
503
  == Clause
467
504
  8.1
@@ -472,7 +509,7 @@ end
472
509
  it "Style warning if billion used" do
473
510
  FileUtils.rm_f "test.err"
474
511
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
475
- #{VALIDATING_BLANK_HDR}
512
+ #{VALIDATING_BLANK_HDR}
476
513
 
477
514
  == Clause
478
515
  "Billions" are a term of art.
@@ -483,7 +520,7 @@ end
483
520
  it "Style warning if no space before percent sign" do
484
521
  FileUtils.rm_f "test.err"
485
522
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
486
- #{VALIDATING_BLANK_HDR}
523
+ #{VALIDATING_BLANK_HDR}
487
524
 
488
525
  == Clause
489
526
  95%
@@ -572,7 +609,7 @@ end
572
609
  # it "Style warning if foreword contains subclauses" do
573
610
  # expect { Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true) }.to output(%r{non-standard unit}).to_stderr
574
611
  # #{VALIDATING_BLANK_HDR}
575
- #
612
+ #
576
613
  # INPUT
577
614
  # end
578
615
 
@@ -644,7 +681,7 @@ it "Warning if introduction not followed by scope" do
644
681
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
645
682
  #{VALIDATING_BLANK_HDR}
646
683
 
647
- .Foreword
684
+ .Foreword
648
685
  Foreword
649
686
 
650
687
  == Introduction
@@ -661,7 +698,7 @@ it "Warning if normative references not followed by terms and definitions" do
661
698
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
662
699
  #{VALIDATING_BLANK_HDR}
663
700
 
664
- .Foreword
701
+ .Foreword
665
702
  Foreword
666
703
 
667
704
  == Scope
@@ -681,7 +718,7 @@ it "Warning if there are no clauses in the document" do
681
718
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
682
719
  #{VALIDATING_BLANK_HDR}
683
720
 
684
- .Foreword
721
+ .Foreword
685
722
  Foreword
686
723
 
687
724
  == Scope
@@ -1089,7 +1126,7 @@ it "Warning if term definition starts with article" do
1089
1126
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1090
1127
  #{VALIDATING_BLANK_HDR}
1091
1128
  == Terms and Definitions
1092
-
1129
+
1093
1130
  === Term
1094
1131
 
1095
1132
  The definition of a term is a part of the specialized vocabulary of a particular field
@@ -1102,7 +1139,7 @@ it "Warning if term definition ends with period" do
1102
1139
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1103
1140
  #{VALIDATING_BLANK_HDR}
1104
1141
  == Terms and Definitions
1105
-
1142
+
1106
1143
  === Term
1107
1144
 
1108
1145
  Part of the specialized vocabulary of a particular field.
@@ -1202,7 +1239,7 @@ it "Warn if an undated reference has no associated footnote" do
1202
1239
  FileUtils.rm_f "test.err"
1203
1240
  Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1204
1241
  #{VALIDATING_BLANK_HDR}
1205
-
1242
+
1206
1243
  [bibliography]
1207
1244
  == Bibliography
1208
1245
  * [[[ISO8,ISO 8:--]]], _Title_
@@ -0,0 +1,7 @@
1
+ = X
2
+ A
3
+
4
+ == Clause
5
+
6
+ <<a,b>>
7
+
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "cross-references notes in amendments" do
5
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
8
8
  <preface>
@@ -57,10 +57,10 @@ RSpec.describe IsoDoc do
57
57
  </iso-standard>
58
58
  INPUT
59
59
  <?xml version='1.0'?>
60
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
60
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
61
61
  <bibdata>
62
62
  <ext>
63
- <doctype>amendment</doctype>
63
+ <doctype language="">amendment</doctype>
64
64
  </ext>
65
65
  </bibdata>
66
66
  <preface>
@@ -153,7 +153,7 @@ RSpec.describe IsoDoc do
153
153
  end
154
154
 
155
155
  it "cross-references sections" do
156
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
156
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
157
157
  <iso-standard xmlns="http://riboseinc.com/isoxml">
158
158
  <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
159
159
  <preface>
@@ -218,10 +218,10 @@ RSpec.describe IsoDoc do
218
218
  </iso-standard>
219
219
  INPUT
220
220
  <?xml version='1.0'?>
221
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
221
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
222
222
  <bibdata>
223
223
  <ext>
224
- <doctype>amendment</doctype>
224
+ <doctype language="">amendment</doctype>
225
225
  </ext>
226
226
  </bibdata>
227
227
  <preface>
@@ -396,10 +396,10 @@ RSpec.describe IsoDoc do
396
396
  </iso-standard>
397
397
  INPUT
398
398
  presxml = <<~OUTPUT
399
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
399
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
400
400
  <bibdata>
401
401
  <ext>
402
- <doctype>amendment</doctype>
402
+ <doctype language="">amendment</doctype>
403
403
  </ext>
404
404
  </bibdata>
405
405
  <boilerplate>
@@ -618,7 +618,7 @@ RSpec.describe IsoDoc do
618
618
  </body>
619
619
  </html>
620
620
  OUTPUT
621
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
621
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
622
622
  expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
623
623
  end
624
624
 
@@ -627,7 +627,7 @@ OUTPUT
627
627
  arr = c.convert_init(<<~"INPUT", "test", false)
628
628
  <iso-standard xmlns="http://riboseinc.com/isoxml">
629
629
  INPUT
630
- expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort]).to be_equivalent_to <<~"OUTPUT"
630
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
631
631
  <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
632
632
  <bibdata type='standard'>
633
633
  <title language='en' format='text/plain' type='main'>Introduction — Main Title — Title — Title Part  — Mass fraction of
@@ -719,9 +719,11 @@ OUTPUT
719
719
  <sections/>
720
720
  </iso-standard>
721
721
  INPUT
722
- {:agency=>"ISO",
723
- :authors=>[],
724
- :authors_affiliations=>{},
722
+ {:accesseddate=>"XXX",
723
+ :agency=>"ISO",
724
+ :circulateddate=>"XXX",
725
+ :confirmeddate=>"XXX",
726
+ :copieddate=>"XXX",
725
727
  :createddate=>"2016-05-01",
726
728
  :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
727
729
  :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
@@ -744,31 +746,203 @@ INPUT
744
746
  :doctitlepart=>"Title Part",
745
747
  :doctitlepartlabel=>"Part&nbsp;1",
746
748
  :doctype=>"Amendment",
749
+ :doctype_display=>"Amendment",
747
750
  :docyear=>"2017",
748
751
  :draft=>"0.3.4",
749
752
  :draftinfo=>" (draft 0.3.4, 2000-01-01)",
750
753
  :edition=>"2",
751
754
  :editorialgroup=>["A 1", "B 2", "C 3"],
752
755
  :ics=>"1, 2, 3",
753
- :keywords=>[],
754
- :obsoletes=>nil,
755
- :obsoletes_part=>nil,
756
+ :implementeddate=>"XXX",
757
+ :issueddate=>"XXX",
758
+ :lang=>"en",
759
+ :obsoleteddate=>"XXX",
760
+ :publisheddate=>"XXX",
756
761
  :publisher=>"International Organization for Standardization",
762
+ :receiveddate=>"XXX",
757
763
  :revdate=>"2000-01-01",
758
764
  :revdate_monthyear=>"January 2000",
759
765
  :sc=>"B 2",
766
+ :script=>"Latn",
760
767
  :secretariat=>"SECRETARIAT",
761
768
  :stage=>"10",
762
769
  :stage_int=>10,
763
770
  :stageabbr=>"NWIP",
764
771
  :statusabbr=>"PreNWIP3",
765
772
  :tc=>"A 1",
766
- :tc_docnumber=>[],
773
+ :transmitteddate=>"XXX",
774
+ :unchangeddate=>"XXX",
767
775
  :unpublished=>true,
776
+ :updateddate=>"XXX",
777
+ :vote_endeddate=>"XXX",
778
+ :vote_starteddate=>"XXX",
768
779
  :wg=>"C 3"}
769
780
  OUTPUT
770
781
  end
771
782
 
783
+ it "processes IsoXML metadata in French" do
784
+ c = IsoDoc::Iso::HtmlConvert.new({})
785
+ arr = c.convert_init(<<~"INPUT", "test", false)
786
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
787
+ <bibdata>
788
+ <language>fr</language>
789
+ </bibdata>
790
+ </iso-standard>
791
+ INPUT
792
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
793
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
794
+ <bibdata type='standard'>
795
+ <title language='en' format='text/plain' type='main'>Introduction — Main Title — Title — Title Part  — Mass fraction of
796
+ extraneous matter, milled rice (nonglutinous), sample dividers and
797
+ recommendations relating to storage and transport conditions</title>
798
+ <title language='en' format='text/plain' type='title-intro'>Introduction</title>
799
+ <title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
800
+ <title language='en' format='text/plain' type='title-part'>Title Part</title>
801
+ <title language='en' format='text/plain' type='title-amd'>Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
802
+ <title language='fr' format='text/plain' type='main'>
803
+ Introduction Française — Titre Principal — Part du Titre — Fraction
804
+ massique de matière étrangère, riz usiné (non gluant), diviseurs
805
+ d’échantillon et recommandations relatives aux conditions d’entreposage et
806
+ de transport
807
+ </title>
808
+ <title language='fr' format='text/plain' type='title-intro'>Introduction Française</title>
809
+ <title language='fr' format='text/plain' type='title-main'>Titre Principal</title>
810
+ <title language='fr' format='text/plain' type='title-part'>Part du Titre</title>
811
+ <title language='fr' format='text/plain' type='title-amd'>Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
812
+ <docidentifier type='ISO'>ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
813
+ <docidentifier type='iso-with-lang'>ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
814
+ <docidentifier type='iso-reference'>ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
815
+ <docnumber>17301</docnumber>
816
+ <date type='created'>
817
+ <on>2016-05-01</on>
818
+ </date>
819
+ <contributor>
820
+ <role type='author'/>
821
+ <organization>
822
+ <name>International Organization for Standardization</name>
823
+ <abbreviation>ISO</abbreviation>
824
+ </organization>
825
+ </contributor>
826
+ <contributor>
827
+ <role type='publisher'/>
828
+ <organization>
829
+ <name>International Organization for Standardization</name>
830
+ <abbreviation>ISO</abbreviation>
831
+ </organization>
832
+ </contributor>
833
+ <edition>2</edition>
834
+ <version>
835
+ <revision-date>2000-01-01</revision-date>
836
+ <draft>0.3.4</draft>
837
+ </version>
838
+ <language>fr</language>
839
+ <script>Latn</script>
840
+ <status>
841
+ <stage abbreviation='NWIP'>10</stage>
842
+ <substage>20</substage>
843
+ <iteration>3</iteration>
844
+ </status>
845
+ <copyright>
846
+ <from>2017</from>
847
+ <owner>
848
+ <organization>
849
+ <name>International Organization for Standardization</name>
850
+ <abbreviation>ISO</abbreviation>
851
+ </organization>
852
+ </owner>
853
+ </copyright>
854
+ <ext>
855
+ <doctype language="">amendment</doctype>
856
+ <doctype language="fr">Amendment</doctype>
857
+ <editorialgroup>
858
+ <technical-committee number='1' type='A'>TC</technical-committee>
859
+ <technical-committee number='11' type='A1'>TC1</technical-committee>
860
+ <subcommittee number='2' type='B'>SC</subcommittee>
861
+ <subcommittee number='21' type='B1'>SC1</subcommittee>
862
+ <workgroup number='3' type='C'>WG</workgroup>
863
+ <workgroup number='31' type='C1'>WG1</workgroup>
864
+ <secretariat>SECRETARIAT</secretariat>
865
+ </editorialgroup>
866
+ <ics>
867
+ <code>1</code>
868
+ </ics>
869
+ <ics>
870
+ <code>2</code>
871
+ </ics>
872
+ <ics>
873
+ <code>3</code>
874
+ </ics>
875
+ <structuredidentifier>
876
+ <project-number part='1' amendment='1' corrigendum='2' origyr='2016-05-01'>17301</project-number>
877
+ </structuredidentifier>
878
+ <stagename>New work item proposal</stagename>
879
+ <updates-document-type>international-standard</updates-document-type>
880
+ </ext>
881
+ </bibdata>
882
+ <sections/>
883
+ </iso-standard>
884
+ INPUT
885
+ {:accesseddate=>"XXX",
886
+ :agency=>"ISO",
887
+ :circulateddate=>"XXX",
888
+ :confirmeddate=>"XXX",
889
+ :copieddate=>"XXX",
890
+ :createddate=>"2016-05-01",
891
+ :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
892
+ :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
893
+ :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
894
+ :docnumeric=>"17301",
895
+ :docsubtitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
896
+ :docsubtitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
897
+ :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
898
+ :docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
899
+ :docsubtitleintro=>"Introduction",
900
+ :docsubtitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
901
+ :docsubtitlepart=>"Title Part",
902
+ :docsubtitlepartlabel=>"Part&nbsp;1",
903
+ :doctitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
904
+ :doctitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
905
+ :doctitleamdlabel=>"AMENDMENT&nbsp;1",
906
+ :doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
907
+ :doctitleintro=>"Introduction Fran&#xe7;aise",
908
+ :doctitlemain=>"Titre Principal",
909
+ :doctitlepart=>"Part du Titre",
910
+ :doctitlepartlabel=>"Partie&nbsp;1",
911
+ :doctype=>"Amendment",
912
+ :doctype_display=>"Amendment",
913
+ :docyear=>"2017",
914
+ :draft=>"0.3.4",
915
+ :draftinfo=>" (brouillon 0.3.4, 2000-01-01)",
916
+ :edition=>"2",
917
+ :editorialgroup=>["A 1", "B 2", "C 3"],
918
+ :ics=>"1, 2, 3",
919
+ :implementeddate=>"XXX",
920
+ :issueddate=>"XXX",
921
+ :lang=>"fr",
922
+ :obsoleteddate=>"XXX",
923
+ :publisheddate=>"XXX",
924
+ :publisher=>"International Organization for Standardization",
925
+ :receiveddate=>"XXX",
926
+ :revdate=>"2000-01-01",
927
+ :revdate_monthyear=>"Janvier 2000",
928
+ :sc=>"B 2",
929
+ :script=>"Latn",
930
+ :secretariat=>"SECRETARIAT",
931
+ :stage=>"10",
932
+ :stage_int=>10,
933
+ :stageabbr=>"NWIP",
934
+ :statusabbr=>"PreNWIP3",
935
+ :tc=>"A 1",
936
+ :transmitteddate=>"XXX",
937
+ :unchangeddate=>"XXX",
938
+ :unpublished=>true,
939
+ :updateddate=>"XXX",
940
+ :vote_endeddate=>"XXX",
941
+ :vote_starteddate=>"XXX",
942
+ :wg=>"C 3"}
943
+ OUTPUT
944
+ end
945
+
772
946
  it "processes middle title" do
773
947
  expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
774
948
  <iso-standard xmlns="http://riboseinc.com/isoxml">