isodoc 1.5.5 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/isodoc.gemspec +10 -10
- data/lib/isodoc/base_style/all.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.css +7 -0
- data/lib/isodoc/base_style/metanorma_word.scss +8 -0
- data/lib/isodoc/base_style/reset.css +7 -0
- data/lib/isodoc/base_style/reset.scss +9 -0
- data/lib/isodoc/base_style/scripts.html +187 -0
- data/lib/isodoc/class_utils.rb +6 -5
- data/lib/isodoc/convert.rb +24 -15
- data/lib/isodoc/css.rb +14 -9
- data/lib/isodoc/function/inline.rb +31 -10
- data/lib/isodoc/function/to_word_html.rb +19 -9
- data/lib/isodoc/function/utils.rb +1 -0
- data/lib/isodoc/pdf_convert.rb +1 -3
- data/lib/isodoc/presentation_function/inline.rb +31 -19
- data/lib/isodoc/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xslfo_convert.rb +36 -27
- data/spec/isodoc/footnotes_spec.rb +1 -16
- data/spec/isodoc/inline_spec.rb +34 -0
- data/spec/isodoc/postproc_spec.rb +36 -12
- data/spec/isodoc/presentation_xml_spec.rb +345 -342
- data/spec/isodoc/section_spec.rb +910 -902
- data/spec/isodoc/table_spec.rb +566 -556
- data/spec/isodoc/terms_spec.rb +252 -256
- data/spec/isodoc/xref_spec.rb +2991 -2994
- data/spec/isodoc/xslfo_convert_spec.rb +39 -0
- data/spec/spec_helper.rb +30 -29
- metadata +67 -65
data/spec/isodoc/section_spec.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
-
|
5
|
-
|
4
|
+
it "processes prefatory blocks" do
|
5
|
+
input = <<~INPUT
|
6
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
7
|
<preface>
|
8
8
|
<abstract id="A"><title>abstract</title></abstract>
|
@@ -20,140 +20,143 @@ RSpec.describe IsoDoc do
|
|
20
20
|
</sections>
|
21
21
|
</iso-standard>
|
22
22
|
INPUT
|
23
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
23
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
24
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
25
|
+
<html lang='en'>
|
26
|
+
<head/>
|
27
|
+
<body lang='en'>
|
28
|
+
<div class='title-section'>
|
29
|
+
<p> </p>
|
30
|
+
</div>
|
31
|
+
<br/>
|
32
|
+
<div class='prefatory-section'>
|
33
|
+
<p> </p>
|
34
|
+
</div>
|
35
|
+
<br/>
|
36
|
+
<div class='main-section'>
|
37
|
+
<div id='C' class='Note'>note</div>
|
38
|
+
<br/>
|
39
|
+
<div id='A'>
|
40
|
+
<h1 class='AbstractTitle'>abstract</h1>
|
41
|
+
</div>
|
42
|
+
<br/>
|
43
|
+
<div class='Section3' id='B'>
|
44
|
+
<h1 class='IntroTitle'>introduction</h1>
|
45
|
+
</div>
|
46
|
+
<p class='zzSTDTitle1'/>
|
47
|
+
<div id='L' class='Admonition'>
|
48
|
+
<p class='AdmonitionTitle' style='text-align:center;'>CAUTION</p>
|
49
|
+
<p>admonition</p>
|
50
|
+
</div>
|
51
|
+
<div id='M'>
|
52
|
+
<h1>Clause 4</h1>
|
53
|
+
<div id='N'>
|
54
|
+
<h2>Introduction</h2>
|
55
|
+
</div>
|
56
|
+
<div id='O'>
|
57
|
+
<span class='zzMoveToFollowing'>
|
58
|
+
<b>Clause 4.2  </b>
|
59
|
+
</span>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</body>
|
64
|
+
</html>
|
65
|
+
OUTPUT
|
66
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
67
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
68
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
69
|
+
<head>
|
70
|
+
<style>
|
71
|
+
</style>
|
72
|
+
</head>
|
73
|
+
<body lang='EN-US' link='blue' vlink='#954F72'>
|
74
|
+
<div class='WordSection1'>
|
75
|
+
<p> </p>
|
76
|
+
</div>
|
77
|
+
<p>
|
78
|
+
<br clear='all' class='section'/>
|
79
|
+
</p>
|
80
|
+
<div class='WordSection2'>
|
81
|
+
<div id='C' class='Note'>
|
82
|
+
<p class='Note'>
|
83
|
+
<span class='note_label'/>
|
84
|
+
<span style='mso-tab-count:1'>  </span>
|
85
|
+
</p>
|
86
|
+
note
|
87
|
+
</div>
|
88
|
+
<p>
|
89
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
90
|
+
</p>
|
91
|
+
<div id='A'>
|
92
|
+
<h1 class='AbstractTitle'>abstract</h1>
|
93
|
+
</div>
|
94
|
+
<p>
|
95
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
96
|
+
</p>
|
97
|
+
<div class='Section3' id='B'>
|
98
|
+
<h1 class='IntroTitle'>introduction</h1>
|
99
|
+
</div>
|
100
|
+
<p> </p>
|
101
|
+
</div>
|
102
|
+
<p>
|
103
|
+
<br clear='all' class='section'/>
|
104
|
+
</p>
|
105
|
+
<div class='WordSection3'>
|
106
|
+
<p class='zzSTDTitle1'/>
|
107
|
+
<div id='L' class='Admonition'>
|
108
|
+
<p class='AdmonitionTitle' style='text-align:center;'>CAUTION</p>
|
109
|
+
<p>admonition</p>
|
110
|
+
</div>
|
111
|
+
<div id='M'>
|
112
|
+
<h1>Clause 4</h1>
|
113
|
+
<div id='N'>
|
114
|
+
<h2>Introduction</h2>
|
115
|
+
</div>
|
116
|
+
<div id='O'>
|
117
|
+
<span class='zzMoveToFollowing'>
|
118
|
+
<b>
|
119
|
+
Clause 4.2
|
120
|
+
<span style='mso-tab-count:1'>  </span>
|
121
|
+
</b>
|
122
|
+
</span>
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
</body>
|
127
|
+
</html>
|
128
|
+
OUTPUT
|
129
|
+
end
|
130
|
+
|
131
|
+
it "processes document with no content" do
|
132
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
133
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
134
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
135
|
+
<preface/>
|
136
|
+
<sections/>
|
137
|
+
</iso-standard>
|
138
|
+
INPUT
|
139
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
|
140
|
+
<head/>
|
141
|
+
<body lang="en">
|
142
|
+
<div class="title-section">
|
143
|
+
<p> </p>
|
40
144
|
</div>
|
41
145
|
<br/>
|
42
|
-
<div class=
|
43
|
-
<
|
44
|
-
</div>
|
45
|
-
<p class='zzSTDTitle1'/>
|
46
|
-
<div id='L' class='Admonition'>
|
47
|
-
<p class='AdmonitionTitle' style='text-align:center;'>CAUTION</p>
|
48
|
-
<p>admonition</p>
|
49
|
-
</div>
|
50
|
-
<div id='M'>
|
51
|
-
<h1>Clause 4</h1>
|
52
|
-
<div id='N'>
|
53
|
-
<h2>Introduction</h2>
|
54
|
-
</div>
|
55
|
-
<div id='O'>
|
56
|
-
<span class='zzMoveToFollowing'>
|
57
|
-
<b>Clause 4.2  </b>
|
58
|
-
</span>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</body>
|
63
|
-
</html>
|
64
|
-
OUTPUT
|
65
|
-
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
66
|
-
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
67
|
-
<head>
|
68
|
-
<style>
|
69
|
-
</style>
|
70
|
-
</head>
|
71
|
-
<body lang='EN-US' link='blue' vlink='#954F72'>
|
72
|
-
<div class='WordSection1'>
|
73
|
-
<p> </p>
|
74
|
-
</div>
|
75
|
-
<p>
|
76
|
-
<br clear='all' class='section'/>
|
77
|
-
</p>
|
78
|
-
<div class='WordSection2'>
|
79
|
-
<div id='C' class='Note'>
|
80
|
-
<p class='Note'>
|
81
|
-
<span class='note_label'/>
|
82
|
-
<span style='mso-tab-count:1'>  </span>
|
83
|
-
</p>
|
84
|
-
note
|
85
|
-
</div>
|
86
|
-
<p>
|
87
|
-
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
88
|
-
</p>
|
89
|
-
<div id='A'>
|
90
|
-
<h1 class='AbstractTitle'>abstract</h1>
|
146
|
+
<div class="prefatory-section">
|
147
|
+
<p> </p>
|
91
148
|
</div>
|
92
|
-
<
|
93
|
-
|
94
|
-
|
95
|
-
<div class='Section3' id='B'>
|
96
|
-
<h1 class='IntroTitle'>introduction</h1>
|
97
|
-
</div>
|
98
|
-
<p> </p>
|
99
|
-
</div>
|
100
|
-
<p>
|
101
|
-
<br clear='all' class='section'/>
|
102
|
-
</p>
|
103
|
-
<div class='WordSection3'>
|
104
|
-
<p class='zzSTDTitle1'/>
|
105
|
-
<div id='L' class='Admonition'>
|
106
|
-
<p class='AdmonitionTitle' style='text-align:center;'>CAUTION</p>
|
107
|
-
<p>admonition</p>
|
108
|
-
</div>
|
109
|
-
<div id='M'>
|
110
|
-
<h1>Clause 4</h1>
|
111
|
-
<div id='N'>
|
112
|
-
<h2>Introduction</h2>
|
113
|
-
</div>
|
114
|
-
<div id='O'>
|
115
|
-
<span class='zzMoveToFollowing'>
|
116
|
-
<b>
|
117
|
-
Clause 4.2
|
118
|
-
<span style='mso-tab-count:1'>  </span>
|
119
|
-
</b>
|
120
|
-
</span>
|
121
|
-
</div>
|
149
|
+
<br/>
|
150
|
+
<div class="main-section">
|
151
|
+
<p class="zzSTDTitle1"/>
|
122
152
|
</div>
|
123
|
-
</
|
124
|
-
</
|
125
|
-
</html>
|
153
|
+
</body>
|
154
|
+
</html>
|
126
155
|
OUTPUT
|
127
|
-
|
128
|
-
|
129
|
-
it "processes document with no content" do
|
130
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
131
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
132
|
-
<preface/>
|
133
|
-
<sections/>
|
134
|
-
</iso-standard>
|
135
|
-
INPUT
|
136
|
-
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
|
137
|
-
<head/>
|
138
|
-
<body lang="en">
|
139
|
-
<div class="title-section">
|
140
|
-
<p> </p>
|
141
|
-
</div>
|
142
|
-
<br/>
|
143
|
-
<div class="prefatory-section">
|
144
|
-
<p> </p>
|
145
|
-
</div>
|
146
|
-
<br/>
|
147
|
-
<div class="main-section">
|
148
|
-
<p class="zzSTDTitle1"/>
|
149
|
-
</div>
|
150
|
-
</body>
|
151
|
-
</html>
|
152
|
-
OUTPUT
|
153
|
-
end
|
156
|
+
end
|
154
157
|
|
155
|
-
|
156
|
-
|
158
|
+
it "processes section names" do
|
159
|
+
input = <<~"INPUT"
|
157
160
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
158
161
|
<boilerplate>
|
159
162
|
<copyright-statement>
|
@@ -201,7 +204,6 @@ OUTPUT
|
|
201
204
|
<title>Scope</title>
|
202
205
|
<p id="E">Text</p>
|
203
206
|
</clause>
|
204
|
-
|
205
207
|
<clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
|
206
208
|
<title>Normal Terms</title>
|
207
209
|
<term id="J">
|
@@ -232,7 +234,6 @@ OUTPUT
|
|
232
234
|
<clause id="O1" inline-header="false" obligation="normative">
|
233
235
|
</clause>
|
234
236
|
</clause>
|
235
|
-
|
236
237
|
</sections><annex id="P" inline-header="false" obligation="normative">
|
237
238
|
<title>Annex</title>
|
238
239
|
<clause id="Q" inline-header="false" obligation="normative">
|
@@ -260,648 +261,652 @@ OUTPUT
|
|
260
261
|
INPUT
|
261
262
|
|
262
263
|
presxml = <<~"PRESXML"
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
</iso-standard>
|
387
|
-
|
388
|
-
|
389
|
-
html = <<~"OUTPUT"
|
390
|
-
#{HTML_HDR}
|
391
|
-
<div class='authority'>
|
392
|
-
<div class='boilerplate-copyright'>
|
393
|
-
<div>
|
394
|
-
<h1>Copyright</h1>
|
395
|
-
</div>
|
396
|
-
</div>
|
397
|
-
<div class='boilerplate-license'>
|
398
|
-
<div>
|
399
|
-
<h1>License</h1>
|
400
|
-
</div>
|
401
|
-
</div>
|
402
|
-
<div class='boilerplate-legal'>
|
403
|
-
<div>
|
404
|
-
<h1>Legal</h1>
|
405
|
-
</div>
|
406
|
-
</div>
|
407
|
-
<div class='boilerplate-feedback'>
|
408
|
-
<div>
|
409
|
-
<h1>Feedback</h1>
|
410
|
-
</div>
|
411
|
-
</div>
|
412
|
-
</div>
|
413
|
-
<br/>
|
414
|
-
<div>
|
415
|
-
<h1 class="AbstractTitle">Abstract</h1>
|
416
|
-
</div>
|
417
|
-
|
418
|
-
<br/>
|
419
|
-
<div>
|
420
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
421
|
-
<p id="A">This is a preamble</p>
|
422
|
-
</div>
|
423
|
-
<br/>
|
424
|
-
<div class="Section3" id="B">
|
425
|
-
<h1 class="IntroTitle">Introduction</h1>
|
426
|
-
<div id="C">
|
427
|
-
<h2>Introduction Subsection</h2>
|
428
|
-
</div>
|
429
|
-
</div>
|
430
|
-
<br/>
|
431
|
-
<div class='Section3' id='B1'>
|
432
|
-
<h1 class='IntroTitle'>Dedication</h1>
|
433
|
-
</div>
|
434
|
-
<br/>
|
435
|
-
<div class='Section3' id='B2'>
|
436
|
-
<h1 class='IntroTitle'>Note to reader</h1>
|
437
|
-
</div>
|
438
|
-
<br/>
|
439
|
-
<div class='Section3' id=''>
|
440
|
-
<h1 class='IntroTitle'>Acknowledgements</h1>
|
441
|
-
</div>
|
442
|
-
<p class="zzSTDTitle1"/>
|
443
|
-
<div id='NN1' class='Note'>
|
444
|
-
<p>
|
445
|
-
<span class='note_label'>NOTE</span>
|
446
|
-
  Initial note
|
447
|
-
</p>
|
448
|
-
</div>
|
449
|
-
<div id='NN2' class='Admonition'>
|
450
|
-
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
451
|
-
<p>Initial admonition</p>
|
452
|
-
</div>
|
453
|
-
<div id="D">
|
454
|
-
<h1>1.  Scope</h1>
|
455
|
-
<p id="E">Text</p>
|
456
|
-
</div>
|
457
|
-
<div>
|
458
|
-
<h1>2.  Normative References</h1>
|
459
|
-
</div>
|
460
|
-
<div id="H"><h1>3.  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
461
|
-
<div id="I">
|
462
|
-
<h2>3.1.  Normal Terms</h2>
|
463
|
-
<p class="TermNum" id="J">3.1.1.</p>
|
464
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
465
|
-
|
466
|
-
</div><div id="K"><h2>3.2.  Definitions</h2>
|
467
|
-
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
468
|
-
</div></div>
|
469
|
-
<div id="L" class="Symbols">
|
470
|
-
<h1>4.  Symbols and abbreviated terms</h1>
|
471
|
-
<dl>
|
472
|
-
<dt>
|
473
|
-
<p>Symbol</p>
|
474
|
-
</dt>
|
475
|
-
<dd>Definition</dd>
|
476
|
-
</dl>
|
477
|
-
</div>
|
478
|
-
<div id="M">
|
479
|
-
<h1>5.  Clause 4</h1>
|
480
|
-
<div id="N">
|
481
|
-
<h2>5.1.  Introduction</h2>
|
482
|
-
</div>
|
483
|
-
<div id="O">
|
484
|
-
<h2>5.2.  Clause 4.2</h2>
|
485
|
-
</div>
|
486
|
-
<div id="O1">
|
487
|
-
<h2>5.3.</h2>
|
488
|
-
</div>
|
489
|
-
</div>
|
490
|
-
<br/>
|
491
|
-
<div id="P" class="Section3">
|
492
|
-
<h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
|
493
|
-
<div id="Q">
|
494
|
-
<h2>A.1.  Annex A.1</h2>
|
495
|
-
<div id="Q1">
|
496
|
-
<h3>A.1.1.  Annex A.1a</h3>
|
497
|
-
</div>
|
498
|
-
<div><h3 class="Section3">A.1.2.  Annex Bibliography</h3></div>
|
499
|
-
</div>
|
264
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
265
|
+
<boilerplate>
|
266
|
+
<copyright-statement>
|
267
|
+
<clause>
|
268
|
+
<title depth="1">Copyright</title>
|
269
|
+
</clause>
|
270
|
+
</copyright-statement>
|
271
|
+
<license-statement>
|
272
|
+
<clause>
|
273
|
+
<title depth="1">License</title>
|
274
|
+
</clause>
|
275
|
+
</license-statement>
|
276
|
+
<legal-statement>
|
277
|
+
<clause>
|
278
|
+
<title depth="1">Legal</title>
|
279
|
+
</clause>
|
280
|
+
</legal-statement>
|
281
|
+
<feedback-statement>
|
282
|
+
<clause>
|
283
|
+
<title depth="1">Feedback</title>
|
284
|
+
</clause>
|
285
|
+
</feedback-statement>
|
286
|
+
</boilerplate>
|
287
|
+
<preface>
|
288
|
+
<abstract obligation='informative'>
|
289
|
+
<title>Abstract</title>
|
290
|
+
</abstract>
|
291
|
+
<foreword obligation='informative'>
|
292
|
+
<title>Foreword</title>
|
293
|
+
<p id='A'>This is a preamble</p>
|
294
|
+
</foreword>
|
295
|
+
<introduction id='B' obligation='informative'>
|
296
|
+
<title>Introduction</title>
|
297
|
+
<clause id='C' inline-header='false' obligation='informative'>
|
298
|
+
<title depth='2'>Introduction Subsection</title>
|
299
|
+
</clause>
|
300
|
+
</introduction>
|
301
|
+
<clause id='B1'>
|
302
|
+
<title depth='1'>Dedication</title>
|
303
|
+
</clause>
|
304
|
+
<clause id='B2'>
|
305
|
+
<title depth='1'>Note to reader</title>
|
306
|
+
</clause>
|
307
|
+
<acknowledgements obligation='informative'>
|
308
|
+
<title>Acknowledgements</title>
|
309
|
+
</acknowledgements>
|
310
|
+
</preface>
|
311
|
+
<sections>
|
312
|
+
<note id='NN1'>
|
313
|
+
<name>NOTE</name>
|
314
|
+
<p>Initial note</p>
|
315
|
+
</note>
|
316
|
+
<admonition id='NN2' type='warning'>
|
317
|
+
<p>Initial admonition</p>
|
318
|
+
</admonition>
|
319
|
+
<clause id='D' obligation='normative' type='scope'>
|
320
|
+
<title depth='1'>1.<tab/>Scope</title>
|
321
|
+
<p id='E'>Text</p>
|
322
|
+
</clause>
|
323
|
+
<clause id='H' obligation='normative'>
|
324
|
+
<title depth='1'>3.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
325
|
+
<terms id='I' obligation='normative'>
|
326
|
+
<title depth='2'>3.1.<tab/>Normal Terms</title>
|
327
|
+
<term id='J'>
|
328
|
+
<name>3.1.1.</name>
|
329
|
+
<preferred>Term2</preferred>
|
330
|
+
</term>
|
331
|
+
</terms>
|
332
|
+
<definitions id='K'>
|
333
|
+
<title depth='2'>3.2.<tab/>Definitions</title>
|
334
|
+
<dl>
|
335
|
+
<dt>Symbol</dt>
|
336
|
+
<dd>Definition</dd>
|
337
|
+
</dl>
|
338
|
+
</definitions>
|
339
|
+
</clause>
|
340
|
+
<definitions id='L'>
|
341
|
+
<title depth='1'>4.<tab/>Symbols and abbreviated terms</title>
|
342
|
+
<dl>
|
343
|
+
<dt>Symbol</dt>
|
344
|
+
<dd>Definition</dd>
|
345
|
+
</dl>
|
346
|
+
</definitions>
|
347
|
+
<clause id='M' inline-header='false' obligation='normative'>
|
348
|
+
<title depth='1'>5.<tab/>Clause 4</title>
|
349
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
350
|
+
<title depth='2'>5.1.<tab/>Introduction</title>
|
351
|
+
</clause>
|
352
|
+
<clause id='O' inline-header='false' obligation='normative'>
|
353
|
+
<title depth='2'>5.2.<tab/>Clause 4.2</title>
|
354
|
+
</clause>
|
355
|
+
<clause id='O1' inline-header='false' obligation='normative'>
|
356
|
+
<title>5.3.</title>
|
357
|
+
</clause>
|
358
|
+
</clause>
|
359
|
+
</sections>
|
360
|
+
<annex id='P' inline-header='false' obligation='normative'>
|
361
|
+
<title> <strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong>
|
362
|
+
</title>
|
363
|
+
<clause id='Q' inline-header='false' obligation='normative'>
|
364
|
+
<title depth='2'>A.1.<tab/>Annex A.1</title>
|
365
|
+
<clause id='Q1' inline-header='false' obligation='normative'>
|
366
|
+
<title depth='3'>A.1.1.<tab/>Annex A.1a</title>
|
367
|
+
</clause>
|
368
|
+
<references id='Q2' normative='false'>
|
369
|
+
<title depth='3'>A.1.2.<tab/>Annex Bibliography</title>
|
370
|
+
</references>
|
371
|
+
</clause>
|
372
|
+
</annex>
|
373
|
+
<annex id='P1' inline-header='false' obligation='normative'>
|
374
|
+
<title><strong>Annex B</strong><br/>(normative)</title>
|
375
|
+
</annex>
|
376
|
+
<bibliography>
|
377
|
+
<references id='R' obligation='informative' normative='true'>
|
378
|
+
<title depth='1'>2.<tab/>Normative References</title>
|
379
|
+
</references>
|
380
|
+
<clause id='S' obligation='informative'>
|
381
|
+
<title depth='1'>Bibliography</title>
|
382
|
+
<references id='T' obligation='informative' normative='false'>
|
383
|
+
<title depth="2">Bibliography Subsection</title>
|
384
|
+
</references>
|
385
|
+
</clause>
|
386
|
+
</bibliography>
|
387
|
+
</iso-standard>
|
388
|
+
PRESXML
|
500
389
|
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
390
|
+
html = <<~"OUTPUT"
|
391
|
+
#{HTML_HDR}
|
392
|
+
<div class='authority'>
|
393
|
+
<div class='boilerplate-copyright'>
|
394
|
+
<div>
|
395
|
+
<h1>Copyright</h1>
|
396
|
+
</div>
|
397
|
+
</div>
|
398
|
+
<div class='boilerplate-license'>
|
399
|
+
<div>
|
400
|
+
<h1>License</h1>
|
401
|
+
</div>
|
402
|
+
</div>
|
403
|
+
<div class='boilerplate-legal'>
|
404
|
+
<div>
|
405
|
+
<h1>Legal</h1>
|
406
|
+
</div>
|
407
|
+
</div>
|
408
|
+
<div class='boilerplate-feedback'>
|
409
|
+
<div>
|
410
|
+
<h1>Feedback</h1>
|
411
|
+
</div>
|
412
|
+
</div>
|
413
|
+
</div>
|
414
|
+
<br/>
|
415
|
+
<div>
|
416
|
+
<h1 class="AbstractTitle">Abstract</h1>
|
417
|
+
</div>
|
418
|
+
<br/>
|
419
|
+
<div>
|
420
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
421
|
+
<p id="A">This is a preamble</p>
|
422
|
+
</div>
|
423
|
+
<br/>
|
424
|
+
<div class="Section3" id="B">
|
425
|
+
<h1 class="IntroTitle">Introduction</h1>
|
426
|
+
<div id="C">
|
427
|
+
<h2>Introduction Subsection</h2>
|
428
|
+
</div>
|
429
|
+
</div>
|
430
|
+
<br/>
|
431
|
+
<div class='Section3' id='B1'>
|
432
|
+
<h1 class='IntroTitle'>Dedication</h1>
|
433
|
+
</div>
|
434
|
+
<br/>
|
435
|
+
<div class='Section3' id='B2'>
|
436
|
+
<h1 class='IntroTitle'>Note to reader</h1>
|
437
|
+
</div>
|
438
|
+
<br/>
|
439
|
+
<div class='Section3' id=''>
|
440
|
+
<h1 class='IntroTitle'>Acknowledgements</h1>
|
441
|
+
</div>
|
442
|
+
<p class="zzSTDTitle1"/>
|
443
|
+
<div id='NN1' class='Note'>
|
444
|
+
<p>
|
445
|
+
<span class='note_label'>NOTE</span>
|
446
|
+
  Initial note
|
447
|
+
</p>
|
448
|
+
</div>
|
449
|
+
<div id='NN2' class='Admonition'>
|
450
|
+
<p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
|
451
|
+
<p>Initial admonition</p>
|
452
|
+
</div>
|
453
|
+
<div id="D">
|
454
|
+
<h1>1.  Scope</h1>
|
455
|
+
<p id="E">Text</p>
|
456
|
+
</div>
|
457
|
+
<div>
|
458
|
+
<h1>2.  Normative References</h1>
|
459
|
+
</div>
|
460
|
+
<div id="H"><h1>3.  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
461
|
+
<div id="I">
|
462
|
+
<h2>3.1.  Normal Terms</h2>
|
463
|
+
<p class="TermNum" id="J">3.1.1.</p>
|
464
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
465
|
+
</div><div id="K"><h2>3.2.  Definitions</h2>
|
466
|
+
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
467
|
+
</div></div>
|
468
|
+
<div id="L" class="Symbols">
|
469
|
+
<h1>4.  Symbols and abbreviated terms</h1>
|
470
|
+
<dl>
|
471
|
+
<dt>
|
472
|
+
<p>Symbol</p>
|
473
|
+
</dt>
|
474
|
+
<dd>Definition</dd>
|
475
|
+
</dl>
|
476
|
+
</div>
|
477
|
+
<div id="M">
|
478
|
+
<h1>5.  Clause 4</h1>
|
479
|
+
<div id="N">
|
480
|
+
<h2>5.1.  Introduction</h2>
|
481
|
+
</div>
|
482
|
+
<div id="O">
|
483
|
+
<h2>5.2.  Clause 4.2</h2>
|
484
|
+
</div>
|
485
|
+
<div id="O1">
|
486
|
+
<h2>5.3.</h2>
|
487
|
+
</div>
|
488
|
+
</div>
|
489
|
+
<br/>
|
490
|
+
<div id="P" class="Section3">
|
491
|
+
<h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
|
492
|
+
<div id="Q">
|
493
|
+
<h2>A.1.  Annex A.1</h2>
|
494
|
+
<div id="Q1">
|
495
|
+
<h3>A.1.1.  Annex A.1a</h3>
|
496
|
+
</div>
|
497
|
+
<div><h3 class="Section3">A.1.2.  Annex Bibliography</h3></div>
|
498
|
+
</div>
|
499
|
+
</div>
|
500
|
+
<br/>
|
501
|
+
<div id='P1' class='Section3'>
|
502
|
+
<h1 class='Annex'>
|
503
|
+
<b>Annex B</b>
|
504
|
+
<br/>
|
505
|
+
(normative)
|
506
|
+
</h1>
|
507
|
+
</div>
|
508
|
+
<br/>
|
509
|
+
<div>
|
510
|
+
<h1 class="Section3">Bibliography</h1>
|
511
|
+
<div>
|
512
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
513
|
+
</div>
|
514
|
+
</div>
|
515
|
+
</div>
|
516
|
+
</body>
|
517
|
+
</html>
|
518
|
+
OUTPUT
|
521
519
|
|
522
|
-
word = <<~"OUTPUT"
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
520
|
+
word = <<~"OUTPUT"
|
521
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
|
522
|
+
<head><style/></head>
|
523
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
524
|
+
<div class="WordSection1">
|
525
|
+
<p> </p>
|
526
|
+
</div>
|
527
|
+
<p>
|
528
|
+
<br clear="all" class="section"/>
|
529
|
+
</p>
|
530
|
+
<div class="WordSection2">
|
531
|
+
<div class="authority">
|
532
|
+
<div class="boilerplate-copyright">
|
533
|
+
<div><h1>Copyright</h1>
|
536
534
|
|
537
|
-
</div>
|
538
535
|
</div>
|
539
|
-
|
540
|
-
|
536
|
+
</div>
|
537
|
+
<div class="boilerplate-license">
|
538
|
+
<div><h1>License</h1>
|
541
539
|
|
542
|
-
</div>
|
543
540
|
</div>
|
544
|
-
|
545
|
-
|
541
|
+
</div>
|
542
|
+
<div class="boilerplate-legal">
|
543
|
+
<div><h1>Legal</h1>
|
546
544
|
|
547
|
-
</div>
|
548
545
|
</div>
|
549
|
-
|
550
|
-
|
546
|
+
</div>
|
547
|
+
<div class="boilerplate-feedback">
|
548
|
+
<div><h1>Feedback</h1>
|
551
549
|
|
552
|
-
</div>
|
553
550
|
</div>
|
554
551
|
</div>
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
</
|
561
|
-
<p>
|
562
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
563
|
-
</p>
|
564
|
-
<div>
|
565
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
566
|
-
<p id="A">This is a preamble</p>
|
567
|
-
</div>
|
568
|
-
<p>
|
569
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
570
|
-
</p>
|
571
|
-
<div class="Section3" id="B">
|
572
|
-
<h1 class="IntroTitle">Introduction</h1>
|
573
|
-
<div id="C"><h2>Introduction Subsection</h2>
|
574
|
-
|
575
|
-
</div>
|
576
|
-
</div>
|
577
|
-
<p>
|
578
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
579
|
-
</p>
|
580
|
-
<div class="Section3" id="B1">
|
581
|
-
<h1 class="IntroTitle">Dedication</h1>
|
582
|
-
</div>
|
583
|
-
<p>
|
584
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
585
|
-
</p>
|
586
|
-
<div class="Section3" id="B2">
|
587
|
-
<h1 class="IntroTitle">Note to reader</h1>
|
588
|
-
</div>
|
589
|
-
<p>
|
590
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
591
|
-
</p>
|
592
|
-
<div class="Section3" id="">
|
593
|
-
<h1 class="IntroTitle">Acknowledgements</h1>
|
594
|
-
</div>
|
595
|
-
<p> </p>
|
552
|
+
</div>
|
553
|
+
<p>
|
554
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
555
|
+
</p>
|
556
|
+
<div>
|
557
|
+
<h1 class="AbstractTitle">Abstract</h1>
|
596
558
|
</div>
|
597
559
|
<p>
|
598
|
-
<br clear="all"
|
560
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
599
561
|
</p>
|
600
|
-
<div
|
601
|
-
<
|
602
|
-
<
|
603
|
-
<p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">  </span>Initial note</p>
|
604
|
-
</div>
|
605
|
-
<div id="NN2" class="Admonition"><p class="AdmonitionTitle" style="text-align:center;">WARNING</p>
|
606
|
-
<p>Initial admonition</p>
|
562
|
+
<div>
|
563
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
564
|
+
<p id="A">This is a preamble</p>
|
607
565
|
</div>
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
<
|
566
|
+
<p>
|
567
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
568
|
+
</p>
|
569
|
+
<div class="Section3" id="B">
|
570
|
+
<h1 class="IntroTitle">Introduction</h1>
|
571
|
+
<div id="C"><h2>Introduction Subsection</h2>
|
613
572
|
|
614
573
|
</div>
|
615
|
-
|
616
|
-
|
617
|
-
|
574
|
+
</div>
|
575
|
+
<p>
|
576
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
577
|
+
</p>
|
578
|
+
<div class="Section3" id="B1">
|
579
|
+
<h1 class="IntroTitle">Dedication</h1>
|
580
|
+
</div>
|
581
|
+
<p>
|
582
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
583
|
+
</p>
|
584
|
+
<div class="Section3" id="B2">
|
585
|
+
<h1 class="IntroTitle">Note to reader</h1>
|
586
|
+
</div>
|
587
|
+
<p>
|
588
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
589
|
+
</p>
|
590
|
+
<div class="Section3" id="">
|
591
|
+
<h1 class="IntroTitle">Acknowledgements</h1>
|
592
|
+
</div>
|
593
|
+
<p> </p>
|
594
|
+
</div>
|
595
|
+
<p>
|
596
|
+
<br clear="all" class="section"/>
|
597
|
+
</p>
|
598
|
+
<div class="WordSection3">
|
599
|
+
<p class="zzSTDTitle1"/>
|
600
|
+
<div id="NN1" class="Note">
|
601
|
+
<p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">  </span>Initial note</p>
|
602
|
+
</div>
|
603
|
+
<div id="NN2" class="Admonition"><p class="AdmonitionTitle" style="text-align:center;">WARNING</p>
|
604
|
+
<p>Initial admonition</p>
|
605
|
+
</div>
|
606
|
+
<div id="D">
|
607
|
+
<h1>1.<span style="mso-tab-count:1">  </span>Scope</h1>
|
608
|
+
<p id="E">Text</p>
|
609
|
+
</div>
|
610
|
+
<div><h1>2.<span style="mso-tab-count:1">  </span>Normative References</h1>
|
618
611
|
|
619
|
-
|
612
|
+
</div>
|
613
|
+
<div id="H">
|
614
|
+
<h1>3.<span style="mso-tab-count:1">  </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
615
|
+
<div id="I"><h2>3.1.<span style="mso-tab-count:1">  </span>Normal Terms</h2>
|
620
616
|
|
621
|
-
|
617
|
+
<p class="TermNum" id="J">3.1.1.</p>
|
622
618
|
|
623
|
-
|
624
|
-
<div id="K"><h2>3.2.<span style="mso-tab-count:1">  </span>Definitions</h2>
|
619
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
625
620
|
|
626
|
-
|
627
|
-
|
628
|
-
</div>
|
629
|
-
<div id="L" class="Symbols">
|
630
|
-
<h1>4.<span style="mso-tab-count:1">  </span>Symbols and abbreviated terms</h1>
|
631
|
-
<table class="dl">
|
632
|
-
<tr>
|
633
|
-
<td valign="top" align="left">
|
634
|
-
<p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
|
635
|
-
</td>
|
636
|
-
<td valign="top">Definition</td>
|
637
|
-
</tr>
|
638
|
-
</table>
|
639
|
-
</div>
|
640
|
-
<div id="M">
|
641
|
-
<h1>5.<span style="mso-tab-count:1">  </span>Clause 4</h1>
|
642
|
-
<div id="N"><h2>5.1.<span style="mso-tab-count:1">  </span>Introduction</h2>
|
621
|
+
</div>
|
622
|
+
<div id="K"><h2>3.2.<span style="mso-tab-count:1">  </span>Definitions</h2>
|
643
623
|
|
644
|
-
</
|
645
|
-
|
624
|
+
<table class="dl"><tr><td valign="top" align="left"><p align="left" style="margin-left:0pt;text-align:left;">Symbol</p></td><td valign="top">Definition</td></tr></table>
|
625
|
+
</div>
|
626
|
+
</div>
|
627
|
+
<div id="L" class="Symbols">
|
628
|
+
<h1>4.<span style="mso-tab-count:1">  </span>Symbols and abbreviated terms</h1>
|
629
|
+
<table class="dl">
|
630
|
+
<tr>
|
631
|
+
<td valign="top" align="left">
|
632
|
+
<p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
|
633
|
+
</td>
|
634
|
+
<td valign="top">Definition</td>
|
635
|
+
</tr>
|
636
|
+
</table>
|
637
|
+
</div>
|
638
|
+
<div id="M">
|
639
|
+
<h1>5.<span style="mso-tab-count:1">  </span>Clause 4</h1>
|
640
|
+
<div id="N"><h2>5.1.<span style="mso-tab-count:1">  </span>Introduction</h2>
|
646
641
|
|
647
|
-
|
648
|
-
|
642
|
+
</div>
|
643
|
+
<div id="O"><h2>5.2.<span style="mso-tab-count:1">  </span>Clause 4.2</h2>
|
649
644
|
|
650
|
-
|
651
|
-
|
652
|
-
<p>
|
653
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
654
|
-
</p>
|
655
|
-
<div id="P" class="Section3">
|
656
|
-
<h1 class="Annex"> <b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b>
|
657
|
-
</h1>
|
658
|
-
<div id="Q"><h2>A.1.<span style="mso-tab-count:1">  </span>Annex A.1</h2>
|
645
|
+
</div>
|
646
|
+
<div id="O1"><h2>5.3.</h2>
|
659
647
|
|
660
|
-
|
648
|
+
</div>
|
649
|
+
</div>
|
650
|
+
<p>
|
651
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
652
|
+
</p>
|
653
|
+
<div id="P" class="Section3">
|
654
|
+
<h1 class="Annex"> <b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b>
|
655
|
+
</h1>
|
656
|
+
<div id="Q"><h2>A.1.<span style="mso-tab-count:1">  </span>Annex A.1</h2>
|
661
657
|
|
662
|
-
|
663
|
-
<div><h3 class="Section3">A.1.2.<span style="mso-tab-count:1">  </span>Annex Bibliography</h3>
|
658
|
+
<div id="Q1"><h3>A.1.1.<span style="mso-tab-count:1">  </span>Annex A.1a</h3>
|
664
659
|
|
665
|
-
</div>
|
666
660
|
</div>
|
667
|
-
|
668
|
-
<p>
|
669
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
670
|
-
</p>
|
671
|
-
<div id="P1" class="Section3">
|
672
|
-
<h1 class="Annex"><b>Annex B</b><br/>(normative)</h1>
|
673
|
-
</div>
|
674
|
-
<p>
|
675
|
-
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
676
|
-
</p>
|
677
|
-
<div><h1 class="Section3">Bibliography</h1>
|
661
|
+
<div><h3 class="Section3">A.1.2.<span style="mso-tab-count:1">  </span>Annex Bibliography</h3>
|
678
662
|
|
679
|
-
<div><h2 class="Section3">Bibliography Subsection</h2>
|
680
|
-
|
681
|
-
</div>
|
682
663
|
</div>
|
664
|
+
</div>
|
683
665
|
</div>
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
666
|
+
<p>
|
667
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
668
|
+
</p>
|
669
|
+
<div id="P1" class="Section3">
|
670
|
+
<h1 class="Annex"><b>Annex B</b><br/>(normative)</h1>
|
671
|
+
</div>
|
672
|
+
<p>
|
673
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
674
|
+
</p>
|
675
|
+
<div><h1 class="Section3">Bibliography</h1>
|
676
|
+
|
677
|
+
<div><h2 class="Section3">Bibliography Subsection</h2>
|
678
|
+
|
679
|
+
</div>
|
680
|
+
</div>
|
681
|
+
</div>
|
682
|
+
</body>
|
683
|
+
</html>
|
684
|
+
OUTPUT
|
685
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
686
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
687
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
688
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
689
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
690
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
|
690
691
|
end
|
691
692
|
|
692
|
-
|
693
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({suppressheadingnumbers: true})
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
693
|
+
it "processes section names suppressing section numbering" do
|
694
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
|
695
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
696
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
697
|
+
<preface>
|
698
|
+
<foreword obligation="informative">
|
699
|
+
<title>Foreword</title>
|
700
|
+
<p id="A">This is a preamble</p>
|
701
|
+
</foreword>
|
702
|
+
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
703
|
+
<title>Introduction Subsection</title>
|
704
|
+
</clause>
|
705
|
+
</introduction></preface><sections>
|
706
|
+
<clause id="D" obligation="normative" type="scope">
|
707
|
+
<title>Scope</title>
|
708
|
+
<p id="E">Text</p>
|
709
|
+
</clause>
|
708
710
|
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
711
|
+
<clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
|
712
|
+
<title>Normal Terms</title>
|
713
|
+
<term id="J">
|
714
|
+
<preferred>Term2</preferred>
|
715
|
+
</term>
|
716
|
+
</terms>
|
717
|
+
<definitions id="K">
|
718
|
+
<dl>
|
719
|
+
<dt>Symbol</dt>
|
720
|
+
<dd>Definition</dd>
|
721
|
+
</dl>
|
722
|
+
</definitions>
|
723
|
+
</clause>
|
724
|
+
<definitions id="L">
|
725
|
+
<dl>
|
726
|
+
<dt>Symbol</dt>
|
727
|
+
<dd>Definition</dd>
|
728
|
+
</dl>
|
729
|
+
</definitions>
|
730
|
+
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
731
|
+
<title>Introduction</title>
|
732
|
+
</clause>
|
733
|
+
<clause id="O" inline-header="false" obligation="normative">
|
734
|
+
<title>Clause 4.2</title>
|
735
|
+
</clause>
|
736
|
+
<clause id="O1" inline-header="false" obligation="normative">
|
737
|
+
</clause>
|
738
|
+
</clause>
|
737
739
|
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
740
|
+
</sections><annex id="P" inline-header="false" obligation="normative">
|
741
|
+
<title>Annex</title>
|
742
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
743
|
+
<title>Annex A.1</title>
|
744
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
745
|
+
<title>Annex A.1a</title>
|
746
|
+
</clause>
|
747
|
+
</clause>
|
748
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
749
|
+
<title>Normative References</title>
|
750
|
+
</references><clause id="S" obligation="informative">
|
751
|
+
<title>Bibliography</title>
|
752
|
+
<references id="T" obligation="informative" normative="false">
|
753
|
+
<title>Bibliography Subsection</title>
|
754
|
+
</references>
|
755
|
+
</clause>
|
756
|
+
</bibliography>
|
757
|
+
</iso-standard>
|
756
758
|
INPUT
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
</clause>
|
769
|
-
</introduction>
|
770
|
-
</preface>
|
771
|
-
<sections>
|
772
|
-
<clause id='D' obligation='normative' type="scope">
|
773
|
-
<title depth="1">Scope</title>
|
774
|
-
<p id='E'>Text</p>
|
775
|
-
</clause>
|
776
|
-
<clause id='H' obligation='normative'>
|
777
|
-
<title depth="1">Terms, Definitions, Symbols and Abbreviated Terms</title>
|
778
|
-
<terms id='I' obligation='normative'>
|
779
|
-
<title depth="2">Normal Terms</title>
|
780
|
-
<term id='J'>
|
781
|
-
<name>3.1.1.</name>
|
782
|
-
<preferred>Term2</preferred>
|
783
|
-
</term>
|
784
|
-
</terms>
|
785
|
-
<definitions id='K'>
|
786
|
-
<dl>
|
787
|
-
<dt>Symbol</dt>
|
788
|
-
<dd>Definition</dd>
|
789
|
-
</dl>
|
790
|
-
</definitions>
|
759
|
+
<?xml version='1.0'?>
|
760
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
761
|
+
<preface>
|
762
|
+
<foreword obligation='informative'>
|
763
|
+
<title>Foreword</title>
|
764
|
+
<p id='A'>This is a preamble</p>
|
765
|
+
</foreword>
|
766
|
+
<introduction id='B' obligation='informative'>
|
767
|
+
<title>Introduction</title>
|
768
|
+
<clause id='C' inline-header='false' obligation='informative'>
|
769
|
+
<title depth="2">Introduction Subsection</title>
|
791
770
|
</clause>
|
792
|
-
|
771
|
+
</introduction>
|
772
|
+
</preface>
|
773
|
+
<sections>
|
774
|
+
<clause id='D' obligation='normative' type="scope">
|
775
|
+
<title depth="1">Scope</title>
|
776
|
+
<p id='E'>Text</p>
|
777
|
+
</clause>
|
778
|
+
<clause id='H' obligation='normative'>
|
779
|
+
<title depth="1">Terms, Definitions, Symbols and Abbreviated Terms</title>
|
780
|
+
<terms id='I' obligation='normative'>
|
781
|
+
<title depth="2">Normal Terms</title>
|
782
|
+
<term id='J'>
|
783
|
+
<name>3.1.1.</name>
|
784
|
+
<preferred>Term2</preferred>
|
785
|
+
</term>
|
786
|
+
</terms>
|
787
|
+
<definitions id='K'>
|
793
788
|
<dl>
|
794
789
|
<dt>Symbol</dt>
|
795
790
|
<dd>Definition</dd>
|
796
791
|
</dl>
|
797
792
|
</definitions>
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
</
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
793
|
+
</clause>
|
794
|
+
<definitions id='L'>
|
795
|
+
<dl>
|
796
|
+
<dt>Symbol</dt>
|
797
|
+
<dd>Definition</dd>
|
798
|
+
</dl>
|
799
|
+
</definitions>
|
800
|
+
<clause id='M' inline-header='false' obligation='normative'>
|
801
|
+
<title depth="1">Clause 4</title>
|
802
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
803
|
+
<title depth="2">Introduction</title>
|
807
804
|
</clause>
|
808
|
-
|
809
|
-
|
810
|
-
<title>
|
811
|
-
<strong>Annex A</strong>
|
812
|
-
<br/>
|
813
|
-
(normative)
|
814
|
-
<br/>
|
815
|
-
<br/>
|
816
|
-
<strong>Annex</strong>
|
817
|
-
</title>
|
818
|
-
<clause id='Q' inline-header='false' obligation='normative'>
|
819
|
-
<title depth="2">Annex A.1</title>
|
820
|
-
<clause id='Q1' inline-header='false' obligation='normative'>
|
821
|
-
<title depth="3">Annex A.1a</title>
|
822
|
-
</clause>
|
805
|
+
<clause id='O' inline-header='false' obligation='normative'>
|
806
|
+
<title depth="2">Clause 4.2</title>
|
823
807
|
</clause>
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
<
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
808
|
+
<clause id='O1' inline-header='false' obligation='normative'> </clause>
|
809
|
+
</clause>
|
810
|
+
</sections>
|
811
|
+
<annex id='P' inline-header='false' obligation='normative'>
|
812
|
+
<title>
|
813
|
+
<strong>Annex A</strong>
|
814
|
+
<br/>
|
815
|
+
(normative)
|
816
|
+
<br/>
|
817
|
+
<br/>
|
818
|
+
<strong>Annex</strong>
|
819
|
+
</title>
|
820
|
+
<clause id='Q' inline-header='false' obligation='normative'>
|
821
|
+
<title depth="2">Annex A.1</title>
|
822
|
+
<clause id='Q1' inline-header='false' obligation='normative'>
|
823
|
+
<title depth="3">Annex A.1a</title>
|
834
824
|
</clause>
|
835
|
-
</
|
836
|
-
</
|
837
|
-
|
838
|
-
|
825
|
+
</clause>
|
826
|
+
</annex>
|
827
|
+
<bibliography>
|
828
|
+
<references id='R' obligation='informative' normative='true'>
|
829
|
+
<title depth="1">Normative References</title>
|
830
|
+
</references>
|
831
|
+
<clause id='S' obligation='informative'>
|
832
|
+
<title depth="1">Bibliography</title>
|
833
|
+
<references id='T' obligation='informative' normative='false'>
|
834
|
+
<title depth="2">Bibliography Subsection</title>
|
835
|
+
</references>
|
836
|
+
</clause>
|
837
|
+
</bibliography>
|
838
|
+
</iso-standard>
|
839
|
+
OUTPUT
|
840
|
+
end
|
839
841
|
|
840
|
-
|
841
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({suppressheadingnumbers: true})
|
842
|
-
|
843
|
-
|
844
|
-
<introduction id="B" obligation="informative"><title>Introduction</title><clause obligation="informative">
|
845
|
-
<title>Introduction Subsection</title>
|
846
|
-
</clause>
|
847
|
-
</introduction>
|
848
|
-
</preface>
|
849
|
-
</iso-standard>
|
850
|
-
INPUT
|
851
|
-
<?xml version='1.0'?>
|
852
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
842
|
+
it "processes section titles without ID" do
|
843
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
|
844
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
845
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
853
846
|
<preface>
|
854
|
-
<introduction id=
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
</preface>
|
861
|
-
</iso-standard>
|
862
|
-
OUTPUT
|
863
|
-
end
|
864
|
-
|
865
|
-
it "processes simple terms & definitions" do
|
866
|
-
input = <<~"INPUT"
|
867
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
868
|
-
<sections>
|
869
|
-
<terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
870
|
-
<term id="J">
|
871
|
-
<preferred>Term2</preferred>
|
872
|
-
</term>
|
873
|
-
</terms>
|
874
|
-
</sections>
|
875
|
-
</iso-standard>
|
847
|
+
<introduction id="B" obligation="informative"><title>Introduction</title><clause obligation="informative">
|
848
|
+
<title>Introduction Subsection</title>
|
849
|
+
</clause>
|
850
|
+
</introduction>
|
851
|
+
</preface>
|
852
|
+
</iso-standard>
|
876
853
|
INPUT
|
854
|
+
<?xml version='1.0'?>
|
855
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
856
|
+
<preface>
|
857
|
+
<introduction id='B' obligation='informative'>
|
858
|
+
<title>Introduction</title>
|
859
|
+
<clause obligation='informative'>
|
860
|
+
<title depth="1">Introduction Subsection</title>
|
861
|
+
</clause>
|
862
|
+
</introduction>
|
863
|
+
</preface>
|
864
|
+
</iso-standard>
|
865
|
+
OUTPUT
|
866
|
+
end
|
877
867
|
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
<name>1.1.</name>
|
868
|
+
it "processes simple terms & definitions" do
|
869
|
+
input = <<~"INPUT"
|
870
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
871
|
+
<sections>
|
872
|
+
<terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
873
|
+
<term id="J">
|
885
874
|
<preferred>Term2</preferred>
|
886
875
|
</term>
|
887
|
-
|
888
|
-
|
889
|
-
</iso-standard>
|
876
|
+
</terms>
|
877
|
+
</sections>
|
878
|
+
</iso-standard>
|
879
|
+
INPUT
|
880
|
+
|
881
|
+
presxml = <<~"OUTPUT"
|
882
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
883
|
+
<sections>
|
884
|
+
<terms id='H' obligation='normative'>
|
885
|
+
<title depth='1'>1.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
886
|
+
<term id='J'>
|
887
|
+
<name>1.1.</name>
|
888
|
+
<preferred>Term2</preferred>
|
889
|
+
</term>
|
890
|
+
</terms>
|
891
|
+
</sections>
|
892
|
+
</iso-standard>
|
890
893
|
OUTPUT
|
891
894
|
|
892
895
|
html = <<~"OUTPUT"
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
896
|
+
#{HTML_HDR}
|
897
|
+
<p class="zzSTDTitle1"/>
|
898
|
+
<div id="H"><h1>1.  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
899
|
+
<p class="TermNum" id="J">1.1.</p>
|
900
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
901
|
+
</div>
|
902
|
+
</div>
|
903
|
+
</body>
|
904
|
+
</html>
|
902
905
|
OUTPUT
|
903
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
904
|
-
|
906
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
907
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
908
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
909
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
905
910
|
end
|
906
911
|
|
907
912
|
it "processes inline section headers" do
|
@@ -921,197 +926,200 @@ OUTPUT
|
|
921
926
|
INPUT
|
922
927
|
|
923
928
|
presxml = <<~"PRESXML"
|
924
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
</iso-standard>
|
938
|
-
PRESXML
|
939
|
-
|
940
|
-
output = <<~"OUTPUT"
|
941
|
-
#{HTML_HDR}
|
942
|
-
<p class="zzSTDTitle1"/>
|
943
|
-
<div id="M">
|
944
|
-
<h1>1.  Clause 4</h1>
|
945
|
-
<div id="N">
|
946
|
-
<h2>1.1.  Introduction</h2>
|
947
|
-
</div>
|
948
|
-
<div id="O">
|
949
|
-
<span class="zzMoveToFollowing"><b>1.2.  Clause 4.2  </b></span>
|
950
|
-
<p>ABC</p>
|
951
|
-
</div>
|
952
|
-
</div>
|
953
|
-
</div>
|
954
|
-
</body>
|
955
|
-
</html>
|
956
|
-
OUTPUT
|
957
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
958
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
959
|
-
end
|
929
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
930
|
+
<sections>
|
931
|
+
<clause id='M' inline-header='false' obligation='normative'>
|
932
|
+
<title depth='1'>1.<tab/>Clause 4</title>
|
933
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
934
|
+
<title depth='2'>1.1.<tab/>Introduction</title>
|
935
|
+
</clause>
|
936
|
+
<clause id='O' inline-header='true' obligation='normative'>
|
937
|
+
<title depth='2'>1.2.<tab/>Clause 4.2</title>
|
938
|
+
<p>ABC</p>
|
939
|
+
</clause>
|
940
|
+
</clause>
|
941
|
+
</sections>
|
942
|
+
</iso-standard>
|
943
|
+
PRESXML
|
960
944
|
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
945
|
+
output = <<~"OUTPUT"
|
946
|
+
#{HTML_HDR}
|
947
|
+
<p class="zzSTDTitle1"/>
|
948
|
+
<div id="M">
|
949
|
+
<h1>1.  Clause 4</h1>
|
950
|
+
<div id="N">
|
951
|
+
<h2>1.1.  Introduction</h2>
|
952
|
+
</div>
|
953
|
+
<div id="O">
|
954
|
+
<span class="zzMoveToFollowing"><b>1.2.  Clause 4.2  </b></span>
|
955
|
+
<p>ABC</p>
|
956
|
+
</div>
|
957
|
+
</div>
|
958
|
+
</div>
|
959
|
+
</body>
|
960
|
+
</html>
|
961
|
+
OUTPUT
|
962
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
963
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
964
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
965
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
966
|
+
end
|
971
967
|
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
<
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
<clause id='O' inline-header='true' obligation='normative'>
|
984
|
-
<title depth="2">Clause 4.2</title>
|
985
|
-
</clause>
|
986
|
-
</clause>
|
987
|
-
</sections>
|
988
|
-
</iso-standard>
|
989
|
-
OUTPUT
|
990
|
-
end
|
968
|
+
it "processes inline section headers with suppressed heading numbering" do
|
969
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
|
970
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
971
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
972
|
+
<sections>
|
973
|
+
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
974
|
+
<title>Introduction</title>
|
975
|
+
</clause>
|
976
|
+
<clause id="O" inline-header="true" obligation="normative">
|
977
|
+
<title>Clause 4.2</title>
|
978
|
+
</clause></clause>
|
991
979
|
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
980
|
+
</sections>
|
981
|
+
</iso-standard>
|
982
|
+
INPUT
|
983
|
+
<?xml version='1.0'?>
|
984
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
985
|
+
<sections>
|
986
|
+
<clause id='M' inline-header='false' obligation='normative'>
|
987
|
+
<title depth="1">Clause 4</title>
|
988
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
989
|
+
<title depth="2">Introduction</title>
|
990
|
+
</clause>
|
991
|
+
<clause id='O' inline-header='true' obligation='normative'>
|
992
|
+
<title depth="2">Clause 4.2</title>
|
993
|
+
</clause>
|
994
|
+
</clause>
|
995
|
+
</sections>
|
996
|
+
</iso-standard>
|
997
|
+
OUTPUT
|
998
|
+
end
|
1008
999
|
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
<iso-standard xmlns=
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
</clause>
|
1027
|
-
<clause id='O1' inline-header='true' obligation='normative'>
|
1028
|
-
<title>1.2.</title>
|
1029
|
-
</clause>
|
1030
|
-
</clause>
|
1031
|
-
</sections>
|
1032
|
-
</iso-standard>
|
1033
|
-
OUTPUT
|
1034
|
-
end
|
1000
|
+
it "processes sections without titles" do
|
1001
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1002
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1003
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
1004
|
+
<preface>
|
1005
|
+
<introduction id="M" inline-header="false" obligation="normative"><clause id="N" inline-header="false" obligation="normative">
|
1006
|
+
<title>Intro</title>
|
1007
|
+
</clause>
|
1008
|
+
<clause id="O" inline-header="true" obligation="normative">
|
1009
|
+
</clause></clause>
|
1010
|
+
</preface>
|
1011
|
+
<sections>
|
1012
|
+
<clause id="M1" inline-header="false" obligation="normative"><clause id="N1" inline-header="false" obligation="normative">
|
1013
|
+
</clause>
|
1014
|
+
<clause id="O1" inline-header="true" obligation="normative">
|
1015
|
+
</clause></clause>
|
1016
|
+
</sections>
|
1035
1017
|
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
<references id="C" obligation="informative" normative="false">
|
1054
|
-
<title>Normative References 2</title>
|
1055
|
-
</references>
|
1018
|
+
</iso-standard>
|
1019
|
+
INPUT
|
1020
|
+
<?xml version='1.0'?>
|
1021
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1022
|
+
<preface>
|
1023
|
+
<introduction id='M' inline-header='false' obligation='normative'>
|
1024
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
1025
|
+
<title depth="2">Intro</title>
|
1026
|
+
</clause>
|
1027
|
+
<clause id='O' inline-header='true' obligation='normative'> </clause>
|
1028
|
+
</introduction>
|
1029
|
+
</preface>
|
1030
|
+
<sections>
|
1031
|
+
<clause id='M1' inline-header='false' obligation='normative'>
|
1032
|
+
<title>1.</title>
|
1033
|
+
<clause id='N1' inline-header='false' obligation='normative'>
|
1034
|
+
<title>1.1.</title>
|
1056
1035
|
</clause>
|
1057
|
-
|
1058
|
-
|
1059
|
-
</iso-standard>
|
1060
|
-
INPUT
|
1061
|
-
presxml = <<~OUTPUT
|
1062
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
1063
|
-
<bibliography>
|
1064
|
-
<clause id="D" obligation="informative">
|
1065
|
-
<title depth="1">Bibliography</title>
|
1066
|
-
<references id="E" obligation="informative" normative="false">
|
1067
|
-
<title depth="2">Bibliography Subsection 1</title>
|
1068
|
-
</references>
|
1069
|
-
<references id="F" obligation="informative" normative="false">
|
1070
|
-
<title depth="2">Bibliography Subsection 2</title>
|
1071
|
-
</references>
|
1072
|
-
</clause>
|
1073
|
-
<clause id="A" obligation="informative"><title depth="1">1.<tab/>First References</title>
|
1074
|
-
<references id="B" obligation="informative" normative="true">
|
1075
|
-
<title depth="2">1.1.<tab/>Normative References 1</title>
|
1076
|
-
</references>
|
1077
|
-
<references id="C" obligation="informative" normative="false">
|
1078
|
-
<title depth="2">1.2.<tab/>Normative References 2</title>
|
1079
|
-
</references>
|
1036
|
+
<clause id='O1' inline-header='true' obligation='normative'>
|
1037
|
+
<title>1.2.</title>
|
1080
1038
|
</clause>
|
1039
|
+
</clause>
|
1040
|
+
</sections>
|
1041
|
+
</iso-standard>
|
1042
|
+
OUTPUT
|
1043
|
+
end
|
1081
1044
|
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
<
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
<
|
1101
|
-
|
1102
|
-
|
1103
|
-
</div>
|
1104
|
-
<div>
|
1105
|
-
<h2 class='Section3'>Bibliography Subsection 2</h2>
|
1106
|
-
</div>
|
1107
|
-
</div>
|
1108
|
-
</div>
|
1109
|
-
</body>
|
1110
|
-
</html>
|
1045
|
+
it "processes clauses containing normative references" do
|
1046
|
+
input = <<~INPUT
|
1047
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1048
|
+
<bibliography>
|
1049
|
+
<clause id="D" obligation="informative">
|
1050
|
+
<title>Bibliography</title>
|
1051
|
+
<references id="E" obligation="informative" normative="false">
|
1052
|
+
<title>Bibliography Subsection 1</title>
|
1053
|
+
</references>
|
1054
|
+
<references id="F" obligation="informative" normative="false">
|
1055
|
+
<title>Bibliography Subsection 2</title>
|
1056
|
+
</references>
|
1057
|
+
</clause>
|
1058
|
+
<clause id="A" obligation="informative"><title>First References</title>
|
1059
|
+
<references id="B" obligation="informative" normative="true">
|
1060
|
+
<title>Normative References 1</title>
|
1061
|
+
</references>
|
1062
|
+
<references id="C" obligation="informative" normative="false">
|
1063
|
+
<title>Normative References 2</title>
|
1064
|
+
</references>
|
1065
|
+
</clause>
|
1111
1066
|
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1067
|
+
</bibliography>
|
1068
|
+
</iso-standard>
|
1069
|
+
INPUT
|
1070
|
+
presxml = <<~OUTPUT
|
1071
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
1072
|
+
<bibliography>
|
1073
|
+
<clause id="D" obligation="informative">
|
1074
|
+
<title depth="1">Bibliography</title>
|
1075
|
+
<references id="E" obligation="informative" normative="false">
|
1076
|
+
<title depth="2">Bibliography Subsection 1</title>
|
1077
|
+
</references>
|
1078
|
+
<references id="F" obligation="informative" normative="false">
|
1079
|
+
<title depth="2">Bibliography Subsection 2</title>
|
1080
|
+
</references>
|
1081
|
+
</clause>
|
1082
|
+
<clause id="A" obligation="informative"><title depth="1">1.<tab/>First References</title>
|
1083
|
+
<references id="B" obligation="informative" normative="true">
|
1084
|
+
<title depth="2">1.1.<tab/>Normative References 1</title>
|
1085
|
+
</references>
|
1086
|
+
<references id="C" obligation="informative" normative="false">
|
1087
|
+
<title depth="2">1.2.<tab/>Normative References 2</title>
|
1088
|
+
</references>
|
1089
|
+
</clause>
|
1090
|
+
</bibliography>
|
1091
|
+
</iso-standard>
|
1092
|
+
OUTPUT
|
1116
1093
|
|
1094
|
+
html = <<~OUTPUT
|
1095
|
+
#{HTML_HDR}
|
1096
|
+
<p class='zzSTDTitle1'/>
|
1097
|
+
<div>
|
1098
|
+
<h1>1.  First References</h1>
|
1099
|
+
<div>
|
1100
|
+
<h2 class='Section3'>1.1.  Normative References 1</h2>
|
1101
|
+
</div>
|
1102
|
+
<div>
|
1103
|
+
<h2 class='Section3'>1.2.  Normative References 2</h2>
|
1104
|
+
</div>
|
1105
|
+
</div>
|
1106
|
+
<br/>
|
1107
|
+
<div>
|
1108
|
+
<h1 class='Section3'>Bibliography</h1>
|
1109
|
+
<div>
|
1110
|
+
<h2 class='Section3'>Bibliography Subsection 1</h2>
|
1111
|
+
</div>
|
1112
|
+
<div>
|
1113
|
+
<h2 class='Section3'>Bibliography Subsection 2</h2>
|
1114
|
+
</div>
|
1115
|
+
</div>
|
1116
|
+
</div>
|
1117
|
+
</body>
|
1118
|
+
</html>
|
1119
|
+
OUTPUT
|
1120
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1121
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1122
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1123
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1124
|
+
end
|
1117
1125
|
end
|