metanorma-iec 2.0.6 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -71,7 +71,7 @@ RSpec.describe IsoDoc::Iec do
71
71
 
72
72
  </references><references id="_bibliography" obligation="informative" normative="false">
73
73
  <title>Bibliography</title>
74
- <bibitem id="ISBN" type="ISBN">
74
+ <bibitem id="ISBN" type="book">
75
75
  <title format="text/plain">Chemicals for analytical laboratory use</title>
76
76
  <docidentifier type="ISBN">ISBN</docidentifier>
77
77
  <docidentifier type="metanorma">[1]</docidentifier>
@@ -82,7 +82,7 @@ RSpec.describe IsoDoc::Iec do
82
82
  </organization>
83
83
  </contributor>
84
84
  </bibitem>
85
- <bibitem id="ISSN" type="ISSN">
85
+ <bibitem id="ISSN" type="journal">
86
86
  <title format="text/plain">Instruments for analytical laboratory use</title>
87
87
  <docidentifier type="ISSN">ISSN</docidentifier>
88
88
  <docidentifier type="metanorma">[2]</docidentifier>
@@ -145,44 +145,18 @@ RSpec.describe IsoDoc::Iec do
145
145
  <bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder="2"><title depth="1">1<tab/>Normative References</title>
146
146
  <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
147
147
  <bibitem id="ISO712" type="standard">
148
- <title format="text/plain">Cereals or cereal products</title>
149
- <title type="main" format="text/plain">Cereals and cereal products</title>
148
+ <formattedref><em><span class='stddocTitle'>Cereals and cereal products</span></em></formattedref>
150
149
  <docidentifier type="ISO">ISO 712</docidentifier>
151
150
  <docidentifier type="metanorma">[110]</docidentifier>
152
- <contributor>
153
- <role type="publisher"/>
154
- <organization>
155
- <name>International Organization for Standardization</name>
156
- </organization>
157
- </contributor>
158
151
  </bibitem>
159
152
  <bibitem id="ISO16634" type="standard">
160
- <title language="x" format="text/plain">Cereals, pulses, milled cereal products, xxxx, oilseeds and animal feeding stuffs</title>
161
- <title language="en" format="text/plain">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
153
+ <formattedref><em><span class='stddocTitle'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</span></em></formattedref>
162
154
  <docidentifier type="ISO">ISO 16634:-- (all parts)</docidentifier>
163
- <date type="published"><on>--</on></date>
164
- <contributor>
165
- <role type="publisher"/>
166
- <organization>
167
- <abbreviation>ISO</abbreviation>
168
- </organization>
169
- </contributor>
170
155
  <note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
171
- <extent type="part">
172
- <referenceFrom>all</referenceFrom>
173
- </extent>
174
-
175
156
  </bibitem>
176
157
  <bibitem id="ISO20483" type="standard">
177
- <title format="text/plain">Cereals and pulses</title>
158
+ <formattedref><em><span class='stddocTitle'>Cereals and pulses</span></em></formattedref>
178
159
  <docidentifier type="ISO">ISO 20483:2013-2014</docidentifier>
179
- <date type="published"><from>2013</from><to>2014</to></date>
180
- <contributor>
181
- <role type="publisher"/>
182
- <organization>
183
- <name>International Organization for Standardization</name>
184
- </organization>
185
- </contributor>
186
160
  </bibitem>
187
161
  <bibitem id="ref1">
188
162
  <formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
@@ -190,52 +164,32 @@ RSpec.describe IsoDoc::Iec do
190
164
  </bibitem>
191
165
  <note><name>NOTE</name><p>This is an annotation of ISO 20483:2013-2014</p></note>
192
166
  <bibitem id="zip_ffs"><formattedref format="application/x-isodoc+xml">Title 5</formattedref><docidentifier type="metanorma">[5]</docidentifier></bibitem>
193
-
194
-
195
167
  </references><references id="_bibliography" obligation="informative" normative="false" displayorder="3">
196
168
  <title depth="1">Bibliography</title>
197
- <bibitem id="ISBN" type="ISBN">
198
- <title format="text/plain">Chemicals for analytical laboratory use</title>
169
+ <bibitem id="ISBN" type="book">
170
+ <formattedref><em>Chemicals for analytical laboratory use</em>. ISBN.</formattedref>
199
171
  <docidentifier type="ISBN">ISBN</docidentifier>
200
172
  <docidentifier type="metanorma">[1]</docidentifier>
201
- <contributor>
202
- <role type="publisher"/>
203
- <organization>
204
- <abbreviation>ISBN</abbreviation>
205
- </organization>
206
- </contributor>
207
173
  </bibitem>
208
- <bibitem id="ISSN" type="ISSN">
209
- <title format="text/plain">Instruments for analytical laboratory use</title>
174
+ <bibitem id="ISSN" type="journal">
175
+ <formattedref><em>Instruments for analytical laboratory use</em>. ISSN.</formattedref>
210
176
  <docidentifier type="ISSN">ISSN</docidentifier>
211
177
  <docidentifier type="metanorma">[2]</docidentifier>
212
- <contributor>
213
- <role type="publisher"/>
214
- <organization>
215
- <abbreviation>ISSN</abbreviation>
216
- </organization>
217
- </contributor>
218
178
  </bibitem>
219
179
  <note><name>NOTE</name><p>This is an annotation of document ISSN.</p></note>
220
180
  <note><name>NOTE</name><p>This is another annotation of document ISSN.</p></note>
221
181
  <bibitem id="ISO3696" type="standard">
222
- <title format="text/plain">Water for analytical laboratory use</title>
223
- <docidentifier type='metanorma-ordinal'>[1]</docidentifier>
182
+ <formattedref><em><span class='stddocTitle'>Water for analytical laboratory use</span></em></formattedref>
183
+ <docidentifier type='metanorma-ordinal'>[3]</docidentifier>
224
184
  <docidentifier type="ISO">ISO 3696</docidentifier>
225
- <contributor>
226
- <role type="publisher"/>
227
- <organization>
228
- <abbreviation>ISO</abbreviation>
229
- </organization>
230
- </contributor>
231
185
  </bibitem>
232
186
  <bibitem id="ref10">
233
187
  <formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
234
188
  <docidentifier type="metanorma">[10]</docidentifier>
235
189
  </bibitem>
236
190
  <bibitem id="ref11">
237
- <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
238
- <docidentifier type='metanorma-ordinal'>[2]</docidentifier>
191
+ <formattedref><em>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</em>.</formattedref>
192
+ <docidentifier type='metanorma-ordinal'>[4]</docidentifier>
239
193
  <docidentifier type="IETF">IETF RFC 10</docidentifier>
240
194
  </bibitem>
241
195
  <bibitem id="ref12">
@@ -243,8 +197,6 @@ RSpec.describe IsoDoc::Iec do
243
197
  <docidentifier type="metanorma">[Citn]</docidentifier>
244
198
  <docidentifier type="IETF">IETF RFC 20</docidentifier>
245
199
  </bibitem>
246
-
247
-
248
200
  </references>
249
201
  </bibliography>
250
202
  </iso-standard>
@@ -318,11 +270,11 @@ RSpec.describe IsoDoc::Iec do
318
270
  <h1 class='Section3'>Bibliography</h1>
319
271
  <p id='ISBN' class='Biblio'>
320
272
  [1]&#160;
321
- <i>Chemicals for analytical laboratory use</i>
273
+ <i>Chemicals for analytical laboratory use</i>. ISBN.
322
274
  </p>
323
275
  <p id='ISSN' class='Biblio'>
324
276
  [2]&#160;
325
- <i>Instruments for analytical laboratory use</i>
277
+ <i>Instruments for analytical laboratory use</i>. ISSN.
326
278
  </p>
327
279
  <div class='Note'>
328
280
  <p>
@@ -337,7 +289,7 @@ RSpec.describe IsoDoc::Iec do
337
289
  </p>
338
290
  </div>
339
291
  <p id='ISO3696' class='Biblio'>
340
- [1]&#160; ISO 3696,
292
+ [3]&#160; ISO 3696,
341
293
  <i>Water for analytical laboratory use</i>
342
294
  </p>
343
295
  <p id='ref10' class='Biblio'>
@@ -354,8 +306,8 @@ RSpec.describe IsoDoc::Iec do
354
306
  )
355
307
  </p>
356
308
  <p id='ref11' class='Biblio'>
357
- [2]&#160; IETF RFC 10,
358
- <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
309
+ [4]&#160; IETF RFC 10,
310
+ <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>.
359
311
  </p>
360
312
  <p id='ref12' class='Biblio'>
361
313
  Citn&#160; IETF RFC 20, CitationWorks. 2019.
@@ -357,7 +357,7 @@ RSpec.describe Metanorma::Iec do
357
357
  <?xml version="1.0" encoding="UTF-8"?>
358
358
  <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
359
359
  <bibdata type='standard'>
360
- <docidentifier type='ISO'>ISO/IEC/IETF/2CDTS 1000-1-1 ED 1</docidentifier>
360
+ <docidentifier type='ISO'>IEC/IETF/ISO/2CDTS 1000-1-1 ED 1</docidentifier>
361
361
  <docidentifier type='iso-tc'>2000</docidentifier>
362
362
  <docnumber>1000</docnumber>
363
363
  <contributor>
@@ -443,7 +443,7 @@ RSpec.describe Metanorma::Iec do
443
443
  <workgroup/>
444
444
  </editorialgroup>
445
445
  <structuredidentifier>
446
- <project-number part='1' subpart='1'>ISO/IEC/IETF 1000</project-number>
446
+ <project-number part='1' subpart='1'>IEC/IETF/ISO 1000</project-number>
447
447
  </structuredidentifier>
448
448
  <stagename>Committee draft</stagename>
449
449
  </ext>
@@ -132,7 +132,7 @@ RSpec.describe Metanorma::Iec do
132
132
  <title>Terms and definitions</title>
133
133
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
134
134
  #{TERMS_BOILERPLATE}
135
- <term id="term-term1">
135
+ <term id="term-Term1">
136
136
  <preferred><expression><name>Term1</name></expression></preferred>
137
137
  <termnote id="_">
138
138
  <p id="_">This is a note</p>
@@ -254,7 +254,7 @@ RSpec.describe Metanorma::Iec do
254
254
  <title>Terms and definitions</title>
255
255
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
256
256
  #{TERMS_BOILERPLATE}
257
- <term id="term-term1">
257
+ <term id="term-Term1">
258
258
  <preferred><expression><name>Term1</name></expression></preferred>
259
259
  <termexample id="_">
260
260
  <p id="_">This is an example</p>
@@ -127,7 +127,7 @@ RSpec.describe Metanorma::Iec do
127
127
  <p id='_'>So am I</p>
128
128
  </li>
129
129
  </ul>
130
- <term id="term-time">
130
+ <term id="term-Time">
131
131
  <preferred><expression><name>Time</name></expression></preferred>
132
132
  <definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
133
133
  </term></terms>
@@ -164,7 +164,7 @@ RSpec.describe Metanorma::Iec do
164
164
  <title>Terms and definitions</title>
165
165
  <terms id='_' obligation='normative'>
166
166
  <title>General</title>
167
- <term id='term-term-1'>
167
+ <term id='term-Term-1'>
168
168
  <preferred><expression><name>Term 1</name></expression></preferred>
169
169
  </term>
170
170
  </terms>
@@ -1,12 +1,12 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Metanorma::Iec do
4
- before(:all) do
5
- @blank_hdr = blank_hdr_gen
6
- end
4
+ before(:all) do
5
+ @blank_hdr = blank_hdr_gen
6
+ end
7
7
 
8
8
  it "processes breaks" do
9
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
9
+ input = <<~INPUT
10
10
  #{ASCIIDOC_BLANK_HDR}
11
11
  Line break +
12
12
  line break
@@ -15,47 +15,56 @@ end
15
15
 
16
16
  <<<
17
17
  INPUT
18
- #{@blank_hdr}
19
- <sections><p id="_">Line break<br/>
20
- line break</p>
21
- <hr/>
22
- <pagebreak/></sections>
23
- </iec-standard>
18
+ output = <<~OUTPUT
19
+ #{@blank_hdr}
20
+ <sections><p id="_">Line break<br/>
21
+ line break</p>
22
+ <hr/>
23
+ <pagebreak/></sections>
24
+ </iec-standard>
24
25
  OUTPUT
26
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
27
+ .to be_equivalent_to xmlpp(output)
25
28
  end
26
29
 
27
30
  it "processes links" do
28
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
31
+ input = <<~INPUT
29
32
  #{ASCIIDOC_BLANK_HDR}
30
33
  mailto:fred@example.com
31
34
  http://example.com[]
32
35
  http://example.com[Link]
33
36
  INPUT
34
- #{@blank_hdr}
35
- <sections>
36
- <p id="_">mailto:fred@example.com
37
- <link target="http://example.com"/>
38
- <link target="http://example.com">Link</link></p>
39
- </sections>
40
- </iec-standard>
37
+ output = <<~OUTPUT
38
+ #{@blank_hdr}
39
+ <sections>
40
+ <p id="_">mailto:fred@example.com
41
+ <link target="http://example.com"/>
42
+ <link target="http://example.com">Link</link></p>
43
+ </sections>
44
+ </iec-standard>
41
45
  OUTPUT
46
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
47
+ .to be_equivalent_to xmlpp(output)
42
48
  end
43
49
 
44
- it "processes bookmarks" do
45
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
50
+ it "processes bookmarks" do
51
+ input = <<~INPUT
46
52
  #{ASCIIDOC_BLANK_HDR}
47
53
  Text [[bookmark]] Text
48
54
  INPUT
49
- #{@blank_hdr}
50
- <sections>
51
- <p id="_">Text <bookmark id="bookmark"/> Text</p>
52
- </sections>
53
- </iec-standard>
55
+ output = <<~OUTPUT
56
+ #{@blank_hdr}
57
+ <sections>
58
+ <p id="_">Text <bookmark id="bookmark"/> Text</p>
59
+ </sections>
60
+ </iec-standard>
54
61
  OUTPUT
55
- end
62
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
63
+ .to be_equivalent_to xmlpp(output)
64
+ end
56
65
 
57
- it "processes crossreferences" do
58
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
66
+ it "processes crossreferences" do
67
+ input = <<~INPUT
59
68
  #{ASCIIDOC_BLANK_HDR}
60
69
  [[reference]]
61
70
  == Section
@@ -65,22 +74,25 @@ end
65
74
  Inline Reference with Text to <<reference,text>>
66
75
  Footnoted Reference with Text to <<reference,fn: text>>
67
76
  INPUT
68
- #{@blank_hdr}
69
- <sections>
70
- <clause id="reference" inline-header="false" obligation="normative">
71
- <title>Section</title>
72
- <p id="_">Inline Reference to <xref target="reference"/>
73
- Footnoted Reference to <xref target="reference"/>
74
- Inline Reference with Text to <xref target="reference">text</xref>
75
- Footnoted Reference with Text to <xref target="reference">text</xref></p>
76
- </clause>
77
- </sections>
78
- </iec-standard>
79
- OUTPUT
80
- end
77
+ output = <<~OUTPUT
78
+ #{@blank_hdr}
79
+ <sections>
80
+ <clause id="reference" inline-header="false" obligation="normative">
81
+ <title>Section</title>
82
+ <p id="_">Inline Reference to <xref target="reference"/>
83
+ Footnoted Reference to <xref target="reference"/>
84
+ Inline Reference with Text to <xref target="reference">text</xref>
85
+ Footnoted Reference with Text to <xref target="reference">text</xref></p>
86
+ </clause>
87
+ </sections>
88
+ </iec-standard>
89
+ OUTPUT
90
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
91
+ .to be_equivalent_to xmlpp(output)
92
+ end
81
93
 
82
- it "processes bibliographic anchors" do
83
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
94
+ it "processes bibliographic anchors" do
95
+ input = <<~INPUT
84
96
  #{ASCIIDOC_BLANK_HDR}
85
97
  [bibliography]
86
98
  == Normative References
@@ -89,41 +101,45 @@ end
89
101
  * [[[ISO713]]] Reference
90
102
 
91
103
  INPUT
92
- #{@blank_hdr}
93
- <sections>
104
+ output = <<~OUTPUT
105
+ #{@blank_hdr}
106
+ <sections>
94
107
 
95
- </sections><bibliography><references id="_" obligation="informative" normative="true">
96
- <title>Normative references</title>
97
- <p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
98
- <bibitem id="ISO712">
99
- <formattedref format="application/x-isodoc+xml">Reference</formattedref>
100
- <docidentifier>x</docidentifier>
101
- </bibitem>
102
- <bibitem id="ISO713">
103
- <formattedref format="application/x-isodoc+xml">Reference</formattedref>
104
- <docidentifier>ISO713</docidentifier>
105
- <docnumber>713</docnumber>
106
- </bibitem>
107
- </references>
108
- </bibliography>
109
- </iec-standard>
108
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
109
+ <title>Normative references</title>
110
+ <p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
111
+ <bibitem id="ISO712">
112
+ <formattedref format="application/x-isodoc+xml">Reference</formattedref>
113
+ <docidentifier>x</docidentifier>
114
+ </bibitem>
115
+ <bibitem id="ISO713">
116
+ <formattedref format="application/x-isodoc+xml">Reference</formattedref>
117
+ <docidentifier>ISO713</docidentifier>
118
+ <docnumber>713</docnumber>
119
+ </bibitem>
120
+ </references>
121
+ </bibliography>
122
+ </iec-standard>
110
123
  OUTPUT
124
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
125
+ .to be_equivalent_to xmlpp(output)
111
126
  end
112
127
 
113
128
  it "processes footnotes" do
114
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
129
+ input = <<~INPUT
115
130
  #{ASCIIDOC_BLANK_HDR}
116
131
  Hello!footnote:[Footnote text]
117
132
  INPUT
118
- #{@blank_hdr}
119
- <sections>
120
- <p id="_">Hello!<fn reference="1">
121
- <p id="_">Footnote text</p>
122
- </fn></p>
123
- </sections>
124
- </iec-standard>
133
+ output = <<~OUTPUT
134
+ #{@blank_hdr}
135
+ <sections>
136
+ <p id="_">Hello!<fn reference="1">
137
+ <p id="_">Footnote text</p>
138
+ </fn></p>
139
+ </sections>
140
+ </iec-standard>
125
141
  OUTPUT
142
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
143
+ .to be_equivalent_to xmlpp(output)
126
144
  end
127
-
128
-
129
145
  end