isodoc 1.2.2 → 1.2.7
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.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +64 -0
- data/isodoc.gemspec +3 -1
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -1
- data/lib/isodoc/base_style/all.css +5 -1
- data/lib/isodoc/base_style/metanorma_word.css +6 -0
- data/lib/isodoc/base_style/metanorma_word.scss +6 -0
- data/lib/isodoc/base_style/reset.css +5 -1
- data/lib/isodoc/base_style/reset.scss +6 -1
- data/lib/isodoc/convert.rb +1 -14
- data/lib/isodoc/function/blocks.rb +1 -0
- data/lib/isodoc/function/cleanup.rb +1 -1
- data/lib/isodoc/function/references.rb +4 -2
- data/lib/isodoc/function/section.rb +13 -1
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +4 -0
- data/lib/isodoc/function/utils.rb +1 -1
- data/lib/isodoc/html_function/html.rb +1 -0
- data/lib/isodoc/i18n.rb +8 -50
- data/lib/isodoc/metadata.rb +44 -111
- data/lib/isodoc/metadata_contributor.rb +90 -0
- data/lib/isodoc/metadata_date.rb +11 -0
- data/lib/isodoc/presentation_function/bibdata.rb +96 -0
- data/lib/isodoc/presentation_function/block.rb +14 -0
- data/lib/isodoc/presentation_function/inline.rb +27 -14
- data/lib/isodoc/presentation_xml_convert.rb +4 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +1 -0
- data/lib/isodoc/word_function/postprocess.rb +2 -2
- data/lib/isodoc/word_function/table.rb +3 -2
- data/lib/isodoc/xref.rb +1 -0
- data/lib/isodoc/xref/xref_anchor.rb +8 -3
- data/lib/isodoc/xref/xref_counter.rb +21 -7
- data/lib/isodoc/xref/xref_gen.rb +29 -6
- data/lib/isodoc/xref/xref_sect_gen.rb +1 -1
- data/lib/isodoc/xslfo_convert.rb +6 -1
- data/spec/assets/i18n.yaml +16 -0
- data/spec/isodoc/blocks_spec.rb +330 -215
- data/spec/isodoc/cleanup_spec.rb +3 -1
- data/spec/isodoc/i18n_spec.rb +68 -16
- data/spec/isodoc/inline_spec.rb +47 -5
- data/spec/isodoc/metadata_spec.rb +69 -19
- data/spec/isodoc/postproc_spec.rb +39 -3
- data/spec/isodoc/ref_spec.rb +3 -3
- data/spec/isodoc/section_spec.rb +134 -10
- data/spec/isodoc/table_spec.rb +306 -207
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/isodoc/xref_spec.rb +46 -18
- data/spec/spec_helper.rb +6 -0
- metadata +35 -7
- data/.github/workflows/macos.yml +0 -42
- data/.github/workflows/ubuntu.yml +0 -62
- data/.github/workflows/windows.yml +0 -44
data/spec/isodoc/cleanup_spec.rb
CHANGED
@@ -1084,6 +1084,7 @@ INPUT
|
|
1084
1084
|
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
1085
1085
|
[/TERMREF]</p>
|
1086
1086
|
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
1087
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION] [/TERMREF]</p>
|
1087
1088
|
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
1088
1089
|
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
1089
1090
|
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
@@ -1140,7 +1141,8 @@ INPUT
|
|
1140
1141
|
<a href='#ISO7301'>ISO 7301:2011, Clause 3.1</a>
|
1141
1142
|
, modified — The term "cargo rice" is shown as deprecated, and
|
1142
1143
|
Note 1 to entry is not included here; Termbase IEV, term ID xyz;
|
1143
|
-
Termbase IEV, term ID xyz, modified
|
1144
|
+
Termbase IEV, term ID xyz, modified; Termbase IEV, term ID xyz,
|
1145
|
+
modified — with adjustments]
|
1144
1146
|
</p>
|
1145
1147
|
<p class='TermNum' id='paddy'>1.2.</p>
|
1146
1148
|
<p class='Terms' style='text-align:left;'>paddy</p>
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -68,9 +68,9 @@ RSpec.describe IsoDoc do
|
|
68
68
|
INPUT
|
69
69
|
|
70
70
|
presxml = <<~"PRESXML"
|
71
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
71
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
72
72
|
<bibdata>
|
73
|
-
<language>en</language>
|
73
|
+
<language current="true">en</language>
|
74
74
|
</bibdata>
|
75
75
|
<preface>
|
76
76
|
<foreword obligation='informative'>
|
@@ -226,12 +226,12 @@ PRESXML
|
|
226
226
|
</body>
|
227
227
|
</html>
|
228
228
|
OUTPUT
|
229
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
229
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
|
230
230
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
231
231
|
end
|
232
232
|
|
233
233
|
it "defaults to English" do
|
234
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
234
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
235
235
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
236
236
|
<bibdata>
|
237
237
|
<language>tlh</language>
|
@@ -296,9 +296,9 @@ PRESXML
|
|
296
296
|
</iso-standard>
|
297
297
|
INPUT
|
298
298
|
<?xml version='1.0'?>
|
299
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
299
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
300
300
|
<bibdata>
|
301
|
-
<language>tlh</language>
|
301
|
+
<language current="true">tlh</language>
|
302
302
|
</bibdata>
|
303
303
|
<preface>
|
304
304
|
<foreword obligation='informative'>
|
@@ -449,9 +449,9 @@ PRESXML
|
|
449
449
|
INPUT
|
450
450
|
|
451
451
|
presxml = <<~"PRESXML"
|
452
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
452
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
453
453
|
<bibdata>
|
454
|
-
<language>fr</language>
|
454
|
+
<language current="true">fr</language>
|
455
455
|
</bibdata>
|
456
456
|
<preface>
|
457
457
|
<foreword obligation='informative'>
|
@@ -607,7 +607,7 @@ PRESXML
|
|
607
607
|
</body>
|
608
608
|
</html>
|
609
609
|
OUTPUT
|
610
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
610
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
|
611
611
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
612
612
|
end
|
613
613
|
|
@@ -689,10 +689,10 @@ PRESXML
|
|
689
689
|
INPUT
|
690
690
|
|
691
691
|
presxml = <<~"PRESXML"
|
692
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
692
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
693
693
|
<bibdata>
|
694
|
-
<language>zh</language>
|
695
|
-
<script>Hans</script>
|
694
|
+
<language current="true">zh</language>
|
695
|
+
<script current="true">Hans</script>
|
696
696
|
</bibdata>
|
697
697
|
<preface>
|
698
698
|
<foreword obligation='informative'>
|
@@ -862,16 +862,24 @@ PRESXML
|
|
862
862
|
</body>
|
863
863
|
</html>
|
864
864
|
OUTPUT
|
865
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
865
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
|
866
866
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
867
867
|
end
|
868
868
|
|
869
869
|
it "processes i18n file" do
|
870
|
+
mock_i18n
|
870
871
|
input = <<~"INPUT"
|
871
872
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
872
873
|
<bibdata>
|
873
874
|
<language>eo</language>
|
874
875
|
<script>Latn</script>
|
876
|
+
<status>
|
877
|
+
<stage>published</stage>
|
878
|
+
<substage>withdrawn</substage>
|
879
|
+
</status>
|
880
|
+
<ext>
|
881
|
+
<doctype>brochure</doctype>
|
882
|
+
</ext>
|
875
883
|
</bibdata>
|
876
884
|
<preface>
|
877
885
|
<foreword obligation="informative">
|
@@ -944,11 +952,48 @@ PRESXML
|
|
944
952
|
INPUT
|
945
953
|
|
946
954
|
presxml = <<~OUTPUT
|
947
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
955
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
948
956
|
<bibdata>
|
949
|
-
<language>eo</language>
|
950
|
-
<script>Latn</script>
|
957
|
+
<language current="true">eo</language>
|
958
|
+
<script current="true">Latn</script>
|
959
|
+
<status>
|
960
|
+
<stage language=''>published</stage>
|
961
|
+
<stage language='eo'>publikigita</stage>
|
962
|
+
<substage language=''>withdrawn</substage>
|
963
|
+
<substage language='eo'>fortirita</substage>
|
964
|
+
</status>
|
965
|
+
<ext>
|
966
|
+
<doctype language=''>brochure</doctype>
|
967
|
+
<doctype language='eo'>broŝuro</doctype>
|
968
|
+
</ext>
|
951
969
|
</bibdata>
|
970
|
+
<localized-strings>
|
971
|
+
<localized-string key='foreword' language='eo'>Antaŭparolo</localized-string>
|
972
|
+
<localized-string key='introduction' language='eo'>Enkonduko</localized-string>
|
973
|
+
<localized-string key='clause' language='eo'>klaŭzo</localized-string>
|
974
|
+
<localized-string key='table' language='eo'>Tabelo</localized-string>
|
975
|
+
<localized-string key='source' language='eo'>SOURCE</localized-string>
|
976
|
+
<localized-string key='modified' language='eo'>modified</localized-string>
|
977
|
+
<localized-string key='scope' language='eo'>Amplekso</localized-string>
|
978
|
+
<localized-string key='symbols' language='eo'>Simboloj kai mallongigitaj terminoj</localized-string>
|
979
|
+
<localized-string key='annex' language='eo'>Aldono</localized-string>
|
980
|
+
<localized-string key='normref' language='eo'>Normaj citaĵoj</localized-string>
|
981
|
+
<localized-string key='bibliography' language='eo'>Bibliografio</localized-string>
|
982
|
+
<localized-string key='inform_annex' language='eo'>informa</localized-string>
|
983
|
+
<localized-string key='all_parts' language='eo'>ĉiuj partoj</localized-string>
|
984
|
+
<localized-string key='norm_annex' language='eo'>normative</localized-string>
|
985
|
+
<localized-string key='locality.table' language='eo'>Tabelo</localized-string>
|
986
|
+
<localized-string key='doctype_dict.brochure' language='eo'>broŝuro</localized-string>
|
987
|
+
<localized-string key='doctype_dict.conference_proceedings' language='eo'>konferencaktoj</localized-string>
|
988
|
+
<localized-string key='stage_dict.published' language='eo'>publikigita</localized-string>
|
989
|
+
<localized-string key='substage_dict.withdrawn' language='eo'>fortirita</localized-string>
|
990
|
+
<localized-string key='array.0' language='eo'>elem1</localized-string>
|
991
|
+
<localized-string key='array.1' language='eo'>elem2</localized-string>
|
992
|
+
<localized-string key='array.2.elem3' language='eo'>elem4</localized-string>
|
993
|
+
<localized-string key='array.2.elem5' language='eo'>elem6</localized-string>
|
994
|
+
<localized-string key='language' language='eo'>eo</localized-string>
|
995
|
+
<localized-string key='script' language='eo'>Latn</localized-string>
|
996
|
+
</localized-strings>
|
952
997
|
<preface>
|
953
998
|
<foreword obligation="informative">
|
954
999
|
<title>Foreword</title>
|
@@ -1128,4 +1173,11 @@ PRESXML
|
|
1128
1173
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1129
1174
|
expect(xmlpp(IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
1130
1175
|
end
|
1176
|
+
|
1177
|
+
private
|
1178
|
+
|
1179
|
+
def mock_i18n
|
1180
|
+
allow_any_instance_of(::IsoDoc::I18n).to receive(:load_yaml).with("eo", "Latn", "spec/assets/i18n.yaml").and_return(YAML.load_file("spec/assets/i18n.yaml"))
|
1181
|
+
end
|
1182
|
+
|
1131
1183
|
end
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -20,7 +20,7 @@ RSpec.describe IsoDoc do
|
|
20
20
|
</iso-standard>
|
21
21
|
INPUT
|
22
22
|
<?xml version='1.0'?>
|
23
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
23
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
24
24
|
<sections>
|
25
25
|
<clause id='A'>
|
26
26
|
<title>1.</title>
|
@@ -57,6 +57,48 @@ INPUT
|
|
57
57
|
OUTPUT
|
58
58
|
end
|
59
59
|
|
60
|
+
it "droplocs xrefs" do
|
61
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
62
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
63
|
+
<sections>
|
64
|
+
<clause id="A">
|
65
|
+
<formula id="B">
|
66
|
+
</formula>
|
67
|
+
</clause>
|
68
|
+
<clause id="C">
|
69
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
70
|
+
This is <xref target="A" droploc="true"/> and <xref target="B" droploc="true"/>.</p>
|
71
|
+
</clause>
|
72
|
+
</sections>
|
73
|
+
</iso-standard>
|
74
|
+
INPUT
|
75
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
76
|
+
<sections>
|
77
|
+
<clause id='A'>
|
78
|
+
<title>1.</title>
|
79
|
+
<formula id='B'>
|
80
|
+
<name>1</name>
|
81
|
+
</formula>
|
82
|
+
</clause>
|
83
|
+
<clause id='C'>
|
84
|
+
<title>2.</title>
|
85
|
+
<p>
|
86
|
+
This is
|
87
|
+
<xref target='A'>klaŭzo 1</xref>
|
88
|
+
and
|
89
|
+
<xref target='B'>klaŭzo 1, Formula (1)</xref>
|
90
|
+
. This is
|
91
|
+
<xref target='A' droploc='true'>1</xref>
|
92
|
+
and
|
93
|
+
<xref target='B' droploc='true'>(1)</xref>
|
94
|
+
.
|
95
|
+
</p>
|
96
|
+
</clause>
|
97
|
+
</sections>
|
98
|
+
</iso-standard>
|
99
|
+
OUTPUT
|
100
|
+
end
|
101
|
+
|
60
102
|
it "processes inline formatting" do
|
61
103
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
62
104
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -238,7 +280,7 @@ end
|
|
238
280
|
</iso-standard>
|
239
281
|
INPUT
|
240
282
|
presxml = <<~OUTPUT
|
241
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
283
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
242
284
|
<preface><foreword>
|
243
285
|
<p>
|
244
286
|
<ul>
|
@@ -606,7 +648,7 @@ OUTPUT
|
|
606
648
|
</iso-standard>
|
607
649
|
INPUT
|
608
650
|
presxml = <<~OUTPUT
|
609
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
651
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
610
652
|
<preface><foreword>
|
611
653
|
<p>
|
612
654
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">ISO 712</eref>
|
@@ -728,7 +770,7 @@ html = <<~OUTPUT
|
|
728
770
|
</iso-standard>
|
729
771
|
INPUT
|
730
772
|
presxml = <<~OUTPUT
|
731
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
773
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
732
774
|
<preface>
|
733
775
|
<foreword>
|
734
776
|
<p>
|
@@ -955,7 +997,7 @@ it "cases xrefs" do
|
|
955
997
|
</iso-standard>
|
956
998
|
INPUT
|
957
999
|
<?xml version='1.0'?>
|
958
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1000
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
959
1001
|
<sections>
|
960
1002
|
<clause id='A'>
|
961
1003
|
<title>1.</title>
|
@@ -7,7 +7,7 @@ RSpec.describe IsoDoc do
|
|
7
7
|
arr = c.convert_init(<<~"INPUT", "test", false)
|
8
8
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
9
9
|
INPUT
|
10
|
-
expect(
|
10
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
11
11
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
12
12
|
<bibdata type="standard">
|
13
13
|
<title>The Incredible Mr Ripley</title>
|
@@ -18,6 +18,8 @@ RSpec.describe IsoDoc do
|
|
18
18
|
<uri type="pdf">URL D</uri>
|
19
19
|
<uri type="doc">URL E</uri>
|
20
20
|
<docidentifier>17301-1</docidentifier>
|
21
|
+
<docidentifier type="ISBN">ISBN 13</docidentifier>
|
22
|
+
<docidentifier type="ISBN10">ISBN 10</docidentifier>
|
21
23
|
<docnumber>17301</docnumber>
|
22
24
|
<date type="published"><on>2011</on></date>
|
23
25
|
<date type="accessed"><on>2012</on></date>
|
@@ -73,6 +75,9 @@ RSpec.describe IsoDoc do
|
|
73
75
|
</name>
|
74
76
|
</person>
|
75
77
|
</contributor>
|
78
|
+
<note type="title-footnote"><p>A footnote</p></note>
|
79
|
+
<note type="iso"><p>A note</p></note>
|
80
|
+
<note type="title-footnote"><p>Another footnote</p></note>
|
76
81
|
<language>en</language>
|
77
82
|
<script>Latn</script>
|
78
83
|
<status>
|
@@ -111,25 +116,32 @@ INPUT
|
|
111
116
|
:docnumeric=>"17301",
|
112
117
|
:doctitle=>"Cereals and pulses",
|
113
118
|
:doctype=>"International Standard",
|
119
|
+
:doctype_display=>"International Standard",
|
114
120
|
:docyear=>"2016",
|
115
121
|
:draft=>"0.4",
|
116
122
|
:draftinfo=>" (draft 0.4, 2016-05-01)",
|
117
123
|
:edition=>"2",
|
118
124
|
:html=>"URL B",
|
119
125
|
:implementeddate=>"XXX",
|
126
|
+
:isbn=>"ISBN 13",
|
127
|
+
:isbn10=>"ISBN 10",
|
120
128
|
:issueddate=>"XXX",
|
121
129
|
:iteration=>"2",
|
122
130
|
:keywords=>["KW2", "KW1", "KW3"],
|
131
|
+
:lang=>"en",
|
123
132
|
:obsoleteddate=>"2014",
|
124
133
|
:pdf=>"URL D",
|
125
134
|
:publisheddate=>"2011",
|
126
|
-
:publisher=>"",
|
127
135
|
:receiveddate=>"XXX",
|
128
136
|
:revdate=>"2016-05-01",
|
129
137
|
:revdate_monthyear=>"May 2016",
|
130
|
-
:
|
138
|
+
:script=>"Latn",
|
139
|
+
:stage=>"Committee Draft",
|
140
|
+
:stage_display=>"Committee Draft",
|
131
141
|
:stageabbr=>"CD",
|
132
142
|
:substage=>"Withdrawn",
|
143
|
+
:substage_display=>"Withdrawn",
|
144
|
+
:title_footnote=>["A footnote", "Another footnote"],
|
133
145
|
:transmitteddate=>"2020",
|
134
146
|
:unchangeddate=>"2019",
|
135
147
|
:unpublished=>true,
|
@@ -146,7 +158,7 @@ OUTPUT
|
|
146
158
|
arr = c.convert_init(<<~"INPUT", "test", false)
|
147
159
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
148
160
|
INPUT
|
149
|
-
expect(
|
161
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
150
162
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
151
163
|
<bibdata type="standard">
|
152
164
|
<title language="fr" format="text/plain">Céréales et légumineuses</ti>
|
@@ -167,7 +179,15 @@ OUTPUT
|
|
167
179
|
<role type="publisher"/>
|
168
180
|
<organization>
|
169
181
|
<name>International Organization for Standardization</name>
|
182
|
+
<subdivision>Subdivision</subdivision>
|
170
183
|
<abbreviation>ISO</abbreviation>
|
184
|
+
<address>
|
185
|
+
<formattedAddress>1 Infinity Loop + California</formattedAddress>
|
186
|
+
</address>
|
187
|
+
<phone>3333333</phone>
|
188
|
+
<phone type='fax'>4444444</phone>
|
189
|
+
<email>x@example.com</email>
|
190
|
+
<uri>http://www.example.com</uri>
|
171
191
|
</organization>
|
172
192
|
</contributor>
|
173
193
|
<contributor>
|
@@ -213,8 +233,6 @@ OUTPUT
|
|
213
233
|
INPUT
|
214
234
|
{:accesseddate=>"XXX",
|
215
235
|
:agency=>"ISO/IEC/IEEE",
|
216
|
-
:authors=>[],
|
217
|
-
:authors_affiliations=>{},
|
218
236
|
:circulateddate=>"XXX",
|
219
237
|
:confirmeddate=>"XXX",
|
220
238
|
:copieddate=>"XXX",
|
@@ -223,23 +241,31 @@ INPUT
|
|
223
241
|
:docnumeric=>"17301",
|
224
242
|
:doctitle=>"Cereals and pulses",
|
225
243
|
:doctype=>"International Standard",
|
244
|
+
:doctype_display=>"International Standard",
|
226
245
|
:docyear=>"2016",
|
227
246
|
:draft=>"12",
|
228
247
|
:draftinfo=>" (draft 12, 2016-05)",
|
229
|
-
:edition=>nil,
|
230
248
|
:implementeddate=>"XXX",
|
231
249
|
:issueddate=>"XXX",
|
232
|
-
:
|
250
|
+
:lang=>"en",
|
233
251
|
:obsoleteddate=>"XXX",
|
234
252
|
:obsoletes=>"IEC 8121",
|
235
253
|
:obsoletes_part=>"3.1",
|
236
254
|
:partof=>"IEC 8122",
|
255
|
+
:pub_address=>"1 Infinity Loop + California",
|
256
|
+
:pub_email=>"x@example.com",
|
257
|
+
:pub_fax=>"4444444",
|
258
|
+
:pub_phone=>"3333333",
|
259
|
+
:pub_uri=>"http://www.example.com",
|
237
260
|
:publisheddate=>"2011-01",
|
238
261
|
:publisher=>"International Organization for Standardization, International Electrotechnical Commission and Institute of Electrical and Electronics Engineers",
|
239
262
|
:receiveddate=>"XXX",
|
240
263
|
:revdate=>"2016-05",
|
241
264
|
:revdate_monthyear=>"May 2016",
|
265
|
+
:script=>"Latn",
|
242
266
|
:stage=>"Published",
|
267
|
+
:stage_display=>"Published",
|
268
|
+
:subdivision=>"Subdivision",
|
243
269
|
:transmitteddate=>"XXX",
|
244
270
|
:unchangeddate=>"XXX",
|
245
271
|
:unpublished=>false,
|
@@ -256,10 +282,21 @@ OUTPUT
|
|
256
282
|
<bibdata type="standard">
|
257
283
|
<language>fr</language>
|
258
284
|
<script>Latn</script>
|
285
|
+
<status>
|
286
|
+
<stage lang="">Committee Draft</stage>
|
287
|
+
<stage lang=fr">Projet de comité</stage>
|
288
|
+
<substage lang="">Withdrawn</substage>
|
289
|
+
<substage lang="fr">Rétiré</substage>
|
290
|
+
<iteration>2</iteration>
|
291
|
+
</status>
|
292
|
+
<ext>
|
293
|
+
<doctype lang="">international-standard</doctype>
|
294
|
+
<doctype lang="fr">Standard international</doctype>
|
295
|
+
</ext>
|
259
296
|
</bibdata>
|
260
297
|
</iso-standard>
|
261
298
|
INPUT
|
262
|
-
expect(
|
299
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
263
300
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
264
301
|
<bibdata type="standard">
|
265
302
|
<title language="fr" format="text/plain">Céréales et légumineuses</ti>
|
@@ -292,7 +329,13 @@ OUTPUT
|
|
292
329
|
</contributor>
|
293
330
|
<language>fr</language>
|
294
331
|
<script>Latn</script>
|
295
|
-
<status
|
332
|
+
<status>
|
333
|
+
<stage language="">Committee Draft</stage>
|
334
|
+
<stage language="fr">Projet de comité</stage>
|
335
|
+
<substage language="">Withdrawn</substage>
|
336
|
+
<substage language="fr">Rétiré</substage>
|
337
|
+
<iteration>2</iteration>
|
338
|
+
</status>
|
296
339
|
<copyright>
|
297
340
|
<from>2016</from>
|
298
341
|
<owner>
|
@@ -301,37 +344,44 @@ OUTPUT
|
|
301
344
|
</organization>
|
302
345
|
</owner>
|
303
346
|
</copyright>
|
347
|
+
<ext>
|
348
|
+
<doctype language="">international-standard</doctype>
|
349
|
+
<doctype language="fr">Standard international</doctype>
|
350
|
+
</ext>
|
304
351
|
</bibdata>
|
305
352
|
</iso-standard>
|
306
353
|
INPUT
|
307
354
|
{:accesseddate=>"XXX",
|
308
355
|
:agency=>"ISO/IEC",
|
309
|
-
:authors=>[],
|
310
|
-
:authors_affiliations=>{},
|
311
356
|
:circulateddate=>"XXX",
|
312
357
|
:confirmeddate=>"XXX",
|
313
358
|
:copieddate=>"XXX",
|
314
359
|
:createddate=>"XXX",
|
315
360
|
:docnumber=>"17301-1-3",
|
316
361
|
:docnumeric=>"17301",
|
317
|
-
:doctitle=>"
|
362
|
+
:doctitle=>"Céréales et légumineuses",
|
363
|
+
:doctype=>"International Standard",
|
364
|
+
:doctype_display=>"Standard International",
|
318
365
|
:docyear=>"2016",
|
319
|
-
:draft=>nil,
|
320
|
-
:draftinfo=>"",
|
321
|
-
:edition=>nil,
|
322
366
|
:implementeddate=>"XXX",
|
323
367
|
:issueddate=>"XXX",
|
324
|
-
:
|
368
|
+
:iteration=>"2",
|
369
|
+
:lang=>"fr",
|
325
370
|
:obsoleteddate=>"XXX",
|
326
371
|
:publisheddate=>"2011-01",
|
327
372
|
:publisher=>"International Organization for Standardization et International Electrotechnical Commission",
|
328
373
|
:receiveddate=>"XXX",
|
329
374
|
:revdate=>"2016-05",
|
330
375
|
:revdate_monthyear=>"Mai 2016",
|
331
|
-
:
|
376
|
+
:script=>"Latn",
|
377
|
+
:stage=>"Committee Draft",
|
378
|
+
:stage_display=>"Projet De Comité",
|
379
|
+
:stageabbr=>"CD",
|
380
|
+
:substage=>"Withdrawn",
|
381
|
+
:substage_display=>"Rétiré",
|
332
382
|
:transmitteddate=>"XXX",
|
333
383
|
:unchangeddate=>"XXX",
|
334
|
-
:unpublished=>
|
384
|
+
:unpublished=>true,
|
335
385
|
:updateddate=>"XXX",
|
336
386
|
:vote_endeddate=>"XXX",
|
337
387
|
:vote_starteddate=>"XXX"}
|