isodoc 1.5.3 → 1.6.2

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -1
  3. data/.rubocop.yml +6 -4
  4. data/Gemfile +2 -2
  5. data/bin/rspec +1 -2
  6. data/isodoc.gemspec +11 -11
  7. data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
  8. data/lib/isodoc-yaml/i18n-de.yaml +149 -0
  9. data/lib/isodoc-yaml/i18n-es.yaml +151 -0
  10. data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
  11. data/lib/isodoc/base_style/all.css +7 -0
  12. data/lib/isodoc/base_style/metanorma_word.css +7 -0
  13. data/lib/isodoc/base_style/metanorma_word.scss +8 -0
  14. data/lib/isodoc/base_style/reset.css +7 -0
  15. data/lib/isodoc/base_style/reset.scss +9 -0
  16. data/lib/isodoc/base_style/scripts.html +187 -0
  17. data/lib/isodoc/class_utils.rb +6 -5
  18. data/lib/isodoc/common.rb +2 -0
  19. data/lib/isodoc/convert.rb +30 -17
  20. data/lib/isodoc/css.rb +42 -28
  21. data/lib/isodoc/function/blocks.rb +25 -4
  22. data/lib/isodoc/function/blocks_example_note.rb +2 -2
  23. data/lib/isodoc/function/cleanup.rb +1 -2
  24. data/lib/isodoc/function/form.rb +51 -0
  25. data/lib/isodoc/function/inline.rb +32 -10
  26. data/lib/isodoc/function/references.rb +55 -42
  27. data/lib/isodoc/function/table.rb +1 -0
  28. data/lib/isodoc/function/to_word_html.rb +29 -27
  29. data/lib/isodoc/function/utils.rb +41 -38
  30. data/lib/isodoc/gem_tasks.rb +30 -31
  31. data/lib/isodoc/html_convert.rb +6 -4
  32. data/lib/isodoc/html_function/form.rb +62 -0
  33. data/lib/isodoc/html_function/postprocess.rb +35 -76
  34. data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
  35. data/lib/isodoc/i18n.rb +33 -31
  36. data/lib/isodoc/pdf_convert.rb +1 -3
  37. data/lib/isodoc/presentation_function/block.rb +26 -11
  38. data/lib/isodoc/presentation_function/inline.rb +60 -111
  39. data/lib/isodoc/presentation_function/math.rb +84 -0
  40. data/lib/isodoc/presentation_xml_convert.rb +2 -1
  41. data/lib/isodoc/version.rb +1 -1
  42. data/lib/isodoc/word_function/body.rb +28 -24
  43. data/lib/isodoc/word_function/footnotes.rb +22 -15
  44. data/lib/isodoc/word_function/inline.rb +6 -0
  45. data/lib/isodoc/word_function/postprocess.rb +16 -6
  46. data/lib/isodoc/xref.rb +10 -11
  47. data/lib/isodoc/xref/xref_counter.rb +31 -15
  48. data/lib/isodoc/xref/xref_gen.rb +28 -22
  49. data/lib/isodoc/xref/xref_sect_gen.rb +22 -20
  50. data/lib/isodoc/xslfo_convert.rb +36 -25
  51. data/spec/assets/html_override.css +1 -0
  52. data/spec/assets/word_override.css +1 -0
  53. data/spec/isodoc/blocks_spec.rb +2599 -2503
  54. data/spec/isodoc/cleanup_spec.rb +1107 -1109
  55. data/spec/isodoc/footnotes_spec.rb +1 -16
  56. data/spec/isodoc/form_spec.rb +156 -0
  57. data/spec/isodoc/i18n_spec.rb +984 -972
  58. data/spec/isodoc/inline_spec.rb +984 -920
  59. data/spec/isodoc/lists_spec.rb +316 -315
  60. data/spec/isodoc/postproc_spec.rb +1692 -1538
  61. data/spec/isodoc/presentation_xml_spec.rb +345 -338
  62. data/spec/isodoc/ref_spec.rb +718 -723
  63. data/spec/isodoc/section_spec.rb +910 -902
  64. data/spec/isodoc/table_spec.rb +566 -556
  65. data/spec/isodoc/terms_spec.rb +252 -256
  66. data/spec/isodoc/xref_spec.rb +3040 -2985
  67. data/spec/isodoc/xslfo_convert_spec.rb +39 -0
  68. data/spec/spec_helper.rb +30 -29
  69. metadata +80 -69
  70. data/.rubocop.ribose.yml +0 -65
  71. data/.rubocop.tb.yml +0 -650
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "processes prefatory blocks" do
5
- input = <<~INPUT
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({}).convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
24
- <html lang='en'>
25
- <head/>
26
- <body lang='en'>
27
- <div class='title-section'>
28
- <p>&#160;</p>
29
- </div>
30
- <br/>
31
- <div class='prefatory-section'>
32
- <p>&#160;</p>
33
- </div>
34
- <br/>
35
- <div class='main-section'>
36
- <div id='C' class='Note'>note</div>
37
- <br/>
38
- <div id='A'>
39
- <h1 class='AbstractTitle'>abstract</h1>
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 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&#160; </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>&#160;</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'>&#160; </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>&#160;</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'>&#160; </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>&#160;</p>
40
144
  </div>
41
145
  <br/>
42
- <div class='Section3' id='B'>
43
- <h1 class='IntroTitle'>introduction</h1>
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&#160; </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>&#160;</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'>&#160; </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>&#160;</p>
91
148
  </div>
92
- <p>
93
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
94
- </p>
95
- <div class='Section3' id='B'>
96
- <h1 class='IntroTitle'>introduction</h1>
97
- </div>
98
- <p>&#160;</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'>&#160; </span>
119
- </b>
120
- </span>
121
- </div>
149
+ <br/>
150
+ <div class="main-section">
151
+ <p class="zzSTDTitle1"/>
122
152
  </div>
123
- </div>
124
- </body>
125
- </html>
153
+ </body>
154
+ </html>
126
155
  OUTPUT
127
- end
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>&#160;</p>
141
- </div>
142
- <br/>
143
- <div class="prefatory-section">
144
- <p>&#160;</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
- it "processes section names" do
156
- input = <<~"INPUT"
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
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
264
- <boilerplate>
265
- <copyright-statement>
266
- <clause>
267
- <title depth="1">Copyright</title>
268
- </clause>
269
- </copyright-statement>
270
- <license-statement>
271
- <clause>
272
- <title depth="1">License</title>
273
- </clause>
274
- </license-statement>
275
- <legal-statement>
276
- <clause>
277
- <title depth="1">Legal</title>
278
- </clause>
279
- </legal-statement>
280
- <feedback-statement>
281
- <clause>
282
- <title depth="1">Feedback</title>
283
- </clause>
284
- </feedback-statement>
285
- </boilerplate>
286
- <preface>
287
- <abstract obligation='informative'>
288
- <title>Abstract</title>
289
- </abstract>
290
- <foreword obligation='informative'>
291
- <title>Foreword</title>
292
- <p id='A'>This is a preamble</p>
293
- </foreword>
294
- <introduction id='B' obligation='informative'>
295
- <title>Introduction</title>
296
- <clause id='C' inline-header='false' obligation='informative'>
297
- <title depth='2'>Introduction Subsection</title>
298
- </clause>
299
- </introduction>
300
- <clause id='B1'>
301
- <title depth='1'>Dedication</title>
302
- </clause>
303
- <clause id='B2'>
304
- <title depth='1'>Note to reader</title>
305
- </clause>
306
- <acknowledgements obligation='informative'>
307
- <title>Acknowledgements</title>
308
- </acknowledgements>
309
- </preface>
310
- <sections>
311
- <note id='NN1'>
312
- <name>NOTE</name>
313
- <p>Initial note</p>
314
- </note>
315
- <admonition id='NN2' type='warning'>
316
- <p>Initial admonition</p>
317
- </admonition>
318
- <clause id='D' obligation='normative' type='scope'>
319
- <title depth='1'>1.<tab/>Scope</title>
320
- <p id='E'>Text</p>
321
- </clause>
322
- <clause id='H' obligation='normative'>
323
- <title depth='1'>3.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
324
- <terms id='I' obligation='normative'>
325
- <title depth='2'>3.1.<tab/>Normal Terms</title>
326
- <term id='J'>
327
- <name>3.1.1.</name>
328
- <preferred>Term2</preferred>
329
- </term>
330
- </terms>
331
- <definitions id='K'>
332
- <title depth='2'>3.2.<tab/>Definitions</title>
333
- <dl>
334
- <dt>Symbol</dt>
335
- <dd>Definition</dd>
336
- </dl>
337
- </definitions>
338
- </clause>
339
- <definitions id='L'>
340
- <title depth='1'>4.<tab/>Symbols and abbreviated terms</title>
341
- <dl>
342
- <dt>Symbol</dt>
343
- <dd>Definition</dd>
344
- </dl>
345
- </definitions>
346
- <clause id='M' inline-header='false' obligation='normative'>
347
- <title depth='1'>5.<tab/>Clause 4</title>
348
- <clause id='N' inline-header='false' obligation='normative'>
349
- <title depth='2'>5.1.<tab/>Introduction</title>
350
- </clause>
351
- <clause id='O' inline-header='false' obligation='normative'>
352
- <title depth='2'>5.2.<tab/>Clause 4.2</title>
353
- </clause>
354
- <clause id='O1' inline-header='false' obligation='normative'>
355
- <title>5.3.</title>
356
- </clause>
357
- </clause>
358
- </sections>
359
- <annex id='P' inline-header='false' obligation='normative'>
360
- <title> <strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong>
361
- </title>
362
- <clause id='Q' inline-header='false' obligation='normative'>
363
- <title depth='2'>A.1.<tab/>Annex A.1</title>
364
- <clause id='Q1' inline-header='false' obligation='normative'>
365
- <title depth='3'>A.1.1.<tab/>Annex A.1a</title>
366
- </clause>
367
- <references id='Q2' normative='false'>
368
- <title depth='3'>A.1.2.<tab/>Annex Bibliography</title>
369
- </references>
370
- </clause>
371
- </annex>
372
- <annex id='P1' inline-header='false' obligation='normative'>
373
- <title><strong>Annex B</strong><br/>(normative)</title>
374
- </annex>
375
- <bibliography>
376
- <references id='R' obligation='informative' normative='true'>
377
- <title depth='1'>2.<tab/>Normative References</title>
378
- </references>
379
- <clause id='S' obligation='informative'>
380
- <title depth='1'>Bibliography</title>
381
- <references id='T' obligation='informative' normative='false'>
382
- <title depth="2">Bibliography Subsection</title>
383
- </references>
384
- </clause>
385
- </bibliography>
386
- </iso-standard>
387
- PRESXML
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
- &#160; 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.&#160; Scope</h1>
455
- <p id="E">Text</p>
456
- </div>
457
- <div>
458
- <h1>2.&#160; Normative References</h1>
459
- </div>
460
- <div id="H"><h1>3.&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
461
- <div id="I">
462
- <h2>3.1.&#160; 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.&#160; 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.&#160; 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.&#160; Clause 4</h1>
480
- <div id="N">
481
- <h2>5.1.&#160; Introduction</h2>
482
- </div>
483
- <div id="O">
484
- <h2>5.2.&#160; 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.&#160; Annex A.1</h2>
495
- <div id="Q1">
496
- <h3>A.1.1.&#160; Annex A.1a</h3>
497
- </div>
498
- <div><h3 class="Section3">A.1.2.&#160; 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
- </div>
502
- <br/>
503
- <div id='P1' class='Section3'>
504
- <h1 class='Annex'>
505
- <b>Annex B</b>
506
- <br/>
507
- (normative)
508
- </h1>
509
- </div>
510
- <br/>
511
- <div>
512
- <h1 class="Section3">Bibliography</h1>
513
- <div>
514
- <h2 class="Section3">Bibliography Subsection</h2>
515
- </div>
516
- </div>
517
- </div>
518
- </body>
519
- </html>
520
- OUTPUT
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
+ &#160; 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.&#160; Scope</h1>
455
+ <p id="E">Text</p>
456
+ </div>
457
+ <div>
458
+ <h1>2.&#160; Normative References</h1>
459
+ </div>
460
+ <div id="H"><h1>3.&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
461
+ <div id="I">
462
+ <h2>3.1.&#160; 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.&#160; 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.&#160; 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.&#160; Clause 4</h1>
479
+ <div id="N">
480
+ <h2>5.1.&#160; Introduction</h2>
481
+ </div>
482
+ <div id="O">
483
+ <h2>5.2.&#160; 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.&#160; Annex A.1</h2>
494
+ <div id="Q1">
495
+ <h3>A.1.1.&#160; Annex A.1a</h3>
496
+ </div>
497
+ <div><h3 class="Section3">A.1.2.&#160; 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
- <html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
524
- <head><style/></head>
525
- <body lang="EN-US" link="blue" vlink="#954F72">
526
- <div class="WordSection1">
527
- <p>&#160;</p>
528
- </div>
529
- <p>
530
- <br clear="all" class="section"/>
531
- </p>
532
- <div class="WordSection2">
533
- <div class="authority">
534
- <div class="boilerplate-copyright">
535
- <div><h1>Copyright</h1>
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>&#160;</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
- <div class="boilerplate-license">
540
- <div><h1>License</h1>
536
+ </div>
537
+ <div class="boilerplate-license">
538
+ <div><h1>License</h1>
541
539
 
542
- </div>
543
540
  </div>
544
- <div class="boilerplate-legal">
545
- <div><h1>Legal</h1>
541
+ </div>
542
+ <div class="boilerplate-legal">
543
+ <div><h1>Legal</h1>
546
544
 
547
- </div>
548
545
  </div>
549
- <div class="boilerplate-feedback">
550
- <div><h1>Feedback</h1>
546
+ </div>
547
+ <div class="boilerplate-feedback">
548
+ <div><h1>Feedback</h1>
551
549
 
552
- </div>
553
550
  </div>
554
551
  </div>
555
- <p>
556
- <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
557
- </p>
558
- <div>
559
- <h1 class="AbstractTitle">Abstract</h1>
560
- </div>
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>&#160;</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" class="section"/>
560
+ <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
599
561
  </p>
600
- <div class="WordSection3">
601
- <p class="zzSTDTitle1"/>
602
- <div id="NN1" class="Note">
603
- <p class="Note"><span class="note_label">NOTE</span><span style="mso-tab-count:1">&#160; </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
- <div id="D">
609
- <h1>1.<span style="mso-tab-count:1">&#160; </span>Scope</h1>
610
- <p id="E">Text</p>
611
- </div>
612
- <div><h1>2.<span style="mso-tab-count:1">&#160; </span>Normative References</h1>
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
- <div id="H">
616
- <h1>3.<span style="mso-tab-count:1">&#160; </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
617
- <div id="I"><h2>3.1.<span style="mso-tab-count:1">&#160; </span>Normal Terms</h2>
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>&#160;</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">&#160; </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">&#160; </span>Scope</h1>
608
+ <p id="E">Text</p>
609
+ </div>
610
+ <div><h1>2.<span style="mso-tab-count:1">&#160; </span>Normative References</h1>
618
611
 
619
- <p class="TermNum" id="J">3.1.1.</p>
612
+ </div>
613
+ <div id="H">
614
+ <h1>3.<span style="mso-tab-count:1">&#160; </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
615
+ <div id="I"><h2>3.1.<span style="mso-tab-count:1">&#160; </span>Normal Terms</h2>
620
616
 
621
- <p class="Terms" style="text-align:left;">Term2</p>
617
+ <p class="TermNum" id="J">3.1.1.</p>
622
618
 
623
- </div>
624
- <div id="K"><h2>3.2.<span style="mso-tab-count:1">&#160; </span>Definitions</h2>
619
+ <p class="Terms" style="text-align:left;">Term2</p>
625
620
 
626
- <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>
627
- </div>
628
- </div>
629
- <div id="L" class="Symbols">
630
- <h1>4.<span style="mso-tab-count:1">&#160; </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">&#160; </span>Clause 4</h1>
642
- <div id="N"><h2>5.1.<span style="mso-tab-count:1">&#160; </span>Introduction</h2>
621
+ </div>
622
+ <div id="K"><h2>3.2.<span style="mso-tab-count:1">&#160; </span>Definitions</h2>
643
623
 
644
- </div>
645
- <div id="O"><h2>5.2.<span style="mso-tab-count:1">&#160; </span>Clause 4.2</h2>
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">&#160; </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">&#160; </span>Clause 4</h1>
640
+ <div id="N"><h2>5.1.<span style="mso-tab-count:1">&#160; </span>Introduction</h2>
646
641
 
647
- </div>
648
- <div id="O1"><h2>5.3.</h2>
642
+ </div>
643
+ <div id="O"><h2>5.2.<span style="mso-tab-count:1">&#160; </span>Clause 4.2</h2>
649
644
 
650
- </div>
651
- </div>
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">&#160; </span>Annex A.1</h2>
645
+ </div>
646
+ <div id="O1"><h2>5.3.</h2>
659
647
 
660
- <div id="Q1"><h3>A.1.1.<span style="mso-tab-count:1">&#160; </span>Annex A.1a</h3>
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">&#160; </span>Annex A.1</h2>
661
657
 
662
- </div>
663
- <div><h3 class="Section3">A.1.2.<span style="mso-tab-count:1">&#160; </span>Annex Bibliography</h3>
658
+ <div id="Q1"><h3>A.1.1.<span style="mso-tab-count:1">&#160; </span>Annex A.1a</h3>
664
659
 
665
- </div>
666
660
  </div>
667
- </div>
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">&#160; </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
- </body>
685
- </html>
686
- OUTPUT
687
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
688
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
689
- expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
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
- it "processes section names suppressing section numbering" do
693
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({suppressheadingnumbers: true}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
694
- <iso-standard xmlns="http://riboseinc.com/isoxml">
695
- <preface>
696
- <foreword obligation="informative">
697
- <title>Foreword</title>
698
- <p id="A">This is a preamble</p>
699
- </foreword>
700
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
701
- <title>Introduction Subsection</title>
702
- </clause>
703
- </introduction></preface><sections>
704
- <clause id="D" obligation="normative" type="scope">
705
- <title>Scope</title>
706
- <p id="E">Text</p>
707
- </clause>
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
- <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
710
- <title>Normal Terms</title>
711
- <term id="J">
712
- <preferred>Term2</preferred>
713
- </term>
714
- </terms>
715
- <definitions id="K">
716
- <dl>
717
- <dt>Symbol</dt>
718
- <dd>Definition</dd>
719
- </dl>
720
- </definitions>
721
- </clause>
722
- <definitions id="L">
723
- <dl>
724
- <dt>Symbol</dt>
725
- <dd>Definition</dd>
726
- </dl>
727
- </definitions>
728
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
729
- <title>Introduction</title>
730
- </clause>
731
- <clause id="O" inline-header="false" obligation="normative">
732
- <title>Clause 4.2</title>
733
- </clause>
734
- <clause id="O1" inline-header="false" obligation="normative">
735
- </clause>
736
- </clause>
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
- </sections><annex id="P" inline-header="false" obligation="normative">
739
- <title>Annex</title>
740
- <clause id="Q" inline-header="false" obligation="normative">
741
- <title>Annex A.1</title>
742
- <clause id="Q1" inline-header="false" obligation="normative">
743
- <title>Annex A.1a</title>
744
- </clause>
745
- </clause>
746
- </annex><bibliography><references id="R" obligation="informative" normative="true">
747
- <title>Normative References</title>
748
- </references><clause id="S" obligation="informative">
749
- <title>Bibliography</title>
750
- <references id="T" obligation="informative" normative="false">
751
- <title>Bibliography Subsection</title>
752
- </references>
753
- </clause>
754
- </bibliography>
755
- </iso-standard>
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
- <?xml version='1.0'?>
758
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
759
- <preface>
760
- <foreword obligation='informative'>
761
- <title>Foreword</title>
762
- <p id='A'>This is a preamble</p>
763
- </foreword>
764
- <introduction id='B' obligation='informative'>
765
- <title>Introduction</title>
766
- <clause id='C' inline-header='false' obligation='informative'>
767
- <title depth="2">Introduction Subsection</title>
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
- <definitions id='L'>
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
- <clause id='M' inline-header='false' obligation='normative'>
799
- <title depth="1">Clause 4</title>
800
- <clause id='N' inline-header='false' obligation='normative'>
801
- <title depth="2">Introduction</title>
802
- </clause>
803
- <clause id='O' inline-header='false' obligation='normative'>
804
- <title depth="2">Clause 4.2</title>
805
- </clause>
806
- <clause id='O1' inline-header='false' obligation='normative'> </clause>
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
- </sections>
809
- <annex id='P' inline-header='false' obligation='normative'>
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
- </annex>
825
- <bibliography>
826
- <references id='R' obligation='informative' normative='true'>
827
- <title depth="1">Normative References</title>
828
- </references>
829
- <clause id='S' obligation='informative'>
830
- <title depth="1">Bibliography</title>
831
- <references id='T' obligation='informative' normative='false'>
832
- <title depth="2">Bibliography Subsection</title>
833
- </references>
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
- </bibliography>
836
- </iso-standard>
837
- OUTPUT
838
- end
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
- it "processes section titles without ID" do
841
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({suppressheadingnumbers: true}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
842
- <iso-standard xmlns="http://riboseinc.com/isoxml">
843
- <preface>
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='B' obligation='informative'>
855
- <title>Introduction</title>
856
- <clause obligation='informative'>
857
- <title depth="1">Introduction Subsection</title>
858
- </clause>
859
- </introduction>
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
- presxml = <<~"OUTPUT"
879
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
880
- <sections>
881
- <terms id='H' obligation='normative'>
882
- <title depth='1'>1.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
883
- <term id='J'>
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
- </terms>
888
- </sections>
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
- #{HTML_HDR}
894
- <p class="zzSTDTitle1"/>
895
- <div id="H"><h1>1.&#160; Terms, Definitions, Symbols and Abbreviated Terms</h1>
896
- <p class="TermNum" id="J">1.1.</p>
897
- <p class="Terms" style="text-align:left;">Term2</p>
898
- </div>
899
- </div>
900
- </body>
901
- </html>
896
+ #{HTML_HDR}
897
+ <p class="zzSTDTitle1"/>
898
+ <div id="H"><h1>1.&#160; 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({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
904
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
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
- <sections>
926
- <clause id='M' inline-header='false' obligation='normative'>
927
- <title depth='1'>1.<tab/>Clause 4</title>
928
- <clause id='N' inline-header='false' obligation='normative'>
929
- <title depth='2'>1.1.<tab/>Introduction</title>
930
- </clause>
931
- <clause id='O' inline-header='true' obligation='normative'>
932
- <title depth='2'>1.2.<tab/>Clause 4.2</title>
933
- <p>ABC</p>
934
- </clause>
935
- </clause>
936
- </sections>
937
- </iso-standard>
938
- PRESXML
939
-
940
- output = <<~"OUTPUT"
941
- #{HTML_HDR}
942
- <p class="zzSTDTitle1"/>
943
- <div id="M">
944
- <h1>1.&#160; Clause 4</h1>
945
- <div id="N">
946
- <h2>1.1.&#160; Introduction</h2>
947
- </div>
948
- <div id="O">
949
- <span class="zzMoveToFollowing"><b>1.2.&#160; Clause 4.2&#160; </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
- it "processes inline section headers with suppressed heading numbering" do
962
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({suppressheadingnumbers: true}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
963
- <iso-standard xmlns="http://riboseinc.com/isoxml">
964
- <sections>
965
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
966
- <title>Introduction</title>
967
- </clause>
968
- <clause id="O" inline-header="true" obligation="normative">
969
- <title>Clause 4.2</title>
970
- </clause></clause>
945
+ output = <<~"OUTPUT"
946
+ #{HTML_HDR}
947
+ <p class="zzSTDTitle1"/>
948
+ <div id="M">
949
+ <h1>1.&#160; Clause 4</h1>
950
+ <div id="N">
951
+ <h2>1.1.&#160; Introduction</h2>
952
+ </div>
953
+ <div id="O">
954
+ <span class="zzMoveToFollowing"><b>1.2.&#160; Clause 4.2&#160; </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
- </sections>
973
- </iso-standard>
974
- INPUT
975
- <?xml version='1.0'?>
976
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
977
- <sections>
978
- <clause id='M' inline-header='false' obligation='normative'>
979
- <title depth="1">Clause 4</title>
980
- <clause id='N' inline-header='false' obligation='normative'>
981
- <title depth="2">Introduction</title>
982
- </clause>
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
- it "processes sections without titles" do
993
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
994
- <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
995
- <preface>
996
- <introduction id="M" inline-header="false" obligation="normative"><clause id="N" inline-header="false" obligation="normative">
997
- <title>Intro</title>
998
- </clause>
999
- <clause id="O" inline-header="true" obligation="normative">
1000
- </clause></clause>
1001
- </preface>
1002
- <sections>
1003
- <clause id="M1" inline-header="false" obligation="normative"><clause id="N1" inline-header="false" obligation="normative">
1004
- </clause>
1005
- <clause id="O1" inline-header="true" obligation="normative">
1006
- </clause></clause>
1007
- </sections>
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
- </iso-standard>
1010
- INPUT
1011
- <?xml version='1.0'?>
1012
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1013
- <preface>
1014
- <introduction id='M' inline-header='false' obligation='normative'>
1015
- <clause id='N' inline-header='false' obligation='normative'>
1016
- <title depth="2">Intro</title>
1017
- </clause>
1018
- <clause id='O' inline-header='true' obligation='normative'> </clause>
1019
- </introduction>
1020
- </preface>
1021
- <sections>
1022
- <clause id='M1' inline-header='false' obligation='normative'>
1023
- <title>1.</title>
1024
- <clause id='N1' inline-header='false' obligation='normative'>
1025
- <title>1.1.</title>
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
- it "processes clauses containing normative references" do
1037
- input = <<~INPUT
1038
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1039
- <bibliography>
1040
- <clause id="D" obligation="informative">
1041
- <title>Bibliography</title>
1042
- <references id="E" obligation="informative" normative="false">
1043
- <title>Bibliography Subsection 1</title>
1044
- </references>
1045
- <references id="F" obligation="informative" normative="false">
1046
- <title>Bibliography Subsection 2</title>
1047
- </references>
1048
- </clause>
1049
- <clause id="A" obligation="informative"><title>First References</title>
1050
- <references id="B" obligation="informative" normative="true">
1051
- <title>Normative References 1</title>
1052
- </references>
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
- </bibliography>
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
- </bibliography>
1083
- </iso-standard>
1084
- OUTPUT
1085
-
1086
- html = <<~OUTPUT
1087
- #{HTML_HDR}
1088
- <p class='zzSTDTitle1'/>
1089
- <div>
1090
- <h1>1.&#160; First References</h1>
1091
- <div>
1092
- <h2 class='Section3'>1.1.&#160; Normative References 1</h2>
1093
- </div>
1094
- <div>
1095
- <h2 class='Section3'>1.2.&#160; Normative References 2</h2>
1096
- </div>
1097
- </div>
1098
- <br/>
1099
- <div>
1100
- <h1 class='Section3'>Bibliography</h1>
1101
- <div>
1102
- <h2 class='Section3'>Bibliography Subsection 1</h2>
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
- OUTPUT
1113
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
1114
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
1115
- end
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.&#160; First References</h1>
1099
+ <div>
1100
+ <h2 class='Section3'>1.1.&#160; Normative References 1</h2>
1101
+ </div>
1102
+ <div>
1103
+ <h2 class='Section3'>1.2.&#160; 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