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.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/i18n-en.yaml +22 -0
- data/lib/isodoc/iso/i18n-fr.yaml +22 -1
- data/lib/isodoc/iso/i18n-ru.yaml +42 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +21 -1
- data/lib/isodoc/iso/i18n.rb +1 -0
- data/lib/isodoc/iso/iso.amendment.xsl +510 -297
- data/lib/isodoc/iso/iso.international-standard.xsl +510 -297
- data/lib/isodoc/iso/metadata.rb +12 -2
- data/lib/metanorma/iso/boilerplate-fr.xml +3 -3
- data/lib/metanorma/iso/boilerplate-ru.xml +39 -0
- data/lib/metanorma/iso/boilerplate.xml +3 -3
- data/lib/metanorma/iso/cleanup.rb +5 -1
- data/lib/metanorma/iso/front.rb +1 -1
- data/lib/metanorma/iso/front_id.rb +1 -0
- data/lib/metanorma/iso/isodoc.rng +73 -3
- data/lib/metanorma/iso/validate.rb +1 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/isodoc/amd_spec.rb +10 -5
- data/spec/isodoc/i18n_spec.rb +350 -9
- data/spec/isodoc/metadata_spec.rb +153 -3
- data/spec/isodoc/postproc_spec.rb +1 -0
- data/spec/isodoc/section_spec.rb +1 -0
- data/spec/metanorma/base_spec.rb +434 -326
- metadata +4 -2
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -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
|
-
|
89
|
-
|
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
|
-
|
348
|
-
|
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
|
-
|
522
|
-
|
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
|
+
Международный стандарт
|
840
|
+
</stage>
|
841
|
+
</status>
|
842
|
+
<language current='true'>ru</language>
|
843
|
+
<ext>
|
844
|
+
<doctype language=''>international-standard</doctype>
|
845
|
+
<doctype language='ru'>
|
846
|
+
Международный Стандарт
|
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>Дополнение A</strong>
|
905
|
+
<br/>(нормативное)
|
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"> Приложение 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  Introduction</h1>
|
943
|
+
<div id="C">
|
944
|
+
<h2>0.1  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  Scope</h1>
|
951
|
+
<p id="E">Text</p>
|
952
|
+
</div>
|
953
|
+
<div>
|
954
|
+
<h1>2  Normative References</h1>
|
955
|
+
</div>
|
956
|
+
<div id="H">
|
957
|
+
<h1>3  Terms, definitions, symbols and abbreviated terms</h1>
|
958
|
+
<div id="I">
|
959
|
+
<h2>3.1  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  </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  Clause 4</h1>
|
986
|
+
<div id="N">
|
987
|
+
<h2>5.1  Introduction</h2>
|
988
|
+
</div>
|
989
|
+
<div id="O">
|
990
|
+
<h2>5.2  Clause 4.2</h2>
|
991
|
+
</div>
|
992
|
+
</div>
|
993
|
+
<br/>
|
994
|
+
<div class="Section3" id="P">
|
995
|
+
<h1 class="Annex">
|
996
|
+
<b>Дополнение A</b>
|
997
|
+
<br/>(нормативное)
|
998
|
+
<br/>
|
999
|
+
<br/>
|
1000
|
+
<b>Annex</b></h1>
|
1001
|
+
<div id="Q">
|
1002
|
+
<h2>A.1  Annex A.1</h2>
|
1003
|
+
<div id="Q1">
|
1004
|
+
<h3>A.1.1  Annex A.1a</h3>
|
1005
|
+
</div>
|
1006
|
+
</div>
|
1007
|
+
<div id="Q2">
|
1008
|
+
<h2>Приложение 1  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
|
-
|
806
|
-
|
807
|
-
|
1138
|
+
<status>
|
1139
|
+
<stage abbreviation='IS' language=''>60</stage>
|
1140
|
+
<stage abbreviation='IS' language='zh'>国际标准</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'>国际标准</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
|
-
|
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
|
-
|
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
|
-
|
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 — Specifications and test methods — Part 1–3: Rice",
|
519
|
+
:docsubtitleintro=>"Cereals and pulses",
|
520
|
+
:docsubtitlemain=>"Specifications and test methods",
|
521
|
+
:docsubtitlepart=>"Rice",
|
522
|
+
:docsubtitlepartlabel=>"Part 1–3",
|
523
|
+
:doctitle=>"Зерновые и бобовые — Технические характеристики и методы испытаний — Часть 1–3: Рис",
|
524
|
+
:doctitleintro=>"Зерновые и бобовые",
|
525
|
+
:doctitlemain=>"Технические характеристики и методы испытаний",
|
526
|
+
:doctitlepart=>"Рис",
|
527
|
+
:doctitlepartlabel=>"Часть 1–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 и 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
|
data/spec/isodoc/section_spec.rb
CHANGED
@@ -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>
|