isodoc 1.6.0 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +2 -12
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/isodoc.gemspec +4 -3
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc.rb +0 -2
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +10 -4
- data/lib/isodoc/css.rb +30 -26
- data/lib/isodoc/function/blocks.rb +26 -8
- data/lib/isodoc/function/blocks_example_note.rb +2 -2
- data/lib/isodoc/function/cleanup.rb +53 -45
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +8 -7
- data/lib/isodoc/function/references.rb +71 -77
- data/lib/isodoc/function/section.rb +28 -16
- data/lib/isodoc/function/table.rb +22 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/function/to_word_html.rb +19 -25
- data/lib/isodoc/function/utils.rb +180 -160
- data/lib/isodoc/gem_tasks.rb +36 -38
- data/lib/isodoc/headlesshtml_convert.rb +8 -7
- data/lib/isodoc/html_convert.rb +10 -4
- data/lib/isodoc/html_function/comments.rb +14 -12
- data/lib/isodoc/html_function/footnotes.rb +14 -7
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/html.rb +30 -26
- data/lib/isodoc/html_function/postprocess.rb +191 -226
- data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
- data/lib/isodoc/html_function/sectionsplit.rb +230 -0
- data/lib/isodoc/i18n.rb +33 -31
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/pdf_convert.rb +11 -13
- data/lib/isodoc/presentation_function/bibdata.rb +54 -30
- data/lib/isodoc/presentation_function/block.rb +17 -8
- data/lib/isodoc/presentation_function/inline.rb +72 -120
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +55 -19
- data/lib/isodoc/presentation_xml_convert.rb +2 -0
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/footnotes.rb +22 -15
- data/lib/isodoc/word_function/postprocess.rb +50 -36
- data/lib/isodoc/xref.rb +11 -10
- data/lib/isodoc/xref/xref_counter.rb +32 -17
- data/lib/isodoc/xref/xref_gen.rb +33 -21
- data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
- data/lib/isodoc/xref/xref_sect_gen.rb +37 -35
- data/spec/assets/scripts_override.html +3 -0
- data/spec/isodoc/blocks_spec.rb +2258 -2622
- data/spec/isodoc/cleanup_spec.rb +1103 -1107
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +802 -917
- data/spec/isodoc/inline_spec.rb +1105 -921
- data/spec/isodoc/lists_spec.rb +316 -315
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +1783 -1549
- data/spec/isodoc/presentation_xml_spec.rb +355 -278
- data/spec/isodoc/ref_spec.rb +718 -723
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +84 -84
- data/spec/isodoc/xref_spec.rb +1024 -930
- metadata +33 -7
data/spec/isodoc/xref_spec.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
-
it "cross-references external documents
|
5
|
-
|
4
|
+
it "cross-references external documents" do
|
5
|
+
input = <<~INPUT
|
6
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
7
|
<preface>
|
8
8
|
<foreword>
|
@@ -13,10 +13,11 @@ RSpec.describe IsoDoc do
|
|
13
13
|
</preface>
|
14
14
|
</iso-standard
|
15
15
|
INPUT
|
16
|
+
presxml = <<~OUTPUT
|
16
17
|
<?xml version='1.0'?>
|
17
18
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
18
19
|
<preface>
|
19
|
-
<foreword>
|
20
|
+
<foreword displayorder='1'>
|
20
21
|
<p>
|
21
22
|
<xref target='a#b'>a#b</xref>
|
22
23
|
</p>
|
@@ -24,20 +25,7 @@ RSpec.describe IsoDoc do
|
|
24
25
|
</preface>
|
25
26
|
</iso-standard>
|
26
27
|
OUTPUT
|
27
|
-
|
28
|
-
|
29
|
-
it "cross-references external documents in HTML" do
|
30
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
31
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
32
|
-
<preface>
|
33
|
-
<foreword>
|
34
|
-
<p>
|
35
|
-
<xref target='a#b'>a#b</xref>
|
36
|
-
</p>
|
37
|
-
</foreword>
|
38
|
-
</preface>
|
39
|
-
</iso-standard
|
40
|
-
INPUT
|
28
|
+
html = <<~OUTPUT
|
41
29
|
#{HTML_HDR}
|
42
30
|
<br/>
|
43
31
|
<div>
|
@@ -51,20 +39,7 @@ RSpec.describe IsoDoc do
|
|
51
39
|
</body>
|
52
40
|
</html>
|
53
41
|
OUTPUT
|
54
|
-
|
55
|
-
|
56
|
-
it "cross-references external documents in DOC" do
|
57
|
-
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">').sub(%r{</div>.*$}m, "</div></div>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
58
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
59
|
-
<preface>
|
60
|
-
<foreword>
|
61
|
-
<p>
|
62
|
-
<xref target='a#b'>a#b</xref>
|
63
|
-
</p>
|
64
|
-
</foreword>
|
65
|
-
</preface>
|
66
|
-
</iso-standard>
|
67
|
-
INPUT
|
42
|
+
doc = <<~OUTPUT
|
68
43
|
<div class="WordSection2">
|
69
44
|
<p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
|
70
45
|
<div>
|
@@ -74,10 +49,18 @@ RSpec.describe IsoDoc do
|
|
74
49
|
</p>
|
75
50
|
</div></div>
|
76
51
|
OUTPUT
|
52
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
53
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
54
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
55
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
56
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
57
|
+
.convert("test", presxml, true)
|
58
|
+
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
|
59
|
+
.sub(%r{</div>.*$}m, "</div></div>"))).to be_equivalent_to xmlpp(doc)
|
77
60
|
end
|
78
61
|
|
79
62
|
it "warns of missing crossreference" do
|
80
|
-
|
63
|
+
i = <<~INPUT
|
81
64
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
82
65
|
<preface>
|
83
66
|
<foreword>
|
@@ -86,10 +69,12 @@ RSpec.describe IsoDoc do
|
|
86
69
|
</preface>
|
87
70
|
</iso-standard>
|
88
71
|
INPUT
|
72
|
+
expect { IsoDoc::PresentationXMLConvert.new({}).convert("test", i, true) }
|
73
|
+
.to output(/No label has been processed for ID N1/).to_stderr
|
89
74
|
end
|
90
75
|
|
91
76
|
it "does not warn of missing crossreference if text is supplied" do
|
92
|
-
|
77
|
+
i = <<~INPUT
|
93
78
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
94
79
|
<preface>
|
95
80
|
<foreword>
|
@@ -98,78 +83,79 @@ RSpec.describe IsoDoc do
|
|
98
83
|
</preface>
|
99
84
|
</iso-standard>
|
100
85
|
INPUT
|
86
|
+
expect { IsoDoc::HtmlConvert.new({}).convert("test", i, true) }
|
87
|
+
.not_to output(/No label has been processed for ID N1/).to_stderr
|
101
88
|
end
|
102
89
|
|
103
90
|
it "cross-references notes" do
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
</annex>
|
167
|
-
</iso-standard>
|
91
|
+
input = <<~INPUT
|
92
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
93
|
+
<preface>
|
94
|
+
<foreword>
|
95
|
+
<p>
|
96
|
+
<xref target="N1"/>
|
97
|
+
<xref target="N2"/>
|
98
|
+
<xref target="N"/>
|
99
|
+
<xref target="note1"/>
|
100
|
+
<xref target="note2"/>
|
101
|
+
<xref target="AN"/>
|
102
|
+
<xref target="Anote1"/>
|
103
|
+
<xref target="Anote2"/>
|
104
|
+
</p>
|
105
|
+
</foreword>
|
106
|
+
<introduction id="intro">
|
107
|
+
<note id="N1">
|
108
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83e">These results are based on a study carried out on three different types of kernel.</p>
|
109
|
+
</note>
|
110
|
+
<clause id="xyz"><title>Preparatory</title>
|
111
|
+
<note id="N2">
|
112
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83d">These results are based on a study carried out on three different types of kernel.</p>
|
113
|
+
</note>
|
114
|
+
</clause>
|
115
|
+
</introduction>
|
116
|
+
</preface>
|
117
|
+
<sections>
|
118
|
+
<clause id="scope" type="scope"><title>Scope</title>
|
119
|
+
<note id="N">
|
120
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
121
|
+
</note>
|
122
|
+
<p><xref target="N"/></p>
|
123
|
+
</clause>
|
124
|
+
<terms id="terms"/>
|
125
|
+
<clause id="widgets"><title>Widgets</title>
|
126
|
+
<clause id="widgets1">
|
127
|
+
<note id="note1">
|
128
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
129
|
+
</note>
|
130
|
+
<note id="note2">
|
131
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
|
132
|
+
</note>
|
133
|
+
<p> <xref target="note1"/> <xref target="note2"/> </p>
|
134
|
+
</clause>
|
135
|
+
</clause>
|
136
|
+
</sections>
|
137
|
+
<annex id="annex1">
|
138
|
+
<clause id="annex1a">
|
139
|
+
<note id="AN">
|
140
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
141
|
+
</note>
|
142
|
+
</clause>
|
143
|
+
<clause id="annex1b">
|
144
|
+
<note id="Anote1">
|
145
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
146
|
+
</note>
|
147
|
+
<note id="Anote2">
|
148
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
|
149
|
+
</note>
|
150
|
+
</clause>
|
151
|
+
</annex>
|
152
|
+
</iso-standard>
|
168
153
|
INPUT
|
154
|
+
output = <<~OUTPUT
|
169
155
|
<?xml version='1.0'?>
|
170
156
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
171
157
|
<preface>
|
172
|
-
<foreword>
|
158
|
+
<foreword displayorder='1'>
|
173
159
|
<p>
|
174
160
|
<xref target='N1'>Introduction, Note</xref>
|
175
161
|
<xref target='N2'>Preparatory, Note</xref>
|
@@ -181,7 +167,7 @@ RSpec.describe IsoDoc do
|
|
181
167
|
<xref target='Anote2'>Annex A.2, Note 2</xref>
|
182
168
|
</p>
|
183
169
|
</foreword>
|
184
|
-
<introduction id='intro'>
|
170
|
+
<introduction id='intro' displayorder="2">
|
185
171
|
<note id='N1'>
|
186
172
|
<name>NOTE</name>
|
187
173
|
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83e'>
|
@@ -202,7 +188,7 @@ RSpec.describe IsoDoc do
|
|
202
188
|
</introduction>
|
203
189
|
</preface>
|
204
190
|
<sections>
|
205
|
-
<clause id='scope' type="scope">
|
191
|
+
<clause id='scope' type="scope" displayorder="3">
|
206
192
|
<title depth='1'>
|
207
193
|
1.
|
208
194
|
<tab/>
|
@@ -219,10 +205,10 @@ RSpec.describe IsoDoc do
|
|
219
205
|
<xref target='N'>Note</xref>
|
220
206
|
</p>
|
221
207
|
</clause>
|
222
|
-
<terms id='terms'>
|
208
|
+
<terms id='terms' displayorder="4">
|
223
209
|
<title>2.</title>
|
224
210
|
</terms>
|
225
|
-
<clause id='widgets'>
|
211
|
+
<clause id='widgets' displayorder="5">
|
226
212
|
<title depth='1'>
|
227
213
|
3.
|
228
214
|
<tab/>
|
@@ -250,7 +236,7 @@ RSpec.describe IsoDoc do
|
|
250
236
|
</clause>
|
251
237
|
</clause>
|
252
238
|
</sections>
|
253
|
-
<annex id='annex1'>
|
239
|
+
<annex id='annex1' displayorder="6">
|
254
240
|
<title>
|
255
241
|
<strong>Annex A</strong>
|
256
242
|
<br/>
|
@@ -284,10 +270,12 @@ RSpec.describe IsoDoc do
|
|
284
270
|
</annex>
|
285
271
|
</iso-standard>
|
286
272
|
OUTPUT
|
273
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
274
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
287
275
|
end
|
288
276
|
|
289
277
|
it "cross-references figures" do
|
290
|
-
|
278
|
+
input = <<~INPUT
|
291
279
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
292
280
|
<preface>
|
293
281
|
<foreword id="fwd">
|
@@ -376,10 +364,11 @@ RSpec.describe IsoDoc do
|
|
376
364
|
</annex>
|
377
365
|
</iso-standard>
|
378
366
|
INPUT
|
367
|
+
output = <<~OUTPUT
|
379
368
|
<?xml version='1.0'?>
|
380
369
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
381
370
|
<preface>
|
382
|
-
<foreword id='fwd'>
|
371
|
+
<foreword id='fwd' displayorder="1">
|
383
372
|
<p>
|
384
373
|
<xref target='N1'>Figure 1</xref>
|
385
374
|
<xref target='N2'>Figure (??)</xref>
|
@@ -395,7 +384,7 @@ RSpec.describe IsoDoc do
|
|
395
384
|
<xref target='Anote3'>Figure A.3</xref>
|
396
385
|
</p>
|
397
386
|
</foreword>
|
398
|
-
<introduction id='intro'>
|
387
|
+
<introduction id='intro' displayorder="2">
|
399
388
|
<figure id='N1'>
|
400
389
|
<name>Figure 1 — Split-it-right sample divider</name>
|
401
390
|
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
@@ -410,7 +399,7 @@ RSpec.describe IsoDoc do
|
|
410
399
|
</introduction>
|
411
400
|
</preface>
|
412
401
|
<sections>
|
413
|
-
<clause id='scope' type="scope">
|
402
|
+
<clause id='scope' type="scope" displayorder="3">
|
414
403
|
<title depth='1'>
|
415
404
|
1.
|
416
405
|
<tab/>
|
@@ -424,10 +413,10 @@ RSpec.describe IsoDoc do
|
|
424
413
|
<xref target='N'>Figure 2</xref>
|
425
414
|
</p>
|
426
415
|
</clause>
|
427
|
-
<terms id='terms'>
|
416
|
+
<terms id='terms' displayorder="4">
|
428
417
|
<title>2.</title>
|
429
418
|
</terms>
|
430
|
-
<clause id='widgets'>
|
419
|
+
<clause id='widgets' displayorder="5">
|
431
420
|
<title depth='1'>
|
432
421
|
3.
|
433
422
|
<tab/>
|
@@ -461,7 +450,7 @@ RSpec.describe IsoDoc do
|
|
461
450
|
</clause>
|
462
451
|
</clause>
|
463
452
|
</sections>
|
464
|
-
<annex id='annex1'>
|
453
|
+
<annex id='annex1' displayorder="6">
|
465
454
|
<title>
|
466
455
|
<strong>Annex A</strong>
|
467
456
|
<br/>
|
@@ -490,10 +479,12 @@ RSpec.describe IsoDoc do
|
|
490
479
|
</annex>
|
491
480
|
</iso-standard>
|
492
481
|
OUTPUT
|
482
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
483
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
493
484
|
end
|
494
485
|
|
495
486
|
it "cross-references subfigures" do
|
496
|
-
|
487
|
+
input = <<~INPUT
|
497
488
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
498
489
|
<preface>
|
499
490
|
<foreword id="fwd">
|
@@ -545,10 +536,11 @@ RSpec.describe IsoDoc do
|
|
545
536
|
</annex>
|
546
537
|
</iso-standard>
|
547
538
|
INPUT
|
539
|
+
output = <<~OUTPUT
|
548
540
|
<?xml version='1.0'?>
|
549
541
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
550
542
|
<preface>
|
551
|
-
<foreword id='fwd'>
|
543
|
+
<foreword id='fwd' displayorder="1">
|
552
544
|
<p>
|
553
545
|
<xref target='N'>Figure 1</xref>
|
554
546
|
<xref target='note1'>Figure 1-1</xref>
|
@@ -560,17 +552,17 @@ RSpec.describe IsoDoc do
|
|
560
552
|
</foreword>
|
561
553
|
</preface>
|
562
554
|
<sections>
|
563
|
-
<clause id='scope' type="scope">
|
555
|
+
<clause id='scope' type="scope" displayorder="2">
|
564
556
|
<title depth='1'>
|
565
557
|
1.
|
566
558
|
<tab/>
|
567
559
|
Scope
|
568
560
|
</title>
|
569
561
|
</clause>
|
570
|
-
<terms id='terms'>
|
562
|
+
<terms id='terms' displayorder="3">
|
571
563
|
<title>2.</title>
|
572
564
|
</terms>
|
573
|
-
<clause id='widgets'>
|
565
|
+
<clause id='widgets' displayorder="4">
|
574
566
|
<title depth='1'>
|
575
567
|
3.
|
576
568
|
<tab/>
|
@@ -594,7 +586,7 @@ RSpec.describe IsoDoc do
|
|
594
586
|
</clause>
|
595
587
|
</clause>
|
596
588
|
</sections>
|
597
|
-
<annex id='annex1'>
|
589
|
+
<annex id='annex1' displayorder="5">
|
598
590
|
<title>
|
599
591
|
<strong>Annex A</strong>
|
600
592
|
<br/>
|
@@ -617,10 +609,12 @@ RSpec.describe IsoDoc do
|
|
617
609
|
</annex>
|
618
610
|
</iso-standard>
|
619
611
|
OUTPUT
|
612
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
613
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
620
614
|
end
|
621
615
|
|
622
616
|
it "cross-references examples" do
|
623
|
-
|
617
|
+
input = <<~INPUT
|
624
618
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
625
619
|
<preface>
|
626
620
|
<foreword>
|
@@ -683,10 +677,11 @@ RSpec.describe IsoDoc do
|
|
683
677
|
</annex>
|
684
678
|
</iso-standard>
|
685
679
|
INPUT
|
680
|
+
output = <<~OUTPUT
|
686
681
|
<?xml version='1.0'?>
|
687
682
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
688
683
|
<preface>
|
689
|
-
<foreword>
|
684
|
+
<foreword displayorder='1'>
|
690
685
|
<p>
|
691
686
|
<xref target='N1'>Introduction, Example</xref>
|
692
687
|
<xref target='N2'>Preparatory, Example (??)</xref>
|
@@ -698,7 +693,7 @@ RSpec.describe IsoDoc do
|
|
698
693
|
<xref target='Anote2'>Annex A.2, Example 1</xref>
|
699
694
|
</p>
|
700
695
|
</foreword>
|
701
|
-
<introduction id='intro'>
|
696
|
+
<introduction id='intro' displayorder="2">
|
702
697
|
<example id='N1'>
|
703
698
|
<name>EXAMPLE</name>
|
704
699
|
<p>Hello</p>
|
@@ -713,7 +708,7 @@ RSpec.describe IsoDoc do
|
|
713
708
|
</introduction>
|
714
709
|
</preface>
|
715
710
|
<sections>
|
716
|
-
<clause id='scope' type="scope">
|
711
|
+
<clause id='scope' type="scope" displayorder="3">
|
717
712
|
<title depth='1'>
|
718
713
|
1.
|
719
714
|
<tab/>
|
@@ -727,10 +722,10 @@ RSpec.describe IsoDoc do
|
|
727
722
|
<xref target='N'>Example</xref>
|
728
723
|
</p>
|
729
724
|
</clause>
|
730
|
-
<terms id='terms'>
|
725
|
+
<terms id='terms' displayorder="4">
|
731
726
|
<title>2.</title>
|
732
727
|
</terms>
|
733
|
-
<clause id='widgets'>
|
728
|
+
<clause id='widgets' displayorder="5">
|
734
729
|
<title depth='1'>
|
735
730
|
3.
|
736
731
|
<tab/>
|
@@ -752,7 +747,7 @@ RSpec.describe IsoDoc do
|
|
752
747
|
</clause>
|
753
748
|
</clause>
|
754
749
|
</sections>
|
755
|
-
<annex id='annex1'>
|
750
|
+
<annex id='annex1' displayorder="6">
|
756
751
|
<title>
|
757
752
|
<strong>Annex A</strong>
|
758
753
|
<br/>
|
@@ -777,10 +772,12 @@ RSpec.describe IsoDoc do
|
|
777
772
|
</annex>
|
778
773
|
</iso-standard>
|
779
774
|
OUTPUT
|
775
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
776
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
780
777
|
end
|
781
778
|
|
782
779
|
it "cross-references formulae" do
|
783
|
-
|
780
|
+
input = <<~INPUT
|
784
781
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
785
782
|
<preface>
|
786
783
|
<foreword>
|
@@ -843,10 +840,11 @@ RSpec.describe IsoDoc do
|
|
843
840
|
</annex>
|
844
841
|
</iso-standard>
|
845
842
|
INPUT
|
843
|
+
output = <<~OUTPUT
|
846
844
|
<?xml version='1.0'?>
|
847
845
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
848
846
|
<preface>
|
849
|
-
<foreword>
|
847
|
+
<foreword displayorder='1'>
|
850
848
|
<p>
|
851
849
|
<xref target='N1'>Introduction, Formula (1)</xref>
|
852
850
|
<xref target='N2'>Preparatory, Formula ((??))</xref>
|
@@ -858,7 +856,7 @@ RSpec.describe IsoDoc do
|
|
858
856
|
<xref target='Anote2'>Formula (A.2)</xref>
|
859
857
|
</p>
|
860
858
|
</foreword>
|
861
|
-
<introduction id='intro'>
|
859
|
+
<introduction id='intro' displayorder="2">
|
862
860
|
<formula id='N1'>
|
863
861
|
<name>1</name>
|
864
862
|
<stem type='AsciiMath'>r = 1 %</stem>
|
@@ -872,7 +870,7 @@ RSpec.describe IsoDoc do
|
|
872
870
|
</introduction>
|
873
871
|
</preface>
|
874
872
|
<sections>
|
875
|
-
<clause id='scope' type="scope">
|
873
|
+
<clause id='scope' type="scope" displayorder="3">
|
876
874
|
<title depth='1'>
|
877
875
|
1.
|
878
876
|
<tab/>
|
@@ -886,10 +884,10 @@ RSpec.describe IsoDoc do
|
|
886
884
|
<xref target='N'>Formula (2)</xref>
|
887
885
|
</p>
|
888
886
|
</clause>
|
889
|
-
<terms id='terms'>
|
887
|
+
<terms id='terms' displayorder="4">
|
890
888
|
<title>2.</title>
|
891
889
|
</terms>
|
892
|
-
<clause id='widgets'>
|
890
|
+
<clause id='widgets' displayorder="5">
|
893
891
|
<title depth='1'>
|
894
892
|
3.
|
895
893
|
<tab/>
|
@@ -911,7 +909,7 @@ RSpec.describe IsoDoc do
|
|
911
909
|
</clause>
|
912
910
|
</clause>
|
913
911
|
</sections>
|
914
|
-
<annex id='annex1'>
|
912
|
+
<annex id='annex1' displayorder="6">
|
915
913
|
<title>
|
916
914
|
<strong>Annex A</strong>
|
917
915
|
<br/>
|
@@ -935,10 +933,12 @@ RSpec.describe IsoDoc do
|
|
935
933
|
</annex>
|
936
934
|
</iso-standard>
|
937
935
|
OUTPUT
|
936
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
937
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
938
938
|
end
|
939
939
|
|
940
940
|
it "cross-references requirements" do
|
941
|
-
|
941
|
+
input = <<~INPUT
|
942
942
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
943
943
|
<preface>
|
944
944
|
<foreword>
|
@@ -1001,10 +1001,11 @@ RSpec.describe IsoDoc do
|
|
1001
1001
|
</annex>
|
1002
1002
|
</iso-standard>
|
1003
1003
|
INPUT
|
1004
|
+
output = <<~OUTPUT
|
1004
1005
|
<?xml version='1.0'?>
|
1005
1006
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1006
1007
|
<preface>
|
1007
|
-
<foreword>
|
1008
|
+
<foreword displayorder='1'>
|
1008
1009
|
<p>
|
1009
1010
|
<xref target='N1'>Introduction, Requirement 1</xref>
|
1010
1011
|
<xref target='N2'>Preparatory, Requirement (??)</xref>
|
@@ -1016,7 +1017,7 @@ RSpec.describe IsoDoc do
|
|
1016
1017
|
<xref target='Anote2'>Requirement A.2</xref>
|
1017
1018
|
</p>
|
1018
1019
|
</foreword>
|
1019
|
-
<introduction id='intro'>
|
1020
|
+
<introduction id='intro' displayorder="2">
|
1020
1021
|
<requirement id='N1'>
|
1021
1022
|
<name>Requirement 1</name>
|
1022
1023
|
<stem type='AsciiMath'>r = 1 %</stem>
|
@@ -1031,7 +1032,7 @@ RSpec.describe IsoDoc do
|
|
1031
1032
|
</introduction>
|
1032
1033
|
</preface>
|
1033
1034
|
<sections>
|
1034
|
-
<clause id='scope' type="scope">
|
1035
|
+
<clause id='scope' type="scope" displayorder="3">
|
1035
1036
|
<title depth='1'>
|
1036
1037
|
1.
|
1037
1038
|
<tab/>
|
@@ -1045,10 +1046,10 @@ RSpec.describe IsoDoc do
|
|
1045
1046
|
<xref target='N'>Requirement 2</xref>
|
1046
1047
|
</p>
|
1047
1048
|
</clause>
|
1048
|
-
<terms id='terms'>
|
1049
|
+
<terms id='terms' displayorder="4">
|
1049
1050
|
<title>2.</title>
|
1050
1051
|
</terms>
|
1051
|
-
<clause id='widgets'>
|
1052
|
+
<clause id='widgets' displayorder="5">
|
1052
1053
|
<title depth='1'>
|
1053
1054
|
3.
|
1054
1055
|
<tab/>
|
@@ -1070,7 +1071,7 @@ RSpec.describe IsoDoc do
|
|
1070
1071
|
</clause>
|
1071
1072
|
</clause>
|
1072
1073
|
</sections>
|
1073
|
-
<annex id='annex1'>
|
1074
|
+
<annex id='annex1' displayorder="6">
|
1074
1075
|
<title>
|
1075
1076
|
<strong>Annex A</strong>
|
1076
1077
|
<br/>
|
@@ -1095,10 +1096,12 @@ RSpec.describe IsoDoc do
|
|
1095
1096
|
</annex>
|
1096
1097
|
</iso-standard>
|
1097
1098
|
OUTPUT
|
1099
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1100
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1098
1101
|
end
|
1099
1102
|
|
1100
1103
|
it "cross-references recommendations" do
|
1101
|
-
|
1104
|
+
input = <<~INPUT
|
1102
1105
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1103
1106
|
<preface>
|
1104
1107
|
<foreword>
|
@@ -1161,10 +1164,11 @@ RSpec.describe IsoDoc do
|
|
1161
1164
|
</annex>
|
1162
1165
|
</iso-standard>
|
1163
1166
|
INPUT
|
1167
|
+
output = <<~OUTPUT
|
1164
1168
|
<?xml version='1.0'?>
|
1165
1169
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1166
1170
|
<preface>
|
1167
|
-
<foreword>
|
1171
|
+
<foreword displayorder='1'>
|
1168
1172
|
<p>
|
1169
1173
|
<xref target='N1'>Introduction, Recommendation 1</xref>
|
1170
1174
|
<xref target='N2'>Preparatory, Recommendation (??)</xref>
|
@@ -1176,7 +1180,7 @@ RSpec.describe IsoDoc do
|
|
1176
1180
|
<xref target='Anote2'>Recommendation A.2</xref>
|
1177
1181
|
</p>
|
1178
1182
|
</foreword>
|
1179
|
-
<introduction id='intro'>
|
1183
|
+
<introduction id='intro' displayorder="2">
|
1180
1184
|
<recommendation id='N1'>
|
1181
1185
|
<name>Recommendation 1</name>
|
1182
1186
|
<stem type='AsciiMath'>r = 1 %</stem>
|
@@ -1191,7 +1195,7 @@ RSpec.describe IsoDoc do
|
|
1191
1195
|
</introduction>
|
1192
1196
|
</preface>
|
1193
1197
|
<sections>
|
1194
|
-
<clause id='scope' type="scope">
|
1198
|
+
<clause id='scope' type="scope" displayorder="3">
|
1195
1199
|
<title depth='1'>
|
1196
1200
|
1.
|
1197
1201
|
<tab/>
|
@@ -1205,10 +1209,10 @@ RSpec.describe IsoDoc do
|
|
1205
1209
|
<xref target='N'>Recommendation 2</xref>
|
1206
1210
|
</p>
|
1207
1211
|
</clause>
|
1208
|
-
<terms id='terms'>
|
1212
|
+
<terms id='terms' displayorder="4">
|
1209
1213
|
<title>2.</title>
|
1210
1214
|
</terms>
|
1211
|
-
<clause id='widgets'>
|
1215
|
+
<clause id='widgets' displayorder="5">
|
1212
1216
|
<title depth='1'>
|
1213
1217
|
3.
|
1214
1218
|
<tab/>
|
@@ -1230,7 +1234,7 @@ RSpec.describe IsoDoc do
|
|
1230
1234
|
</clause>
|
1231
1235
|
</clause>
|
1232
1236
|
</sections>
|
1233
|
-
<annex id='annex1'>
|
1237
|
+
<annex id='annex1' displayorder="6">
|
1234
1238
|
<title>
|
1235
1239
|
<strong>Annex A</strong>
|
1236
1240
|
<br/>
|
@@ -1255,10 +1259,12 @@ RSpec.describe IsoDoc do
|
|
1255
1259
|
</annex>
|
1256
1260
|
</iso-standard>
|
1257
1261
|
OUTPUT
|
1262
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1263
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1258
1264
|
end
|
1259
1265
|
|
1260
1266
|
it "cross-references permissions" do
|
1261
|
-
|
1267
|
+
input = <<~INPUT
|
1262
1268
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1263
1269
|
<preface>
|
1264
1270
|
<foreword>
|
@@ -1321,10 +1327,11 @@ RSpec.describe IsoDoc do
|
|
1321
1327
|
</annex>
|
1322
1328
|
</iso-standard>
|
1323
1329
|
INPUT
|
1330
|
+
output = <<~OUTPUT
|
1324
1331
|
<?xml version='1.0'?>
|
1325
1332
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1326
1333
|
<preface>
|
1327
|
-
<foreword>
|
1334
|
+
<foreword displayorder='1'>
|
1328
1335
|
<p>
|
1329
1336
|
<xref target='N1'>Introduction, Permission 1</xref>
|
1330
1337
|
<xref target='N2'>Preparatory, Permission (??)</xref>
|
@@ -1336,7 +1343,7 @@ RSpec.describe IsoDoc do
|
|
1336
1343
|
<xref target='Anote2'>Permission A.2</xref>
|
1337
1344
|
</p>
|
1338
1345
|
</foreword>
|
1339
|
-
<introduction id='intro'>
|
1346
|
+
<introduction id='intro' displayorder="2">
|
1340
1347
|
<permission id='N1'>
|
1341
1348
|
<name>Permission 1</name>
|
1342
1349
|
<stem type='AsciiMath'>r = 1 %</stem>
|
@@ -1351,7 +1358,7 @@ RSpec.describe IsoDoc do
|
|
1351
1358
|
</introduction>
|
1352
1359
|
</preface>
|
1353
1360
|
<sections>
|
1354
|
-
<clause id='scope' type="scope">
|
1361
|
+
<clause id='scope' type="scope" displayorder="3">
|
1355
1362
|
<title depth='1'>
|
1356
1363
|
1.
|
1357
1364
|
<tab/>
|
@@ -1365,10 +1372,10 @@ RSpec.describe IsoDoc do
|
|
1365
1372
|
<xref target='N'>Permission 2</xref>
|
1366
1373
|
</p>
|
1367
1374
|
</clause>
|
1368
|
-
<terms id='terms'>
|
1375
|
+
<terms id='terms' displayorder="4">
|
1369
1376
|
<title>2.</title>
|
1370
1377
|
</terms>
|
1371
|
-
<clause id='widgets'>
|
1378
|
+
<clause id='widgets' displayorder="5">
|
1372
1379
|
<title depth='1'>
|
1373
1380
|
3.
|
1374
1381
|
<tab/>
|
@@ -1390,7 +1397,7 @@ RSpec.describe IsoDoc do
|
|
1390
1397
|
</clause>
|
1391
1398
|
</clause>
|
1392
1399
|
</sections>
|
1393
|
-
<annex id='annex1'>
|
1400
|
+
<annex id='annex1' displayorder="6">
|
1394
1401
|
<title>
|
1395
1402
|
<strong>Annex A</strong>
|
1396
1403
|
<br/>
|
@@ -1415,10 +1422,12 @@ RSpec.describe IsoDoc do
|
|
1415
1422
|
</annex>
|
1416
1423
|
</iso-standard>
|
1417
1424
|
OUTPUT
|
1425
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1426
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1418
1427
|
end
|
1419
1428
|
|
1420
1429
|
it "labels and cross-references nested requirements" do
|
1421
|
-
|
1430
|
+
input = <<~INPUT
|
1422
1431
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1423
1432
|
<preface>
|
1424
1433
|
<foreword>
|
@@ -1464,10 +1473,11 @@ RSpec.describe IsoDoc do
|
|
1464
1473
|
</annex>
|
1465
1474
|
</iso-standard>
|
1466
1475
|
INPUT
|
1476
|
+
output = <<~OUTPUT
|
1467
1477
|
<?xml version='1.0'?>
|
1468
1478
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1469
1479
|
<preface>
|
1470
|
-
<foreword>
|
1480
|
+
<foreword displayorder='1'>
|
1471
1481
|
<p>
|
1472
1482
|
<xref target='N1'>Clause 1, Permission 1</xref>
|
1473
1483
|
<xref target='N2'>Clause 1, Permission 1-1</xref>
|
@@ -1483,7 +1493,7 @@ RSpec.describe IsoDoc do
|
|
1483
1493
|
</foreword>
|
1484
1494
|
</preface>
|
1485
1495
|
<sections>
|
1486
|
-
<clause id='xyz'>
|
1496
|
+
<clause id='xyz' displayorder="2">
|
1487
1497
|
<title depth='1'>
|
1488
1498
|
1.
|
1489
1499
|
<tab/>
|
@@ -1506,7 +1516,7 @@ RSpec.describe IsoDoc do
|
|
1506
1516
|
</permission>
|
1507
1517
|
</clause>
|
1508
1518
|
</sections>
|
1509
|
-
<annex id='Axyz'>
|
1519
|
+
<annex id='Axyz' displayorder="3">
|
1510
1520
|
<title>
|
1511
1521
|
<strong>Annex A</strong>
|
1512
1522
|
<br/>
|
@@ -1532,10 +1542,12 @@ RSpec.describe IsoDoc do
|
|
1532
1542
|
</annex>
|
1533
1543
|
</iso-standard>
|
1534
1544
|
OUTPUT
|
1545
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1546
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1535
1547
|
end
|
1536
1548
|
|
1537
1549
|
it "cross-references tables" do
|
1538
|
-
|
1550
|
+
input = <<~INPUT
|
1539
1551
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1540
1552
|
<preface>
|
1541
1553
|
<foreword>
|
@@ -1654,22 +1666,22 @@ RSpec.describe IsoDoc do
|
|
1654
1666
|
</annex>
|
1655
1667
|
</iso-standard>
|
1656
1668
|
INPUT
|
1657
|
-
|
1658
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type=
|
1669
|
+
output = <<~OUTPUT
|
1670
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1659
1671
|
<preface>
|
1660
|
-
<foreword>
|
1672
|
+
<foreword displayorder='1'>
|
1661
1673
|
<p>
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1674
|
+
<xref target='N1'>Table 1</xref>
|
1675
|
+
<xref target='N2'>Table (??)</xref>
|
1676
|
+
<xref target='N'>Table 2</xref>
|
1677
|
+
<xref target='note1'>Table 3</xref>
|
1678
|
+
<xref target='note2'>Table 4</xref>
|
1679
|
+
<xref target='AN'>Table A.1</xref>
|
1680
|
+
<xref target='Anote1'>Table (??)</xref>
|
1681
|
+
<xref target='Anote2'>Table A.2</xref>
|
1670
1682
|
</p>
|
1671
1683
|
</foreword>
|
1672
|
-
<introduction id='intro'>
|
1684
|
+
<introduction id='intro' displayorder='2'>
|
1673
1685
|
<table id='N1'>
|
1674
1686
|
<name>Table 1 — Repeatability and reproducibility of husked rice yield</name>
|
1675
1687
|
<tbody>
|
@@ -1696,12 +1708,12 @@ RSpec.describe IsoDoc do
|
|
1696
1708
|
</introduction>
|
1697
1709
|
</preface>
|
1698
1710
|
<sections>
|
1699
|
-
<clause id='scope' type=
|
1711
|
+
<clause id='scope' type='scope' displayorder='3'>
|
1700
1712
|
<title depth='1'>
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1713
|
+
1.
|
1714
|
+
<tab/>
|
1715
|
+
Scope
|
1716
|
+
</title>
|
1705
1717
|
<table id='N'>
|
1706
1718
|
<name>Table 2 — Repeatability and reproducibility of husked rice yield</name>
|
1707
1719
|
<tbody>
|
@@ -1716,16 +1728,17 @@ RSpec.describe IsoDoc do
|
|
1716
1728
|
<xref target='N'>Table 2</xref>
|
1717
1729
|
</p>
|
1718
1730
|
</clause>
|
1719
|
-
<terms id='terms'>
|
1720
|
-
|
1721
|
-
|
1722
|
-
<clause id='widgets'>
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
<clause id='widgets1'
|
1731
|
+
<terms id='terms' displayorder='4'>
|
1732
|
+
<title>2.</title>
|
1733
|
+
</terms>
|
1734
|
+
<clause id='widgets' displayorder='5'>
|
1735
|
+
<title depth='1'>
|
1736
|
+
3.
|
1737
|
+
<tab/>
|
1738
|
+
Widgets
|
1739
|
+
</title>
|
1740
|
+
<clause id='widgets1'>
|
1741
|
+
<title>3.1.</title>
|
1729
1742
|
<table id='note1'>
|
1730
1743
|
<name>Table 3 — Repeatability and reproducibility of husked rice yield</name>
|
1731
1744
|
<tbody>
|
@@ -1748,18 +1761,19 @@ RSpec.describe IsoDoc do
|
|
1748
1761
|
</table>
|
1749
1762
|
<p>
|
1750
1763
|
<xref target='note1'>Table 3</xref>
|
1751
|
-
|
1764
|
+
<xref target='note2'>Table 4</xref>
|
1752
1765
|
</p>
|
1753
1766
|
</clause>
|
1754
1767
|
</clause>
|
1755
1768
|
</sections>
|
1756
|
-
<annex id='annex1'>
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
<clause id='annex1a'
|
1769
|
+
<annex id='annex1' displayorder='6'>
|
1770
|
+
<title>
|
1771
|
+
<strong>Annex A</strong>
|
1772
|
+
<br/>
|
1773
|
+
(informative)
|
1774
|
+
</title>
|
1775
|
+
<clause id='annex1a'>
|
1776
|
+
<title>A.1.</title>
|
1763
1777
|
<table id='AN'>
|
1764
1778
|
<name>Table A.1 — Repeatability and reproducibility of husked rice yield</name>
|
1765
1779
|
<tbody>
|
@@ -1771,7 +1785,8 @@ RSpec.describe IsoDoc do
|
|
1771
1785
|
</tbody>
|
1772
1786
|
</table>
|
1773
1787
|
</clause>
|
1774
|
-
<clause id='annex1b'
|
1788
|
+
<clause id='annex1b'>
|
1789
|
+
<title>A.2.</title>
|
1775
1790
|
<table id='Anote1' unnumbered='true'>
|
1776
1791
|
<name>Table  — Repeatability and reproducibility of husked rice yield</name>
|
1777
1792
|
<tbody>
|
@@ -1796,43 +1811,45 @@ RSpec.describe IsoDoc do
|
|
1796
1811
|
</annex>
|
1797
1812
|
</iso-standard>
|
1798
1813
|
OUTPUT
|
1814
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1815
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1799
1816
|
end
|
1800
1817
|
|
1801
1818
|
it "cross-references term notes" do
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
</iso-standard>
|
1819
|
+
input = <<~INPUT
|
1820
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1821
|
+
<preface>
|
1822
|
+
<foreword>
|
1823
|
+
<p>
|
1824
|
+
<xref target="note1"/>
|
1825
|
+
<xref target="note2"/>
|
1826
|
+
<xref target="note3"/>
|
1827
|
+
</p>
|
1828
|
+
</foreword>
|
1829
|
+
</preface>
|
1830
|
+
<sections>
|
1831
|
+
<clause id="scope" type="scope"><title>Scope</title>
|
1832
|
+
</clause>
|
1833
|
+
<terms id="terms">
|
1834
|
+
<term id="_waxy_rice"><preferred>waxy rice</preferred>
|
1835
|
+
<termnote id="note1">
|
1836
|
+
<p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
1837
|
+
</termnote></term>
|
1838
|
+
<term id="_nonwaxy_rice"><preferred>nonwaxy rice</preferred>
|
1839
|
+
<termnote id="note2">
|
1840
|
+
<p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
1841
|
+
</termnote>
|
1842
|
+
<termnote id="note3">
|
1843
|
+
<p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
1844
|
+
</termnote></term>
|
1845
|
+
</terms>
|
1846
|
+
</iso-standard>
|
1831
1847
|
INPUT
|
1848
|
+
output = <<~OUTPUT
|
1832
1849
|
<?xml version='1.0'?>
|
1833
1850
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1834
1851
|
<preface>
|
1835
|
-
<foreword>
|
1852
|
+
<foreword displayorder="1">
|
1836
1853
|
<p>
|
1837
1854
|
<xref target='note1'>Clause 2.1, Note 1</xref>
|
1838
1855
|
<xref target='note2'>Clause 2.2, Note 1</xref>
|
@@ -1841,14 +1858,14 @@ RSpec.describe IsoDoc do
|
|
1841
1858
|
</foreword>
|
1842
1859
|
</preface>
|
1843
1860
|
<sections>
|
1844
|
-
<clause id='scope' type="scope">
|
1861
|
+
<clause id='scope' type="scope" displayorder="2">
|
1845
1862
|
<title depth='1'>
|
1846
1863
|
1.
|
1847
1864
|
<tab/>
|
1848
1865
|
Scope
|
1849
1866
|
</title>
|
1850
1867
|
</clause>
|
1851
|
-
<terms id='terms'>
|
1868
|
+
<terms id='terms'displayorder="3">
|
1852
1869
|
<title>2.</title>
|
1853
1870
|
<term id='_waxy_rice'>
|
1854
1871
|
<name>2.1.</name>
|
@@ -1883,10 +1900,12 @@ RSpec.describe IsoDoc do
|
|
1883
1900
|
</sections>
|
1884
1901
|
</iso-standard>
|
1885
1902
|
OUTPUT
|
1903
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1904
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1886
1905
|
end
|
1887
1906
|
|
1888
1907
|
it "cross-references sections" do
|
1889
|
-
|
1908
|
+
input = <<~INPUT
|
1890
1909
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1891
1910
|
<preface>
|
1892
1911
|
<foreword obligation="informative">
|
@@ -1974,161 +1993,165 @@ RSpec.describe IsoDoc do
|
|
1974
1993
|
</bibliography>
|
1975
1994
|
</iso-standard>
|
1976
1995
|
INPUT
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2066
|
-
|
2067
|
-
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
<
|
2101
|
-
|
2102
|
-
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
1996
|
+
output = <<~OUTPUT
|
1997
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1998
|
+
<preface>
|
1999
|
+
<foreword obligation='informative' displayorder='1'>
|
2000
|
+
<title>Foreword</title>
|
2001
|
+
<p id='A'>
|
2002
|
+
This is a preamble#{' '}
|
2003
|
+
<xref target='C'>Introduction Subsection</xref>
|
2004
|
+
<xref target='C1'>Introduction, 2</xref>
|
2005
|
+
<xref target='D'>Clause 1</xref>
|
2006
|
+
<xref target='H'>Clause 3</xref>
|
2007
|
+
<xref target='I'>Clause 3.1</xref>
|
2008
|
+
<xref target='J'>Clause 3.1.1</xref>
|
2009
|
+
<xref target='K'>Clause 3.2</xref>
|
2010
|
+
<xref target='L'>Clause 4</xref>
|
2011
|
+
<xref target='M'>Clause 5</xref>
|
2012
|
+
<xref target='N'>Clause 5.1</xref>
|
2013
|
+
<xref target='O'>Clause 5.2</xref>
|
2014
|
+
<xref target='P'>Annex A</xref>
|
2015
|
+
<xref target='Q'>Annex A.1</xref>
|
2016
|
+
<xref target='Q1'>Annex A.1.1</xref>
|
2017
|
+
<xref target='QQ'>Annex B</xref>
|
2018
|
+
<xref target='QQ1'>Annex B</xref>
|
2019
|
+
<xref target='QQ2'>Annex B.1</xref>
|
2020
|
+
<xref target='R'>Clause 2</xref>
|
2021
|
+
<xref target='S'>Bibliography</xref>
|
2022
|
+
</p>
|
2023
|
+
</foreword>
|
2024
|
+
<introduction id='B' obligation='informative' displayorder='2'>
|
2025
|
+
<title>Introduction</title>
|
2026
|
+
<clause id='C' inline-header='false' obligation='informative'>
|
2027
|
+
<title depth='2'>Introduction Subsection</title>
|
2028
|
+
</clause>
|
2029
|
+
<clause id='C1' inline-header='false' obligation='informative'>Text</clause>
|
2030
|
+
</introduction>
|
2031
|
+
</preface>
|
2032
|
+
<sections>
|
2033
|
+
<clause id='D' obligation='normative' type='scope' displayorder='3'>
|
2034
|
+
<title depth='1'>
|
2035
|
+
1.
|
2036
|
+
<tab/>
|
2037
|
+
Scope
|
2038
|
+
</title>
|
2039
|
+
<p id='E'>Text</p>
|
2040
|
+
</clause>
|
2041
|
+
<terms id='H' obligation='normative' displayorder='5'>
|
2042
|
+
<title depth='1'>
|
2043
|
+
3.
|
2044
|
+
<tab/>
|
2045
|
+
Terms, definitions, symbols and abbreviated terms
|
2046
|
+
</title>
|
2047
|
+
<terms id='I' obligation='normative'>
|
2048
|
+
<title depth='2'>
|
2049
|
+
3.1.
|
2050
|
+
<tab/>
|
2051
|
+
Normal Terms
|
2052
|
+
</title>
|
2053
|
+
<term id='J'>
|
2054
|
+
<name>3.1.1.</name>
|
2055
|
+
<preferred>Term2</preferred>
|
2056
|
+
</term>
|
2057
|
+
</terms>
|
2058
|
+
<definitions id='K'>
|
2059
|
+
<title>3.2.</title>
|
2060
|
+
<dl>
|
2061
|
+
<dt>Symbol</dt>
|
2062
|
+
<dd>Definition</dd>
|
2063
|
+
</dl>
|
2064
|
+
</definitions>
|
2065
|
+
</terms>
|
2066
|
+
<definitions id='L' displayorder='6'>
|
2067
|
+
<title>4.</title>
|
2068
|
+
<dl>
|
2069
|
+
<dt>Symbol</dt>
|
2070
|
+
<dd>Definition</dd>
|
2071
|
+
</dl>
|
2072
|
+
</definitions>
|
2073
|
+
<clause id='M' inline-header='false' obligation='normative' displayorder='7'>
|
2074
|
+
<title depth='1'>
|
2075
|
+
5.
|
2076
|
+
<tab/>
|
2077
|
+
Clause 4
|
2078
|
+
</title>
|
2079
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
2080
|
+
<title depth='2'>
|
2081
|
+
5.1.
|
2082
|
+
<tab/>
|
2083
|
+
Introduction
|
2084
|
+
</title>
|
2085
|
+
</clause>
|
2086
|
+
<clause id='O' inline-header='false' obligation='normative'>
|
2087
|
+
<title depth='2'>
|
2088
|
+
5.2.
|
2089
|
+
<tab/>
|
2090
|
+
Clause 4.2
|
2091
|
+
</title>
|
2092
|
+
</clause>
|
2093
|
+
</clause>
|
2094
|
+
</sections>
|
2095
|
+
<annex id='P' inline-header='false' obligation='normative' displayorder='8'>
|
2096
|
+
<title>
|
2097
|
+
<strong>Annex A</strong>
|
2098
|
+
<br/>
|
2099
|
+
(normative)
|
2100
|
+
<br/>
|
2101
|
+
<br/>
|
2102
|
+
<strong>Annex</strong>
|
2103
|
+
</title>
|
2104
|
+
<clause id='Q' inline-header='false' obligation='normative'>
|
2105
|
+
<title depth='2'>
|
2106
|
+
A.1.
|
2107
|
+
<tab/>
|
2108
|
+
Annex A.1
|
2109
|
+
</title>
|
2110
|
+
<clause id='Q1' inline-header='false' obligation='normative'>
|
2111
|
+
<title depth='3'>
|
2112
|
+
A.1.1.
|
2113
|
+
<tab/>
|
2114
|
+
Annex A.1a
|
2115
|
+
</title>
|
2116
|
+
</clause>
|
2117
|
+
</clause>
|
2118
|
+
</annex>
|
2119
|
+
<annex id='QQ' displayorder='9'>
|
2120
|
+
<title>
|
2121
|
+
<strong>Annex B</strong>
|
2122
|
+
<br/>
|
2123
|
+
(informative)
|
2124
|
+
</title>
|
2125
|
+
<terms id='QQ1'>
|
2126
|
+
<title>B.</title>
|
2127
|
+
<term id='QQ2'>
|
2128
|
+
<name>B.1.</name>
|
2129
|
+
</term>
|
2130
|
+
</terms>
|
2131
|
+
</annex>
|
2132
|
+
<bibliography>
|
2133
|
+
<references id='R' obligation='informative' normative='true' displayorder='4'>
|
2134
|
+
<title depth='1'>
|
2135
|
+
2.
|
2136
|
+
<tab/>
|
2137
|
+
Normative References
|
2138
|
+
</title>
|
2139
|
+
</references>
|
2140
|
+
<clause id='S' obligation='informative' displayorder='10'>
|
2141
|
+
<title depth='1'>Bibliography</title>
|
2142
|
+
<references id='T' obligation='informative' normative='false'>
|
2143
|
+
<title depth='2'>Bibliography Subsection</title>
|
2144
|
+
</references>
|
2145
|
+
</clause>
|
2146
|
+
</bibliography>
|
2147
|
+
</iso-standard>
|
2127
2148
|
OUTPUT
|
2149
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
2150
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
2128
2151
|
end
|
2129
2152
|
|
2130
2153
|
it "cross-references lists" do
|
2131
|
-
|
2154
|
+
input = <<~INPUT
|
2132
2155
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
2133
2156
|
<preface>
|
2134
2157
|
<foreword>
|
@@ -2189,110 +2212,115 @@ RSpec.describe IsoDoc do
|
|
2189
2212
|
</annex>
|
2190
2213
|
</iso-standard>
|
2191
2214
|
INPUT
|
2192
|
-
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2201
|
-
|
2202
|
-
|
2203
|
-
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2207
|
-
|
2208
|
-
|
2209
|
-
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2215
|
-
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
|
2248
|
-
|
2249
|
-
|
2250
|
-
|
2251
|
-
|
2252
|
-
|
2253
|
-
|
2254
|
-
|
2255
|
-
|
2256
|
-
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
</
|
2290
|
-
</
|
2215
|
+
output = <<~OUTPUT
|
2216
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
2217
|
+
<preface>
|
2218
|
+
<foreword displayorder='1'>
|
2219
|
+
<p>
|
2220
|
+
<xref target='N1'>Introduction, List</xref>
|
2221
|
+
<xref target='N2'>Preparatory, List</xref>
|
2222
|
+
<xref target='N'>Clause 1, List</xref>
|
2223
|
+
<xref target='note1'>Clause 3.1, List 1</xref>
|
2224
|
+
<xref target='note2'>Clause 3.1, List 2</xref>
|
2225
|
+
<xref target='AN'>Annex A.1, List</xref>
|
2226
|
+
<xref target='Anote1'>Annex A.2, List 1</xref>
|
2227
|
+
<xref target='Anote2'>Annex A.2, List 2</xref>
|
2228
|
+
</p>
|
2229
|
+
</foreword>
|
2230
|
+
<introduction id='intro' displayorder='2'>
|
2231
|
+
<ol id='N1'>
|
2232
|
+
<li>
|
2233
|
+
<p>A</p>
|
2234
|
+
</li>
|
2235
|
+
</ol>
|
2236
|
+
<clause id='xyz'>
|
2237
|
+
<title depth='2'>Preparatory</title>
|
2238
|
+
<ol id='N2'>
|
2239
|
+
<li>
|
2240
|
+
<p>A</p>
|
2241
|
+
</li>
|
2242
|
+
</ol>
|
2243
|
+
</clause>
|
2244
|
+
</introduction>
|
2245
|
+
</preface>
|
2246
|
+
<sections>
|
2247
|
+
<clause id='scope' type='scope' displayorder='3'>
|
2248
|
+
<title depth='1'>
|
2249
|
+
1.
|
2250
|
+
<tab/>
|
2251
|
+
Scope
|
2252
|
+
</title>
|
2253
|
+
<ol id='N'>
|
2254
|
+
<li>
|
2255
|
+
<p>A</p>
|
2256
|
+
</li>
|
2257
|
+
</ol>
|
2258
|
+
</clause>
|
2259
|
+
<terms id='terms' displayorder='4'>
|
2260
|
+
<title>2.</title>
|
2261
|
+
</terms>
|
2262
|
+
<clause id='widgets' displayorder='5'>
|
2263
|
+
<title depth='1'>
|
2264
|
+
3.
|
2265
|
+
<tab/>
|
2266
|
+
Widgets
|
2267
|
+
</title>
|
2268
|
+
<clause id='widgets1'>
|
2269
|
+
<title>3.1.</title>
|
2270
|
+
<ol id='note1'>
|
2271
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
2272
|
+
These results are based on a study carried out on three different
|
2273
|
+
types of kernel.
|
2274
|
+
</p>
|
2275
|
+
</ol>
|
2276
|
+
<ol id='note2'>
|
2277
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
|
2278
|
+
These results are based on a study carried out on three different
|
2279
|
+
types of kernel.
|
2280
|
+
</p>
|
2281
|
+
</ol>
|
2282
|
+
</clause>
|
2283
|
+
</clause>
|
2284
|
+
</sections>
|
2285
|
+
<annex id='annex1' displayorder='6'>
|
2286
|
+
<title>
|
2287
|
+
<strong>Annex A</strong>
|
2288
|
+
<br/>
|
2289
|
+
(informative)
|
2290
|
+
</title>
|
2291
|
+
<clause id='annex1a'>
|
2292
|
+
<title>A.1.</title>
|
2293
|
+
<ol id='AN'>
|
2294
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
2295
|
+
These results are based on a study carried out on three different
|
2296
|
+
types of kernel.
|
2297
|
+
</p>
|
2298
|
+
</ol>
|
2299
|
+
</clause>
|
2300
|
+
<clause id='annex1b'>
|
2301
|
+
<title>A.2.</title>
|
2302
|
+
<ol id='Anote1'>
|
2303
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
2304
|
+
These results are based on a study carried out on three different
|
2305
|
+
types of kernel.
|
2306
|
+
</p>
|
2307
|
+
</ol>
|
2308
|
+
<ol id='Anote2'>
|
2309
|
+
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
|
2310
|
+
These results are based on a study carried out on three different
|
2311
|
+
types of kernel.
|
2312
|
+
</p>
|
2313
|
+
</ol>
|
2314
|
+
</clause>
|
2315
|
+
</annex>
|
2316
|
+
</iso-standard>
|
2291
2317
|
OUTPUT
|
2318
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
2319
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
2292
2320
|
end
|
2293
2321
|
|
2294
2322
|
it "cross-references list items" do
|
2295
|
-
|
2323
|
+
input = <<~INPUT
|
2296
2324
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
2297
2325
|
<preface>
|
2298
2326
|
<foreword>
|
@@ -2353,105 +2381,110 @@ RSpec.describe IsoDoc do
|
|
2353
2381
|
</annex>
|
2354
2382
|
</iso-standard>
|
2355
2383
|
INPUT
|
2356
|
-
|
2357
|
-
|
2358
|
-
|
2359
|
-
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
|
2365
|
-
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2370
|
-
|
2371
|
-
|
2372
|
-
|
2373
|
-
|
2374
|
-
|
2375
|
-
|
2376
|
-
|
2377
|
-
|
2378
|
-
|
2379
|
-
|
2380
|
-
|
2381
|
-
|
2382
|
-
|
2383
|
-
|
2384
|
-
|
2385
|
-
|
2386
|
-
|
2387
|
-
|
2388
|
-
|
2389
|
-
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2398
|
-
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2412
|
-
|
2413
|
-
|
2414
|
-
|
2415
|
-
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
|
2427
|
-
|
2428
|
-
|
2429
|
-
|
2430
|
-
|
2431
|
-
|
2432
|
-
|
2433
|
-
|
2434
|
-
|
2435
|
-
|
2436
|
-
|
2437
|
-
|
2438
|
-
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2447
|
-
</
|
2448
|
-
</
|
2449
|
-
</
|
2384
|
+
output = <<~OUTPUT
|
2385
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
2386
|
+
<preface>
|
2387
|
+
<foreword displayorder='1'>
|
2388
|
+
<p>
|
2389
|
+
<xref target='N1'>Introduction, a)</xref>
|
2390
|
+
<xref target='N2'>Preparatory, 1)</xref>
|
2391
|
+
<xref target='N'>Clause 1, i)</xref>
|
2392
|
+
<xref target='note1'>Clause 3.1, List 1 a)</xref>
|
2393
|
+
<xref target='note2'>Clause 3.1, List 2 I)</xref>
|
2394
|
+
<xref target='AN'>Annex A.1, A)</xref>
|
2395
|
+
<xref target='Anote1'>Annex A.2, List 1 iv)</xref>
|
2396
|
+
<xref target='Anote2'>Annex A.2, List 2 a)</xref>
|
2397
|
+
</p>
|
2398
|
+
</foreword>
|
2399
|
+
<introduction id='intro' displayorder='2'>
|
2400
|
+
<ol id='N01'>
|
2401
|
+
<li id='N1'>
|
2402
|
+
<p>A</p>
|
2403
|
+
</li>
|
2404
|
+
</ol>
|
2405
|
+
<clause id='xyz'>
|
2406
|
+
<title depth='2'>Preparatory</title>
|
2407
|
+
<ol id='N02' type='arabic'>
|
2408
|
+
<li id='N2'>
|
2409
|
+
<p>A</p>
|
2410
|
+
</li>
|
2411
|
+
</ol>
|
2412
|
+
</clause>
|
2413
|
+
</introduction>
|
2414
|
+
</preface>
|
2415
|
+
<sections>
|
2416
|
+
<clause id='scope' type='scope' displayorder='3'>
|
2417
|
+
<title depth='1'>
|
2418
|
+
1.
|
2419
|
+
<tab/>
|
2420
|
+
Scope
|
2421
|
+
</title>
|
2422
|
+
<ol id='N0' type='roman'>
|
2423
|
+
<li id='N'>
|
2424
|
+
<p>A</p>
|
2425
|
+
</li>
|
2426
|
+
</ol>
|
2427
|
+
</clause>
|
2428
|
+
<terms id='terms' displayorder='4'>
|
2429
|
+
<title>2.</title>
|
2430
|
+
</terms>
|
2431
|
+
<clause id='widgets' displayorder='5'>
|
2432
|
+
<title depth='1'>
|
2433
|
+
3.
|
2434
|
+
<tab/>
|
2435
|
+
Widgets
|
2436
|
+
</title>
|
2437
|
+
<clause id='widgets1'>
|
2438
|
+
<title>3.1.</title>
|
2439
|
+
<ol id='note1l' type='alphabet'>
|
2440
|
+
<li id='note1'>
|
2441
|
+
<p>A</p>
|
2442
|
+
</li>
|
2443
|
+
</ol>
|
2444
|
+
<ol id='note2l' type='roman_upper'>
|
2445
|
+
<li id='note2'>
|
2446
|
+
<p>A</p>
|
2447
|
+
</li>
|
2448
|
+
</ol>
|
2449
|
+
</clause>
|
2450
|
+
</clause>
|
2451
|
+
</sections>
|
2452
|
+
<annex id='annex1' displayorder='6'>
|
2453
|
+
<title>
|
2454
|
+
<strong>Annex A</strong>
|
2455
|
+
<br/>
|
2456
|
+
(informative)
|
2457
|
+
</title>
|
2458
|
+
<clause id='annex1a'>
|
2459
|
+
<title>A.1.</title>
|
2460
|
+
<ol id='ANl' type='alphabet_upper'>
|
2461
|
+
<li id='AN'>
|
2462
|
+
<p>A</p>
|
2463
|
+
</li>
|
2464
|
+
</ol>
|
2465
|
+
</clause>
|
2466
|
+
<clause id='annex1b'>
|
2467
|
+
<title>A.2.</title>
|
2468
|
+
<ol id='Anote1l' type='roman' start='4'>
|
2469
|
+
<li id='Anote1'>
|
2470
|
+
<p>A</p>
|
2471
|
+
</li>
|
2472
|
+
</ol>
|
2473
|
+
<ol id='Anote2l'>
|
2474
|
+
<li id='Anote2'>
|
2475
|
+
<p>A</p>
|
2476
|
+
</li>
|
2477
|
+
</ol>
|
2478
|
+
</clause>
|
2479
|
+
</annex>
|
2480
|
+
</iso-standard>
|
2450
2481
|
OUTPUT
|
2482
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
2483
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
2451
2484
|
end
|
2452
2485
|
|
2453
2486
|
it "cross-references nested list items" do
|
2454
|
-
|
2487
|
+
input = <<~INPUT
|
2455
2488
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
2456
2489
|
<preface>
|
2457
2490
|
<foreword>
|
@@ -2489,10 +2522,11 @@ RSpec.describe IsoDoc do
|
|
2489
2522
|
</sections>
|
2490
2523
|
</iso-standard>
|
2491
2524
|
INPUT
|
2525
|
+
output = <<~OUTPUT
|
2492
2526
|
<?xml version='1.0'?>
|
2493
2527
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
2494
2528
|
<preface>
|
2495
|
-
<foreword>
|
2529
|
+
<foreword displayorder="1">
|
2496
2530
|
<p>
|
2497
2531
|
<xref target='N'>Clause 1, a)</xref>
|
2498
2532
|
<xref target='note1'>Clause 1, a.1)</xref>
|
@@ -2504,7 +2538,7 @@ RSpec.describe IsoDoc do
|
|
2504
2538
|
</foreword>
|
2505
2539
|
</preface>
|
2506
2540
|
<sections>
|
2507
|
-
<clause id='scope' type="scope">
|
2541
|
+
<clause id='scope' type="scope" displayorder="2">
|
2508
2542
|
<title depth='1'>
|
2509
2543
|
1.
|
2510
2544
|
<tab/>
|
@@ -2544,10 +2578,12 @@ RSpec.describe IsoDoc do
|
|
2544
2578
|
</sections>
|
2545
2579
|
</iso-standard>
|
2546
2580
|
OUTPUT
|
2581
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
2582
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
2547
2583
|
end
|
2548
2584
|
|
2549
2585
|
it "cross-references bookmarks" do
|
2550
|
-
|
2586
|
+
input = <<~INPUT
|
2551
2587
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
2552
2588
|
<preface>
|
2553
2589
|
<foreword>
|
@@ -2609,96 +2645,99 @@ RSpec.describe IsoDoc do
|
|
2609
2645
|
</annex>
|
2610
2646
|
</iso-standard>
|
2611
2647
|
INPUT
|
2648
|
+
output = <<~OUTPUT
|
2612
2649
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
2613
|
-
|
2614
|
-
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2621
|
-
|
2622
|
-
|
2623
|
-
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
|
2628
|
-
|
2629
|
-
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2658
|
-
|
2659
|
-
|
2660
|
-
|
2661
|
-
|
2662
|
-
|
2663
|
-
|
2664
|
-
|
2665
|
-
|
2666
|
-
|
2667
|
-
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2676
|
-
|
2677
|
-
|
2678
|
-
|
2679
|
-
|
2680
|
-
|
2681
|
-
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
|
2692
|
-
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2696
|
-
|
2650
|
+
<preface>
|
2651
|
+
<foreword displayorder='1'>
|
2652
|
+
<p>
|
2653
|
+
<xref target='N1'>Introduction</xref>
|
2654
|
+
<xref target='N2'>Preparatory</xref>
|
2655
|
+
<xref target='N'>Clause 1</xref>
|
2656
|
+
<xref target='note1'>Note 2</xref>
|
2657
|
+
<xref target='note2'>Clause 3.1</xref>
|
2658
|
+
<xref target='AN'>Annex A.1</xref>
|
2659
|
+
<xref target='Anote1'>Figure A.1</xref>
|
2660
|
+
<xref target='Anote2'>Annex A.2</xref>
|
2661
|
+
</p>
|
2662
|
+
</foreword>
|
2663
|
+
<introduction id='intro' displayorder='2'>
|
2664
|
+
<p id='N01'>
|
2665
|
+
<bookmark id='N1'/>
|
2666
|
+
</p>
|
2667
|
+
<clause id='xyz'>
|
2668
|
+
<title depth='2'>Preparatory</title>
|
2669
|
+
<p id='N02' type='arabic'>
|
2670
|
+
<bookmark id='N2'/>
|
2671
|
+
</p>
|
2672
|
+
</clause>
|
2673
|
+
</introduction>
|
2674
|
+
</preface>
|
2675
|
+
<sections>
|
2676
|
+
<clause id='scope' type='scope' displayorder='3'>
|
2677
|
+
<title depth='1'>
|
2678
|
+
1.
|
2679
|
+
<tab/>
|
2680
|
+
Scope
|
2681
|
+
</title>
|
2682
|
+
<p id='N0' type='roman'>
|
2683
|
+
<bookmark id='N'/>
|
2684
|
+
</p>
|
2685
|
+
</clause>
|
2686
|
+
<terms id='terms' displayorder='4'>
|
2687
|
+
<title>2.</title>
|
2688
|
+
</terms>
|
2689
|
+
<clause id='widgets' displayorder='5'>
|
2690
|
+
<title depth='1'>
|
2691
|
+
3.
|
2692
|
+
<tab/>
|
2693
|
+
Widgets
|
2694
|
+
</title>
|
2695
|
+
<clause id='widgets1'>
|
2696
|
+
<title>3.1.</title>
|
2697
|
+
<note id='note0'>
|
2698
|
+
<name>NOTE 1</name>
|
2699
|
+
</note>
|
2700
|
+
<note id='note1l' type='alphabet'>
|
2701
|
+
<name>NOTE 2</name>
|
2702
|
+
<bookmark id='note1'/>
|
2703
|
+
</note>
|
2704
|
+
<p id='note2l' type='roman_upper'>
|
2705
|
+
<bookmark id='note2'/>
|
2706
|
+
</p>
|
2707
|
+
</clause>
|
2708
|
+
</clause>
|
2709
|
+
</sections>
|
2710
|
+
<annex id='annex1' displayorder='6'>
|
2711
|
+
<title>
|
2712
|
+
<strong>Annex A</strong>
|
2713
|
+
<br/>
|
2714
|
+
(informative)
|
2715
|
+
</title>
|
2716
|
+
<clause id='annex1a'>
|
2717
|
+
<title>A.1.</title>
|
2718
|
+
<p id='ANl' type='alphabet_upper'>
|
2719
|
+
<bookmark id='AN'/>
|
2720
|
+
</p>
|
2721
|
+
</clause>
|
2722
|
+
<clause id='annex1b'>
|
2723
|
+
<title>A.2.</title>
|
2724
|
+
<figure id='Anote1l' type='roman' start='4'>
|
2725
|
+
<name>Figure A.1</name>
|
2726
|
+
<bookmark id='Anote1'/>
|
2727
|
+
</figure>
|
2728
|
+
<p id='Anote2l'>
|
2729
|
+
<bookmark id='Anote2'/>
|
2730
|
+
</p>
|
2731
|
+
</clause>
|
2732
|
+
</annex>
|
2733
|
+
</iso-standard>
|
2697
2734
|
OUTPUT
|
2735
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
2736
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
2698
2737
|
end
|
2699
2738
|
|
2700
2739
|
it "realises subsequences" do
|
2701
|
-
|
2740
|
+
input = <<~INPUT
|
2702
2741
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
2703
2742
|
<preface>
|
2704
2743
|
<foreword id="fwd">
|
@@ -2741,10 +2780,11 @@ RSpec.describe IsoDoc do
|
|
2741
2780
|
</introduction>
|
2742
2781
|
</iso-standard>
|
2743
2782
|
INPUT
|
2783
|
+
output = <<~OUTPUT
|
2744
2784
|
<?xml version='1.0'?>
|
2745
2785
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
2746
2786
|
<preface>
|
2747
|
-
<foreword id='fwd'>
|
2787
|
+
<foreword id='fwd' displayorder="1">
|
2748
2788
|
<p>
|
2749
2789
|
<xref target='N1'>Figure 1</xref>
|
2750
2790
|
<xref target='N2'>Figure 2a</xref>
|
@@ -2756,7 +2796,7 @@ RSpec.describe IsoDoc do
|
|
2756
2796
|
<xref target='N8'>Figure 5</xref>
|
2757
2797
|
</p>
|
2758
2798
|
</foreword>
|
2759
|
-
<introduction id='intro'>
|
2799
|
+
<introduction id='intro' displayorder="2">
|
2760
2800
|
<figure id='N1'>
|
2761
2801
|
<name>Figure 1 — Split-it-right sample divider</name>
|
2762
2802
|
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
@@ -2793,10 +2833,12 @@ RSpec.describe IsoDoc do
|
|
2793
2833
|
</preface>
|
2794
2834
|
</iso-standard>
|
2795
2835
|
OUTPUT
|
2836
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
2837
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
2796
2838
|
end
|
2797
2839
|
|
2798
2840
|
it "realises numbering overrides" do
|
2799
|
-
|
2841
|
+
input = <<~INPUT
|
2800
2842
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
2801
2843
|
<preface>
|
2802
2844
|
<foreword id="fwd">
|
@@ -2961,275 +3003,277 @@ RSpec.describe IsoDoc do
|
|
2961
3003
|
</bibliography>
|
2962
3004
|
</iso-standard>
|
2963
3005
|
INPUT
|
2964
|
-
|
2965
|
-
|
2966
|
-
|
2967
|
-
|
2968
|
-
|
2969
|
-
|
2970
|
-
|
2971
|
-
|
2972
|
-
|
2973
|
-
|
2974
|
-
|
2975
|
-
|
2976
|
-
|
2977
|
-
|
2978
|
-
|
2979
|
-
|
2980
|
-
|
2981
|
-
|
2982
|
-
</
|
2983
|
-
|
2984
|
-
|
2985
|
-
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
2996
|
-
|
2997
|
-
|
2998
|
-
|
2999
|
-
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
</
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
3036
|
-
|
3037
|
-
|
3038
|
-
|
3039
|
-
|
3040
|
-
|
3041
|
-
|
3042
|
-
|
3043
|
-
|
3044
|
-
|
3045
|
-
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
3049
|
-
|
3050
|
-
|
3051
|
-
|
3052
|
-
|
3053
|
-
|
3054
|
-
|
3055
|
-
|
3056
|
-
|
3057
|
-
|
3058
|
-
|
3059
|
-
|
3060
|
-
|
3061
|
-
|
3062
|
-
|
3063
|
-
|
3064
|
-
|
3065
|
-
|
3066
|
-
|
3067
|
-
|
3068
|
-
|
3069
|
-
|
3070
|
-
|
3071
|
-
|
3072
|
-
|
3073
|
-
|
3074
|
-
|
3075
|
-
|
3076
|
-
|
3077
|
-
|
3078
|
-
|
3079
|
-
|
3080
|
-
|
3081
|
-
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3088
|
-
|
3089
|
-
|
3090
|
-
|
3091
|
-
|
3092
|
-
|
3093
|
-
|
3094
|
-
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
|
3102
|
-
|
3103
|
-
|
3104
|
-
|
3105
|
-
|
3106
|
-
|
3107
|
-
|
3108
|
-
|
3109
|
-
|
3110
|
-
|
3111
|
-
|
3112
|
-
|
3113
|
-
|
3114
|
-
|
3115
|
-
|
3116
|
-
|
3117
|
-
|
3118
|
-
|
3119
|
-
|
3120
|
-
|
3121
|
-
|
3122
|
-
|
3123
|
-
|
3124
|
-
|
3125
|
-
|
3126
|
-
|
3127
|
-
|
3128
|
-
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3132
|
-
|
3133
|
-
|
3134
|
-
|
3135
|
-
|
3136
|
-
|
3137
|
-
|
3138
|
-
|
3139
|
-
|
3140
|
-
|
3141
|
-
|
3142
|
-
|
3143
|
-
|
3144
|
-
|
3145
|
-
|
3146
|
-
|
3147
|
-
|
3148
|
-
|
3149
|
-
|
3150
|
-
|
3151
|
-
|
3152
|
-
|
3153
|
-
|
3154
|
-
|
3155
|
-
|
3156
|
-
|
3157
|
-
|
3158
|
-
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3170
|
-
|
3171
|
-
|
3172
|
-
|
3173
|
-
|
3174
|
-
|
3175
|
-
|
3176
|
-
|
3177
|
-
|
3178
|
-
|
3179
|
-
|
3180
|
-
|
3181
|
-
|
3182
|
-
|
3183
|
-
|
3184
|
-
|
3185
|
-
|
3186
|
-
|
3187
|
-
|
3188
|
-
|
3189
|
-
|
3190
|
-
|
3191
|
-
|
3192
|
-
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
3205
|
-
|
3206
|
-
|
3207
|
-
|
3208
|
-
|
3209
|
-
|
3210
|
-
|
3211
|
-
|
3212
|
-
|
3213
|
-
|
3214
|
-
|
3215
|
-
|
3216
|
-
|
3217
|
-
|
3218
|
-
|
3219
|
-
|
3220
|
-
|
3221
|
-
|
3222
|
-
|
3223
|
-
|
3224
|
-
|
3225
|
-
|
3226
|
-
|
3227
|
-
|
3228
|
-
|
3229
|
-
|
3230
|
-
|
3231
|
-
|
3006
|
+
output = <<~OUTPUT
|
3007
|
+
<?xml version='1.0'?>
|
3008
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
3009
|
+
<preface>
|
3010
|
+
<foreword id='fwd' displayorder='1'>
|
3011
|
+
<p>
|
3012
|
+
<xref target='N1'>Figure 1</xref>
|
3013
|
+
<xref target='N2'>Figure A</xref>
|
3014
|
+
<xref target='N3'>Figure B</xref>
|
3015
|
+
<xref target='N4'>Figure 7</xref>
|
3016
|
+
<xref target='N5'>Figure 8</xref>
|
3017
|
+
<xref target='N6'>Figure 9a</xref>
|
3018
|
+
<xref target='N7'>Figure 9c</xref>
|
3019
|
+
<xref target='N8'>Figure 9d</xref>
|
3020
|
+
<xref target='N9'>Figure 20f</xref>
|
3021
|
+
<xref target='N10'>Figure 20g</xref>
|
3022
|
+
<xref target='N11'>Figure A.1</xref>
|
3023
|
+
<xref target='N12'>Figure A.2</xref>
|
3024
|
+
<xref target='N13'>Figure 100</xref>
|
3025
|
+
</p>
|
3026
|
+
<p>
|
3027
|
+
<xref target='S1'>Clause 1bis</xref>
|
3028
|
+
<xref target='S2'>Clause 2bis</xref>
|
3029
|
+
<xref target='S3'>Clause 3bis</xref>
|
3030
|
+
<xref target='S4'>Clause 3bis.4bis</xref>
|
3031
|
+
<xref target='S12'>Clause 12bis</xref>
|
3032
|
+
<xref target='S13'>Clause 13bis</xref>
|
3033
|
+
<xref target='S14'>Clause 13bis.14bis</xref>
|
3034
|
+
<xref target='S15'>Clause 13bis.14bit</xref>
|
3035
|
+
<xref target='S16'>Clause 13bis.14biu</xref>
|
3036
|
+
<xref target='S17'>Clause 13bis.0</xref>
|
3037
|
+
<xref target='S18'>Clause 13bis.1</xref>
|
3038
|
+
<xref target='S19'>Clause 13bis.2</xref>
|
3039
|
+
<xref target='S20'>Clause 13bis.a</xref>
|
3040
|
+
<xref target='S21'>Clause 13bis.b</xref>
|
3041
|
+
<xref target='S22'>Clause 13bis.B</xref>
|
3042
|
+
<xref target='S23'>Clause 13bis.C</xref>
|
3043
|
+
<xref target='S24'>Clause 16bis</xref>
|
3044
|
+
<xref target='S25'>Annex A</xref>
|
3045
|
+
<xref target='S26'>Annex 17bis</xref>
|
3046
|
+
<xref target='S27'>Annex 17bis.18bis</xref>
|
3047
|
+
<xref target='S28'>Annex 17bit</xref>
|
3048
|
+
<xref target='S29'>Bibliography</xref>
|
3049
|
+
<xref target='S30'>Bibliography Subsection</xref>
|
3050
|
+
</p>
|
3051
|
+
</foreword>
|
3052
|
+
<introduction id='intro' displayorder='2'>
|
3053
|
+
<figure id='N1'>
|
3054
|
+
<name>Figure 1 — Split-it-right sample divider</name>
|
3055
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3056
|
+
</figure>
|
3057
|
+
<figure id='N2' number='A'>
|
3058
|
+
<name>Figure A — Split-it-right sample divider</name>
|
3059
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3060
|
+
</figure>
|
3061
|
+
<figure id='N3'>
|
3062
|
+
<name>Figure B — Split-it-right sample divider</name>
|
3063
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3064
|
+
</figure>
|
3065
|
+
<figure id='N4' number='7'>
|
3066
|
+
<name>Figure 7 — Split-it-right sample divider</name>
|
3067
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3068
|
+
</figure>
|
3069
|
+
<figure id='N5'>
|
3070
|
+
<name>Figure 8 — Split-it-right sample divider</name>
|
3071
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3072
|
+
</figure>
|
3073
|
+
<figure id='N6' subsequence='B'>
|
3074
|
+
<name>Figure 9a — Split-it-right sample divider</name>
|
3075
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3076
|
+
</figure>
|
3077
|
+
<figure id='N7' subsequence='B' number='c'>
|
3078
|
+
<name>Figure 9c — Split-it-right sample divider</name>
|
3079
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3080
|
+
</figure>
|
3081
|
+
<figure id='N8' subsequence='B'>
|
3082
|
+
<name>Figure 9d — Split-it-right sample divider</name>
|
3083
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3084
|
+
</figure>
|
3085
|
+
<figure id='N9' subsequence='C' number='20f'>
|
3086
|
+
<name>Figure 20f — Split-it-right sample divider</name>
|
3087
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3088
|
+
</figure>
|
3089
|
+
<figure id='N10' subsequence='C'>
|
3090
|
+
<name>Figure 20g — Split-it-right sample divider</name>
|
3091
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3092
|
+
</figure>
|
3093
|
+
<figure id='N11' number='A.1'>
|
3094
|
+
<name>Figure A.1 — Split-it-right sample divider</name>
|
3095
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3096
|
+
</figure>
|
3097
|
+
<figure id='N12'>
|
3098
|
+
<name>Figure A.2 — Split-it-right sample divider</name>
|
3099
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3100
|
+
</figure>
|
3101
|
+
<figure id='N13' number='100'>
|
3102
|
+
<name>Figure 100 — Split-it-right sample divider</name>
|
3103
|
+
<image src='rice_images/rice_image1.png' id='_8357ede4-6d44-4672-bac4-9a85e82ab7f0' mimetype='image/png'/>
|
3104
|
+
</figure>
|
3105
|
+
</introduction>
|
3106
|
+
</preface>
|
3107
|
+
<sections>
|
3108
|
+
<clause id='S1' number='1bis' type='scope' inline-header='false' obligation='normative' displayorder='3'>
|
3109
|
+
<title depth='1'>
|
3110
|
+
1bis.
|
3111
|
+
<tab/>
|
3112
|
+
Scope
|
3113
|
+
</title>
|
3114
|
+
<p id='_'>Text</p>
|
3115
|
+
</clause>
|
3116
|
+
<terms id='S3' number='3bis' obligation='normative' displayorder='5'>
|
3117
|
+
<title depth='1'>
|
3118
|
+
3bis.
|
3119
|
+
<tab/>
|
3120
|
+
Terms and definitions
|
3121
|
+
</title>
|
3122
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
3123
|
+
<term id='S4' number='4bis'>
|
3124
|
+
<name>3bis.4bis.</name>
|
3125
|
+
<preferred>Term1</preferred>
|
3126
|
+
</term>
|
3127
|
+
</terms>
|
3128
|
+
<definitions id='S12' number='12bis' type='abbreviated_terms' obligation='normative' displayorder='6'>
|
3129
|
+
<title depth='1'>
|
3130
|
+
12bis.
|
3131
|
+
<tab/>
|
3132
|
+
Abbreviated terms
|
3133
|
+
</title>
|
3134
|
+
</definitions>
|
3135
|
+
<clause id='S13' number='13bis' inline-header='false' obligation='normative' displayorder='7'>
|
3136
|
+
<title depth='1'>
|
3137
|
+
13bis.
|
3138
|
+
<tab/>
|
3139
|
+
Clause 4
|
3140
|
+
</title>
|
3141
|
+
<clause id='S14' number='14bis' inline-header='false' obligation='normative'>
|
3142
|
+
<title depth='2'>
|
3143
|
+
13bis.14bis.
|
3144
|
+
<tab/>
|
3145
|
+
Introduction
|
3146
|
+
</title>
|
3147
|
+
</clause>
|
3148
|
+
<clause id='S15' inline-header='false' obligation='normative'>
|
3149
|
+
<title depth='2'>
|
3150
|
+
13bis.14bit.
|
3151
|
+
<tab/>
|
3152
|
+
Clause A
|
3153
|
+
</title>
|
3154
|
+
</clause>
|
3155
|
+
<clause id='S16' inline-header='false' obligation='normative'>
|
3156
|
+
<title depth='2'>
|
3157
|
+
13bis.14biu.
|
3158
|
+
<tab/>
|
3159
|
+
Clause B
|
3160
|
+
</title>
|
3161
|
+
</clause>
|
3162
|
+
<clause id='S17' number='0' inline-header='false' obligation='normative'>
|
3163
|
+
<title depth='2'>
|
3164
|
+
13bis.0.
|
3165
|
+
<tab/>
|
3166
|
+
Clause C
|
3167
|
+
</title>
|
3168
|
+
</clause>
|
3169
|
+
<clause id='S18' inline-header='false' obligation='normative'>
|
3170
|
+
<title depth='2'>
|
3171
|
+
13bis.1.
|
3172
|
+
<tab/>
|
3173
|
+
Clause D
|
3174
|
+
</title>
|
3175
|
+
</clause>
|
3176
|
+
<clause id='S19' inline-header='false' obligation='normative'>
|
3177
|
+
<title depth='2'>
|
3178
|
+
13bis.2.
|
3179
|
+
<tab/>
|
3180
|
+
Clause E
|
3181
|
+
</title>
|
3182
|
+
</clause>
|
3183
|
+
<clause id='S20' number='a' inline-header='false' obligation='normative'>
|
3184
|
+
<title depth='2'>
|
3185
|
+
13bis.a.
|
3186
|
+
<tab/>
|
3187
|
+
Clause F
|
3188
|
+
</title>
|
3189
|
+
</clause>
|
3190
|
+
<clause id='S21' inline-header='false' obligation='normative'>
|
3191
|
+
<title depth='2'>
|
3192
|
+
13bis.b.
|
3193
|
+
<tab/>
|
3194
|
+
Clause G
|
3195
|
+
</title>
|
3196
|
+
</clause>
|
3197
|
+
<clause id='S22' number='B' inline-header='false' obligation='normative'>
|
3198
|
+
<title depth='2'>
|
3199
|
+
13bis.B.
|
3200
|
+
<tab/>
|
3201
|
+
Clause H
|
3202
|
+
</title>
|
3203
|
+
</clause>
|
3204
|
+
<clause id='S23' inline-header='false' obligation='normative'>
|
3205
|
+
<title depth='2'>
|
3206
|
+
13bis.C.
|
3207
|
+
<tab/>
|
3208
|
+
Clause I
|
3209
|
+
</title>
|
3210
|
+
</clause>
|
3211
|
+
</clause>
|
3212
|
+
<clause id='S24' number='16bis' inline-header='false' obligation='normative' displayorder='8'>
|
3213
|
+
<title depth='1'>
|
3214
|
+
16bis.
|
3215
|
+
<tab/>
|
3216
|
+
Terms and Definitions
|
3217
|
+
</title>
|
3218
|
+
</clause>
|
3219
|
+
</sections>
|
3220
|
+
<annex id='S25' obligation='normative' displayorder='9'>
|
3221
|
+
<title>
|
3222
|
+
<strong>Annex A</strong>
|
3223
|
+
<br/>
|
3224
|
+
(normative)
|
3225
|
+
<br/>
|
3226
|
+
<br/>
|
3227
|
+
<strong>First Annex</strong>
|
3228
|
+
</title>
|
3229
|
+
</annex>
|
3230
|
+
<annex id='S26' number='17bis' inline-header='false' obligation='normative' displayorder='10'>
|
3231
|
+
<title>
|
3232
|
+
<strong>Annex 17bis</strong>
|
3233
|
+
<br/>
|
3234
|
+
(normative)
|
3235
|
+
<br/>
|
3236
|
+
<br/>
|
3237
|
+
<strong>Annex</strong>
|
3238
|
+
</title>
|
3239
|
+
<clause id='S27' number='18bis' inline-header='false' obligation='normative'>
|
3240
|
+
<title depth='2'>
|
3241
|
+
17bis.18bis.
|
3242
|
+
<tab/>
|
3243
|
+
Annex A.1
|
3244
|
+
</title>
|
3245
|
+
</clause>
|
3246
|
+
</annex>
|
3247
|
+
<annex id='S28' inline-header='false' obligation='normative' displayorder='11'>
|
3248
|
+
<title>
|
3249
|
+
<strong>Annex 17bit</strong>
|
3250
|
+
<br/>
|
3251
|
+
(normative)
|
3252
|
+
<br/>
|
3253
|
+
<br/>
|
3254
|
+
<strong>Another Annex</strong>
|
3255
|
+
</title>
|
3256
|
+
</annex>
|
3257
|
+
<bibliography>
|
3258
|
+
<references id='S2' number='2bis' normative='true' obligation='informative' displayorder='4'>
|
3259
|
+
<title depth='1'>
|
3260
|
+
2bis.
|
3261
|
+
<tab/>
|
3262
|
+
Normative references
|
3263
|
+
</title>
|
3264
|
+
<p id='_'>There are no normative references in this document.</p>
|
3265
|
+
</references>
|
3266
|
+
<clause id='S29' number='19bis' obligation='informative' displayorder='12'>
|
3267
|
+
<title depth='1'>Bibliography</title>
|
3268
|
+
<references id='S30' number='20bis' normative='false' obligation='informative'>
|
3269
|
+
<title depth='2'>Bibliography Subsection</title>
|
3270
|
+
</references>
|
3271
|
+
</clause>
|
3272
|
+
</bibliography>
|
3273
|
+
</iso-standard>
|
3232
3274
|
OUTPUT
|
3275
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
3276
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
3233
3277
|
end
|
3234
3278
|
|
3235
3279
|
it "realises roman counter for xrefs" do
|
@@ -3245,4 +3289,54 @@ RSpec.describe IsoDoc do
|
|
3245
3289
|
a.increment({})
|
3246
3290
|
expect(a.print).to eq "V"
|
3247
3291
|
end
|
3292
|
+
|
3293
|
+
it "skips I in counter for xrefs" do
|
3294
|
+
a = IsoDoc::XrefGen::Counter.new("@", skip_i: true)
|
3295
|
+
a.increment({})
|
3296
|
+
a.increment({})
|
3297
|
+
a.increment({})
|
3298
|
+
a.increment({})
|
3299
|
+
a.increment({})
|
3300
|
+
a.increment({})
|
3301
|
+
a.increment({})
|
3302
|
+
a.increment({})
|
3303
|
+
expect(a.print).to eq "H"
|
3304
|
+
a.increment({})
|
3305
|
+
expect(a.print).to eq "J"
|
3306
|
+
a = IsoDoc::XrefGen::Counter.new("@")
|
3307
|
+
a.increment({})
|
3308
|
+
a.increment({})
|
3309
|
+
a.increment({})
|
3310
|
+
a.increment({})
|
3311
|
+
a.increment({})
|
3312
|
+
a.increment({})
|
3313
|
+
a.increment({})
|
3314
|
+
a.increment({})
|
3315
|
+
expect(a.print).to eq "H"
|
3316
|
+
a.increment({})
|
3317
|
+
expect(a.print).to eq "I"
|
3318
|
+
end
|
3319
|
+
|
3320
|
+
it "increments counter past Z for xrefs" do
|
3321
|
+
a = IsoDoc::XrefGen::Counter.new("Z")
|
3322
|
+
a.increment({})
|
3323
|
+
expect(a.print).to eq "AA"
|
3324
|
+
a.increment({})
|
3325
|
+
expect(a.print).to eq "AB"
|
3326
|
+
a = IsoDoc::XrefGen::Counter.new("BZ")
|
3327
|
+
a.increment({})
|
3328
|
+
expect(a.print).to eq "CA"
|
3329
|
+
a.increment({})
|
3330
|
+
expect(a.print).to eq "CB"
|
3331
|
+
a = IsoDoc::XrefGen::Counter.new("z")
|
3332
|
+
a.increment({})
|
3333
|
+
expect(a.print).to eq "aa"
|
3334
|
+
a.increment({})
|
3335
|
+
expect(a.print).to eq "ab"
|
3336
|
+
a = IsoDoc::XrefGen::Counter.new("Az")
|
3337
|
+
a.increment({})
|
3338
|
+
expect(a.print).to eq "Ba"
|
3339
|
+
a.increment({})
|
3340
|
+
expect(a.print).to eq "Bb"
|
3341
|
+
end
|
3248
3342
|
end
|