metanorma-iec 1.1.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/iec/converter.rb +6 -15
- data/lib/asciidoctor/iec/isodoc.rng +12 -6
- data/lib/isodoc/iec/base_convert.rb +9 -41
- data/lib/isodoc/iec/html_convert.rb +2 -0
- data/lib/isodoc/iec/i18n-en.yaml +13 -0
- data/lib/isodoc/iec/i18n-fr.yaml +13 -0
- data/lib/isodoc/iec/i18n-zh-Hans.yaml +11 -0
- data/lib/isodoc/iec/i18n.rb +19 -0
- data/lib/isodoc/iec/init.rb +29 -0
- data/lib/isodoc/iec/presentation_xml_convert.rb +26 -1
- data/lib/isodoc/iec/word_convert.rb +3 -1
- data/lib/isodoc/iec/xref.rb +1 -1
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +2 -2
- data/spec/asciidoctor-iec/blocks_spec.rb +1 -1
- data/spec/asciidoctor-iec/cleanup_spec.rb +2 -2
- data/spec/asciidoctor-iec/iev_spec.rb +74 -1
- data/spec/asciidoctor-iec/inline_spec.rb +1 -1
- data/spec/asciidoctor-iec/section_spec.rb +17 -15
- data/spec/isodoc/blocks_spec.rb +66 -1
- data/spec/isodoc/i18n_spec.rb +296 -244
- data/spec/isodoc/iev_spec.rb +221 -14
- data/spec/isodoc/inline_spec.rb +97 -73
- data/spec/isodoc/iso_spec.rb +6 -0
- data/spec/isodoc/postproc_spec.rb +15 -29
- data/spec/isodoc/ref_spec.rb +129 -2
- data/spec/isodoc/section_spec.rb +112 -102
- data/spec/isodoc/terms_spec.rb +67 -53
- data/spec/metanorma/processor_spec.rb +2 -1
- metadata +8 -9
- data/lib/asciidoctor/iec/i18n-en.yaml +0 -12
- data/lib/asciidoctor/iec/i18n-fr.yaml +0 -11
- data/lib/asciidoctor/iec/i18n-zh-Hans.yaml +0 -9
data/spec/isodoc/iev_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
4
|
it "processes introductions under IEV" do
|
5
|
-
|
5
|
+
input = <<~INPUT
|
6
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
7
|
<bibdata>
|
8
8
|
<docidentifier type="iso">IEC/PWI 60050-871 ED 2</docidentifier>
|
@@ -20,6 +20,30 @@ RSpec.describe IsoDoc do
|
|
20
20
|
</introduction></preface><sections/>
|
21
21
|
</iso-standard>
|
22
22
|
INPUT
|
23
|
+
|
24
|
+
presxml = <<~OUTPUT
|
25
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
26
|
+
<bibdata>
|
27
|
+
<docidentifier type='iso'>IEC/PWI 60050-871 ED 2</docidentifier>
|
28
|
+
<docnumber>60050</docnumber>
|
29
|
+
</bibdata>
|
30
|
+
<preface>
|
31
|
+
<foreword obligation='informative'>
|
32
|
+
<title>Foreword</title>
|
33
|
+
<p id='A'>This is a preamble</p>
|
34
|
+
</foreword>
|
35
|
+
<introduction id='B' obligation='informative'>
|
36
|
+
<title depth='1'>Introduction</title>
|
37
|
+
<clause id='C' inline-header='false' obligation='informative'>
|
38
|
+
<title depth='2'>Introduction Subsection</title>
|
39
|
+
</clause>
|
40
|
+
</introduction>
|
41
|
+
</preface>
|
42
|
+
<sections/>
|
43
|
+
</iso-standard>
|
44
|
+
OUTPUT
|
45
|
+
|
46
|
+
html = <<~OUTPUT
|
23
47
|
#{HTML_HDR}
|
24
48
|
<div>
|
25
49
|
<h1 class='ForewordTitle'>FOREWORD</h1>
|
@@ -29,9 +53,7 @@ RSpec.describe IsoDoc do
|
|
29
53
|
<br/>
|
30
54
|
<div class='Section3' id='B'>
|
31
55
|
<h1 class='IntroTitle'>
|
32
|
-
|
33
|
-
<br/>
|
34
|
-
Principles and rules followed
|
56
|
+
Introduction
|
35
57
|
</h1>
|
36
58
|
<div id='C'>
|
37
59
|
<h2>Introduction Subsection</h2>
|
@@ -42,10 +64,12 @@ RSpec.describe IsoDoc do
|
|
42
64
|
</body>
|
43
65
|
</html>
|
44
66
|
OUTPUT
|
67
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
68
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
45
69
|
end
|
46
70
|
|
47
71
|
it "processes bibliographies under IEV" do
|
48
|
-
|
72
|
+
input = <<~INPUT
|
49
73
|
<iec-standard xmlns='https://www.metanorma.org/ns/iec'>
|
50
74
|
<bibdata type='standard'>
|
51
75
|
<docidentifier type='iso'>IEC 60050 ED 1</docidentifier>
|
@@ -93,7 +117,7 @@ RSpec.describe IsoDoc do
|
|
93
117
|
</bibdata>
|
94
118
|
<sections> </sections>
|
95
119
|
<bibliography>
|
96
|
-
<references
|
120
|
+
<references obligation='informative' normative="true" id="X">
|
97
121
|
<title>Normative References</title>
|
98
122
|
<p id='_'>There are no normative references in this document.</p>
|
99
123
|
<bibitem id='A'>
|
@@ -116,7 +140,79 @@ RSpec.describe IsoDoc do
|
|
116
140
|
|
117
141
|
</bibliography>
|
118
142
|
</iec-standard>
|
119
|
-
INPUT
|
143
|
+
INPUT
|
144
|
+
presxml = <<~OUTPUT
|
145
|
+
<iec-standard xmlns='https://www.metanorma.org/ns/iec'>
|
146
|
+
<bibdata type='standard'>
|
147
|
+
<docidentifier type='iso'>IEC 60050 ED 1</docidentifier>
|
148
|
+
<docnumber>60050</docnumber>
|
149
|
+
<contributor>
|
150
|
+
<role type='author'/>
|
151
|
+
<organization>
|
152
|
+
<name>International Electrotechnical Commission</name>
|
153
|
+
<abbreviation>IEC</abbreviation>
|
154
|
+
</organization>
|
155
|
+
</contributor>
|
156
|
+
<contributor>
|
157
|
+
<role type='publisher'/>
|
158
|
+
<organization>
|
159
|
+
<name>International Electrotechnical Commission</name>
|
160
|
+
<abbreviation>IEC</abbreviation>
|
161
|
+
</organization>
|
162
|
+
</contributor>
|
163
|
+
<language>en</language>
|
164
|
+
<script>Latn</script>
|
165
|
+
<status>
|
166
|
+
<stage>60</stage>
|
167
|
+
<substage>60</substage>
|
168
|
+
</status>
|
169
|
+
<copyright>
|
170
|
+
<from>2020</from>
|
171
|
+
<owner>
|
172
|
+
<organization>
|
173
|
+
<name>International Electrotechnical Commission</name>
|
174
|
+
<abbreviation>IEC</abbreviation>
|
175
|
+
</organization>
|
176
|
+
</owner>
|
177
|
+
</copyright>
|
178
|
+
<ext>
|
179
|
+
<doctype>article</doctype>
|
180
|
+
<editorialgroup>
|
181
|
+
<technical-committee/>
|
182
|
+
<subcommittee/>
|
183
|
+
<workgroup/>
|
184
|
+
</editorialgroup>
|
185
|
+
<structuredidentifier>
|
186
|
+
<project-number>IEC 60050</project-number>
|
187
|
+
</structuredidentifier>
|
188
|
+
</ext>
|
189
|
+
</bibdata>
|
190
|
+
<sections> </sections>
|
191
|
+
<bibliography>
|
192
|
+
<references obligation='informative' normative='true' id="X">
|
193
|
+
<title depth='1'>1<tab/>Normative References</title>
|
194
|
+
<p id='_'>There are no normative references in this document.</p>
|
195
|
+
<bibitem id='A'>
|
196
|
+
<formattedref format='application/x-isodoc+xml'>
|
197
|
+
<em>TITLE</em>
|
198
|
+
</formattedref>
|
199
|
+
<docidentifier>B</docidentifier>
|
200
|
+
</bibitem>
|
201
|
+
</references>
|
202
|
+
<references id='_' obligation='informative' normative='false'>
|
203
|
+
<title depth='1'>Bibliography</title>
|
204
|
+
<p id='_'>There are no normative references in this document.</p>
|
205
|
+
<bibitem id='A'>
|
206
|
+
<formattedref format='application/x-isodoc+xml'>
|
207
|
+
<em>TITLE</em>
|
208
|
+
</formattedref>
|
209
|
+
<docidentifier>B</docidentifier>
|
210
|
+
</bibitem>
|
211
|
+
</references>
|
212
|
+
</bibliography>
|
213
|
+
</iec-standard>
|
214
|
+
OUTPUT
|
215
|
+
html = <<~OUTPUT
|
120
216
|
#{HTML_HDR}
|
121
217
|
<div id=''>
|
122
218
|
<h1 class='ForewordTitle'>FOREWORD</h1>
|
@@ -124,7 +220,7 @@ INPUT
|
|
124
220
|
</div>
|
125
221
|
#{IEC_TITLE1}
|
126
222
|
<div>
|
127
|
-
<h1>1  Normative
|
223
|
+
<h1>1  Normative References</h1>
|
128
224
|
<p id='_'>There are no normative references in this document.</p>
|
129
225
|
<p id='A' class='NormRef'>
|
130
226
|
B,
|
@@ -135,10 +231,12 @@ INPUT
|
|
135
231
|
</body>
|
136
232
|
</html>
|
137
233
|
OUTPUT
|
234
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
235
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
138
236
|
end
|
139
237
|
|
140
238
|
it "processes IEV terms" do
|
141
|
-
|
239
|
+
input = <<~INPUT
|
142
240
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
143
241
|
<bibdata type='standard'>
|
144
242
|
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
@@ -163,7 +261,7 @@ OUTPUT
|
|
163
261
|
</termexample>
|
164
262
|
|
165
263
|
<termsource status="modified">
|
166
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality
|
264
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
167
265
|
<modification>
|
168
266
|
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
169
267
|
</modification>
|
@@ -187,12 +285,81 @@ OUTPUT
|
|
187
285
|
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
188
286
|
</termnote>
|
189
287
|
<termsource status="identical">
|
190
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality
|
288
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
191
289
|
</termsource></term>
|
192
290
|
</terms>
|
291
|
+
</clause>
|
193
292
|
</sections>
|
194
293
|
</iso-standard>
|
195
294
|
INPUT
|
295
|
+
|
296
|
+
presxml = <<~INPUT
|
297
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
298
|
+
<bibdata type='standard'>
|
299
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
300
|
+
<docnumber>60050</docnumber>
|
301
|
+
</bibdata>
|
302
|
+
<sections>
|
303
|
+
<clause id="_terms_and_definitions" obligation="normative"><title depth="1">1<tab/>Terms and definitions</title>
|
304
|
+
<terms id="_general" obligation="normative"><title>192-01 General</title>
|
305
|
+
|
306
|
+
<term id="paddy1">
|
307
|
+
<name>192-01-01</name>
|
308
|
+
<preferred>paddy</preferred>
|
309
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
310
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
311
|
+
<name>EXAMPLE 1</name>
|
312
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
313
|
+
<ul>
|
314
|
+
<li>A</li>
|
315
|
+
</ul>
|
316
|
+
</termexample>
|
317
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
318
|
+
<name>EXAMPLE 2</name>
|
319
|
+
<ul>
|
320
|
+
<li>A</li>
|
321
|
+
</ul>
|
322
|
+
</termexample>
|
323
|
+
|
324
|
+
<termsource status="modified">
|
325
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
326
|
+
<modification>
|
327
|
+
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
328
|
+
</modification>
|
329
|
+
</termsource></term>
|
330
|
+
|
331
|
+
<term id="paddy">
|
332
|
+
<name>192-01-02</name>
|
333
|
+
<preferred>paddy</preferred><admitted>paddy rice</admitted>
|
334
|
+
<admitted>rough rice</admitted>
|
335
|
+
<deprecates>cargo rice</deprecates>
|
336
|
+
<domain>rice</domain>
|
337
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
338
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
339
|
+
<name>EXAMPLE</name>
|
340
|
+
<ul>
|
341
|
+
<li>A</li>
|
342
|
+
</ul>
|
343
|
+
</termexample>
|
344
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
345
|
+
<name>Note 1 to entry</name>
|
346
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
347
|
+
</termnote>
|
348
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
349
|
+
<name>Note 2 to entry</name>
|
350
|
+
<ul><li>A</li></ul>
|
351
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
352
|
+
</termnote>
|
353
|
+
<termsource status="identical">
|
354
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
355
|
+
</termsource></term>
|
356
|
+
</terms>
|
357
|
+
</clause>
|
358
|
+
</sections>
|
359
|
+
</iso-standard>
|
360
|
+
INPUT
|
361
|
+
|
362
|
+
html = <<~OUTPUT
|
196
363
|
#{HTML_HDR}
|
197
364
|
<div id=''>
|
198
365
|
<h1 class='ForewordTitle'>FOREWORD</h1>
|
@@ -278,12 +445,14 @@ INPUT
|
|
278
445
|
</body>
|
279
446
|
</html>
|
280
447
|
OUTPUT
|
448
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
449
|
+
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
281
450
|
end
|
282
451
|
|
283
452
|
it "populates Word template with terms reference labels" do
|
284
453
|
FileUtils.rm_f "test.doc"
|
285
454
|
FileUtils.rm_f "test.html"
|
286
|
-
|
455
|
+
input = <<~INPUT
|
287
456
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
288
457
|
<bibdata type='standard'>
|
289
458
|
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
@@ -296,7 +465,7 @@ end
|
|
296
465
|
<term id="paddy1"><preferred>paddy</preferred>
|
297
466
|
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
298
467
|
<termsource status="modified">
|
299
|
-
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality
|
468
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality>ISO 7301:2011, 3.1</origin>
|
300
469
|
<modification>
|
301
470
|
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
302
471
|
</modification>
|
@@ -306,8 +475,46 @@ end
|
|
306
475
|
</clause>
|
307
476
|
</sections>
|
308
477
|
</iso-standard>
|
309
|
-
|
310
478
|
INPUT
|
479
|
+
presxml = <<~OUTPUT
|
480
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
481
|
+
<bibdata type='standard'>
|
482
|
+
<docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
|
483
|
+
<docnumber>60050</docnumber>
|
484
|
+
</bibdata>
|
485
|
+
<sections>
|
486
|
+
<clause id='_terms_and_definitions' obligation='normative'>
|
487
|
+
<title depth='1'>1<tab/>Terms and definitions</title>
|
488
|
+
<terms id='_general' obligation='normative'>
|
489
|
+
<title>192-01 General</title>
|
490
|
+
<term id='paddy1'>
|
491
|
+
<name>192-01-01</name>
|
492
|
+
<preferred>paddy</preferred>
|
493
|
+
<definition>
|
494
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
495
|
+
</definition>
|
496
|
+
<termsource status='modified'>
|
497
|
+
<origin bibitemid='ISO7301' type='inline' citeas='ISO 7301:2011'>
|
498
|
+
<locality type='clause'>
|
499
|
+
<referenceFrom>3.1</referenceFrom>
|
500
|
+
</locality>
|
501
|
+
ISO 7301:2011, 3.1
|
502
|
+
</origin>
|
503
|
+
<modification>
|
504
|
+
<p id='_e73a417d-ad39-417d-a4c8-20e4e2529489'>
|
505
|
+
The term "cargo rice" is shown as deprecated, and Note 1 to
|
506
|
+
entry is not included here
|
507
|
+
</p>
|
508
|
+
</modification>
|
509
|
+
</termsource>
|
510
|
+
</term>
|
511
|
+
</terms>
|
512
|
+
</clause>
|
513
|
+
</sections>
|
514
|
+
</iso-standard>
|
515
|
+
OUTPUT
|
516
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
517
|
+
IsoDoc::Iec::WordConvert.new({}).convert("test", presxml, false)
|
311
518
|
word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
312
519
|
sub(%r{<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>.*$}m, "")
|
313
520
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -149,52 +149,8 @@ RSpec.describe IsoDoc do
|
|
149
149
|
OUTPUT
|
150
150
|
end
|
151
151
|
|
152
|
-
it "processes eref types" do
|
153
|
-
expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
154
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
155
|
-
<preface><foreword>
|
156
|
-
<p>
|
157
|
-
<eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
|
158
|
-
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
|
159
|
-
</p>
|
160
|
-
</foreword></preface>
|
161
|
-
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
162
|
-
<bibitem id="ISO712" type="standard">
|
163
|
-
<title format="text/plain">Cereals and cereal products</title>
|
164
|
-
<docidentifier>ISO 712</docidentifier>
|
165
|
-
<contributor>
|
166
|
-
<role type="publisher"/>
|
167
|
-
<organization>
|
168
|
-
<abbreviation>ISO</abbreviation>
|
169
|
-
</organization>
|
170
|
-
</contributor>
|
171
|
-
</bibitem>
|
172
|
-
</references>
|
173
|
-
</bibliography>
|
174
|
-
</iso-standard>
|
175
|
-
INPUT
|
176
|
-
#{HTML_HDR}
|
177
|
-
<div>
|
178
|
-
<h1 class="ForewordTitle">FOREWORD</h1>
|
179
|
-
<div class="boilerplate_legal"/>
|
180
|
-
<p>
|
181
|
-
<sup><a href="#ISO712">A</a></sup>
|
182
|
-
<a href="#ISO712">A</a>
|
183
|
-
</p>
|
184
|
-
</div>
|
185
|
-
#{IEC_TITLE1}
|
186
|
-
<div>
|
187
|
-
<h1>1  Normative references</h1>
|
188
|
-
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
|
189
|
-
</div>
|
190
|
-
</div>
|
191
|
-
</body>
|
192
|
-
</html>
|
193
|
-
OUTPUT
|
194
|
-
end
|
195
|
-
|
196
152
|
it "processes eref content" do
|
197
|
-
|
153
|
+
expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
198
154
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
199
155
|
<preface><foreword>
|
200
156
|
<p>
|
@@ -228,34 +184,102 @@ RSpec.describe IsoDoc do
|
|
228
184
|
</bibliography>
|
229
185
|
</iso-standard>
|
230
186
|
INPUT
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
187
|
+
<?xml version='1.0'?>
|
188
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
189
|
+
<preface>
|
190
|
+
<foreword>
|
191
|
+
<p>
|
192
|
+
<eref type='inline' bibitemid='IEV' citeas='IEV'>
|
193
|
+
<locality type='clause'>
|
194
|
+
<referenceFrom>1-2-3</referenceFrom>
|
195
|
+
</locality>
|
196
|
+
IEV, 1-2-3
|
197
|
+
</eref>
|
198
|
+
<eref type='inline' bibitemid='ISO712' citeas='ISO 712'>ISO 712</eref>
|
199
|
+
<eref type='inline' bibitemid='ISO712'>ISO 712</eref>
|
200
|
+
<eref type='inline' bibitemid='ISO712'>
|
201
|
+
<locality type='table'>
|
202
|
+
<referenceFrom>1</referenceFrom>
|
203
|
+
</locality>
|
204
|
+
ISO 712, Table 1
|
205
|
+
</eref>
|
206
|
+
<eref type='inline' bibitemid='ISO712'>
|
207
|
+
<locality type='table'>
|
208
|
+
<referenceFrom>1</referenceFrom>
|
209
|
+
<referenceTo>1</referenceTo>
|
210
|
+
</locality>
|
211
|
+
ISO 712, Table 1–1
|
212
|
+
</eref>
|
213
|
+
<eref type='inline' bibitemid='ISO712'>
|
214
|
+
<locality type='clause'>
|
215
|
+
<referenceFrom>1</referenceFrom>
|
216
|
+
</locality>
|
217
|
+
<locality type='table'>
|
218
|
+
<referenceFrom>1</referenceFrom>
|
219
|
+
</locality>
|
220
|
+
ISO 712, Clause 1, Table 1
|
221
|
+
</eref>
|
222
|
+
<eref type='inline' bibitemid='ISO712'>
|
223
|
+
<locality type='clause'>
|
224
|
+
<referenceFrom>1</referenceFrom>
|
225
|
+
</locality>
|
226
|
+
<locality type='list'>
|
227
|
+
<referenceFrom>a</referenceFrom>
|
228
|
+
</locality>
|
229
|
+
ISO 712, Clause 1 a)
|
230
|
+
</eref>
|
231
|
+
<eref type='inline' bibitemid='ISO712'>
|
232
|
+
<locality type='clause'>
|
233
|
+
<referenceFrom>1</referenceFrom>
|
234
|
+
</locality>
|
235
|
+
ISO 712, Clause 1
|
236
|
+
</eref>
|
237
|
+
<eref type='inline' bibitemid='ISO712'>
|
238
|
+
<locality type='clause'>
|
239
|
+
<referenceFrom>1.5</referenceFrom>
|
240
|
+
</locality>
|
241
|
+
ISO 712, 1.5
|
242
|
+
</eref>
|
243
|
+
<eref type='inline' bibitemid='ISO712'>
|
244
|
+
<locality type='table'>
|
245
|
+
<referenceFrom>1</referenceFrom>
|
246
|
+
</locality>
|
247
|
+
A
|
248
|
+
</eref>
|
249
|
+
<eref type='inline' bibitemid='ISO712'>
|
250
|
+
<locality type='whole'/>
|
251
|
+
ISO 712, Whole of text
|
252
|
+
</eref>
|
253
|
+
<eref type='inline' bibitemid='ISO712'>
|
254
|
+
<locality type='locality:prelude'>
|
255
|
+
<referenceFrom>7</referenceFrom>
|
256
|
+
</locality>
|
257
|
+
ISO 712, Prelude 7
|
258
|
+
</eref>
|
259
|
+
<eref type='inline' bibitemid='ISO712' citeas='ISO 712'>A</eref>
|
260
|
+
</p>
|
261
|
+
</foreword>
|
262
|
+
</preface>
|
263
|
+
<bibliography>
|
264
|
+
<references id='_normative_references' obligation='informative' normative='true'>
|
265
|
+
<title depth='1'>
|
266
|
+
1
|
267
|
+
<tab/>
|
268
|
+
Normative References
|
269
|
+
</title>
|
270
|
+
<bibitem id='ISO712' type='standard'>
|
271
|
+
<title format='text/plain'>Cereals and cereal products</title>
|
272
|
+
<docidentifier>ISO 712</docidentifier>
|
273
|
+
<contributor>
|
274
|
+
<role type='publisher'/>
|
275
|
+
<organization>
|
276
|
+
<abbreviation>ISO</abbreviation>
|
277
|
+
</organization>
|
278
|
+
</contributor>
|
279
|
+
</bibitem>
|
280
|
+
</references>
|
281
|
+
</bibliography>
|
282
|
+
</iso-standard>
|
259
283
|
OUTPUT
|
260
284
|
end
|
261
285
|
|