metanorma-bsi 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.hound.yml +3 -0
- data/.rubocop.yml +14 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/LICENSE +25 -0
- data/README.adoc +199 -0
- data/Rakefile +8 -0
- data/bin/rspec +18 -0
- data/lib/asciidoctor/bsi/basicdoc.rng +1131 -0
- data/lib/asciidoctor/bsi/biblio.rng +1235 -0
- data/lib/asciidoctor/bsi/bsi.rng +120 -0
- data/lib/asciidoctor/bsi/bsi_intro_en.xml +105 -0
- data/lib/asciidoctor/bsi/cleanup.rb +78 -0
- data/lib/asciidoctor/bsi/cleanup_ref.rb +183 -0
- data/lib/asciidoctor/bsi/converter.rb +83 -0
- data/lib/asciidoctor/bsi/front.rb +67 -0
- data/lib/asciidoctor/bsi/isodoc.rng +1870 -0
- data/lib/asciidoctor/bsi/isostandard.rng +477 -0
- data/lib/asciidoctor/bsi/reqt.rng +194 -0
- data/lib/asciidoctor/bsi/validate.rb +224 -0
- data/lib/asciidoctor/bsi/validate_list.rb +72 -0
- data/lib/asciidoctor/bsi/validate_requirement.rb +163 -0
- data/lib/isodoc/bsi/base_convert.rb +91 -0
- data/lib/isodoc/bsi/bsi.international-standard.xsl +6540 -0
- data/lib/isodoc/bsi/html/html_bsi_intro.html +8 -0
- data/lib/isodoc/bsi/html/html_bsi_titlepage.html +50 -0
- data/lib/isodoc/bsi/html/htmlstyle.css +968 -0
- data/lib/isodoc/bsi/html/htmlstyle.scss +699 -0
- data/lib/isodoc/bsi/html_convert.rb +56 -0
- data/lib/isodoc/bsi/i18n-en.yaml +56 -0
- data/lib/isodoc/bsi/i18n.rb +15 -0
- data/lib/isodoc/bsi/init.rb +24 -0
- data/lib/isodoc/bsi/metadata.rb +33 -0
- data/lib/isodoc/bsi/pdf_convert.rb +17 -0
- data/lib/isodoc/bsi/presentation_xml_convert.rb +72 -0
- data/lib/isodoc/bsi/sts_convert.rb +30 -0
- data/lib/isodoc/bsi/xref.rb +134 -0
- data/lib/metanorma-bsi.rb +15 -0
- data/lib/metanorma/bsi.rb +6 -0
- data/lib/metanorma/bsi/processor.rb +51 -0
- data/lib/metanorma/bsi/version.rb +6 -0
- data/metanorma-bsi.gemspec +47 -0
- data/spec/asciidoctor/base_spec.rb +778 -0
- data/spec/asciidoctor/blocks_spec.rb +553 -0
- data/spec/asciidoctor/cleanup_spec.rb +547 -0
- data/spec/asciidoctor/inline_spec.rb +176 -0
- data/spec/asciidoctor/lists_spec.rb +194 -0
- data/spec/asciidoctor/refs_spec.rb +318 -0
- data/spec/asciidoctor/section_spec.rb +382 -0
- data/spec/asciidoctor/validate_spec.rb +858 -0
- data/spec/assets/header.html +7 -0
- data/spec/assets/html.css +2 -0
- data/spec/assets/iso.xml +71 -0
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/word.css +2 -0
- data/spec/assets/wordintro.html +4 -0
- data/spec/assets/xref_error.adoc +7 -0
- data/spec/isodoc/blocks_spec.rb +259 -0
- data/spec/isodoc/i18n_spec.rb +442 -0
- data/spec/isodoc/inline_spec.rb +287 -0
- data/spec/isodoc/iso_spec.rb +116 -0
- data/spec/isodoc/metadata_spec.rb +262 -0
- data/spec/isodoc/postproc_spec.rb +137 -0
- data/spec/isodoc/ref_spec.rb +376 -0
- data/spec/isodoc/section_spec.rb +467 -0
- data/spec/isodoc/terms_spec.rb +246 -0
- data/spec/isodoc/xref_spec.rb +1730 -0
- data/spec/metanorma/processor_spec.rb +76 -0
- data/spec/spec_helper.rb +291 -0
- data/spec/vcr_cassettes/iso-639.yml +182 -0
- data/spec/vcr_cassettes/isobib_get_639_1967.yml +136 -0
- data/spec/vcr_cassettes/multistandard.yml +352 -0
- metadata +343 -0
@@ -0,0 +1,467 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe IsoDoc do
|
4
|
+
it "processes section names" do
|
5
|
+
input = <<~INPUT
|
6
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
+
<preface>
|
8
|
+
<foreword obligation="informative">
|
9
|
+
<title>Foreword</title>
|
10
|
+
<p id="A">This is a preamble</p>
|
11
|
+
</foreword>
|
12
|
+
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
13
|
+
<title>Introduction Subsection</title>
|
14
|
+
</clause>
|
15
|
+
<p>This is patent boilerplate</p>
|
16
|
+
</introduction></preface><sections>
|
17
|
+
<clause id="D" obligation="normative" type="scope">
|
18
|
+
<title>Scope</title>
|
19
|
+
<p id="E">Text</p>
|
20
|
+
</clause>
|
21
|
+
|
22
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
23
|
+
<title>Normal Terms</title>
|
24
|
+
<term id="J">
|
25
|
+
<preferred>Term2</preferred>
|
26
|
+
</term>
|
27
|
+
</terms>
|
28
|
+
<definitions id="K">
|
29
|
+
<dl>
|
30
|
+
<dt>Symbol</dt>
|
31
|
+
<dd>Definition</dd>
|
32
|
+
</dl>
|
33
|
+
</definitions>
|
34
|
+
</clause>
|
35
|
+
<definitions id="L">
|
36
|
+
<dl>
|
37
|
+
<dt>Symbol</dt>
|
38
|
+
<dd>Definition</dd>
|
39
|
+
</dl>
|
40
|
+
</definitions>
|
41
|
+
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
42
|
+
<title>Introduction</title>
|
43
|
+
</clause>
|
44
|
+
<clause id="O" inline-header="false" obligation="normative">
|
45
|
+
<title>Clause 4.2</title>
|
46
|
+
</clause></clause>
|
47
|
+
|
48
|
+
</sections><annex id="P" inline-header="false" obligation="normative">
|
49
|
+
<title>Annex</title>
|
50
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
51
|
+
<title>Annex A.1</title>
|
52
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
53
|
+
<title>Annex A.1a</title>
|
54
|
+
</clause>
|
55
|
+
</clause>
|
56
|
+
<appendix id="Q2" inline-header="false" obligation="normative">
|
57
|
+
<title>An Appendix</title>
|
58
|
+
</appendix>
|
59
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
60
|
+
<title>Normative References</title>
|
61
|
+
</references>
|
62
|
+
<clause id="S" obligation="informative">
|
63
|
+
<title>Bibliography</title>
|
64
|
+
<references id="T" obligation="informative" normative="false">
|
65
|
+
<title>Bibliography Subsection</title>
|
66
|
+
</references>
|
67
|
+
</clause>
|
68
|
+
</bibliography>
|
69
|
+
</iso-standard>
|
70
|
+
INPUT
|
71
|
+
|
72
|
+
presxml = <<~OUTPUT
|
73
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
74
|
+
<preface>
|
75
|
+
<foreword obligation="informative">
|
76
|
+
<title>Foreword</title>
|
77
|
+
<p id="A">This is a preamble</p>
|
78
|
+
</foreword>
|
79
|
+
<introduction id="B" obligation="informative"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
80
|
+
<title depth="2">0.1<tab/>Introduction Subsection</title>
|
81
|
+
</clause>
|
82
|
+
<p>This is patent boilerplate</p>
|
83
|
+
</introduction></preface><sections>
|
84
|
+
<clause id="D" obligation="normative" type="scope">
|
85
|
+
<title depth="1">1<tab/>Scope</title>
|
86
|
+
<p id="E">Text</p>
|
87
|
+
</clause>
|
88
|
+
|
89
|
+
<clause id="H" obligation="normative"><title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
90
|
+
<title depth="2">3.1<tab/>Normal Terms</title>
|
91
|
+
<term id="J"><name>3.1.1</name>
|
92
|
+
<preferred>Term2</preferred>
|
93
|
+
</term>
|
94
|
+
</terms>
|
95
|
+
<definitions id="K" inline-header='true'><title>3.2</title>
|
96
|
+
<dl>
|
97
|
+
<dt>Symbol</dt>
|
98
|
+
<dd>Definition</dd>
|
99
|
+
</dl>
|
100
|
+
</definitions>
|
101
|
+
</clause>
|
102
|
+
<definitions id="L"><title>4</title>
|
103
|
+
<dl>
|
104
|
+
<dt>Symbol</dt>
|
105
|
+
<dd>Definition</dd>
|
106
|
+
</dl>
|
107
|
+
</definitions>
|
108
|
+
<clause id="M" inline-header="false" obligation="normative"><title depth="1">5<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
109
|
+
<title depth="2">5.1<tab/>Introduction</title>
|
110
|
+
</clause>
|
111
|
+
<clause id="O" inline-header="false" obligation="normative">
|
112
|
+
<title depth="2">5.2<tab/>Clause 4.2</title>
|
113
|
+
</clause></clause>
|
114
|
+
|
115
|
+
</sections><annex id="P" inline-header="false" obligation="normative">
|
116
|
+
<title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
117
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
118
|
+
<title depth="2">A.1<tab/>Annex A.1</title>
|
119
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
120
|
+
<title depth="3">A.1.1<tab/>Annex A.1a</title>
|
121
|
+
</clause>
|
122
|
+
</clause>
|
123
|
+
<appendix id="Q2" inline-header="false" obligation="normative">
|
124
|
+
<title depth="2">Appendix 1<tab/>An Appendix</title>
|
125
|
+
</appendix>
|
126
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
127
|
+
<title depth="1">2<tab/>Normative References</title>
|
128
|
+
</references><clause id="S" obligation="informative">
|
129
|
+
<title depth="1">Bibliography</title>
|
130
|
+
<references id="T" obligation="informative" normative="false">
|
131
|
+
<title depth="2">Bibliography Subsection</title>
|
132
|
+
</references>
|
133
|
+
</clause>
|
134
|
+
</bibliography>
|
135
|
+
</iso-standard>
|
136
|
+
OUTPUT
|
137
|
+
|
138
|
+
html = <<~OUTPUT
|
139
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
|
140
|
+
<head/>
|
141
|
+
<body lang="en">
|
142
|
+
<div class="title-section">
|
143
|
+
<p> </p>
|
144
|
+
</div>
|
145
|
+
<br/>
|
146
|
+
<div class="prefatory-section">
|
147
|
+
<p> </p>
|
148
|
+
</div>
|
149
|
+
<br/>
|
150
|
+
<div class="main-section">
|
151
|
+
<br/>
|
152
|
+
#{IEC_TITLE}
|
153
|
+
<div>
|
154
|
+
<h1 class="ForewordTitle">FOREWORD</h1>
|
155
|
+
<div class="boilerplate_legal"/>
|
156
|
+
<p id="A">This is a preamble</p>
|
157
|
+
</div>
|
158
|
+
<br/>
|
159
|
+
<div class="Section3" id="B">
|
160
|
+
<h1 class="IntroTitle">0 Introduction</h1>
|
161
|
+
<div id="C">
|
162
|
+
<h2>0.1 Introduction Subsection</h2>
|
163
|
+
</div>
|
164
|
+
<p>This is patent boilerplate</p>
|
165
|
+
</div>
|
166
|
+
#{IEC_TITLE1}
|
167
|
+
<div id="D">
|
168
|
+
<h1>1 Scope</h1>
|
169
|
+
<p id="E">Text</p>
|
170
|
+
</div>
|
171
|
+
<div>
|
172
|
+
<h1>2 Normative References</h1>
|
173
|
+
</div>
|
174
|
+
<div id="H"><h1>3 Terms, definitions, symbols and abbreviated terms</h1>
|
175
|
+
<div id="I">
|
176
|
+
<h2>3.1 Normal Terms</h2>
|
177
|
+
<p class="TermNum" id="J">3.1.1</p>
|
178
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
179
|
+
</div><div id="K"><span class='zzMoveToFollowing'>
|
180
|
+
<b>3.2 </b>
|
181
|
+
</span>
|
182
|
+
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
183
|
+
</div></div>
|
184
|
+
<div id="L" class="Symbols">
|
185
|
+
<h1>4</h1>
|
186
|
+
<dl>
|
187
|
+
<dt>
|
188
|
+
<p>Symbol</p>
|
189
|
+
</dt>
|
190
|
+
<dd>Definition</dd>
|
191
|
+
</dl>
|
192
|
+
</div>
|
193
|
+
<div id="M">
|
194
|
+
<h1>5 Clause 4</h1>
|
195
|
+
<div id="N">
|
196
|
+
<h2>5.1 Introduction</h2>
|
197
|
+
</div>
|
198
|
+
<div id="O">
|
199
|
+
<h2>5.2 Clause 4.2</h2>
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
<br/>
|
203
|
+
<div id="P" class="Section3">
|
204
|
+
<h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
|
205
|
+
<div id="Q">
|
206
|
+
<h2>A.1 Annex A.1</h2>
|
207
|
+
<div id="Q1">
|
208
|
+
<h3>A.1.1 Annex A.1a</h3>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
<div id="Q2">
|
212
|
+
<h2>Appendix 1 An Appendix</h2>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</div>
|
216
|
+
<br/>
|
217
|
+
<div>
|
218
|
+
<h1 class="Section3">Bibliography</h1>
|
219
|
+
<div>
|
220
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
</body>
|
225
|
+
</html>
|
226
|
+
OUTPUT
|
227
|
+
|
228
|
+
expect(xmlpp(IsoDoc::BSI::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
229
|
+
expect(xmlpp(IsoDoc::BSI::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
230
|
+
end
|
231
|
+
|
232
|
+
it "processes subclauses with and without titles" do
|
233
|
+
expect(xmlpp(IsoDoc::BSI::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
234
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
235
|
+
<sections>
|
236
|
+
<clause id="D" obligation="normative">
|
237
|
+
<title>Scope</title>
|
238
|
+
<clause id="D1" obligation="normative">
|
239
|
+
<title>Scope 1</title>
|
240
|
+
</clause>
|
241
|
+
<clause id="D2" obligation="normative">
|
242
|
+
</clause>
|
243
|
+
</clause>
|
244
|
+
</sections>
|
245
|
+
</iso-standard>
|
246
|
+
INPUT
|
247
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
248
|
+
<sections>
|
249
|
+
<clause id='D' obligation='normative'>
|
250
|
+
<title depth='1'>
|
251
|
+
1
|
252
|
+
<tab/>
|
253
|
+
Scope
|
254
|
+
</title>
|
255
|
+
<clause id='D1' obligation='normative'>
|
256
|
+
<title depth='2'>
|
257
|
+
1.1
|
258
|
+
<tab/>
|
259
|
+
Scope 1
|
260
|
+
</title>
|
261
|
+
</clause>
|
262
|
+
<clause id='D2' obligation='normative' inline-header='true'>
|
263
|
+
<title>1.2</title>
|
264
|
+
</clause>
|
265
|
+
</clause>
|
266
|
+
</sections>
|
267
|
+
</iso-standard>
|
268
|
+
OUTPUT
|
269
|
+
end
|
270
|
+
|
271
|
+
|
272
|
+
it "processes simple terms & definitions" do
|
273
|
+
expect(xmlpp(IsoDoc::BSI::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
274
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
275
|
+
<sections>
|
276
|
+
<terms id="H" obligation="normative"><title>1<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
277
|
+
<term id="J">
|
278
|
+
<name>1.1</name>
|
279
|
+
<preferred>Term2</preferred>
|
280
|
+
</term>
|
281
|
+
</terms>
|
282
|
+
</sections>
|
283
|
+
</iso-standard>
|
284
|
+
INPUT
|
285
|
+
#{HTML_HDR}
|
286
|
+
<div id="">
|
287
|
+
<h1 class="ForewordTitle">FOREWORD</h1>
|
288
|
+
<div class="boilerplate_legal"/>
|
289
|
+
</div>
|
290
|
+
#{IEC_TITLE1}
|
291
|
+
<div id="H"><h1>1 Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
292
|
+
<p class="TermNum" id="J">1.1</p>
|
293
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
294
|
+
</div>
|
295
|
+
</div>
|
296
|
+
</body>
|
297
|
+
</html>
|
298
|
+
OUTPUT
|
299
|
+
end
|
300
|
+
|
301
|
+
it "processes inline section headers" do
|
302
|
+
expect(xmlpp(IsoDoc::BSI::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
303
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
304
|
+
<sections>
|
305
|
+
<clause id="M" inline-header="false" obligation="normative"><title>1<tab/>Clause 4</title>
|
306
|
+
<clause id="N" inline-header="false" obligation="normative">
|
307
|
+
<title>1.1<tab/>Introduction</title>
|
308
|
+
</clause>
|
309
|
+
<clause id="O" inline-header="true" obligation="normative">
|
310
|
+
<title>1.2<tab/>Clause 4.2</title>
|
311
|
+
</clause></clause>
|
312
|
+
|
313
|
+
</sections>
|
314
|
+
</iso-standard>
|
315
|
+
INPUT
|
316
|
+
#{HTML_HDR}
|
317
|
+
<div id="">
|
318
|
+
<h1 class="ForewordTitle">FOREWORD</h1>
|
319
|
+
<div class="boilerplate_legal"/>
|
320
|
+
</div>
|
321
|
+
#{IEC_TITLE1}
|
322
|
+
<div id="M">
|
323
|
+
<h1>1 Clause 4</h1>
|
324
|
+
<div id="N">
|
325
|
+
<h2>1.1 Introduction</h2>
|
326
|
+
</div>
|
327
|
+
<div id="O">
|
328
|
+
<span class="zzMoveToFollowing"><b>1.2 Clause 4.2 </b></span>
|
329
|
+
</div>
|
330
|
+
</div>
|
331
|
+
</div>
|
332
|
+
</body>
|
333
|
+
</html>
|
334
|
+
OUTPUT
|
335
|
+
end
|
336
|
+
|
337
|
+
it "adds boilerplate to foreword" do
|
338
|
+
expect(xmlpp(IsoDoc::BSI::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
339
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
340
|
+
<bibdata>
|
341
|
+
<ext><doctype>International Standard</doctype></ext>
|
342
|
+
</bibdata>
|
343
|
+
<boilerplate>
|
344
|
+
<legal-statement>
|
345
|
+
<p>Boilerplate</p>
|
346
|
+
</legal-statement>
|
347
|
+
</boilerplate>
|
348
|
+
<sections/>
|
349
|
+
</iso-standard>
|
350
|
+
INPUT
|
351
|
+
#{HTML_HDR}
|
352
|
+
<div id="">
|
353
|
+
<h1 class="ForewordTitle">FOREWORD</h1>
|
354
|
+
<div class="boilerplate_legal">
|
355
|
+
<p>Boilerplate</p>
|
356
|
+
</div>
|
357
|
+
</div>
|
358
|
+
#{IEC_TITLE1}
|
359
|
+
</div>
|
360
|
+
</body>
|
361
|
+
</html>
|
362
|
+
OUTPUT
|
363
|
+
end
|
364
|
+
|
365
|
+
it "does not add boilerplate to foreword in amendments" do
|
366
|
+
expect(xmlpp(IsoDoc::BSI::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
367
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
368
|
+
<bibdata>
|
369
|
+
<ext><doctype>Amendment</doctype></ext>
|
370
|
+
</bibdata>
|
371
|
+
<boilerplate>
|
372
|
+
<legal-statement>
|
373
|
+
<p>Boilerplate</p>
|
374
|
+
</legal-statement>
|
375
|
+
</boilerplate>
|
376
|
+
<sections/>
|
377
|
+
</iso-standard>
|
378
|
+
INPUT
|
379
|
+
#{HTML_HDR}
|
380
|
+
<div id="">
|
381
|
+
<h1 class="ForewordTitle">FOREWORD</h1>
|
382
|
+
</div>
|
383
|
+
#{IEC_TITLE1}
|
384
|
+
</div>
|
385
|
+
</body>
|
386
|
+
</html>
|
387
|
+
OUTPUT
|
388
|
+
end
|
389
|
+
|
390
|
+
it "deals with unnumbered normative reference subheadings" do
|
391
|
+
input = <<~INPUT
|
392
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
393
|
+
<sections>
|
394
|
+
<clause id="D" obligation="normative" type="scope">
|
395
|
+
<title>Scope</title>
|
396
|
+
<p id="E">Text</p>
|
397
|
+
</clause>
|
398
|
+
</sections>
|
399
|
+
<bibliography>
|
400
|
+
<clause id="S" obligation="normative">
|
401
|
+
<title>Bibliography</title>
|
402
|
+
<references id="T" obligation="informative" normative="true" unnumbered="true">
|
403
|
+
<title>Bibliography Subsection</title>
|
404
|
+
</references>
|
405
|
+
</clause>
|
406
|
+
</bibliography>
|
407
|
+
</iso-standard>
|
408
|
+
INPUT
|
409
|
+
|
410
|
+
presxml = <<~PRESXML
|
411
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
412
|
+
<sections>
|
413
|
+
<clause id='D' obligation='normative' type='scope'>
|
414
|
+
<title depth='1'>
|
415
|
+
1
|
416
|
+
<tab/>
|
417
|
+
Scope
|
418
|
+
</title>
|
419
|
+
<p id='E'>Text</p>
|
420
|
+
</clause>
|
421
|
+
</sections>
|
422
|
+
<bibliography>
|
423
|
+
<clause id='S' obligation='normative'>
|
424
|
+
<title depth='1'>
|
425
|
+
2
|
426
|
+
<tab/>
|
427
|
+
Bibliography
|
428
|
+
</title>
|
429
|
+
<references id='T' obligation='informative' normative='true' unnumbered='true'>
|
430
|
+
<title depth='2'>Bibliography Subsection</title>
|
431
|
+
</references>
|
432
|
+
</clause>
|
433
|
+
</bibliography>
|
434
|
+
</iso-standard>
|
435
|
+
PRESXML
|
436
|
+
|
437
|
+
html = <<~HTML
|
438
|
+
#{HTML_HDR}
|
439
|
+
<div id=''>
|
440
|
+
<h1 class='ForewordTitle'>FOREWORD</h1>
|
441
|
+
<div class='boilerplate_legal'/>
|
442
|
+
</div>
|
443
|
+
<p class='zzSTDTitle1'>
|
444
|
+
<b/>
|
445
|
+
</p>
|
446
|
+
<p class='zzSTDTitle1'> </p>
|
447
|
+
<div id='D'>
|
448
|
+
<h1> 1   Scope </h1>
|
449
|
+
<p id='E'>Text</p>
|
450
|
+
</div>
|
451
|
+
<div>
|
452
|
+
<h1> 2   Bibliography </h1>
|
453
|
+
<div>
|
454
|
+
<h2 class='Section3'>Bibliography Subsection</h2>
|
455
|
+
</div>
|
456
|
+
</div>
|
457
|
+
</div>
|
458
|
+
</body>
|
459
|
+
</html>
|
460
|
+
HTML
|
461
|
+
|
462
|
+
expect(xmlpp(IsoDoc::BSI::PresentationXMLConvert.new({})
|
463
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
464
|
+
expect(xmlpp(IsoDoc::BSI::HtmlConvert.new({})
|
465
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
466
|
+
end
|
467
|
+
end
|