metanorma-standoc 2.1.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/metanorma/standoc/blocks_notes.rb +1 -1
  3. data/lib/metanorma/standoc/cleanup_footnotes.rb +19 -17
  4. data/lib/metanorma/standoc/cleanup_ref.rb +16 -0
  5. data/lib/metanorma/standoc/cleanup_section.rb +6 -0
  6. data/lib/metanorma/standoc/converter.rb +2 -0
  7. data/lib/metanorma/standoc/isodoc.rng +16 -0
  8. data/lib/metanorma/standoc/macros_note.rb +26 -0
  9. data/lib/metanorma/standoc/ref.rb +3 -1
  10. data/lib/metanorma/standoc/ref_sect.rb +3 -1
  11. data/lib/metanorma/standoc/ref_utility.rb +20 -5
  12. data/lib/metanorma/standoc/version.rb +1 -1
  13. data/metanorma-standoc.gemspec +1 -1
  14. data/spec/examples/datamodel/address_class_profile.presentation.xml +14 -0
  15. data/spec/metanorma/blocks_spec.rb +5 -0
  16. data/spec/metanorma/cleanup_sections_spec.rb +55 -4
  17. data/spec/metanorma/macros_spec.rb +32 -6
  18. data/spec/metanorma/refs_dl_spec.rb +18 -7
  19. data/spec/metanorma/refs_spec.rb +278 -332
  20. data/spec/spec_helper.rb +1 -1
  21. data/spec/vcr_cassettes/bsi16341.yml +58 -72
  22. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +98 -98
  23. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +13 -13
  24. data/spec/vcr_cassettes/hide_refs.yml +62 -62
  25. data/spec/vcr_cassettes/isobib_get_123.yml +11 -11
  26. data/spec/vcr_cassettes/isobib_get_123_1.yml +26 -26
  27. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +32 -32
  28. data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
  29. data/spec/vcr_cassettes/isobib_get_124.yml +12 -12
  30. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +20 -20
  31. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +56 -56
  32. metadata +5 -4
@@ -3,110 +3,237 @@ require "relaton_iso"
3
3
  require "relaton_ietf"
4
4
 
5
5
  RSpec.describe Metanorma::Standoc do
6
- it "processes simple ISO reference" do
7
- input = <<~INPUT
8
- #{ASCIIDOC_BLANK_HDR}
9
- [bibliography]
10
- == Normative References
6
+ it "processes simple ISO reference" do
7
+ input = <<~INPUT
8
+ #{ASCIIDOC_BLANK_HDR}
9
+ [bibliography]
10
+ == Normative References
11
11
 
12
- * [[[iso123,ISO 123]]] _Standard_
13
- * [[[iso124,(1)ISO 123]]] _Standard_
14
- INPUT
15
- output = <<~OUTPUT
12
+ * [[[iso123,ISO 123]]] _Standard_
13
+ * [[[iso124,(1)ISO 123]]] _Standard_
14
+ INPUT
15
+ output = <<~OUTPUT
16
+ #{BLANK_HDR}
17
+ <sections>
18
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
19
+ <title>Normative references</title>
20
+ #{NORM_REF_BOILERPLATE}
21
+ <bibitem id="iso123" type="standard">
22
+ <title format="text/plain">Standard</title>
23
+ <docidentifier>ISO 123</docidentifier>
24
+ <docnumber>123</docnumber>
25
+ <contributor>
26
+ <role type="publisher"/>
27
+ <organization>
28
+ <name>ISO</name>
29
+ </organization>
30
+ </contributor>
31
+ </bibitem>
32
+ <bibitem id='iso124' type='standard'>
33
+ <title format='text/plain'>Standard</title>
34
+ <docidentifier type='metanorma'>[1]</docidentifier>
35
+ <docidentifier>ISO 123</docidentifier>
36
+ <docnumber>123</docnumber>
37
+ <contributor>
38
+ <role type='publisher'/>
39
+ <organization>
40
+ <name>ISO</name>
41
+ </organization>
42
+ </contributor>
43
+ </bibitem>
44
+ </references>
45
+ </bibliography>
46
+ </standard-document>
47
+ OUTPUT
48
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
49
+ .to be_equivalent_to xmlpp(output)
50
+ end
51
+
52
+ it "processes simple ISO reference with date range" do
53
+ input = <<~INPUT
54
+ #{ASCIIDOC_BLANK_HDR}
55
+ [bibliography]
56
+ == Normative References
57
+
58
+ * [[[iso123,ISO 123:1066-1067]]] _Standard_
59
+ * [[[iso124,(1)ISO 123:1066-1067]]] _Standard_
60
+ INPUT
61
+ output = <<~OUTPUT
16
62
  #{BLANK_HDR}
17
63
  <sections>
18
64
  </sections><bibliography><references id="_" obligation="informative" normative="true">
19
65
  <title>Normative references</title>
20
66
  #{NORM_REF_BOILERPLATE}
21
67
  <bibitem id="iso123" type="standard">
22
- <title format="text/plain">Standard</title>
23
- <docidentifier>ISO 123</docidentifier>
68
+ <title format="text/plain">Standard</title>
69
+ <docidentifier>ISO 123:1066-1067</docidentifier>
24
70
  <docnumber>123</docnumber>
25
- <contributor>
26
- <role type="publisher"/>
27
- <organization>
28
- <name>ISO</name>
29
- </organization>
30
- </contributor>
71
+ <date type="published">
72
+ <from>1066</from>
73
+ <to>1067</to>
74
+ </date>
75
+ <contributor>
76
+ <role type="publisher"/>
77
+ <organization>
78
+ <name>ISO</name>
79
+ </organization>
80
+ </contributor>
31
81
  </bibitem>
32
- <bibitem id='iso124' type='standard'>
33
- <title format='text/plain'>Standard</title>
34
- <docidentifier type='metanorma'>[1]</docidentifier>
35
- <docidentifier>ISO 123</docidentifier>
82
+ <bibitem id="iso124" type="standard">
83
+ <title format="text/plain">Standard</title>
84
+ <docidentifier type='metanorma'>[1]</docidentifier>
85
+ <docidentifier>ISO 123:1066-1067</docidentifier>
36
86
  <docnumber>123</docnumber>
87
+ <date type="published">
88
+ <from>1066</from>
89
+ <to>1067</to>
90
+ </date>
37
91
  <contributor>
38
- <role type='publisher'/>
92
+ <role type="publisher"/>
39
93
  <organization>
40
94
  <name>ISO</name>
41
95
  </organization>
42
96
  </contributor>
43
- </bibitem>
97
+ </bibitem>
44
98
  </references>
45
99
  </bibliography>
46
100
  </standard-document>
47
- OUTPUT
48
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
49
- .to be_equivalent_to xmlpp(output)
50
- end
101
+ OUTPUT
102
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
103
+ .to be_equivalent_to xmlpp(output)
104
+ end
51
105
 
52
- it "processes simple ISO reference with date range" do
53
- input = <<~INPUT
54
- #{ASCIIDOC_BLANK_HDR}
55
- [bibliography]
56
- == Normative References
106
+ it "repairs simple fetched ISO reference" do
107
+ mock_isobib_get_123_no_docid(2)
108
+ mock_isobib_get_123_no_docid_lbl(2)
109
+ input = <<~"INPUT"
110
+ #{ISOBIB_BLANK_HDR}
57
111
 
58
- * [[[iso123,ISO 123:1066-1067]]] _Standard_
59
- * [[[iso124,(1)ISO 123:1066-1067]]] _Standard_
60
- INPUT
61
- output = <<~OUTPUT
62
- #{BLANK_HDR}
63
- <sections>
64
- </sections><bibliography><references id="_" obligation="informative" normative="true">
65
- <title>Normative references</title>
66
- #{NORM_REF_BOILERPLATE}
67
- <bibitem id="iso123" type="standard">
68
- <title format="text/plain">Standard</title>
69
- <docidentifier>ISO 123:1066-1067</docidentifier>
70
- <docnumber>123</docnumber>
71
- <date type="published">
72
- <from>1066</from>
73
- <to>1067</to>
74
- </date>
75
- <contributor>
76
- <role type="publisher"/>
77
- <organization>
78
- <name>ISO</name>
79
- </organization>
80
- </contributor>
81
- </bibitem>
82
- <bibitem id="iso124" type="standard">
83
- <title format="text/plain">Standard</title>
84
- <docidentifier type='metanorma'>[1]</docidentifier>
85
- <docidentifier>ISO 123:1066-1067</docidentifier>
86
- <docnumber>123</docnumber>
87
- <date type="published">
88
- <from>1066</from>
89
- <to>1067</to>
90
- </date>
91
- <contributor>
92
- <role type="publisher"/>
93
- <organization>
94
- <name>ISO</name>
95
- </organization>
96
- </contributor>
97
- </bibitem>
112
+ <<iso123>>
113
+ <<iso124>>
98
114
 
99
- </references>
100
- </bibliography>
115
+ [bibliography]
116
+ == Normative References
117
+
118
+ * [[[iso123,ISO 123]]] _Standard_
119
+ * [[[iso124,(1)ISO 123]]] _Standard_
120
+ INPUT
121
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
122
+ .to be_equivalent_to xmlpp(<<~"OUTPUT")
123
+ #{BLANK_HDR}
124
+ <preface>
125
+ <foreword id='_' obligation='informative'>
126
+ <title>Foreword</title>
127
+ <p id='_'>
128
+ <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
129
+ <eref type='inline' bibitemid='iso124' citeas='[1]'/>
130
+ </p>
131
+ </foreword>
132
+ </preface>
133
+ <sections>
134
+ </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
135
+ #{NORM_REF_BOILERPLATE}
136
+ <bibitem type="standard" id="iso123">
137
+ <uri type="src">https://www.iso.org/standard/23281.html</uri>
138
+ <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
139
+ <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
140
+ <date type="published">
141
+ <on>2001</on>
142
+ </date>
143
+ <contributor>
144
+ <role type="publisher"/>
145
+ <organization>
146
+ <name>International Organization for Standardization</name>
147
+ <abbreviation>ISO</abbreviation>
148
+ <uri>www.iso.org</uri>
149
+ </organization>
150
+ </contributor>
151
+ <edition>3</edition>
152
+ <language>en</language>
153
+ <language>fr</language>
154
+ <script>Latn</script>
155
+ <status>
156
+ <stage>Published</stage>
157
+ </status>
158
+ <copyright>
159
+ <from>2001</from>
160
+ <owner>
161
+ <organization>
162
+ <name>ISO</name>
163
+ <abbreviation/>
164
+ </organization>
165
+ </owner>
166
+ </copyright>
167
+ <relation type="obsoletes">
168
+ <bibitem type="standard">
169
+ <formattedref format="text/plain">ISO 123:1985</formattedref>
170
+ </bibitem>
171
+ </relation>
172
+ <relation type="updates">
173
+ <bibitem type="standard">
174
+ <formattedref format="text/plain">ISO 123:2001</formattedref>
175
+ </bibitem>
176
+ </relation>
177
+ <docidentifier>ISO 123</docidentifier>
178
+ <title><em>Standard</em></title>
179
+ </bibitem>
180
+ <bibitem type="standard" id="iso124">
181
+ <uri type="src">https://www.iso.org/standard/23281.html</uri>
182
+ <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
183
+ <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
184
+ <date type="published">
185
+ <on>2001</on>
186
+ </date>
187
+ <contributor>
188
+ <role type="publisher"/>
189
+ <organization>
190
+ <name>International Organization for Standardization</name>
191
+ <abbreviation>ISO</abbreviation>
192
+ <uri>www.iso.org</uri>
193
+ </organization>
194
+ </contributor>
195
+ <edition>3</edition>
196
+ <language>en</language>
197
+ <language>fr</language>
198
+ <script>Latn</script>
199
+ <status>
200
+ <stage>Published</stage>
201
+ </status>
202
+ <copyright>
203
+ <from>2001</from>
204
+ <owner>
205
+ <organization>
206
+ <name>ISO</name>
207
+ <abbreviation/>
208
+ </organization>
209
+ </owner>
210
+ </copyright>
211
+ <relation type="obsoletes">
212
+ <bibitem type="standard">
213
+ <formattedref format="text/plain">ISO 123:1985</formattedref>
214
+ </bibitem>
215
+ </relation>
216
+ <relation type="updates">
217
+ <bibitem type="standard">
218
+ <formattedref format="text/plain">ISO 123:2001</formattedref>
219
+ </bibitem>
220
+ </relation>
221
+ <docidentifier>ISO 123</docidentifier>
222
+ <docidentifier type='metanorma'>[1]</docidentifier>
223
+ <title><em>Standard</em></title>
224
+ </bibitem>
225
+ </references></bibliography>
101
226
  </standard-document>
102
- OUTPUT
103
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
104
- .to be_equivalent_to xmlpp(output)
105
- end
227
+ OUTPUT
228
+ expect do
229
+ Asciidoctor.convert(input, *OPTIONS)
230
+ end.to output(/ERROR: No document identifier retrieved for ISO 123/)
231
+ .to_stderr
232
+ end
106
233
 
107
- it "repairs simple fetched ISO reference" do
108
- mock_isobib_get_123_no_docid(2)
109
- mock_isobib_get_123_no_docid_lbl(2)
234
+ it "customises docidentifier by language" do
235
+ mock_rfcbib_get_rfc8342(3)
236
+ mock_rfcbib_get_rfc8343(3)
110
237
  input = <<~"INPUT"
111
238
  #{ISOBIB_BLANK_HDR}
112
239
 
@@ -116,120 +243,21 @@ RSpec.describe Metanorma::Standoc do
116
243
  [bibliography]
117
244
  == Normative References
118
245
 
119
- * [[[iso123,ISO 123]]] _Standard_
120
- * [[[iso124,(1)ISO 123]]] _Standard_
246
+ * [[[iso123,ISO 8342]]] _Standard_
247
+ * [[[iso124,ISO 8343]]] _Standard_
121
248
  INPUT
122
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
123
- .to be_equivalent_to xmlpp(<<~"OUTPUT")
124
- #{BLANK_HDR}
125
- <preface>
126
- <foreword id='_' obligation='informative'>
127
- <title>Foreword</title>
128
- <p id='_'>
129
- <eref type='inline' bibitemid='iso123' citeas='ISO 123'/>
130
- <eref type='inline' bibitemid='iso124' citeas='[1]'/>
131
- </p>
132
- </foreword>
133
- </preface>
134
- <sections>
135
- </sections><bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
136
- #{NORM_REF_BOILERPLATE}
137
- <bibitem type="standard" id="iso123">
138
- <uri type="src">https://www.iso.org/standard/23281.html</uri>
139
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
140
- <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
141
- <date type="published">
142
- <on>2001</on>
143
- </date>
144
- <contributor>
145
- <role type="publisher"/>
146
- <organization>
147
- <name>International Organization for Standardization</name>
148
- <abbreviation>ISO</abbreviation>
149
- <uri>www.iso.org</uri>
150
- </organization>
151
- </contributor>
152
- <edition>3</edition>
153
- <language>en</language>
154
- <language>fr</language>
155
- <script>Latn</script>
156
- <status>
157
- <stage>Published</stage>
158
- </status>
159
- <copyright>
160
- <from>2001</from>
161
- <owner>
162
- <organization>
163
- <name>ISO</name>
164
- <abbreviation/>
165
- </organization>
166
- </owner>
167
- </copyright>
168
- <relation type="obsoletes">
169
- <bibitem type="standard">
170
- <formattedref format="text/plain">ISO 123:1985</formattedref>
171
- </bibitem>
172
- </relation>
173
- <relation type="updates">
174
- <bibitem type="standard">
175
- <formattedref format="text/plain">ISO 123:2001</formattedref>
176
- </bibitem>
177
- </relation>
178
- <docidentifier>ISO 123</docidentifier>
179
- <title><em>Standard</em></title>
180
- </bibitem>
181
- <bibitem type="standard" id="iso124">
182
- <uri type="src">https://www.iso.org/standard/23281.html</uri>
183
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
184
- <uri type="rss">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
185
- <date type="published">
186
- <on>2001</on>
187
- </date>
188
- <contributor>
189
- <role type="publisher"/>
190
- <organization>
191
- <name>International Organization for Standardization</name>
192
- <abbreviation>ISO</abbreviation>
193
- <uri>www.iso.org</uri>
194
- </organization>
195
- </contributor>
196
- <edition>3</edition>
197
- <language>en</language>
198
- <language>fr</language>
199
- <script>Latn</script>
200
- <status>
201
- <stage>Published</stage>
202
- </status>
203
- <copyright>
204
- <from>2001</from>
205
- <owner>
206
- <organization>
207
- <name>ISO</name>
208
- <abbreviation/>
209
- </organization>
210
- </owner>
211
- </copyright>
212
- <relation type="obsoletes">
213
- <bibitem type="standard">
214
- <formattedref format="text/plain">ISO 123:1985</formattedref>
215
- </bibitem>
216
- </relation>
217
- <relation type="updates">
218
- <bibitem type="standard">
219
- <formattedref format="text/plain">ISO 123:2001</formattedref>
220
- </bibitem>
221
- </relation>
222
- <docidentifier>ISO 123</docidentifier>
223
- <docidentifier type='metanorma'>[1]</docidentifier>
224
- <title><em>Standard</em></title>
225
- </bibitem>
226
- </references></bibliography>
227
- </standard-document>
228
- OUTPUT
229
- expect do
230
- Asciidoctor.convert(input, *OPTIONS)
231
- end.to output(/ERROR: No document identifier retrieved for ISO 123/)
232
- .to_stderr
249
+ doc = Asciidoctor.convert(input
250
+ .sub(/:novalid:/, ":language: de\n:novalid:"), *OPTIONS)
251
+ expect(doc).to include '<eref type="inline" bibitemid="iso123" citeas="ISO 8342-DE"/>'
252
+ expect(doc).to include '<eref type="inline" bibitemid="iso124" citeas="ISO 8343-DE"/>'
253
+ doc = Asciidoctor.convert(input
254
+ .sub(/:novalid:/, ":language: fr\n:novalid:"), *OPTIONS)
255
+ expect(doc).to include '<eref type="inline" bibitemid="iso123" citeas="ISO 8342-EN"/>'
256
+ expect(doc).to include '<eref type="inline" bibitemid="iso124" citeas="ISO 8343-FR"/>'
257
+ doc = Asciidoctor.convert(input
258
+ .sub(/:novalid:/, ":language: en\n:novalid:"), *OPTIONS)
259
+ expect(doc).to include '<eref type="inline" bibitemid="iso123" citeas="ISO 8342-EN"/>'
260
+ expect(doc).to include '<eref type="inline" bibitemid="iso124" citeas="ISO 8341"/>'
233
261
  end
234
262
 
235
263
  it "fetches simple ISO reference" do
@@ -1026,6 +1054,24 @@ RSpec.describe Metanorma::Standoc do
1026
1054
  end
1027
1055
  end
1028
1056
 
1057
+ it "suppress identifier on bibitem" do
1058
+ VCR.use_cassette "dated_iso_ref_joint_iso_iec1" do
1059
+ input = <<~INPUT
1060
+ #{ISOBIB_BLANK_HDR}
1061
+ [bibliography]
1062
+ == Normative References
1063
+
1064
+ * [[[iso123,dropid(ABC)]]] _Standard_
1065
+ * [[[iso124,dropid(ISO 124:2014)]]] _Standard_
1066
+ INPUT
1067
+ doc = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
1068
+ expect(doc.at("//xmlns:bibitem[@id = 'iso123']/@suppress_identifier")&.text)
1069
+ .to eq("true")
1070
+ expect(doc.at("//xmlns:bibitem[@id = 'iso124']/@suppress_identifier")&.text)
1071
+ .to eq("true")
1072
+ end
1073
+ end
1074
+
1029
1075
  it "hides individual references" do
1030
1076
  VCR.use_cassette "hide_refs",
1031
1077
  match_requests_on: %i[method uri body] do
@@ -1471,7 +1517,7 @@ RSpec.describe Metanorma::Standoc do
1471
1517
  end
1472
1518
 
1473
1519
  it "processes draft ISO reference" do
1474
- # stub_fetch_ref no_year: true, note: "The standard is in press"
1520
+ stub_fetch_ref no_year: true, note: "The standard is in press"
1475
1521
 
1476
1522
  input = <<~INPUT
1477
1523
  #{ASCIIDOC_BLANK_HDR}
@@ -2205,8 +2251,8 @@ RSpec.describe Metanorma::Standoc do
2205
2251
  end
2206
2252
 
2207
2253
  it "overrides normative status of bibliographies" do
2208
- # mock_isobib_get_123_no_docid(1)
2209
- # mock_isobib_get_123_no_docid_lbl(1)
2254
+ mock_isobib_get_123_no_docid(1)
2255
+ mock_isobib_get_123_no_docid_lbl(1)
2210
2256
  VCR.use_cassette "isobib_get_123_1" do
2211
2257
  input = <<~INPUT
2212
2258
  #{ISOBIB_BLANK_HDR}
@@ -2525,6 +2571,7 @@ RSpec.describe Metanorma::Standoc do
2525
2571
  #{ASCIIDOC_BLANK_HDR}
2526
2572
  == Section
2527
2573
 
2574
+ <<ref1,clause=3-5>>
2528
2575
  <<ref1,clause=3;to!clause=5>>
2529
2576
  <<ref1,from!clause=3;to!clause=5,text>>
2530
2577
  <<ref1,clause=3;clause=5>>
@@ -2543,6 +2590,14 @@ RSpec.describe Metanorma::Standoc do
2543
2590
  <clause id='_' inline-header='false' obligation='normative'>
2544
2591
  <title>Section</title>
2545
2592
  <p id='_'>
2593
+ <eref type='inline' bibitemid='ref1' citeas='XYZ'>
2594
+ <localityStack>
2595
+ <locality type='clause'>
2596
+ <referenceFrom>3</referenceFrom>
2597
+ <referenceTo>5</referenceTo>
2598
+ </locality>
2599
+ </localityStack>
2600
+ </eref>
2546
2601
  <eref type='inline' bibitemid='ref1' citeas='XYZ'>
2547
2602
  <localityStack connective='from'>
2548
2603
  <locality type='clause'>
@@ -2649,22 +2704,6 @@ RSpec.describe Metanorma::Standoc do
2649
2704
 
2650
2705
  private
2651
2706
 
2652
- def mock_isobib_get_123
2653
- expect(RelatonIso::IsoBibliography).to receive(:get)
2654
- .with("ISO 123", nil, { code: "ISO 123",
2655
- lang: "en",
2656
- match: anything,
2657
- process: 1,
2658
- ord: anything,
2659
- title: "<em>Standard</em>",
2660
- usrlbl: nil,
2661
- year: nil }) do
2662
- IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
2663
- <bibitem type=\"standard\" id=\"ISO123\">\n <title format=\"text/plain\" language=\"en\" script=\"Latn\">Rubber latex -- Sampling</title>\n <title format=\"text/plain\" language=\"fr\" script=\"Latn\">Latex de caoutchouc -- ?chantillonnage</title>\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <docidentifier>ISO 123</docidentifier>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status>Published</status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n</bibitem>
2664
- OUTPUT
2665
- end
2666
- end
2667
-
2668
2707
  def mock_isobib_get_123_no_docid(times)
2669
2708
  expect(RelatonIso::IsoBibliography).to receive(:get)
2670
2709
  .with("ISO 123", nil, { code: "ISO 123",
@@ -2697,136 +2736,43 @@ RSpec.describe Metanorma::Standoc do
2697
2736
  end.exactly(times).times
2698
2737
  end
2699
2738
 
2700
- def mock_isobib_get_124
2701
- expect(RelatonIso::IsoBibliography).to receive(:get)
2702
- .with("ISO 124",
2703
- "2014", anything) do
2704
- IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
2705
- <bibitem type="standard" id="iso124">
2706
- <title format="text/plain" language="en" script="Latn">Latex, rubber -- Determination of total solids content</title>
2707
- <title format="text/plain" language="fr" script="Latn">Latex de caoutchouc -- Détermination des matières solides totales</title>
2708
- <uri type="src">https://www.iso.org/standard/61884.html</uri>
2709
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
2710
- <uri type="rss">https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
2711
- <docidentifier>ISO 124</docidentifier>
2712
- <date type="published">
2713
- <on>2014</on>
2714
- </date>
2715
- <contributor>
2716
- <role type="publisher"/>
2717
- <organization>
2718
- <name>International Organization for Standardization</name>
2719
- <abbreviation>ISO</abbreviation>
2720
- <uri>www.iso.org</uri>
2721
- </organization>
2722
- </contributor>
2723
- <edition>7</edition>
2724
- <language>en</language>
2725
- <language>fr</language>
2726
- <script>Latn</script>
2727
- <abstract format="text/plain" language="en" script="Latn">ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber.</abstract>
2728
- <status>Published</status>
2729
- <copyright>
2730
- <from>2014</from>
2731
- <owner>
2732
- <organization>
2733
- <name>ISO</name>
2734
- <abbreviation/>
2735
- </organization>
2736
- </owner>
2737
- </copyright>
2738
- <relation type="obsoletes">
2739
- <bibitem type="standard">
2740
- <formattedref format="text/plain">ISO 124:2011</formattedref>
2741
- </bibitem>
2742
- </relation>
2743
- <ics>
2744
- <code>83.040.10</code>
2745
- <text>Latex and raw rubber</text>
2746
- </ics>
2739
+ def mock_rfcbib_get_rfc8342(times)
2740
+ expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 8342", nil,
2741
+ anything) do
2742
+ RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
2743
+ <bibitem id="RFC8342">
2744
+ <title format="text/plain" language="en" script="Latn">Network Configuration Access Control Model</title>
2745
+ <docidentifier type="DOI">10.17487/RFC8341</docidentifier>
2746
+ <docidentifier type="ISO">ISO 8341</docidentifier>
2747
+ <docidentifier type="ISO" primary="true">ISO 8342-EN</docidentifier>
2748
+ <docidentifier type="ISO" language="fr">ISO 8342-FR</docidentifier>
2749
+ <docidentifier type="ISO" primary="true" language="de">ISO 8342-DE</docidentifier>
2750
+ <date type="published">
2751
+ <on>2018</on>
2752
+ </date>
2753
+ <status>published</status>
2747
2754
  </bibitem>
2748
2755
  OUTPUT
2749
- end
2750
- end
2751
-
2752
- def mock_isobib_get_iec12382
2753
- expect(RelatonIso::IsoBibliography).to receive(:get).with(
2754
- "ISO/IEC TR 12382", "1992", anything
2755
- ) do
2756
- IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
2757
- <bibitem type="standard" id="iso123">
2758
- <title format="text/plain" language="en" script="Latn">Permuted index of the vocabulary of information technology</title>
2759
- <title format="text/plain" language="fr" script="Latn">Index permuté du vocabulaire des technologies de l'information</title>
2760
- <uri type="src">https://www.iso.org/standard/21071.html</uri>
2761
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:21071:en</uri>
2762
- <uri type="rss">https://www.iso.org/contents/data/standard/02/10/21071.detail.rss</uri>
2763
- <docidentifier>ISO/IEC 12382</docidentifier>
2764
- <date type="published">
2765
- <on>1992</on>
2766
- </date>
2767
- <contributor>
2768
- <role type="publisher"/>
2769
- <organization>
2770
- <name>International Organization for Standardization</name>
2771
- <abbreviation>ISO</abbreviation>
2772
- <uri>www.iso.org</uri>
2773
- </organization>
2774
- </contributor>
2775
- <contributor>
2776
- <role type="publisher"/>
2777
- <organization>
2778
- <name>International Electrotechnical Commission</name>
2779
- <abbreviation>IEC</abbreviation>
2780
- <uri>www.iec.ch</uri>
2781
- </organization>
2782
- </contributor>
2783
- <edition>2</edition>
2784
- <language>en</language>
2785
- <language>fr</language>
2786
- <script>Latn</script>
2787
- <abstract format="text/plain" language="en" script="Latn">Contains a permuted index of all terms included in the parts 1 — 28 of ISO 2382. If any of these parts has been revised, the present TR refers to the revision.</abstract>
2788
- <status>Published</status>
2789
- <copyright>
2790
- <from>1992</from>
2791
- <owner>
2792
- <organization>
2793
- <name>ISO/IEC</name>
2794
- <abbreviation/>
2795
- </organization>
2796
- </owner>
2797
- </copyright>
2798
- <relation type="updates">
2799
- <bibitem type="standard">
2800
- <formattedref format="text/plain">ISO/IEC TR 12382:1992</formattedref>
2801
- </bibitem>
2802
- </relation>
2803
- <ics>
2804
- <code>35.020</code>
2805
- <text>Information technology (IT) in general</text>
2806
- </ics>
2807
- <ics>
2808
- <code>01.040.35</code>
2809
- <text>Information technology (Vocabularies)</text>
2810
- </ics>
2811
- </bibitem>
2812
- OUTPUT
2813
- end
2756
+ end.exactly(times).times
2814
2757
  end
2815
2758
 
2816
- def mock_rfcbib_get_rfc8341
2817
- expect(IETFBib::RfcBibliography).to receive(:get).with("RFC 8341", nil,
2818
- anything) do
2819
- IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
2820
- <bibitem id="RFC8341">
2759
+ def mock_rfcbib_get_rfc8343(times)
2760
+ expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 8343", nil,
2761
+ anything) do
2762
+ RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
2763
+ <bibitem id="RFC8343">
2821
2764
  <title format="text/plain" language="en" script="Latn">Network Configuration Access Control Model</title>
2822
2765
  <docidentifier type="DOI">10.17487/RFC8341</docidentifier>
2823
- <docidentifier type="RFC">RFC 8341</docidentifier>
2766
+ <docidentifier type="ISO">ISO 8341</docidentifier>
2767
+ <docidentifier type="ISO">ISO 8343-EN</docidentifier>
2768
+ <docidentifier type="ISO" language="fr">ISO 8343-FR</docidentifier>
2769
+ <docidentifier type="ISO" language="de">ISO 8343-DE</docidentifier>
2824
2770
  <date type="published">
2825
2771
  <on>2018</on>
2826
2772
  </date>
2827
2773
  <status>published</status>
2828
2774
  </bibitem>
2829
2775
  OUTPUT
2830
- end
2776
+ end.exactly(times).times
2831
2777
  end
2832
2778
  end