isodoc 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/isodoc.gemspec +4 -1
  3. data/lib/isodoc/base_style/blocks.scss +7 -0
  4. data/lib/isodoc/function/inline.rb +2 -0
  5. data/lib/isodoc/function/lists.rb +24 -9
  6. data/lib/isodoc/function/to_word_html.rb +1 -0
  7. data/lib/isodoc/function/utils.rb +17 -7
  8. data/lib/isodoc/gem_tasks.rb +19 -10
  9. data/lib/isodoc/i18n.rb +19 -0
  10. data/lib/isodoc/metadata.rb +2 -2
  11. data/lib/isodoc/presentation_function/inline.rb +11 -4
  12. data/lib/isodoc/presentation_function/xrefs.rb +22 -6
  13. data/lib/isodoc/presentation_xml_convert.rb +1 -0
  14. data/lib/isodoc/version.rb +1 -1
  15. data/lib/isodoc/word_function/body.rb +6 -3
  16. data/lib/isodoc/xref/xref_gen.rb +4 -4
  17. metadata +3 -50
  18. data/.github/workflows/rake.yml +0 -15
  19. data/.github/workflows/release.yml +0 -24
  20. data/.hound.yml +0 -5
  21. data/.oss-guides.rubocop.yml +0 -1077
  22. data/.rubocop.yml +0 -10
  23. data/Rakefile +0 -8
  24. data/bin/rspec +0 -17
  25. data/spec/assets/header.html +0 -7
  26. data/spec/assets/html.scss +0 -20
  27. data/spec/assets/html_override.css +0 -1
  28. data/spec/assets/htmlcover.html +0 -4
  29. data/spec/assets/htmlintro.html +0 -5
  30. data/spec/assets/i18n.yaml +0 -41
  31. data/spec/assets/iso.xml +0 -8
  32. data/spec/assets/odf.emf +0 -0
  33. data/spec/assets/odf.svg +0 -1
  34. data/spec/assets/odf1.svg +0 -4
  35. data/spec/assets/outputtest/a.xml +0 -66
  36. data/spec/assets/outputtest/iso.international-standard.xsl +0 -3011
  37. data/spec/assets/rice_image1 +0 -0
  38. data/spec/assets/rice_image1.png +0 -0
  39. data/spec/assets/scripts.html +0 -3
  40. data/spec/assets/scripts_override.html +0 -3
  41. data/spec/assets/std.css +0 -2
  42. data/spec/assets/word.css +0 -2
  43. data/spec/assets/word_override.css +0 -1
  44. data/spec/assets/wordcover.html +0 -3
  45. data/spec/assets/wordintro.html +0 -4
  46. data/spec/isodoc/blocks_spec.rb +0 -2934
  47. data/spec/isodoc/cleanup_spec.rb +0 -1056
  48. data/spec/isodoc/footnotes_spec.rb +0 -264
  49. data/spec/isodoc/form_spec.rb +0 -160
  50. data/spec/isodoc/i18n_spec.rb +0 -1201
  51. data/spec/isodoc/inline_spec.rb +0 -2301
  52. data/spec/isodoc/lists_spec.rb +0 -469
  53. data/spec/isodoc/metadata_spec.rb +0 -401
  54. data/spec/isodoc/postproc_spec.rb +0 -2938
  55. data/spec/isodoc/presentation_xml_spec.rb +0 -1476
  56. data/spec/isodoc/ref_spec.rb +0 -955
  57. data/spec/isodoc/section_spec.rb +0 -2123
  58. data/spec/isodoc/table_spec.rb +0 -588
  59. data/spec/isodoc/terms_spec.rb +0 -712
  60. data/spec/isodoc/utils_spec.rb +0 -57
  61. data/spec/isodoc/xref_numbering_spec.rb +0 -378
  62. data/spec/isodoc/xref_spec.rb +0 -1837
  63. data/spec/isodoc/xslfo_convert_spec.rb +0 -103
  64. data/spec/spec_helper.rb +0 -88
@@ -1,2123 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe IsoDoc do
4
- it "processes prefatory blocks" do
5
- input = <<~INPUT
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <preface>
8
- <abstract id="A"><title>abstract</title></abstract>
9
- <introduction id="B"><title>introduction</title></introduction>
10
- <note id="C">note</note>
11
- </preface>
12
- <sections>
13
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
14
- <title>Introduction</title>
15
- </clause>
16
- <clause id="O" inline-header="true" obligation="normative">
17
- <title>Clause 4.2</title>
18
- </clause></clause>
19
- <admonition id="L" type="caution"><p>admonition</p></admonition>
20
- </sections>
21
- </iso-standard>
22
- INPUT
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>&#160;</p>
30
- </div>
31
- <br/>
32
- <div class='prefatory-section'>
33
- <p>&#160;</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>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&#160; </b>
58
- </span>
59
- </div>
60
- </div>
61
- </div>
62
- </body>
63
- </html>
64
- OUTPUT
65
- expect(xmlpp(IsoDoc::WordConvert.new({})
66
- .convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
67
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
68
- <head>
69
- <style>
70
- </style>
71
- </head>
72
- <body lang='EN-US' link='blue' vlink='#954F72'>
73
- <div class='WordSection1'>
74
- <p>&#160;</p>
75
- </div>
76
- <p>
77
- <br clear='all' class='section'/>
78
- </p>
79
- <div class='WordSection2'>
80
- <div id='C' class='Note'>
81
- <p class='Note'>
82
- <span class='note_label'/>
83
- <span style='mso-tab-count:1'>&#160; </span>
84
- </p>
85
- note
86
- </div>
87
- <p>
88
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
89
- </p>
90
- <div id='A'>
91
- <h1 class='AbstractTitle'>abstract</h1>
92
- </div>
93
- <p>
94
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
95
- </p>
96
- <div class='Section3' id='B'>
97
- <h1 class='IntroTitle'>introduction</h1>
98
- </div>
99
- <p>&#160;</p>
100
- </div>
101
- <p>
102
- <br clear='all' class='section'/>
103
- </p>
104
- <div class='WordSection3'>
105
- <p class='zzSTDTitle1'/>
106
- <div id='L' class='Admonition'>
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'>&#160; </span>
119
- </b>
120
- </span>
121
- </div>
122
- </div>
123
- </div>
124
- </body>
125
- </html>
126
- OUTPUT
127
- end
128
-
129
- it "processes document with no content" do
130
- input = <<~INPUT
131
- <iso-standard xmlns="http://riboseinc.com/isoxml">
132
- <preface/>
133
- <sections/>
134
- </iso-standard>
135
- INPUT
136
- output = <<~OUTPUT
137
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
138
- <head/>
139
- <body lang="en">
140
- <div class="title-section">
141
- <p>&#160;</p>
142
- </div>
143
- <br/>
144
- <div class="prefatory-section">
145
- <p>&#160;</p>
146
- </div>
147
- <br/>
148
- <div class="main-section">
149
- <p class="zzSTDTitle1"/>
150
- </div>
151
- </body>
152
- </html>
153
- OUTPUT
154
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
155
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
156
- end
157
-
158
- it "processes section names" do
159
- input = <<~"INPUT"
160
- <iso-standard xmlns="http://riboseinc.com/isoxml">
161
- <boilerplate>
162
- <copyright-statement>
163
- <clause>
164
- <title>Copyright</title>
165
- </clause>
166
- </copyright-statement>
167
- <license-statement>
168
- <clause>
169
- <title>License</title>
170
- </clause>
171
- </license-statement>
172
- <legal-statement>
173
- <clause>
174
- <title>Legal</title>
175
- </clause>
176
- </legal-statement>
177
- <feedback-statement>
178
- <clause>
179
- <title>Feedback</title>
180
- </clause>
181
- </feedback-statement>
182
- </boilerplate>
183
- <preface>
184
- <abstract obligation="informative">
185
- <title>Abstract</title>
186
- </abstract>
187
- <foreword obligation="informative">
188
- <title>Foreword</title>
189
- <p id="A">This is a preamble</p>
190
- </foreword>
191
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
192
- <title>Introduction Subsection</title>
193
- </clause>
194
- </introduction>
195
- <clause id="B1"><title>Dedication</title></clause>
196
- <clause id="B2"><title>Note to reader</title></clause>
197
- <acknowledgements obligation="informative">
198
- <title>Acknowledgements</title>
199
- </acknowledgements>
200
- </preface><sections>
201
- <note id="NN1"><p>Initial note</p></note>
202
- <admonition id="NN2" type="warning">
203
- <name>WARNING</name>
204
- <p>Initial admonition</p></admonition>
205
- <clause id="D" obligation="normative" type="scope">
206
- <title>Scope</title>
207
- <p id="E">Text</p>
208
- </clause>
209
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
210
- <title>Normal Terms</title>
211
- <term id="J">
212
- <preferred><expression><name>Term2</name></expression></preferred>
213
- </term>
214
- </terms>
215
- <definitions id="K">
216
- <title>Definitions</title>
217
- <dl>
218
- <dt>Symbol</dt>
219
- <dd>Definition</dd>
220
- </dl>
221
- </definitions>
222
- </clause>
223
- <definitions id="L">
224
- <title>Symbols and abbreviated terms</title>
225
- <dl>
226
- <dt>Symbol</dt>
227
- <dd>Definition</dd>
228
- </dl>
229
- </definitions>
230
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
231
- <title>Introduction</title>
232
- </clause>
233
- <clause id="O" inline-header="false" obligation="normative">
234
- <title>Clause 4.2</title>
235
- </clause>
236
- <clause id="O1" inline-header="false" obligation="normative">
237
- </clause>
238
- </clause>
239
- </sections><annex id="P" inline-header="false" obligation="normative">
240
- <title>Annex</title>
241
- <clause id="Q" inline-header="false" obligation="normative">
242
- <title>Annex A.1</title>
243
- <clause id="Q1" inline-header="false" obligation="normative">
244
- <title>Annex A.1a</title>
245
- </clause>
246
- <references id="Q2" normative="false">
247
- <title>Annex Bibliography</title>
248
- </references>
249
- </clause>
250
- </annex>
251
- <annex id="P1" inline-header="false" obligation="normative">
252
- </annex>
253
- <bibliography><references id="R" obligation="informative" normative="true">
254
- <title>Normative References</title>
255
- </references><clause id="S" obligation="informative">
256
- <title>Bibliography</title>
257
- <references id="T" obligation="informative" normative="false">
258
- <title>Bibliography Subsection</title>
259
- </references>
260
- </clause>
261
- </bibliography>
262
- </iso-standard>
263
- INPUT
264
-
265
- presxml = <<~"PRESXML"
266
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
267
- <boilerplate>
268
- <copyright-statement>
269
- <clause>
270
- <title depth='1'>Copyright</title>
271
- </clause>
272
- </copyright-statement>
273
- <license-statement>
274
- <clause>
275
- <title depth='1'>License</title>
276
- </clause>
277
- </license-statement>
278
- <legal-statement>
279
- <clause>
280
- <title depth='1'>Legal</title>
281
- </clause>
282
- </legal-statement>
283
- <feedback-statement>
284
- <clause>
285
- <title depth='1'>Feedback</title>
286
- </clause>
287
- </feedback-statement>
288
- </boilerplate>
289
- <preface>
290
- <abstract obligation='informative' displayorder='1'>
291
- <title>Abstract</title>
292
- </abstract>
293
- <foreword obligation='informative' displayorder='2'>
294
- <title>Foreword</title>
295
- <p id='A'>This is a preamble</p>
296
- </foreword>
297
- <introduction id='B' obligation='informative' displayorder='3'>
298
- <title>Introduction</title>
299
- <clause id='C' inline-header='false' obligation='informative'>
300
- <title depth='2'>Introduction Subsection</title>
301
- </clause>
302
- </introduction>
303
- <clause id='B1' displayorder='4'>
304
- <title depth='1'>Dedication</title>
305
- </clause>
306
- <clause id='B2' displayorder='5'>
307
- <title depth='1'>Note to reader</title>
308
- </clause>
309
- <acknowledgements obligation='informative' displayorder='6'>
310
- <title>Acknowledgements</title>
311
- </acknowledgements>
312
- </preface>
313
- <sections>
314
- <note id='NN1'>
315
- <name>NOTE</name>
316
- <p>Initial note</p>
317
- </note>
318
- <admonition id='NN2' type='warning'>
319
- <name>WARNING</name>
320
- <p>Initial admonition</p>
321
- </admonition>
322
- <clause id='D' obligation='normative' type='scope' displayorder='7'>
323
- <title depth='1'>1.<tab/>Scope</title>
324
- <p id='E'>Text</p>
325
- </clause>
326
- <clause id='H' obligation='normative' displayorder='9'>
327
- <title depth='1'>3.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
328
- <terms id='I' obligation='normative'>
329
- <title depth='2'>3.1.<tab/>Normal Terms</title>
330
- <term id='J'>
331
- <name>3.1.1.</name>
332
- <preferred><strong>Term2</strong></preferred>
333
- </term>
334
- </terms>
335
- <definitions id='K'>
336
- <title depth='2'>3.2.<tab/>Definitions</title>
337
- <dl>
338
- <dt>Symbol</dt>
339
- <dd>Definition</dd>
340
- </dl>
341
- </definitions>
342
- </clause>
343
- <definitions id='L' displayorder='10'>
344
- <title depth='1'>4.<tab/>Symbols and abbreviated terms</title>
345
- <dl>
346
- <dt>Symbol</dt>
347
- <dd>Definition</dd>
348
- </dl>
349
- </definitions>
350
- <clause id='M' inline-header='false' obligation='normative' displayorder='11'>
351
- <title depth='1'>5.<tab/>Clause 4</title>
352
- <clause id='N' inline-header='false' obligation='normative'>
353
- <title depth='2'>5.1.<tab/>Introduction</title>
354
- </clause>
355
- <clause id='O' inline-header='false' obligation='normative'>
356
- <title depth='2'>5.2.<tab/>Clause 4.2</title>
357
- </clause>
358
- <clause id='O1' inline-header='false' obligation='normative'>
359
- <title>5.3.</title>
360
- </clause>
361
- </clause>
362
- </sections>
363
- <annex id='P' inline-header='false' obligation='normative' displayorder='12'>
364
- <title>
365
- <strong>Annex A</strong>
366
- <br/>
367
- (normative)
368
- <br/>
369
- <br/>
370
- <strong>Annex</strong>
371
- </title>
372
- <clause id='Q' inline-header='false' obligation='normative'>
373
- <title depth='2'>A.1.<tab/>Annex A.1</title>
374
- <clause id='Q1' inline-header='false' obligation='normative'>
375
- <title depth='3'>A.1.1.<tab/>Annex A.1a</title>
376
- </clause>
377
- <references id='Q2' normative='false'>
378
- <title depth='3'>A.1.2.<tab/>Annex Bibliography</title>
379
- </references>
380
- </clause>
381
- </annex>
382
- <annex id='P1' inline-header='false' obligation='normative' displayorder='13'>
383
- <title>
384
- <strong>Annex B</strong>
385
- <br/>
386
- (normative)
387
- </title>
388
- </annex>
389
- <bibliography>
390
- <references id='R' obligation='informative' normative='true' displayorder='8'>
391
- <title depth='1'>2.<tab/>Normative References</title>
392
- </references>
393
- <clause id='S' obligation='informative' displayorder='14'>
394
- <title depth='1'>Bibliography</title>
395
- <references id='T' obligation='informative' normative='false'>
396
- <title depth='2'>Bibliography Subsection</title>
397
- </references>
398
- </clause>
399
- </bibliography>
400
- </iso-standard>
401
- PRESXML
402
-
403
- html = <<~"OUTPUT"
404
- #{HTML_HDR}
405
- <div class='authority'>
406
- <div class='boilerplate-copyright'>
407
- <div>
408
- <h1>Copyright</h1>
409
- </div>
410
- </div>
411
- <div class='boilerplate-license'>
412
- <div>
413
- <h1>License</h1>
414
- </div>
415
- </div>
416
- <div class='boilerplate-legal'>
417
- <div>
418
- <h1>Legal</h1>
419
- </div>
420
- </div>
421
- <div class='boilerplate-feedback'>
422
- <div>
423
- <h1>Feedback</h1>
424
- </div>
425
- </div>
426
- </div>
427
- <br/>
428
- <div>
429
- <h1 class="AbstractTitle">Abstract</h1>
430
- </div>
431
- <br/>
432
- <div>
433
- <h1 class="ForewordTitle">Foreword</h1>
434
- <p id="A">This is a preamble</p>
435
- </div>
436
- <br/>
437
- <div class="Section3" id="B">
438
- <h1 class="IntroTitle">Introduction</h1>
439
- <div id="C">
440
- <h2>Introduction Subsection</h2>
441
- </div>
442
- </div>
443
- <br/>
444
- <div class='Section3' id='B1'>
445
- <h1 class='IntroTitle'>Dedication</h1>
446
- </div>
447
- <br/>
448
- <div class='Section3' id='B2'>
449
- <h1 class='IntroTitle'>Note to reader</h1>
450
- </div>
451
- <br/>
452
- <div class='Section3' id=''>
453
- <h1 class='IntroTitle'>Acknowledgements</h1>
454
- </div>
455
- <p class="zzSTDTitle1"/>
456
- <div id='NN1' class='Note'>
457
- <p>
458
- <span class='note_label'>NOTE</span>
459
- &#160; Initial note
460
- </p>
461
- </div>
462
- <div id='NN2' class='Admonition'>
463
- <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
464
- <p>Initial admonition</p>
465
- </div>
466
- <div id="D">
467
- <h1>1.&#160; Scope</h1>
468
- <p id="E">Text</p>
469
- </div>
470
- <div>
471
- <h1>2.&#160; Normative References</h1>
472
- </div>
473
- <div id="H"><h1>3.&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
474
- <div id="I">
475
- <h2>3.1.&#160; Normal Terms</h2>
476
- <p class="TermNum" id="J">3.1.1.</p>
477
- <p class="Terms" style="text-align:left;"><b>Term2</b></p>
478
- </div><div id="K"><h2>3.2.&#160; Definitions</h2>
479
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
480
- </div></div>
481
- <div id="L" class="Symbols">
482
- <h1>4.&#160; Symbols and abbreviated terms</h1>
483
- <dl>
484
- <dt>
485
- <p>Symbol</p>
486
- </dt>
487
- <dd>Definition</dd>
488
- </dl>
489
- </div>
490
- <div id="M">
491
- <h1>5.&#160; Clause 4</h1>
492
- <div id="N">
493
- <h2>5.1.&#160; Introduction</h2>
494
- </div>
495
- <div id="O">
496
- <h2>5.2.&#160; Clause 4.2</h2>
497
- </div>
498
- <div id="O1">
499
- <h2>5.3.</h2>
500
- </div>
501
- </div>
502
- <br/>
503
- <div id="P" class="Section3">
504
- <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
505
- <div id="Q">
506
- <h2>A.1.&#160; Annex A.1</h2>
507
- <div id="Q1">
508
- <h3>A.1.1.&#160; Annex A.1a</h3>
509
- </div>
510
- <div><h3 class="Section3">A.1.2.&#160; Annex Bibliography</h3></div>
511
- </div>
512
- </div>
513
- <br/>
514
- <div id='P1' class='Section3'>
515
- <h1 class='Annex'>
516
- <b>Annex B</b>
517
- <br/>
518
- (normative)
519
- </h1>
520
- </div>
521
- <br/>
522
- <div>
523
- <h1 class="Section3">Bibliography</h1>
524
- <div>
525
- <h2 class="Section3">Bibliography Subsection</h2>
526
- </div>
527
- </div>
528
- </div>
529
- </body>
530
- </html>
531
- OUTPUT
532
-
533
- word = <<~"OUTPUT"
534
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
535
- <head><style/></head>
536
- <body lang="EN-US" link="blue" vlink="#954F72">
537
- <div class="WordSection1">
538
- <p>&#160;</p>
539
- </div>
540
- <p>
541
- <br clear="all" class="section"/>
542
- </p>
543
- <div class="WordSection2">
544
- <div class="authority">
545
- <div class="boilerplate-copyright">
546
- <div><h1>Copyright</h1>
547
-
548
- </div>
549
- </div>
550
- <div class="boilerplate-license">
551
- <div><h1>License</h1>
552
-
553
- </div>
554
- </div>
555
- <div class="boilerplate-legal">
556
- <div><h1>Legal</h1>
557
-
558
- </div>
559
- </div>
560
- <div class="boilerplate-feedback">
561
- <div><h1>Feedback</h1>
562
-
563
- </div>
564
- </div>
565
- </div>
566
- <p>
567
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
568
- </p>
569
- <div>
570
- <h1 class="AbstractTitle">Abstract</h1>
571
- </div>
572
- <p>
573
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
574
- </p>
575
- <div>
576
- <h1 class="ForewordTitle">Foreword</h1>
577
- <p id="A">This is a preamble</p>
578
- </div>
579
- <p>
580
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
581
- </p>
582
- <div class="Section3" id="B">
583
- <h1 class="IntroTitle">Introduction</h1>
584
- <div id="C"><h2>Introduction Subsection</h2>
585
-
586
- </div>
587
- </div>
588
- <p>
589
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
590
- </p>
591
- <div class="Section3" id="B1">
592
- <h1 class="IntroTitle">Dedication</h1>
593
- </div>
594
- <p>
595
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
596
- </p>
597
- <div class="Section3" id="B2">
598
- <h1 class="IntroTitle">Note to reader</h1>
599
- </div>
600
- <p>
601
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
602
- </p>
603
- <div class="Section3" id="">
604
- <h1 class="IntroTitle">Acknowledgements</h1>
605
- </div>
606
- <p>&#160;</p>
607
- </div>
608
- <p>
609
- <br clear="all" class="section"/>
610
- </p>
611
- <div class="WordSection3">
612
- <p class="zzSTDTitle1"/>
613
- <div id="NN1" class="Note">
614
- <p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </span>Initial note</p>
615
- </div>
616
- <div id="NN2" class="Admonition"><p class="AdmonitionTitle" style="text-align:center;">WARNING</p>
617
- <p>Initial admonition</p>
618
- </div>
619
- <div id="D">
620
- <h1>1.<span style="mso-tab-count:1">&#160; </span>Scope</h1>
621
- <p id="E">Text</p>
622
- </div>
623
- <div><h1>2.<span style="mso-tab-count:1">&#160; </span>Normative References</h1>
624
-
625
- </div>
626
- <div id="H">
627
- <h1>3.<span style="mso-tab-count:1">&#160; </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
628
- <div id="I"><h2>3.1.<span style="mso-tab-count:1">&#160; </span>Normal Terms</h2>
629
-
630
- <p class="TermNum" id="J">3.1.1.</p>
631
-
632
- <p class="Terms" style="text-align:left;"><b>Term2</b></p>
633
-
634
- </div>
635
- <div id="K"><h2>3.2.<span style="mso-tab-count:1">&#160; </span>Definitions</h2>
636
-
637
- <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>
638
- </div>
639
- </div>
640
- <div id="L" class="Symbols">
641
- <h1>4.<span style="mso-tab-count:1">&#160; </span>Symbols and abbreviated terms</h1>
642
- <table class="dl">
643
- <tr>
644
- <td valign="top" align="left">
645
- <p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
646
- </td>
647
- <td valign="top">Definition</td>
648
- </tr>
649
- </table>
650
- </div>
651
- <div id="M">
652
- <h1>5.<span style="mso-tab-count:1">&#160; </span>Clause 4</h1>
653
- <div id="N"><h2>5.1.<span style="mso-tab-count:1">&#160; </span>Introduction</h2>
654
-
655
- </div>
656
- <div id="O"><h2>5.2.<span style="mso-tab-count:1">&#160; </span>Clause 4.2</h2>
657
-
658
- </div>
659
- <div id="O1"><h2>5.3.</h2>
660
-
661
- </div>
662
- </div>
663
- <p>
664
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
665
- </p>
666
- <div id="P" class="Section3">
667
- <h1 class="Annex"> <b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b>
668
- </h1>
669
- <div id="Q"><h2>A.1.<span style="mso-tab-count:1">&#160; </span>Annex A.1</h2>
670
-
671
- <div id="Q1"><h3>A.1.1.<span style="mso-tab-count:1">&#160; </span>Annex A.1a</h3>
672
-
673
- </div>
674
- <div><h3 class="Section3">A.1.2.<span style="mso-tab-count:1">&#160; </span>Annex Bibliography</h3>
675
-
676
- </div>
677
- </div>
678
- </div>
679
- <p>
680
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
681
- </p>
682
- <div id="P1" class="Section3">
683
- <h1 class="Annex"><b>Annex B</b><br/>(normative)</h1>
684
- </div>
685
- <p>
686
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
687
- </p>
688
- <div><h1 class="Section3">Bibliography</h1>
689
-
690
- <div><h2 class="Section3">Bibliography Subsection</h2>
691
-
692
- </div>
693
- </div>
694
- </div>
695
- </body>
696
- </html>
697
- OUTPUT
698
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
699
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
700
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
701
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
702
- expect(xmlpp(IsoDoc::WordConvert.new({})
703
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
704
- end
705
-
706
- it "processes section subtitles" do
707
- input = <<~"INPUT"
708
- <iso-standard xmlns="http://riboseinc.com/isoxml">
709
- <preface>
710
- <abstract obligation="informative">
711
- <title>Abstract</title>
712
- <variant-title type="sub">Variant 1</variant-title>
713
- </abstract>
714
- <foreword obligation="informative">
715
- <title>Foreword</title>
716
- <variant-title type="sub">Variant 1</variant-title>
717
- <p id="A">This is a preamble</p>
718
- </foreword>
719
- <introduction id="B" obligation="informative"><title>Introduction</title>
720
- <clause id="C" inline-header="false" obligation="informative">
721
- <title>Introduction Subsection</title>
722
- <variant-title type="sub">Variant 1</variant-title>
723
- </clause>
724
- </introduction>
725
- <clause id="B1"><title>Dedication</title>
726
- <variant-title type="sub">Variant 1</variant-title>
727
- </clause>
728
- <clause id="B2"><title>Note to reader</title>
729
- <variant-title type="sub">Variant 1</variant-title>
730
- </clause>
731
- <acknowledgements obligation="informative">
732
- <title>Acknowledgements</title>
733
- <variant-title type="sub">Variant 1</variant-title>
734
- </acknowledgements>
735
- </preface><sections>
736
- <note id="NN1"><p>Initial note</p></note>
737
- <admonition id="NN2" type="warning"><p>Initial admonition</p></admonition>
738
- <clause id="D" obligation="normative" type="scope">
739
- <title>Scope</title>
740
- <variant-title type="sub">Variant 1</variant-title>
741
- <p id="E">Text</p>
742
- </clause>
743
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
744
- <variant-title type="sub">Variant 1</variant-title>
745
- <terms id="I" obligation="normative">
746
- <title>Normal Terms</title>
747
- <variant-title type="sub">Variant 1</variant-title>
748
- <term id="J">
749
- <preferred><expression><name>Term2</name></expression></preferred>
750
- </term>
751
- </terms>
752
- <definitions id="K">
753
- <title>Definitions</title>
754
- <variant-title type="sub">Variant 1</variant-title>
755
- <dl>
756
- <dt>Symbol</dt>
757
- <dd>Definition</dd>
758
- </dl>
759
- </definitions>
760
- </clause>
761
- <definitions id="L">
762
- <title>Symbols and abbreviated terms</title>
763
- <variant-title type="sub">Variant 1</variant-title>
764
- <dl>
765
- <dt>Symbol</dt>
766
- <dd>Definition</dd>
767
- </dl>
768
- </definitions>
769
- <clause id="M" inline-header="false" obligation="normative">
770
- <title>Clause 4</title>
771
- <variant-title type="sub">Variant 1</variant-title>
772
- <clause id="N" inline-header="false" obligation="normative">
773
- <title>Introduction</title>
774
- <variant-title type="sub">Variant 1</variant-title>
775
- </clause>
776
- <clause id="O" inline-header="false" obligation="normative">
777
- <title>Clause 4.2</title>
778
- <variant-title type="sub">Variant 1</variant-title>
779
- </clause>
780
- <clause id="O1" inline-header="false" obligation="normative">
781
- </clause>
782
- </clause>
783
- </sections><annex id="P" inline-header="false" obligation="normative">
784
- <title>Annex</title>
785
- <variant-title type="sub">Variant 1</variant-title>
786
- <clause id="Q" inline-header="false" obligation="normative">
787
- <title>Annex A.1</title>
788
- <variant-title type="sub">Variant 1</variant-title>
789
- <clause id="Q1" inline-header="false" obligation="normative">
790
- <title>Annex A.1a</title>
791
- <variant-title type="sub">Variant 1</variant-title>
792
- </clause>
793
- <references id="Q2" normative="false">
794
- <title>Annex Bibliography</title>
795
- <variant-title type="sub">Variant 1</variant-title>
796
- </references>
797
- </clause>
798
- </annex>
799
- <annex id="P1" inline-header="false" obligation="normative">
800
- </annex>
801
- <bibliography><references id="R" obligation="informative" normative="true">
802
- <title>Normative References</title>
803
- <variant-title type="sub">Variant 1</variant-title>
804
- </references><clause id="S" obligation="informative">
805
- <title>Bibliography</title>
806
- <variant-title type="sub">Variant 1</variant-title>
807
- <references id="T" obligation="informative" normative="false">
808
- <title>Bibliography Subsection</title>
809
- <variant-title type="sub">Variant 1</variant-title>
810
- </references>
811
- </clause>
812
- </bibliography>
813
- </iso-standard>
814
- INPUT
815
- html = <<~OUTPUT
816
- <html lang='en'>
817
- <head/>
818
- <body lang='en'>
819
- <div class='title-section'>
820
- <p>&#160;</p>
821
- </div>
822
- <br/>
823
- <div class='prefatory-section'>
824
- <p>&#160;</p>
825
- </div>
826
- <br/>
827
- <div class='main-section'>
828
- <br/>
829
- <div>
830
- <h1 class='AbstractTitle'>
831
- Abstract
832
- <br/>
833
- <br/>
834
- Variant 1
835
- </h1>
836
- </div>
837
- <br/>
838
- <div>
839
- <h1 class='ForewordTitle'>
840
- Foreword
841
- <br/>
842
- <br/>
843
- Variant 1
844
- </h1>
845
- <p id='A'>This is a preamble</p>
846
- </div>
847
- <br/>
848
- <div class='Section3' id='B'>
849
- <h1 class='IntroTitle'>Introduction</h1>
850
- <div id='C'>
851
- <h2>
852
- Introduction Subsection
853
- <br/>
854
- <br/>
855
- Variant 1
856
- </h2>
857
- </div>
858
- </div>
859
- <br/>
860
- <div class='Section3' id='B1'>
861
- <h1 class='IntroTitle'>
862
- Dedication
863
- <br/>
864
- <br/>
865
- Variant 1
866
- </h1>
867
- </div>
868
- <br/>
869
- <div class='Section3' id='B2'>
870
- <h1 class='IntroTitle'>
871
- Note to reader
872
- <br/>
873
- <br/>
874
- Variant 1
875
- </h1>
876
- </div>
877
- <br/>
878
- <div class='Section3' id=''>
879
- <h1 class='IntroTitle'>
880
- Acknowledgements
881
- <br/>
882
- <br/>
883
- Variant 1
884
- </h1>
885
- </div>
886
- <p class='zzSTDTitle1'/>
887
- <div id='NN1' class='Note'>
888
- <p>
889
- <span class='note_label'>NOTE</span>
890
- &#160; Initial note
891
- </p>
892
- </div>
893
- <div id='NN2' class='Admonition'>
894
- <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
895
- <p>Initial admonition</p>
896
- </div>
897
- <div id='D'>
898
- <h1>
899
- 1.&#160; Scope
900
- <br/>
901
- <br/>
902
- Variant 1
903
- </h1>
904
- <p id='E'>Text</p>
905
- </div>
906
- <div>
907
- <h1>
908
- 2.&#160; Normative References
909
- <br/>
910
- <br/>
911
- Variant 1
912
- </h1>
913
- </div>
914
- <div id='H'>
915
- <h1>
916
- 3.&#160; Terms, Definitions, Symbols and Abbreviated Terms
917
- <br/>
918
- <br/>
919
- Variant 1
920
- </h1>
921
- <div id='I'>
922
- <h2>
923
- 3.1.&#160; Normal Terms
924
- <br/>
925
- <br/>
926
- Variant 1
927
- </h2>
928
- <p class='TermNum' id='J'>3.1.1.</p>
929
- <p class='Terms' style='text-align:left;'><b>Term2</b></p>
930
- </div>
931
- <div id='K'>
932
- <h2>
933
- 3.2.&#160; Definitions
934
- <br/>
935
- <br/>
936
- Variant 1
937
- </h2>
938
- <dl>
939
- <dt>
940
- <p>Symbol</p>
941
- </dt>
942
- <dd>Definition</dd>
943
- </dl>
944
- </div>
945
- </div>
946
- <div id='L' class='Symbols'>
947
- <h1>
948
- 4.&#160; Symbols and abbreviated terms
949
- <br/>
950
- <br/>
951
- Variant 1
952
- </h1>
953
- <dl>
954
- <dt>
955
- <p>Symbol</p>
956
- </dt>
957
- <dd>Definition</dd>
958
- </dl>
959
- </div>
960
- <div id='M'>
961
- <h1>
962
- 5.&#160; Clause 4
963
- <br/>
964
- <br/>
965
- Variant 1
966
- </h1>
967
- <div id='N'>
968
- <h2>
969
- 5.1.&#160; Introduction
970
- <br/>
971
- <br/>
972
- Variant 1
973
- </h2>
974
- </div>
975
- <div id='O'>
976
- <h2>
977
- 5.2.&#160; Clause 4.2
978
- <br/>
979
- <br/>
980
- Variant 1
981
- </h2>
982
- </div>
983
- <div id='O1'>
984
- <h2>5.3.</h2>
985
- </div>
986
- </div>
987
- <br/>
988
- <div id='P' class='Section3'>
989
- <h1 class='Annex'>
990
- <b>Annex A</b>
991
- <br/>
992
- (normative)
993
- <br/>
994
- <br/>
995
- <b>Annex</b>
996
- <br/>
997
- <br/>
998
- Variant 1
999
- </h1>
1000
- <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1001
- <div id='Q'>
1002
- <h2>
1003
- A.1.&#160; Annex A.1
1004
- <br/>
1005
- <br/>
1006
- Variant 1
1007
- </h2>
1008
- <div id='Q1'>
1009
- <h3>
1010
- A.1.1.&#160; Annex A.1a
1011
- <br/>
1012
- <br/>
1013
- Variant 1
1014
- </h3>
1015
- </div>
1016
- <div>
1017
- <h3 class='Section3'>
1018
- A.1.2.&#160; Annex Bibliography
1019
- <br/>
1020
- <br/>
1021
- Variant 1
1022
- </h3>
1023
- </div>
1024
- </div>
1025
- </div>
1026
- <br/>
1027
- <div id='P1' class='Section3'>
1028
- <h1 class='Annex'>
1029
- <b>Annex B</b>
1030
- <br/>
1031
- (normative)
1032
- </h1>
1033
- </div>
1034
- <br/>
1035
- <div>
1036
- <h1 class='Section3'>Bibliography</h1>
1037
- <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1038
- <div>
1039
- <h2 class='Section3'>
1040
- Bibliography Subsection
1041
- <br/>
1042
- <br/>
1043
- Variant 1
1044
- </h2>
1045
- </div>
1046
- </div>
1047
- </div>
1048
- </body>
1049
- </html>
1050
- OUTPUT
1051
- word = <<~OUTPUT
1052
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1053
- <head>
1054
- <style>
1055
- </style>
1056
- </head>
1057
- <body lang='EN-US' link='blue' vlink='#954F72'>
1058
- <div class='WordSection1'>
1059
- <p>&#160;</p>
1060
- </div>
1061
- <p>
1062
- <br clear='all' class='section'/>
1063
- </p>
1064
- <div class='WordSection2'>
1065
- <p>
1066
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1067
- </p>
1068
- <div>
1069
- <h1 class='AbstractTitle'>
1070
- Abstract
1071
- <br/>
1072
- <br/>
1073
- Variant 1
1074
- </h1>
1075
- </div>
1076
- <p>
1077
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1078
- </p>
1079
- <div>
1080
- <h1 class='ForewordTitle'>
1081
- Foreword
1082
- <br/>
1083
- <br/>
1084
- Variant 1
1085
- </h1>
1086
- <p id='A'>This is a preamble</p>
1087
- </div>
1088
- <p>
1089
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1090
- </p>
1091
- <div class='Section3' id='B'>
1092
- <h1 class='IntroTitle'>Introduction</h1>
1093
- <div id='C'>
1094
- <h2>
1095
- Introduction Subsection
1096
- <br/>
1097
- <br/>
1098
- Variant 1
1099
- </h2>
1100
- </div>
1101
- </div>
1102
- <p>
1103
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1104
- </p>
1105
- <div class='Section3' id='B1'>
1106
- <h1 class='IntroTitle'>
1107
- Dedication
1108
- <br/>
1109
- <br/>
1110
- Variant 1
1111
- </h1>
1112
- </div>
1113
- <p>
1114
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1115
- </p>
1116
- <div class='Section3' id='B2'>
1117
- <h1 class='IntroTitle'>
1118
- Note to reader
1119
- <br/>
1120
- <br/>
1121
- Variant 1
1122
- </h1>
1123
- </div>
1124
- <p>
1125
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1126
- </p>
1127
- <div class='Section3' id=''>
1128
- <h1 class='IntroTitle'>
1129
- Acknowledgements
1130
- <br/>
1131
- <br/>
1132
- Variant 1
1133
- </h1>
1134
- </div>
1135
- <p>&#160;</p>
1136
- </div>
1137
- <p>
1138
- <br clear='all' class='section'/>
1139
- </p>
1140
- <div class='WordSection3'>
1141
- <p class='zzSTDTitle1'/>
1142
- <div id='NN1' class='Note'>
1143
- <p class='Note'>
1144
- <span class='note_label'>NOTE</span>
1145
- <span style='mso-tab-count:1'>&#160; </span>
1146
- Initial note
1147
- </p>
1148
- </div>
1149
- <div id='NN2' class='Admonition'>
1150
- <p class='AdmonitionTitle' style='text-align:center;'>WARNING</p>
1151
- <p>Initial admonition</p>
1152
- </div>
1153
- <div id='D'>
1154
- <h1>
1155
- 1.
1156
- <span style='mso-tab-count:1'>&#160; </span>
1157
- Scope
1158
- <br/>
1159
- <br/>
1160
- Variant 1
1161
- </h1>
1162
- <p id='E'>Text</p>
1163
- </div>
1164
- <div>
1165
- <h1>
1166
- 2.
1167
- <span style='mso-tab-count:1'>&#160; </span>
1168
- Normative References
1169
- <br/>
1170
- <br/>
1171
- Variant 1
1172
- </h1>
1173
- </div>
1174
- <div id='H'>
1175
- <h1>
1176
- 3.
1177
- <span style='mso-tab-count:1'>&#160; </span>
1178
- Terms, Definitions, Symbols and Abbreviated Terms
1179
- <br/>
1180
- <br/>
1181
- Variant 1
1182
- </h1>
1183
- <div id='I'>
1184
- <h2>
1185
- 3.1.
1186
- <span style='mso-tab-count:1'>&#160; </span>
1187
- Normal Terms
1188
- <br/>
1189
- <br/>
1190
- Variant 1
1191
- </h2>
1192
- <p class='TermNum' id='J'>3.1.1.</p>
1193
- <p class='Terms' style='text-align:left;'><b>Term2</b></p>
1194
- </div>
1195
- <div id='K'>
1196
- <h2>
1197
- 3.2.
1198
- <span style='mso-tab-count:1'>&#160; </span>
1199
- Definitions
1200
- <br/>
1201
- <br/>
1202
- Variant 1
1203
- </h2>
1204
- <table class='dl'>
1205
- <tr>
1206
- <td valign='top' align='left'>
1207
- <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1208
- </td>
1209
- <td valign='top'>Definition</td>
1210
- </tr>
1211
- </table>
1212
- </div>
1213
- </div>
1214
- <div id='L' class='Symbols'>
1215
- <h1>
1216
- 4.
1217
- <span style='mso-tab-count:1'>&#160; </span>
1218
- Symbols and abbreviated terms
1219
- <br/>
1220
- <br/>
1221
- Variant 1
1222
- </h1>
1223
- <table class='dl'>
1224
- <tr>
1225
- <td valign='top' align='left'>
1226
- <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
1227
- </td>
1228
- <td valign='top'>Definition</td>
1229
- </tr>
1230
- </table>
1231
- </div>
1232
- <div id='M'>
1233
- <h1>
1234
- 5.
1235
- <span style='mso-tab-count:1'>&#160; </span>
1236
- Clause 4
1237
- <br/>
1238
- <br/>
1239
- Variant 1
1240
- </h1>
1241
- <div id='N'>
1242
- <h2>
1243
- 5.1.
1244
- <span style='mso-tab-count:1'>&#160; </span>
1245
- Introduction
1246
- <br/>
1247
- <br/>
1248
- Variant 1
1249
- </h2>
1250
- </div>
1251
- <div id='O'>
1252
- <h2>
1253
- 5.2.
1254
- <span style='mso-tab-count:1'>&#160; </span>
1255
- Clause 4.2
1256
- <br/>
1257
- <br/>
1258
- Variant 1
1259
- </h2>
1260
- </div>
1261
- <div id='O1'>
1262
- <h2>5.3.</h2>
1263
- </div>
1264
- </div>
1265
- <p>
1266
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1267
- </p>
1268
- <div id='P' class='Section3'>
1269
- <h1 class='Annex'>
1270
- <b>Annex A</b>
1271
- <br/>
1272
- (normative)
1273
- <br/>
1274
- <br/>
1275
- <b>Annex</b>
1276
- <br/>
1277
- <br/>
1278
- Variant 1
1279
- </h1>
1280
- <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1281
- <div id='Q'>
1282
- <h2>
1283
- A.1.
1284
- <span style='mso-tab-count:1'>&#160; </span>
1285
- Annex A.1
1286
- <br/>
1287
- <br/>
1288
- Variant 1
1289
- </h2>
1290
- <div id='Q1'>
1291
- <h3>
1292
- A.1.1.
1293
- <span style='mso-tab-count:1'>&#160; </span>
1294
- Annex A.1a
1295
- <br/>
1296
- <br/>
1297
- Variant 1
1298
- </h3>
1299
- </div>
1300
- <div>
1301
- <h3 class='Section3'>
1302
- A.1.2.
1303
- <span style='mso-tab-count:1'>&#160; </span>
1304
- Annex Bibliography
1305
- <br/>
1306
- <br/>
1307
- Variant 1
1308
- </h3>
1309
- </div>
1310
- </div>
1311
- </div>
1312
- <p>
1313
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1314
- </p>
1315
- <div id='P1' class='Section3'>
1316
- <h1 class='Annex'>
1317
- <b>Annex B</b>
1318
- <br/>
1319
- (normative)
1320
- </h1>
1321
- </div>
1322
- <p>
1323
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1324
- </p>
1325
- <div>
1326
- <h1 class='Section3'>Bibliography</h1>
1327
- <p style='display:none;' class='variant-title-sub'>Variant 1</p>
1328
- <div>
1329
- <h2 class='Section3'>
1330
- Bibliography Subsection
1331
- <br/>
1332
- <br/>
1333
- Variant 1
1334
- </h2>
1335
- </div>
1336
- </div>
1337
- </div>
1338
- </body>
1339
- </html>
1340
- OUTPUT
1341
- presxml = IsoDoc::PresentationXMLConvert.new({})
1342
- .convert("test", input, true)
1343
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
1344
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1345
- expect(xmlpp(IsoDoc::WordConvert.new({})
1346
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
1347
- end
1348
-
1349
- it "processes section names suppressing section numbering" do
1350
- input = <<~INPUT
1351
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1352
- <preface>
1353
- <foreword obligation="informative">
1354
- <title>Foreword</title>
1355
- <p id="A">This is a preamble</p>
1356
- </foreword>
1357
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
1358
- <title>Introduction Subsection</title>
1359
- </clause>
1360
- </introduction></preface><sections>
1361
- <clause id="D" obligation="normative" type="scope">
1362
- <title>Scope</title>
1363
- <p id="E">Text</p>
1364
- </clause>
1365
-
1366
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
1367
- <title>Normal Terms</title>
1368
- <term id="J">
1369
- <preferred><expression><name>Term2</name></expression></preferred>
1370
- </term>
1371
- </terms>
1372
- <definitions id="K">
1373
- <dl>
1374
- <dt>Symbol</dt>
1375
- <dd>Definition</dd>
1376
- </dl>
1377
- </definitions>
1378
- </clause>
1379
- <definitions id="L">
1380
- <dl>
1381
- <dt>Symbol</dt>
1382
- <dd>Definition</dd>
1383
- </dl>
1384
- </definitions>
1385
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
1386
- <title>Introduction</title>
1387
- </clause>
1388
- <clause id="O" inline-header="false" obligation="normative">
1389
- <title>Clause 4.2</title>
1390
- </clause>
1391
- <clause id="O1" inline-header="false" obligation="normative">
1392
- </clause>
1393
- </clause>
1394
-
1395
- </sections><annex id="P" inline-header="false" obligation="normative">
1396
- <title>Annex</title>
1397
- <clause id="Q" inline-header="false" obligation="normative">
1398
- <title>Annex A.1</title>
1399
- <clause id="Q1" inline-header="false" obligation="normative">
1400
- <title>Annex A.1a</title>
1401
- </clause>
1402
- </clause>
1403
- </annex><bibliography><references id="R" obligation="informative" normative="true">
1404
- <title>Normative References</title>
1405
- </references><clause id="S" obligation="informative">
1406
- <title>Bibliography</title>
1407
- <references id="T" obligation="informative" normative="false">
1408
- <title>Bibliography Subsection</title>
1409
- </references>
1410
- </clause>
1411
- </bibliography>
1412
- </iso-standard>
1413
- INPUT
1414
- output = <<~OUTPUT
1415
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1416
- <preface>
1417
- <foreword obligation='informative' displayorder='1'>
1418
- <title>Foreword</title>
1419
- <p id='A'>This is a preamble</p>
1420
- </foreword>
1421
- <introduction id='B' obligation='informative' displayorder='2'>
1422
- <title>Introduction</title>
1423
- <clause id='C' inline-header='false' obligation='informative'>
1424
- <title depth='2'>Introduction Subsection</title>
1425
- </clause>
1426
- </introduction>
1427
- </preface>
1428
- <sections>
1429
- <clause id='D' obligation='normative' type='scope' displayorder='3'>
1430
- <title depth='1'>Scope</title>
1431
- <p id='E'>Text</p>
1432
- </clause>
1433
- <clause id='H' obligation='normative' displayorder='5'>
1434
- <title depth='1'>Terms, Definitions, Symbols and Abbreviated Terms</title>
1435
- <terms id='I' obligation='normative'>
1436
- <title depth='2'>Normal Terms</title>
1437
- <term id='J'>
1438
- <name>3.1.1.</name>
1439
- <preferred><strong>Term2</strong></preferred>
1440
- </term>
1441
- </terms>
1442
- <definitions id='K'>
1443
- <dl>
1444
- <dt>Symbol</dt>
1445
- <dd>Definition</dd>
1446
- </dl>
1447
- </definitions>
1448
- </clause>
1449
- <definitions id='L' displayorder='6'>
1450
- <dl>
1451
- <dt>Symbol</dt>
1452
- <dd>Definition</dd>
1453
- </dl>
1454
- </definitions>
1455
- <clause id='M' inline-header='false' obligation='normative' displayorder='7'>
1456
- <title depth='1'>Clause 4</title>
1457
- <clause id='N' inline-header='false' obligation='normative'>
1458
- <title depth='2'>Introduction</title>
1459
- </clause>
1460
- <clause id='O' inline-header='false' obligation='normative'>
1461
- <title depth='2'>Clause 4.2</title>
1462
- </clause>
1463
- <clause id='O1' inline-header='false' obligation='normative'> </clause>
1464
- </clause>
1465
- </sections>
1466
- <annex id='P' inline-header='false' obligation='normative' displayorder='8'>
1467
- <title>
1468
- <strong>Annex A</strong>
1469
- <br/>
1470
- (normative)
1471
- <br/>
1472
- <br/>
1473
- <strong>Annex</strong>
1474
- </title>
1475
- <clause id='Q' inline-header='false' obligation='normative'>
1476
- <title depth='2'>Annex A.1</title>
1477
- <clause id='Q1' inline-header='false' obligation='normative'>
1478
- <title depth='3'>Annex A.1a</title>
1479
- </clause>
1480
- </clause>
1481
- </annex>
1482
- <bibliography>
1483
- <references id='R' obligation='informative' normative='true' displayorder='4'>
1484
- <title depth='1'>Normative References</title>
1485
- </references>
1486
- <clause id='S' obligation='informative' displayorder='9'>
1487
- <title depth='1'>Bibliography</title>
1488
- <references id='T' obligation='informative' normative='false'>
1489
- <title depth='2'>Bibliography Subsection</title>
1490
- </references>
1491
- </clause>
1492
- </bibliography>
1493
- </iso-standard>
1494
- OUTPUT
1495
- expect(xmlpp(IsoDoc::PresentationXMLConvert
1496
- .new({ suppressheadingnumbers: true })
1497
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1498
- end
1499
-
1500
- it "processes floating titles" do
1501
- input = <<~INPUT
1502
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1503
- <preface>
1504
- <floating-title depth="1">A0</p>
1505
- <introduction id="B" obligation="informative">
1506
- <title>Introduction</title>
1507
- <floating-title depth="1">A</p>
1508
- <clause id="B1" obligation="informative">
1509
- <title>Introduction Subsection</title>
1510
- <floating-title depth="2">B</p>
1511
- <clause id="B2" obligation="informative">
1512
- <title>Introduction Sub-subsection</title>
1513
- <floating-title depth="1">C</p>
1514
- </clause>
1515
- </clause>
1516
- </introduction>
1517
- </preface>
1518
- <sections>
1519
- <clause id="C" obligation="informative">
1520
- <title>Introduction</title>
1521
- <floating-title depth="1">A</p>
1522
- <clause id="C1" obligation="informative">
1523
- <title>Introduction Subsection</title>
1524
- <floating-title depth="2">B</p>
1525
- <clause id="C2" obligation="informative">
1526
- <title>Introduction Sub-subsection</title>
1527
- <floating-title depth="1">C</p>
1528
- </clause>
1529
- </clause>
1530
- </clause>
1531
- <floating-title depth="1">D</p>
1532
- <clause id="C4"><title>Clause 2</title></clause>
1533
- </sections>
1534
- </iso-standard>
1535
- INPUT
1536
-
1537
- presxml = <<~PRESXML
1538
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1539
- <preface>
1540
- <p depth='1' type='floating-title' displayorder='1'>A0</p>
1541
- <introduction id='B' obligation='informative' displayorder='2'>
1542
- <title>Introduction</title>
1543
- <p depth='1' type='floating-title'>A</p>
1544
- <clause id='B1' obligation='informative'>
1545
- <title depth='2'>Introduction Subsection</title>
1546
- <p depth='2' type='floating-title'>B</p>
1547
- <clause id='B2' obligation='informative'>
1548
- <title depth='3'>Introduction Sub-subsection</title>
1549
- <p depth='1' type='floating-title'>C</p>
1550
- </clause>
1551
- </clause>
1552
- </introduction>
1553
- </preface>
1554
- <sections>
1555
- <clause id='C' obligation='informative' displayorder='3'>
1556
- <title depth='1'>
1557
- 1.
1558
- <tab/>
1559
- Introduction
1560
- </title>
1561
- <p depth='1' type='floating-title'>A</p>
1562
- <clause id='C1' obligation='informative'>
1563
- <title depth='2'>
1564
- 1.1.
1565
- <tab/>
1566
- Introduction Subsection
1567
- </title>
1568
- <p depth='2' type='floating-title'>B</p>
1569
- <clause id='C2' obligation='informative'>
1570
- <title depth='3'>
1571
- 1.1.1.
1572
- <tab/>
1573
- Introduction Sub-subsection
1574
- </title>
1575
- <p depth='1' type='floating-title'>C</p>
1576
- </clause>
1577
- </clause>
1578
- </clause>
1579
- <p depth='1' type='floating-title'>D</p>
1580
- <clause id='C4' displayorder='4'>
1581
- <title depth='1'>
1582
- 2.
1583
- <tab/>
1584
- Clause 2
1585
- </title>
1586
- </clause>
1587
- </sections>
1588
- </iso-standard>
1589
- PRESXML
1590
-
1591
- html = <<~OUTPUT
1592
- #{HTML_HDR}
1593
- <p class='h1'>A0</p>
1594
- <br/>
1595
- <div class='Section3' id='B'>
1596
- <p class='h1'>A0</p>
1597
- <h1 class='IntroTitle'>Introduction</h1>
1598
- <p class='h1'>A</p>
1599
- <div id='B1'>
1600
- <h2>Introduction Subsection</h2>
1601
- <p class='h2'>B</p>
1602
- <div id='B2'>
1603
- <h3>Introduction Sub-subsection</h3>
1604
- <p class='h1'>C</p>
1605
- </div>
1606
- </div>
1607
- </div>
1608
- <p class='zzSTDTitle1'/>
1609
- <div id='C'>
1610
- <h1> 1. &#160; Introduction </h1>
1611
- <p class='h1'>A</p>
1612
- <div id='C1'>
1613
- <h2> 1.1. &#160; Introduction Subsection </h2>
1614
- <p class='h2'>B</p>
1615
- <div id='C2'>
1616
- <h3> 1.1.1. &#160; Introduction Sub-subsection </h3>
1617
- <p class='h1'>C</p>
1618
- </div>
1619
- </div>
1620
- </div>
1621
- <div id='C4'>
1622
- <p class='h1'>D</p>
1623
- <h1> 2. &#160; Clause 2 </h1>
1624
- </div>
1625
- </div>
1626
- </body>
1627
- </html>
1628
- OUTPUT
1629
-
1630
- word = <<~OUTPUT
1631
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
1632
- <head>
1633
- <style></style>
1634
- </head>
1635
- <body lang='EN-US' link='blue' vlink='#954F72'>
1636
- <div class='WordSection1'>
1637
- <p>&#160;</p>
1638
- </div>
1639
- <p>
1640
- <br clear='all' class='section'/>
1641
- </p>
1642
- <div class='WordSection2'>
1643
- <p>A0</p>
1644
- <p>
1645
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
1646
- </p>
1647
- <div class='Section3' id='B'>
1648
- <p>A0</p>
1649
- <h1 class='IntroTitle'>Introduction</h1>
1650
- <p>A</p>
1651
- <div id='B1'>
1652
- <h2>Introduction Subsection</h2>
1653
- <p>B</p>
1654
- <div id='B2'>
1655
- <h3>Introduction Sub-subsection</h3>
1656
- <p>C</p>
1657
- </div>
1658
- </div>
1659
- </div>
1660
- <p>&#160;</p>
1661
- </div>
1662
- <p>
1663
- <br clear='all' class='section'/>
1664
- </p>
1665
- <div class='WordSection3'>
1666
- <p class='zzSTDTitle1'/>
1667
- <div id='C'>
1668
- <h1>
1669
- 1.
1670
- <span style='mso-tab-count:1'>&#160; </span>
1671
- Introduction
1672
- </h1>
1673
- <p>A</p>
1674
- <div id='C1'>
1675
- <h2>
1676
- 1.1.
1677
- <span style='mso-tab-count:1'>&#160; </span>
1678
- Introduction Subsection
1679
- </h2>
1680
- <p>B</p>
1681
- <div id='C2'>
1682
- <h3>
1683
- 1.1.1.
1684
- <span style='mso-tab-count:1'>&#160; </span>
1685
- Introduction Sub-subsection
1686
- </h3>
1687
- <p>C</p>
1688
- </div>
1689
- </div>
1690
- </div>
1691
- <div id='C4'>
1692
- <p>D</p>
1693
- <h1>
1694
- 2.
1695
- <span style='mso-tab-count:1'>&#160; </span>
1696
- Clause 2
1697
- </h1>
1698
- </div>
1699
- </div>
1700
- </body>
1701
- </html>
1702
- OUTPUT
1703
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1704
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1705
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
1706
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1707
- expect(xmlpp(IsoDoc::WordConvert.new({})
1708
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
1709
- end
1710
-
1711
- it "processes section titles without ID" do
1712
- input = <<~INPUT
1713
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1714
- <preface>
1715
- <introduction id="B" obligation="informative"><title>Introduction</title><clause obligation="informative">
1716
- <title>Introduction Subsection</title>
1717
- </clause>
1718
- </introduction>
1719
- </preface>
1720
- </iso-standard>
1721
- INPUT
1722
- output = <<~OUTPUT
1723
- <?xml version='1.0'?>
1724
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1725
- <preface>
1726
- <introduction id='B' obligation='informative' displayorder="1">
1727
- <title>Introduction</title>
1728
- <clause obligation='informative'>
1729
- <title depth="1">Introduction Subsection</title>
1730
- </clause>
1731
- </introduction>
1732
- </preface>
1733
- </iso-standard>
1734
- OUTPUT
1735
- expect(xmlpp(IsoDoc::PresentationXMLConvert
1736
- .new({ suppressheadingnumbers: true })
1737
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1738
- end
1739
-
1740
- it "processes simple terms & definitions" do
1741
- input = <<~"INPUT"
1742
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1743
- <sections>
1744
- <terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
1745
- <term id="J">
1746
- <preferred><expression><name>Term2</name></expression></preferred>
1747
- </term>
1748
- </terms>
1749
- </sections>
1750
- </iso-standard>
1751
- INPUT
1752
-
1753
- presxml = <<~"OUTPUT"
1754
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1755
- <sections>
1756
- <terms id='H' obligation='normative' displayorder="1">
1757
- <title depth='1'>1.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
1758
- <term id='J'>
1759
- <name>1.1.</name>
1760
- <preferred><strong>Term2</strong></preferred>
1761
- </term>
1762
- </terms>
1763
- </sections>
1764
- </iso-standard>
1765
- OUTPUT
1766
-
1767
- html = <<~"OUTPUT"
1768
- #{HTML_HDR}
1769
- <p class="zzSTDTitle1"/>
1770
- <div id="H"><h1>1.&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
1771
- <p class="TermNum" id="J">1.1.</p>
1772
- <p class="Terms" style="text-align:left;"><b>Term2</b></p>
1773
- </div>
1774
- </div>
1775
- </body>
1776
- </html>
1777
- OUTPUT
1778
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1779
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1780
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
1781
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1782
- end
1783
-
1784
- it "processes inline section headers" do
1785
- input = <<~"INPUT"
1786
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1787
- <sections>
1788
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
1789
- <title>Introduction</title>
1790
- </clause>
1791
- <clause id="O" inline-header="true" obligation="normative">
1792
- <title>Clause 4.2</title>
1793
- <p>ABC</p>
1794
- </clause></clause>
1795
-
1796
- </sections>
1797
- </iso-standard>
1798
- INPUT
1799
-
1800
- presxml = <<~"PRESXML"
1801
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1802
- <sections>
1803
- <clause id='M' inline-header='false' obligation='normative' displayorder="1">
1804
- <title depth='1'>1.<tab/>Clause 4</title>
1805
- <clause id='N' inline-header='false' obligation='normative'>
1806
- <title depth='2'>1.1.<tab/>Introduction</title>
1807
- </clause>
1808
- <clause id='O' inline-header='true' obligation='normative'>
1809
- <title depth='2'>1.2.<tab/>Clause 4.2</title>
1810
- <p>ABC</p>
1811
- </clause>
1812
- </clause>
1813
- </sections>
1814
- </iso-standard>
1815
- PRESXML
1816
-
1817
- output = <<~"OUTPUT"
1818
- #{HTML_HDR}
1819
- <p class="zzSTDTitle1"/>
1820
- <div id="M">
1821
- <h1>1.&#160; Clause 4</h1>
1822
- <div id="N">
1823
- <h2>1.1.&#160; Introduction</h2>
1824
- </div>
1825
- <div id="O">
1826
- <span class="zzMoveToFollowing"><b>1.2.&#160; Clause 4.2&#160; </b></span>
1827
- <p>ABC</p>
1828
- </div>
1829
- </div>
1830
- </div>
1831
- </body>
1832
- </html>
1833
- OUTPUT
1834
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1835
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1836
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
1837
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
1838
- end
1839
-
1840
- it "processes inline section headers with suppressed heading numbering" do
1841
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
1842
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1843
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1844
- <sections>
1845
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
1846
- <title>Introduction</title>
1847
- </clause>
1848
- <clause id="O" inline-header="true" obligation="normative">
1849
- <title>Clause 4.2</title>
1850
- </clause></clause>
1851
-
1852
- </sections>
1853
- </iso-standard>
1854
- INPUT
1855
- <?xml version='1.0'?>
1856
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1857
- <sections>
1858
- <clause id='M' inline-header='false' obligation='normative' displayorder="1">
1859
- <title depth="1">Clause 4</title>
1860
- <clause id='N' inline-header='false' obligation='normative'>
1861
- <title depth="2">Introduction</title>
1862
- </clause>
1863
- <clause id='O' inline-header='true' obligation='normative'>
1864
- <title depth="2">Clause 4.2</title>
1865
- </clause>
1866
- </clause>
1867
- </sections>
1868
- </iso-standard>
1869
- OUTPUT
1870
- end
1871
-
1872
- it "processes sections without titles" do
1873
- input = <<~INPUT
1874
- <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
1875
- <preface>
1876
- <introduction id="M" inline-header="false" obligation="normative"><clause id="N" inline-header="false" obligation="normative">
1877
- <title>Intro</title>
1878
- </clause>
1879
- <clause id="O" inline-header="true" obligation="normative">
1880
- </clause></clause>
1881
- </preface>
1882
- <sections>
1883
- <clause id="M1" inline-header="false" obligation="normative"><clause id="N1" inline-header="false" obligation="normative">
1884
- </clause>
1885
- <clause id="O1" inline-header="true" obligation="normative">
1886
- </clause></clause>
1887
- </sections>
1888
-
1889
- </iso-standard>
1890
- INPUT
1891
- output = <<~OUTPUT
1892
- <?xml version='1.0'?>
1893
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1894
- <preface>
1895
- <introduction id='M' inline-header='false' obligation='normative' displayorder="1">
1896
- <clause id='N' inline-header='false' obligation='normative'>
1897
- <title depth="2">Intro</title>
1898
- </clause>
1899
- <clause id='O' inline-header='true' obligation='normative'> </clause>
1900
- </introduction>
1901
- </preface>
1902
- <sections>
1903
- <clause id='M1' inline-header='false' obligation='normative' displayorder="2">
1904
- <title>1.</title>
1905
- <clause id='N1' inline-header='false' obligation='normative'>
1906
- <title>1.1.</title>
1907
- </clause>
1908
- <clause id='O1' inline-header='true' obligation='normative'>
1909
- <title>1.2.</title>
1910
- </clause>
1911
- </clause>
1912
- </sections>
1913
- </iso-standard>
1914
- OUTPUT
1915
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1916
- .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1917
- end
1918
-
1919
- it "processes clauses containing normative references" do
1920
- input = <<~INPUT
1921
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1922
- <bibliography>
1923
- <clause id="D" obligation="informative">
1924
- <title>Bibliography</title>
1925
- <references id="E" obligation="informative" normative="false">
1926
- <title>Bibliography Subsection 1</title>
1927
- </references>
1928
- <references id="F" obligation="informative" normative="false">
1929
- <title>Bibliography Subsection 2</title>
1930
- </references>
1931
- </clause>
1932
- <clause id="A" obligation="informative"><title>First References</title>
1933
- <references id="B" obligation="informative" normative="true">
1934
- <title>Normative References 1</title>
1935
- </references>
1936
- <references id="C" obligation="informative" normative="false">
1937
- <title>Normative References 2</title>
1938
- </references>
1939
- </clause>
1940
-
1941
- </bibliography>
1942
- </iso-standard>
1943
- INPUT
1944
- presxml = <<~OUTPUT
1945
- <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
1946
- <bibliography>
1947
- <clause id="D" obligation="informative" displayorder="2">
1948
- <title depth="1">Bibliography</title>
1949
- <references id="E" obligation="informative" normative="false">
1950
- <title depth="2">Bibliography Subsection 1</title>
1951
- </references>
1952
- <references id="F" obligation="informative" normative="false">
1953
- <title depth="2">Bibliography Subsection 2</title>
1954
- </references>
1955
- </clause>
1956
- <clause id="A" obligation="informative" displayorder="1"><title depth="1">1.<tab/>First References</title>
1957
- <references id="B" obligation="informative" normative="true">
1958
- <title depth="2">1.1.<tab/>Normative References 1</title>
1959
- </references>
1960
- <references id="C" obligation="informative" normative="false">
1961
- <title depth="2">1.2.<tab/>Normative References 2</title>
1962
- </references>
1963
- </clause>
1964
- </bibliography>
1965
- </iso-standard>
1966
- OUTPUT
1967
-
1968
- html = <<~OUTPUT
1969
- #{HTML_HDR}
1970
- <p class='zzSTDTitle1'/>
1971
- <div>
1972
- <h1>1.&#160; First References</h1>
1973
- <div>
1974
- <h2 class='Section3'>1.1.&#160; Normative References 1</h2>
1975
- </div>
1976
- <div>
1977
- <h2 class='Section3'>1.2.&#160; Normative References 2</h2>
1978
- </div>
1979
- </div>
1980
- <br/>
1981
- <div>
1982
- <h1 class='Section3'>Bibliography</h1>
1983
- <div>
1984
- <h2 class='Section3'>Bibliography Subsection 1</h2>
1985
- </div>
1986
- <div>
1987
- <h2 class='Section3'>Bibliography Subsection 2</h2>
1988
- </div>
1989
- </div>
1990
- </div>
1991
- </body>
1992
- </html>
1993
- OUTPUT
1994
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
1995
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1996
- expect(xmlpp(IsoDoc::HtmlConvert.new({})
1997
- .convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1998
- end
1999
-
2000
- it "processes annexes containing one, or more than one special sections" do
2001
- input = <<~INPUT
2002
- <iso-standard xmlns="http://riboseinc.com/isoxml">
2003
- <annex id='PP' obligation='normative'>
2004
- <title>Glossary</title>
2005
- <terms id='PP1' obligation='normative'>
2006
- <term id='term-glossary'>
2007
- <preferred><expression><name>Glossary</name></expression></preferred>
2008
- </term>
2009
- </terms>
2010
- </annex>
2011
- <annex id='QQ' obligation='normative'>
2012
- <title>Glossary</title>
2013
- <terms id='QQ1' obligation='normative'>
2014
- <title>Term Collection</title>
2015
- <term id='term-term-1'>
2016
- <preferred><expression><name>Term</name></expression></preferred>
2017
- </term>
2018
- </terms>
2019
- <terms id='QQ2' obligation='normative'>
2020
- <title>Term Collection 2</title>
2021
- <term id='term-term-2'>
2022
- <preferred><expression><name>Term</name></expression></preferred>
2023
- </term>
2024
- </terms>
2025
- </annex>
2026
- <annex id='RR' obligation='normative'>
2027
- <title>Glossary</title>
2028
- <terms id='RR1' obligation='normative'>
2029
- <title>Term Collection</title>
2030
- <term id='term-term-3'>
2031
- <preferred><expression><name>Term</name></expression></preferred>
2032
- </term>
2033
- </terms>
2034
- <references id='RR2' obligation='normative'>
2035
- <title>References</title>
2036
- </terms>
2037
- </annex>
2038
- </iso-standard>
2039
- INPUT
2040
- presxml = <<~OUTPUT
2041
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2042
- <annex id='PP' obligation='normative' displayorder='1'>
2043
- <title>
2044
- <strong>Annex A</strong>
2045
- <br/>
2046
- (normative)
2047
- <br/>
2048
- <br/>
2049
- <strong>Glossary</strong>
2050
- </title>
2051
- <terms id='PP1' obligation='normative'>
2052
- <term id='term-glossary'>
2053
- <name>A.1.</name>
2054
- <preferred><strong>Glossary</strong></preferred>
2055
- </term>
2056
- </terms>
2057
- </annex>
2058
- <annex id='QQ' obligation='normative' displayorder='2'>
2059
- <title>
2060
- <strong>Annex B</strong>
2061
- <br/>
2062
- (normative)
2063
- <br/>
2064
- <br/>
2065
- <strong>Glossary</strong>
2066
- </title>
2067
- <terms id='QQ1' obligation='normative'>
2068
- <title depth='2'>
2069
- B.1.
2070
- <tab/>
2071
- Term Collection
2072
- </title>
2073
- <term id='term-term-1'>
2074
- <name>B.1.1.</name>
2075
- <preferred><strong>Term</strong></preferred>
2076
- </term>
2077
- </terms>
2078
- <terms id='QQ2' obligation='normative'>
2079
- <title depth='2'>
2080
- B.2.
2081
- <tab/>
2082
- Term Collection 2
2083
- </title>
2084
- <term id='term-term-2'>
2085
- <name>B.2.1.</name>
2086
- <preferred><strong>Term</strong></preferred>
2087
- </term>
2088
- </terms>
2089
- </annex>
2090
- <annex id='RR' obligation='normative' displayorder='3'>
2091
- <title>
2092
- <strong>Annex C</strong>
2093
- <br/>
2094
- (normative)
2095
- <br/>
2096
- <br/>
2097
- <strong>Glossary</strong>
2098
- </title>
2099
- <terms id='RR1' obligation='normative'>
2100
- <title depth='2'>
2101
- C.1.
2102
- <tab/>
2103
- Term Collection
2104
- </title>
2105
- <term id='term-term-3'>
2106
- <name>C.1.1.</name>
2107
- <preferred><strong>Term</strong></preferred>
2108
- </term>
2109
- </terms>
2110
- <references id='RR2' obligation='normative'>
2111
- <title depth='2'>
2112
- C.2.
2113
- <tab/>
2114
- References
2115
- </title>
2116
- </references>
2117
- </annex>
2118
- </iso-standard>
2119
- OUTPUT
2120
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
2121
- .convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
2122
- end
2123
- end