metanorma-iso 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,13 @@ RSpec.describe IsoDoc do
5
5
  input = <<~INPUT
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <bibdata>
8
+ <status>
9
+ <stage abbreviation='IS' language=''>60</stage>
10
+ </status>
8
11
  <language>en</language>
12
+ <ext>
13
+ <doctype language=''>international-standard</doctype>
14
+ </ext>
9
15
  </bibdata>
10
16
  <preface>
11
17
  <foreword obligation="informative">
@@ -85,8 +91,16 @@ RSpec.describe IsoDoc do
85
91
  presxml = <<~OUTPUT
86
92
  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
87
93
  <bibdata>
88
- <language current="true">en</language>
89
- </bibdata>
94
+ <status>
95
+ <stage abbreviation='IS' language=''>60</stage>
96
+ <stage abbreviation='IS' language='en'>International standard</stage>
97
+ </status>
98
+ <language current='true'>en</language>
99
+ <ext>
100
+ <doctype language=''>international-standard</doctype>
101
+ <doctype language='en'>International Standard</doctype>
102
+ </ext>
103
+ </bibdata>
90
104
  <preface>
91
105
  <foreword obligation="informative" displayorder='1'>
92
106
  <title>Foreword</title>
@@ -263,7 +277,13 @@ RSpec.describe IsoDoc do
263
277
  .convert("test", <<~"INPUT", true)
264
278
  <iso-standard xmlns="http://riboseinc.com/isoxml">
265
279
  <bibdata>
280
+ <status>
281
+ <stage abbreviation='IS' language=''>60</stage>
282
+ </status>
266
283
  <language>tlh</language>
284
+ <ext>
285
+ <doctype language=''>international-standard</doctype>
286
+ </ext>
267
287
  </bibdata>
268
288
  <preface>
269
289
  <foreword obligation="informative">
@@ -344,8 +364,16 @@ RSpec.describe IsoDoc do
344
364
  .to be_equivalent_to xmlpp(<<~"OUTPUT")
345
365
  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
346
366
  <bibdata>
347
- <language current="true">tlh</language>
348
- </bibdata>
367
+ <status>
368
+ <stage abbreviation='IS' language=''>60</stage>
369
+ <stage abbreviation='IS' language='tlh'>International standard</stage>
370
+ </status>
371
+ <language current='true'>tlh</language>
372
+ <ext>
373
+ <doctype language=''>international-standard</doctype>
374
+ <doctype language='tlh'>International Standard</doctype>
375
+ </ext>
376
+ </bibdata>
349
377
  <preface>
350
378
  <foreword obligation="informative" displayorder='1'>
351
379
  <title>Foreword</title>
@@ -438,7 +466,13 @@ RSpec.describe IsoDoc do
438
466
  input = <<~INPUT
439
467
  <iso-standard xmlns="http://riboseinc.com/isoxml">
440
468
  <bibdata>
469
+ <status>
470
+ <stage abbreviation='IS' language=''>60</stage>
471
+ </status>
441
472
  <language>fr</language>
473
+ <ext>
474
+ <doctype language=''>international-standard</doctype>
475
+ </ext>
442
476
  </bibdata>
443
477
  <preface>
444
478
  <foreword obligation="informative">
@@ -518,8 +552,16 @@ RSpec.describe IsoDoc do
518
552
  presxml = <<~OUTPUT
519
553
  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
520
554
  <bibdata>
521
- <language current="true">fr</language>
522
- </bibdata>
555
+ <status>
556
+ <stage abbreviation='IS' language=''>60</stage>
557
+ <stage abbreviation='IS' language='fr'>Norme internationale</stage>
558
+ </status>
559
+ <language current='true'>fr</language>
560
+ <ext>
561
+ <doctype language=''>international-standard</doctype>
562
+ <doctype language='fr'>Norme internationale</doctype>
563
+ </ext>
564
+ </bibdata>
523
565
  <preface>
524
566
  <foreword obligation="informative" displayorder='1'>
525
567
  <title>Foreword</title>
@@ -701,12 +743,303 @@ RSpec.describe IsoDoc do
701
743
  .to be_equivalent_to xmlpp(html)
702
744
  end
703
745
 
746
+ it "processes Russian" do
747
+ input = <<~INPUT
748
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
749
+ <bibdata>
750
+ <status>
751
+ <stage abbreviation='IS' language=''>60</stage>
752
+ </status>
753
+ <language>ru</language>
754
+ <ext>
755
+ <doctype language=''>international-standard</doctype>
756
+ </ext>
757
+ </bibdata>
758
+ <preface>
759
+ <foreword obligation="informative">
760
+ <title>Foreword</title>
761
+ <p id="A">This is a preamble</p>
762
+ </foreword>
763
+ <introduction id="B" obligation="informative">
764
+ <title>Introduction</title>
765
+ <clause id="C" inline-header="false" obligation="informative">
766
+ <title>Introduction Subsection</title>
767
+ </clause>
768
+ <p>This is patent boilerplate</p>
769
+ </introduction>
770
+ </preface>
771
+ <sections>
772
+ <clause id="D" obligation="normative" type="scope">
773
+ <title>Scope</title>
774
+ <p id="E">Text</p>
775
+ </clause>
776
+ <clause id="H" obligation="normative">
777
+ <title>Terms, definitions, symbols and abbreviated terms</title>
778
+ <terms id="I" obligation="normative">
779
+ <title>Normal Terms</title>
780
+ <term id="J">
781
+ <preferred><expression><name>Term2</name></expression></preferred>
782
+ </term>
783
+ </terms>
784
+ <definitions id="K">
785
+ <dl>
786
+ <dt>Symbol</dt>
787
+ <dd>Definition</dd>
788
+ </dl>
789
+ </definitions>
790
+ </clause>
791
+ <definitions id="L">
792
+ <dl>
793
+ <dt>Symbol</dt>
794
+ <dd>Definition</dd>
795
+ </dl>
796
+ </definitions>
797
+ <clause id="M" inline-header="false" obligation="normative">
798
+ <title>Clause 4</title>
799
+ <clause id="N" inline-header="false" obligation="normative">
800
+ <title>Introduction</title>
801
+ </clause>
802
+ <clause id="O" inline-header="false" obligation="normative">
803
+ <title>Clause 4.2</title>
804
+ </clause>
805
+ </clause>
806
+ </sections>
807
+ <annex id="P" inline-header="false" obligation="normative">
808
+ <title>Annex</title>
809
+ <clause id="Q" inline-header="false" obligation="normative">
810
+ <title>Annex A.1</title>
811
+ <clause id="Q1" inline-header="false" obligation="normative">
812
+ <title>Annex A.1a</title>
813
+ </clause>
814
+ </clause>
815
+ <appendix id="Q2" inline-header="false" obligation="normative">
816
+ <title>An Appendix</title>
817
+ </appendix>
818
+ </annex>
819
+ <bibliography>
820
+ <references id="R" normative="true" obligation="informative">
821
+ <title>Normative References</title>
822
+ </references>
823
+ <clause id="S" obligation="informative">
824
+ <title>Bibliography</title>
825
+ <references id="T" normative="false" obligation="informative">
826
+ <title>Bibliography Subsection</title>
827
+ </references>
828
+ </clause>
829
+ </bibliography>
830
+ </iso-standard>
831
+ INPUT
832
+
833
+ presxml = <<~OUTPUT
834
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
835
+ <bibdata>
836
+ <status>
837
+ <stage abbreviation='IS' language=''>60</stage>
838
+ <stage abbreviation='IS' language='ru'>
839
+ &#x41C;&#x435;&#x436;&#x434;&#x443;&#x43D;&#x430;&#x440;&#x43E;&#x434;&#x43D;&#x44B;&#x439; &#x441;&#x442;&#x430;&#x43D;&#x434;&#x430;&#x440;&#x442;
840
+ </stage>
841
+ </status>
842
+ <language current='true'>ru</language>
843
+ <ext>
844
+ <doctype language=''>international-standard</doctype>
845
+ <doctype language='ru'>
846
+ &#x41C;&#x435;&#x436;&#x434;&#x443;&#x43D;&#x430;&#x440;&#x43E;&#x434;&#x43D;&#x44B;&#x439; &#x421;&#x442;&#x430;&#x43D;&#x434;&#x430;&#x440;&#x442;
847
+ </doctype>
848
+ </ext>
849
+ </bibdata>
850
+ <preface>
851
+ <foreword obligation="informative" displayorder='1'>
852
+ <title>Foreword</title>
853
+ <p id="A">This is a preamble</p>
854
+ </foreword>
855
+ <introduction id="B" obligation="informative" displayorder='2'>
856
+ <title depth="1">0<tab/>Introduction</title>
857
+ <clause id="C" inline-header="false" obligation="informative">
858
+ <title depth="2">0.1<tab/>Introduction Subsection</title>
859
+ </clause>
860
+ <p>This is patent boilerplate</p>
861
+ </introduction>
862
+ </preface>
863
+ <sections>
864
+ <clause id="D" obligation="normative" type="scope" displayorder='3'>
865
+ <title depth="1">1<tab/>Scope</title>
866
+ <p id="E">Text</p>
867
+ </clause>
868
+ <clause id="H" obligation="normative" displayorder='5'>
869
+ <title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title>
870
+ <terms id="I" obligation="normative">
871
+ <title depth="2">3.1<tab/>Normal Terms</title>
872
+ <term id="J">
873
+ <name>3.1.1</name>
874
+ <preferred><strong>Term2</strong></preferred>
875
+ </term>
876
+ </terms>
877
+ <definitions id="K" inline-header="true">
878
+ <title>3.2</title>
879
+ <dl>
880
+ <dt>Symbol</dt>
881
+ <dd>Definition</dd>
882
+ </dl>
883
+ </definitions>
884
+ </clause>
885
+ <definitions id="L" displayorder='6'>
886
+ <title>4</title>
887
+ <dl>
888
+ <dt>Symbol</dt>
889
+ <dd>Definition</dd>
890
+ </dl>
891
+ </definitions>
892
+ <clause id="M" inline-header="false" obligation="normative" displayorder='7'>
893
+ <title depth="1">5<tab/>Clause 4</title>
894
+ <clause id="N" inline-header="false" obligation="normative">
895
+ <title depth="2">5.1<tab/>Introduction</title>
896
+ </clause>
897
+ <clause id="O" inline-header="false" obligation="normative">
898
+ <title depth="2">5.2<tab/>Clause 4.2</title>
899
+ </clause>
900
+ </clause>
901
+ </sections>
902
+ <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
903
+ <title>
904
+ <strong>&#x414;&#x43E;&#x43F;&#x43E;&#x43B;&#x43D;&#x435;&#x43D;&#x438;&#x435; A</strong>
905
+ <br/>(&#x43D;&#x43E;&#x440;&#x43C;&#x430;&#x442;&#x438;&#x432;&#x43D;&#x43E;&#x435;)
906
+ <br/>
907
+ <br/>
908
+ <strong>Annex</strong></title>
909
+ <clause id="Q" inline-header="false" obligation="normative">
910
+ <title depth="2">A.1<tab/>Annex A.1</title>
911
+ <clause id="Q1" inline-header="false" obligation="normative">
912
+ <title depth="3">A.1.1<tab/>Annex A.1a</title>
913
+ </clause>
914
+ </clause>
915
+ <appendix id="Q2" inline-header="false" obligation="normative">
916
+ <title depth="2"> &#x41F;&#x440;&#x438;&#x43B;&#x43E;&#x436;&#x435;&#x43D;&#x438;&#x435; 1<tab/>An Appendix</title>
917
+ </appendix>
918
+ </annex>
919
+ <bibliography>
920
+ <references id="R" normative="true" obligation="informative" displayorder='4'>
921
+ <title depth="1">2<tab/>Normative References</title>
922
+ </references>
923
+ <clause id="S" obligation="informative" displayorder='9'>
924
+ <title depth="1">Bibliography</title>
925
+ <references id="T" normative="false" obligation="informative">
926
+ <title depth="2">Bibliography Subsection</title>
927
+ </references>
928
+ </clause>
929
+ </bibliography>
930
+ </iso-standard>
931
+ OUTPUT
932
+
933
+ html = <<~OUTPUT
934
+ #{HTML_HDR.gsub(/"en"/, '"ru"')}
935
+ <br/>
936
+ <div>
937
+ <h1 class="ForewordTitle">Foreword</h1>
938
+ <p id="A">This is a preamble</p>
939
+ </div>
940
+ <br/>
941
+ <div class="Section3" id="B">
942
+ <h1 class="IntroTitle">0&#160; Introduction</h1>
943
+ <div id="C">
944
+ <h2>0.1&#160; Introduction Subsection</h2>
945
+ </div>
946
+ <p>This is patent boilerplate</p>
947
+ </div>
948
+ <p class="zzSTDTitle1"/>
949
+ <div id="D">
950
+ <h1>1&#160; Scope</h1>
951
+ <p id="E">Text</p>
952
+ </div>
953
+ <div>
954
+ <h1>2&#160; Normative References</h1>
955
+ </div>
956
+ <div id="H">
957
+ <h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1>
958
+ <div id="I">
959
+ <h2>3.1&#160; Normal Terms</h2>
960
+ <p class="TermNum" id="J">3.1.1</p>
961
+ <p class="Terms" style="text-align:left;"><b>Term2</b></p>
962
+ </div>
963
+ <div id="K">
964
+ <span class="zzMoveToFollowing">
965
+ <b>3.2&#160; </b>
966
+ </span>
967
+ <dl>
968
+ <dt>
969
+ <p>Symbol</p>
970
+ </dt>
971
+ <dd>Definition</dd>
972
+ </dl>
973
+ </div>
974
+ </div>
975
+ <div class="Symbols" id="L">
976
+ <h1>4</h1>
977
+ <dl>
978
+ <dt>
979
+ <p>Symbol</p>
980
+ </dt>
981
+ <dd>Definition</dd>
982
+ </dl>
983
+ </div>
984
+ <div id="M">
985
+ <h1>5&#160; Clause 4</h1>
986
+ <div id="N">
987
+ <h2>5.1&#160; Introduction</h2>
988
+ </div>
989
+ <div id="O">
990
+ <h2>5.2&#160; Clause 4.2</h2>
991
+ </div>
992
+ </div>
993
+ <br/>
994
+ <div class="Section3" id="P">
995
+ <h1 class="Annex">
996
+ <b>&#1044;&#1086;&#1087;&#1086;&#1083;&#1085;&#1077;&#1085;&#1080;&#1077; A</b>
997
+ <br/>(&#1085;&#1086;&#1088;&#1084;&#1072;&#1090;&#1080;&#1074;&#1085;&#1086;&#1077;)
998
+ <br/>
999
+ <br/>
1000
+ <b>Annex</b></h1>
1001
+ <div id="Q">
1002
+ <h2>A.1&#160; Annex A.1</h2>
1003
+ <div id="Q1">
1004
+ <h3>A.1.1&#160; Annex A.1a</h3>
1005
+ </div>
1006
+ </div>
1007
+ <div id="Q2">
1008
+ <h2>&#1055;&#1088;&#1080;&#1083;&#1086;&#1078;&#1077;&#1085;&#1080;&#1077; 1&#160; An Appendix</h2>
1009
+ </div>
1010
+ </div>
1011
+ <br/>
1012
+ <div>
1013
+ <h1 class="Section3">Bibliography</h1>
1014
+ <div>
1015
+ <h2 class="Section3">Bibliography Subsection</h2>
1016
+ </div>
1017
+ </div>
1018
+ </div>
1019
+ </body>
1020
+ </html>
1021
+ OUTPUT
1022
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1023
+ .convert("test", input, true))
1024
+ .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
1025
+ .to be_equivalent_to xmlpp(presxml)
1026
+ expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
1027
+ .convert("test", presxml, true)))
1028
+ .to be_equivalent_to xmlpp(html)
1029
+ end
1030
+
704
1031
  it "processes Simplified Chinese" do
705
1032
  input = <<~INPUT
706
1033
  <iso-standard xmlns="http://riboseinc.com/isoxml">
707
1034
  <bibdata>
1035
+ <status>
1036
+ <stage abbreviation='IS' language=''>60</stage>
1037
+ </status>
708
1038
  <language>zh</language>
709
1039
  <script>Hans</script>
1040
+ <ext>
1041
+ <doctype language=''>international-standard</doctype>
1042
+ </ext>
710
1043
  </bibdata>
711
1044
  <preface>
712
1045
  <foreword obligation="informative">
@@ -802,9 +1135,17 @@ RSpec.describe IsoDoc do
802
1135
  presxml = <<~OUTPUT
803
1136
  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
804
1137
  <bibdata>
805
- <language current="true">zh</language>
806
- <script current="true">Hans</script>
807
- </bibdata>
1138
+ <status>
1139
+ <stage abbreviation='IS' language=''>60</stage>
1140
+ <stage abbreviation='IS' language='zh'>&#x56FD;&#x9645;&#x6807;&#x51C6;</stage>
1141
+ </status>
1142
+ <language current='true'>zh</language>
1143
+ <script current='true'>Hans</script>
1144
+ <ext>
1145
+ <doctype language=''>international-standard</doctype>
1146
+ <doctype language='zh'>&#x56FD;&#x9645;&#x6807;&#x51C6;</doctype>
1147
+ </ext>
1148
+ </bibdata>
808
1149
  <preface>
809
1150
  <foreword obligation="informative" displayorder='1'>
810
1151
  <title>Foreword</title>
@@ -7,7 +7,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
7
7
  _ = c.convert_init(<<~"INPUT", "test", false)
8
8
  <iso-standard xmlns="http://riboseinc.com/isoxml">
9
9
  INPUT
10
- expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
10
+ input = <<~INPUT
11
11
  <iso-standard xmlns="http://riboseinc.com/isoxml">
12
12
  <bibdata type="standard">
13
13
  <title format="text/plain" language="en" type="title-intro">Cereals and pulses</title>
@@ -90,6 +90,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
90
90
  </bibdata>
91
91
  </iso-standard>
92
92
  INPUT
93
+ output = <<~OUTPUT
93
94
  {:accesseddate=>"2012",
94
95
  :activateddate=>"2013",
95
96
  :agency=>"ISO",
@@ -146,6 +147,8 @@ RSpec.describe IsoDoc::Iso::Metadata do
146
147
  :vote_starteddate=>"XXX",
147
148
  :wg=>"WG 3"}
148
149
  OUTPUT
150
+ expect(metadata(c.info(Nokogiri::XML(input),
151
+ nil))).to be_equivalent_to output
149
152
  end
150
153
 
151
154
  it "processes IsoXML metadata #2" do
@@ -153,7 +156,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
153
156
  _ = c.convert_init(<<~"INPUT", "test", false)
154
157
  <iso-standard xmlns="http://riboseinc.com/isoxml">
155
158
  INPUT
156
- expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
159
+ input = <<~INPUT
157
160
  <iso-standard xmlns="http://riboseinc.com/isoxml">
158
161
  <bibdata type="standard">
159
162
  <title>
@@ -225,6 +228,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
225
228
  </bibdata>
226
229
  </iso-standard>
227
230
  INPUT
231
+ output = <<~OUTPUT
228
232
  {:accesseddate=>"XXX",
229
233
  :agency=>"ISO/IEC",
230
234
  :circulateddate=>"XXX",
@@ -274,6 +278,8 @@ RSpec.describe IsoDoc::Iso::Metadata do
274
278
  :vote_starteddate=>"XXX",
275
279
  :wg=>"GHI 3"}
276
280
  OUTPUT
281
+ expect(metadata(c.info(Nokogiri::XML(input),
282
+ nil))).to be_equivalent_to output
277
283
  end
278
284
 
279
285
  it "processes IsoXML metadata in French" do
@@ -285,7 +291,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
285
291
  </bibdata>
286
292
  </iso-standard>
287
293
  INPUT
288
- expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
294
+ input = <<~INPUT
289
295
  <iso-standard xmlns="http://riboseinc.com/isoxml">
290
296
  <bibdata type="standard">
291
297
  <title>
@@ -358,6 +364,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
358
364
  </bibdata>
359
365
  </iso-standard>
360
366
  INPUT
367
+ output = <<~OUTPUT
361
368
  {:accesseddate=>"XXX",
362
369
  :agency=>"ISO/IEC",
363
370
  :circulateddate=>"XXX",
@@ -407,5 +414,148 @@ RSpec.describe IsoDoc::Iso::Metadata do
407
414
  :vote_starteddate=>"XXX",
408
415
  :wg=>"GHI 3"}
409
416
  OUTPUT
417
+ expect(metadata(c.info(Nokogiri::XML(input),
418
+ nil))).to be_equivalent_to output
419
+ end
420
+
421
+ it "processes IsoXML metadata in Russian" do
422
+ c = IsoDoc::Iso::HtmlConvert.new({})
423
+ _ = c.convert_init(<<~"INPUT", "test", false)
424
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
425
+ <bibdata>
426
+ <language>ru</language>
427
+ </bibdata>
428
+ </iso-standard>
429
+ INPUT
430
+ input = <<~INPUT
431
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
432
+ <bibdata type="standard">
433
+ <title>
434
+ <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
435
+ <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
436
+ <title type="title-part" language="en" format="text/plain">Rice</title>
437
+ </title>
438
+ <title>
439
+ <title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
440
+ <title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
441
+ <title type="title-part" language="fr" format="text/plain">Riz</title>
442
+ </title>
443
+ <title>
444
+ <title type="title-intro" language="ru" format="text/plain">Зерновые и бобовые</title>
445
+ <title type="title-main" language="ru" format="text/plain">Технические характеристики и методы испытаний</title>
446
+ <title type="title-part" language="ru" format="text/plain">Рис</title>
447
+ </title>
448
+ <docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
449
+ <docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
450
+ <docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
451
+ <docidentifier type="iso-tc">17301</docidentifier>
452
+ <contributor>
453
+ <role type="author"/>
454
+ <organization>
455
+ <name>ISO</name>
456
+ </organization>
457
+ </contributor>
458
+ <contributor>
459
+ <role type="publisher"/>
460
+ <organization>
461
+ <name>International Organization for Standardization</name>
462
+ <abbreviation>ISO</abbreviation>
463
+ </organization>
464
+ </contributor>
465
+ <contributor>
466
+ <role type="publisher"/>
467
+ <organization>
468
+ <name>International Electrotechnical Commission</name>
469
+ <abbreviation>IEC</abbreviation>
470
+ </organization>
471
+ </contributor>
472
+ <language>ru</language>
473
+ <script>Cyrl</script>
474
+ <status>
475
+ <stage abbreviation="IS">60</stage>
476
+ <substage>92</substage>
477
+ </status>
478
+ <copyright>
479
+ <from>2016</from>
480
+ <owner>
481
+ <organization>
482
+ <name>International Organization for Standardization</name>
483
+ </organization>
484
+ </owner>
485
+ </copyright>
486
+ <relation type="obsoletes">
487
+ <locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
488
+ <docidentifier>IEC 8121</docidentifier>
489
+ </relation>
490
+ <ext>
491
+ <doctype language="">international-standard</doctype>
492
+ <doctype language="fr">Standard International</doctype>
493
+ <editorialgroup>
494
+ <technical-committee number="34" type="ABC">Food products</technical-committee>
495
+ <subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
496
+ <workgroup number="3" type="GHI">Rice Group</workgroup>
497
+ </editorialgroup>
498
+ <ics><code>1.2.3</code></ics>
499
+ <ics><code>1.2.3</code></ics>
500
+ <structuredidentifier>
501
+ <project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
502
+ </strucuredidentifier>
503
+ <stagename>International standard</stagename>
504
+ </ext>
505
+ </bibdata>
506
+ </iso-standard>
507
+ INPUT
508
+ output = <<~OUTPUT
509
+ {:accesseddate=>"XXX",
510
+ :agency=>"ISO/IEC",
511
+ :circulateddate=>"XXX",
512
+ :confirmeddate=>"XXX",
513
+ :copieddate=>"XXX",
514
+ :createddate=>"XXX",
515
+ :docnumber=>"ISO/IEC/CD 17301-1-3",
516
+ :docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
517
+ :docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
518
+ :docsubtitle=>"Cereals and pulses&nbsp;&mdash; Specifications and test methods&nbsp;&mdash; Part&nbsp;1&ndash;3: Rice",
519
+ :docsubtitleintro=>"Cereals and pulses",
520
+ :docsubtitlemain=>"Specifications and test methods",
521
+ :docsubtitlepart=>"Rice",
522
+ :docsubtitlepartlabel=>"Part&nbsp;1&ndash;3",
523
+ :doctitle=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;&nbsp;&mdash; &#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;&nbsp;&mdash; Часть&nbsp;1&ndash;3: &#x420;&#x438;&#x441;",
524
+ :doctitleintro=>"&#x417;&#x435;&#x440;&#x43d;&#x43e;&#x432;&#x44b;&#x435; &#x438; &#x431;&#x43e;&#x431;&#x43e;&#x432;&#x44b;&#x435;",
525
+ :doctitlemain=>"&#x422;&#x435;&#x445;&#x43d;&#x438;&#x447;&#x435;&#x441;&#x43a;&#x438;&#x435; &#x445;&#x430;&#x440;&#x430;&#x43a;&#x442;&#x435;&#x440;&#x438;&#x441;&#x442;&#x438;&#x43a;&#x438; &#x438; &#x43c;&#x435;&#x442;&#x43e;&#x434;&#x44b; &#x438;&#x441;&#x43f;&#x44b;&#x442;&#x430;&#x43d;&#x438;&#x439;",
526
+ :doctitlepart=>"&#x420;&#x438;&#x441;",
527
+ :doctitlepartlabel=>"Часть&nbsp;1&ndash;3",
528
+ :doctype=>"International Standard",
529
+ :doctype_display=>"International Standard",
530
+ :docyear=>"2016",
531
+ :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
532
+ :ics=>"1.2.3, 1.2.3",
533
+ :implementeddate=>"XXX",
534
+ :issueddate=>"XXX",
535
+ :lang=>"ru",
536
+ :obsoleteddate=>"XXX",
537
+ :obsoletes=>"IEC 8121",
538
+ :obsoletes_part=>"3.1",
539
+ :publisheddate=>"XXX",
540
+ :publisher=>"International Organization for Standardization &#x438; International Electrotechnical Commission",
541
+ :receiveddate=>"XXX",
542
+ :sc=>"DEF 4",
543
+ :script=>"Latn",
544
+ :secretariat=>"XXX",
545
+ :stage=>"60",
546
+ :stage_int=>60,
547
+ :statusabbr=>"IS",
548
+ :tc=>"ABC 34",
549
+ :tc_docnumber=>["17301"],
550
+ :transmitteddate=>"XXX",
551
+ :unchangeddate=>"XXX",
552
+ :unpublished=>false,
553
+ :updateddate=>"XXX",
554
+ :vote_endeddate=>"XXX",
555
+ :vote_starteddate=>"XXX",
556
+ :wg=>"GHI 3"}
557
+ OUTPUT
558
+ expect(metadata(c.info(Nokogiri::XML(input),
559
+ nil))).to be_equivalent_to output
410
560
  end
411
561
  end
@@ -875,6 +875,7 @@ RSpec.describe IsoDoc do
875
875
  <bibdata type="standard">
876
876
  <status>
877
877
  <stage language="">30</stage>
878
+ <stage language='en'>Committee draft</stage>
878
879
  </status>
879
880
  </bibdata>
880
881
  <boilerplate>
@@ -562,6 +562,7 @@ RSpec.describe IsoDoc do
562
562
  <script current='true'>Latn</script>
563
563
  <status>
564
564
  <stage abbreviation='IS' language=''>60</stage>
565
+ <stage abbreviation='IS' language='en'>International standard</stage>
565
566
  <substage language=''>60</substage>
566
567
  </status>
567
568
  <copyright>