metanorma-iso 2.2.2 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/html/header-dis.html +111 -29
- data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
- data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
- data/lib/isodoc/iso/html/style-human.css +7 -2
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +7 -2
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/html/wordstyle-dis.css +160 -4
- data/lib/isodoc/iso/html/wordstyle-dis.scss +154 -4
- data/lib/isodoc/iso/html/wordstyle.css +150 -0
- data/lib/isodoc/iso/html/wordstyle.scss +144 -0
- data/lib/isodoc/iso/i18n-en.yaml +4 -4
- data/lib/isodoc/iso/iso.amendment.xsl +1649 -1199
- data/lib/isodoc/iso/iso.international-standard.xsl +1649 -1199
- data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
- data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
- data/lib/isodoc/iso/word_convert.rb +6 -4
- data/lib/isodoc/iso/word_dis_cleanup.rb +30 -8
- data/lib/isodoc/iso/word_dis_convert.rb +5 -2
- data/lib/metanorma/iso/base.rb +2 -1
- data/lib/metanorma/iso/biblio.rng +5 -0
- data/lib/metanorma/iso/isodoc.rng +47 -13
- data/lib/metanorma/iso/validate.rb +2 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +5 -2
- metadata +4 -87
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/.github/workflows/ubuntu.yml +0 -41
- data/Rakefile +0 -8
- data/bin/rspec +0 -17
- data/spec/assets/header.html +0 -7
- data/spec/assets/html.css +0 -2
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -2
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -71
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word.css +0 -2
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -45
- data/spec/examples/iso_123_all_parts.xml +0 -45
- data/spec/examples/iso_123_no_year_note.xml +0 -46
- data/spec/examples/iso_124_.xml +0 -41
- data/spec/examples/iso_216_.xml +0 -47
- data/spec/examples/iso_iec_12382_.xml +0 -48
- data/spec/examples/rice.adoc +0 -714
- data/spec/examples/rice.preview.html +0 -1870
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
- data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
- data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/ISO_1213_1.png +0 -0
- data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
- data/spec/examples/rice_img/rice_image1.png +0 -0
- data/spec/examples/rice_img/rice_image2.png +0 -0
- data/spec/examples/rice_img/rice_image3_1.png +0 -0
- data/spec/examples/rice_img/rice_image3_2.png +0 -0
- data/spec/examples/rice_img/rice_image3_3.png +0 -0
- data/spec/isodoc/amd_spec.rb +0 -986
- data/spec/isodoc/blocks_spec.rb +0 -1174
- data/spec/isodoc/i18n_spec.rb +0 -1579
- data/spec/isodoc/inline_spec.rb +0 -1060
- data/spec/isodoc/iso_spec.rb +0 -255
- data/spec/isodoc/metadata_spec.rb +0 -701
- data/spec/isodoc/postproc_spec.rb +0 -1089
- data/spec/isodoc/ref_spec.rb +0 -439
- data/spec/isodoc/section_spec.rb +0 -998
- data/spec/isodoc/table_spec.rb +0 -420
- data/spec/isodoc/terms_spec.rb +0 -314
- data/spec/isodoc/word_dis_spec.rb +0 -2064
- data/spec/isodoc/xref_spec.rb +0 -1747
- data/spec/metanorma/amd_spec.rb +0 -724
- data/spec/metanorma/base_spec.rb +0 -1384
- data/spec/metanorma/blank_spec.rb +0 -38
- data/spec/metanorma/blocks_spec.rb +0 -624
- data/spec/metanorma/cleanup_spec.rb +0 -1645
- data/spec/metanorma/inline_spec.rb +0 -203
- data/spec/metanorma/lists_spec.rb +0 -197
- data/spec/metanorma/macros_spec.rb +0 -99
- data/spec/metanorma/processor_spec.rb +0 -161
- data/spec/metanorma/refs_spec.rb +0 -672
- data/spec/metanorma/section_spec.rb +0 -492
- data/spec/metanorma/table_spec.rb +0 -329
- data/spec/metanorma/validate_spec.rb +0 -2153
- data/spec/relaton/render_spec.rb +0 -568
- data/spec/requirements/requirement_components_spec.rb +0 -610
- data/spec/requirements/requirements_spec.rb +0 -1596
- data/spec/requirements/xref_spec.rb +0 -1211
- data/spec/spec_helper.rb +0 -313
- data/spec/vcr_cassettes/docrels.yml +0 -385
- data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
data/spec/isodoc/inline_spec.rb
DELETED
@@ -1,1060 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe IsoDoc do
|
4
|
-
it "processes inline formatting" do
|
5
|
-
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
6
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
-
<preface>
|
8
|
-
<foreword>
|
9
|
-
<p>
|
10
|
-
<em>A</em>
|
11
|
-
<strong>B</strong>
|
12
|
-
<sup>C</sup>
|
13
|
-
<sub>D</sub>
|
14
|
-
<tt>E</tt>
|
15
|
-
<strike>F</strike>
|
16
|
-
<smallcap>G</smallcap>
|
17
|
-
<br/>
|
18
|
-
<hr/>
|
19
|
-
<bookmark id="H"/>
|
20
|
-
<pagebreak/>
|
21
|
-
</p>
|
22
|
-
</foreword>
|
23
|
-
</preface>
|
24
|
-
<sections>
|
25
|
-
</iso-standard>
|
26
|
-
INPUT
|
27
|
-
expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
28
|
-
#{HTML_HDR}
|
29
|
-
<br/>
|
30
|
-
<div>
|
31
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
32
|
-
<p>
|
33
|
-
<i>A</i>
|
34
|
-
<b>B</b>
|
35
|
-
<sup>C</sup>
|
36
|
-
<sub>D</sub>
|
37
|
-
<tt>E</tt>
|
38
|
-
<s>F</s>
|
39
|
-
<span style="font-variant:small-caps;">G</span>
|
40
|
-
<br/>
|
41
|
-
<hr/>
|
42
|
-
<a id="H"/>
|
43
|
-
<br/>
|
44
|
-
</p>
|
45
|
-
</div>
|
46
|
-
<p class="zzSTDTitle1"/>
|
47
|
-
</div>
|
48
|
-
</body>
|
49
|
-
</html>
|
50
|
-
OUTPUT
|
51
|
-
end
|
52
|
-
|
53
|
-
it "processes links" do
|
54
|
-
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
55
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
56
|
-
<preface>
|
57
|
-
<foreword>
|
58
|
-
<p>
|
59
|
-
<link target="http://example.com"/>
|
60
|
-
<link target="http://example.com">example</link>
|
61
|
-
<link target="mailto:fred@example.com"/>
|
62
|
-
<link target="mailto:fred@example.com">mailto:fred@example.com</link>
|
63
|
-
</p>
|
64
|
-
</foreword>
|
65
|
-
</preface>
|
66
|
-
<sections>
|
67
|
-
</iso-standard>
|
68
|
-
INPUT
|
69
|
-
expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
70
|
-
#{HTML_HDR}
|
71
|
-
<br/>
|
72
|
-
<div>
|
73
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
74
|
-
<p>
|
75
|
-
<a href="http://example.com">http://example.com</a>
|
76
|
-
<a href="http://example.com">example</a>
|
77
|
-
<a href="mailto:fred@example.com">fred@example.com</a>
|
78
|
-
<a href="mailto:fred@example.com">mailto:fred@example.com</a>
|
79
|
-
</p>
|
80
|
-
</div>
|
81
|
-
<p class="zzSTDTitle1"/>
|
82
|
-
</div>
|
83
|
-
</body>
|
84
|
-
</html>
|
85
|
-
OUTPUT
|
86
|
-
end
|
87
|
-
|
88
|
-
it "processes unrecognised markup" do
|
89
|
-
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
90
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
91
|
-
<preface>
|
92
|
-
<foreword>
|
93
|
-
<p>
|
94
|
-
<barry fred="http://example.com">example</barry>
|
95
|
-
</p>
|
96
|
-
</foreword>
|
97
|
-
</preface>
|
98
|
-
<sections>
|
99
|
-
</iso-standard>
|
100
|
-
INPUT
|
101
|
-
expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
102
|
-
#{HTML_HDR}
|
103
|
-
<br/>
|
104
|
-
<div>
|
105
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
106
|
-
<p>
|
107
|
-
<para>
|
108
|
-
<b role="strong"><barry fred="http://example.com">example</barry></b>
|
109
|
-
</para>
|
110
|
-
</p>
|
111
|
-
</div>
|
112
|
-
<p class="zzSTDTitle1"/>
|
113
|
-
</div>
|
114
|
-
</body>
|
115
|
-
</html>
|
116
|
-
OUTPUT
|
117
|
-
end
|
118
|
-
|
119
|
-
it "processes AsciiMath and MathML" do
|
120
|
-
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
121
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml" xmlns:m="http://www.w3.org/1998/Math/MathML">
|
122
|
-
<preface>
|
123
|
-
<foreword>
|
124
|
-
<p>
|
125
|
-
<stem type="AsciiMath">A</stem>
|
126
|
-
<stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
|
127
|
-
<stem type="None">Latex?</stem>
|
128
|
-
</p>
|
129
|
-
</foreword>
|
130
|
-
</preface>
|
131
|
-
<sections>
|
132
|
-
</iso-standard>
|
133
|
-
INPUT
|
134
|
-
expect(xmlpp(output
|
135
|
-
.sub(/<html/, "<html xmlns:m='m'")))
|
136
|
-
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
137
|
-
#{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
|
138
|
-
<br/>
|
139
|
-
<div>
|
140
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
141
|
-
<p>
|
142
|
-
<span class="stem">(#(A)#)</span>
|
143
|
-
<span class="stem">
|
144
|
-
<m:math>
|
145
|
-
<m:row>X</m:row>
|
146
|
-
</m:math>
|
147
|
-
</span>
|
148
|
-
<span class="stem">Latex?</span>
|
149
|
-
</p>
|
150
|
-
</div>
|
151
|
-
<p class="zzSTDTitle1"/>
|
152
|
-
</div>
|
153
|
-
</body>
|
154
|
-
</html>
|
155
|
-
OUTPUT
|
156
|
-
end
|
157
|
-
|
158
|
-
it "overrides AsciiMath delimiters" do
|
159
|
-
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
160
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
161
|
-
<preface>
|
162
|
-
<foreword>
|
163
|
-
<p><stem type="AsciiMath">A</stem>(#((Hello))#)</p>
|
164
|
-
</foreword>
|
165
|
-
</preface>
|
166
|
-
<sections>
|
167
|
-
</iso-standard>
|
168
|
-
INPUT
|
169
|
-
expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
170
|
-
#{HTML_HDR}
|
171
|
-
<br/>
|
172
|
-
<div>
|
173
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
174
|
-
<p>
|
175
|
-
<span class="stem">(#(((A)#)))</span>
|
176
|
-
(#((Hello))#)
|
177
|
-
</p>
|
178
|
-
</div>
|
179
|
-
<p class="zzSTDTitle1"/>
|
180
|
-
</div>
|
181
|
-
</body>
|
182
|
-
</html>
|
183
|
-
OUTPUT
|
184
|
-
end
|
185
|
-
|
186
|
-
it "processes eref types" do
|
187
|
-
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
188
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
189
|
-
<preface>
|
190
|
-
<foreword>
|
191
|
-
<p>
|
192
|
-
<eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
|
193
|
-
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
|
194
|
-
</p>
|
195
|
-
</foreword>
|
196
|
-
</preface>
|
197
|
-
<bibliography>
|
198
|
-
<references id="_normative_references" normative="true" obligation="informative">
|
199
|
-
<title>1<tab/>
|
200
|
-
Normative references</title>
|
201
|
-
<bibitem id="ISO712" type="standard">
|
202
|
-
<formattedref format="text/plain"><em>Cereals and cereal products</em></formattedref>
|
203
|
-
<docidentifier>ISO 712</docidentifier>
|
204
|
-
<contributor>
|
205
|
-
<role type="publisher"/>
|
206
|
-
<organization>
|
207
|
-
<abbreviation>ISO</abbreviation>
|
208
|
-
</organization>
|
209
|
-
</contributor>
|
210
|
-
</bibitem>
|
211
|
-
</references>
|
212
|
-
</bibliography>
|
213
|
-
</iso-standard>
|
214
|
-
INPUT
|
215
|
-
expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
216
|
-
#{HTML_HDR}
|
217
|
-
<br/>
|
218
|
-
<div>
|
219
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
220
|
-
<p>
|
221
|
-
<sup><a href="#ISO712">A</a></sup>
|
222
|
-
<a href="#ISO712">A</a>
|
223
|
-
</p>
|
224
|
-
</div>
|
225
|
-
<p class="zzSTDTitle1"/>
|
226
|
-
<div>
|
227
|
-
<h1>1  Normative references</h1>
|
228
|
-
<p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
|
229
|
-
</div>
|
230
|
-
</div>
|
231
|
-
</body>
|
232
|
-
</html>
|
233
|
-
OUTPUT
|
234
|
-
end
|
235
|
-
|
236
|
-
it "processes eref content" do
|
237
|
-
output = IsoDoc::Iso::PresentationXMLConvert.new({})
|
238
|
-
.convert("test", <<~"INPUT", true)
|
239
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
240
|
-
<preface>
|
241
|
-
<foreword>
|
242
|
-
<p>
|
243
|
-
<eref bibitemid="IEV" citeas="IEV" type="inline">
|
244
|
-
<locality type="clause">
|
245
|
-
<referenceFrom>1-2-3</referenceFrom>
|
246
|
-
</locality>
|
247
|
-
</eref>
|
248
|
-
<eref bibitemid="ISO712" citeas="ISO 712" type="inline"/>
|
249
|
-
<eref bibitemid="ISO712" type="inline"/>
|
250
|
-
<eref bibitemid="ISO712" type="inline">
|
251
|
-
<locality type="table">
|
252
|
-
<referenceFrom>1</referenceFrom>
|
253
|
-
</locality>
|
254
|
-
</eref>
|
255
|
-
<eref bibitemid="ISO712" type="inline">
|
256
|
-
<locality type="table">
|
257
|
-
<referenceFrom>1</referenceFrom>
|
258
|
-
<referenceTo>1</referenceTo>
|
259
|
-
</locality>
|
260
|
-
</eref>
|
261
|
-
<eref bibitemid="ISO712" type="inline">
|
262
|
-
<locality type="clause">
|
263
|
-
<referenceFrom>1</referenceFrom>
|
264
|
-
</locality>
|
265
|
-
<locality type="table">
|
266
|
-
<referenceFrom>1</referenceFrom>
|
267
|
-
</locality>
|
268
|
-
</eref>
|
269
|
-
<eref bibitemid="ISO712" type="inline">
|
270
|
-
<locality type="clause">
|
271
|
-
<referenceFrom>1</referenceFrom>
|
272
|
-
</locality>
|
273
|
-
<locality type="list">
|
274
|
-
<referenceFrom>a</referenceFrom>
|
275
|
-
</locality>
|
276
|
-
</eref>
|
277
|
-
<eref bibitemid="ISO712" type="inline">
|
278
|
-
<locality type="clause">
|
279
|
-
<referenceFrom>1</referenceFrom>
|
280
|
-
</locality>
|
281
|
-
</eref>
|
282
|
-
<eref bibitemid="ISO712" type="inline">
|
283
|
-
<locality type="clause">
|
284
|
-
<referenceFrom>1.5</referenceFrom>
|
285
|
-
</locality>
|
286
|
-
</eref>
|
287
|
-
<eref bibitemid="ISO712" type="inline">
|
288
|
-
<locality type="table">
|
289
|
-
<referenceFrom>1</referenceFrom>
|
290
|
-
</locality>A</eref>
|
291
|
-
<eref bibitemid="ISO712" type="inline">
|
292
|
-
<locality type="whole"/>
|
293
|
-
</eref>
|
294
|
-
<eref bibitemid="ISO712" type="inline">
|
295
|
-
<locality type="locality:prelude">
|
296
|
-
<referenceFrom>7</referenceFrom>
|
297
|
-
</locality>
|
298
|
-
</eref>
|
299
|
-
<eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
|
300
|
-
<eref bibitemid="ISO712" citeas="ISO/IEC DIR 1" type="inline"/>
|
301
|
-
</p>
|
302
|
-
</foreword>
|
303
|
-
</preface>
|
304
|
-
<bibliography>
|
305
|
-
<references id="_normative_references" normative="true" obligation="informative">
|
306
|
-
<title>Normative References</title>
|
307
|
-
<bibitem id="ISO712" type="standard">
|
308
|
-
<title format="text/plain">Cereals and cereal products</title>
|
309
|
-
<docidentifier>ISO 712</docidentifier>
|
310
|
-
<contributor>
|
311
|
-
<role type="publisher"/>
|
312
|
-
<organization>
|
313
|
-
<abbreviation>ISO</abbreviation>
|
314
|
-
</organization>
|
315
|
-
</contributor>
|
316
|
-
</bibitem>
|
317
|
-
</references>
|
318
|
-
</bibliography>
|
319
|
-
</iso-standard>
|
320
|
-
INPUT
|
321
|
-
expect(xmlpp(output)
|
322
|
-
.sub(%r{<i18nyaml>.*</i18nyaml>}m, ""))
|
323
|
-
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
324
|
-
<?xml version='1.0'?>
|
325
|
-
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
326
|
-
<preface>
|
327
|
-
<foreword displayorder="1">
|
328
|
-
<p>
|
329
|
-
<eref bibitemid="IEV" citeas="IEV" type="inline">
|
330
|
-
<locality type="clause">
|
331
|
-
<referenceFrom>1-2-3</referenceFrom>
|
332
|
-
</locality><span class='stdpublisher'>IEV</span>, <span class="citesec">1-2-3</span></eref>
|
333
|
-
<eref bibitemid="ISO712" citeas="ISO 712" type="inline"><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span></eref>
|
334
|
-
<eref bibitemid="ISO712" type="inline">ISO 712</eref>
|
335
|
-
<eref bibitemid="ISO712" type="inline">
|
336
|
-
<locality type="table">
|
337
|
-
<referenceFrom>1</referenceFrom>
|
338
|
-
</locality>ISO 712, <span class="citetbl">Table 1</span></eref>
|
339
|
-
<eref bibitemid="ISO712" type="inline">
|
340
|
-
<locality type="table">
|
341
|
-
<referenceFrom>1</referenceFrom>
|
342
|
-
<referenceTo>1</referenceTo>
|
343
|
-
</locality>ISO 712, <span class="citetbl">Table 1–1</span></eref>
|
344
|
-
<eref bibitemid="ISO712" type="inline">
|
345
|
-
<locality type="clause">
|
346
|
-
<referenceFrom>1</referenceFrom>
|
347
|
-
</locality>
|
348
|
-
<locality type="table">
|
349
|
-
<referenceFrom>1</referenceFrom>
|
350
|
-
</locality>ISO 712, <span class="citesec">Clause 1</span>, <span class="citetbl">Table 1</span></eref>
|
351
|
-
<eref bibitemid="ISO712" type="inline">
|
352
|
-
<locality type="clause">
|
353
|
-
<referenceFrom>1</referenceFrom>
|
354
|
-
</locality>
|
355
|
-
<locality type="list">
|
356
|
-
<referenceFrom>a</referenceFrom>
|
357
|
-
</locality>ISO 712, <span class="citesec">Clause 1</span> a)</eref>
|
358
|
-
<eref bibitemid="ISO712" type="inline">
|
359
|
-
<locality type="clause">
|
360
|
-
<referenceFrom>1</referenceFrom>
|
361
|
-
</locality>ISO 712, <span class="citesec">Clause 1</span></eref>
|
362
|
-
<eref bibitemid="ISO712" type="inline">
|
363
|
-
<locality type="clause">
|
364
|
-
<referenceFrom>1.5</referenceFrom>
|
365
|
-
</locality>ISO 712, <span class="citesec">1.5</span></eref>
|
366
|
-
<eref bibitemid="ISO712" type="inline">
|
367
|
-
<locality type="table">
|
368
|
-
<referenceFrom>1</referenceFrom>
|
369
|
-
</locality>A</eref>
|
370
|
-
<eref bibitemid="ISO712" type="inline">
|
371
|
-
<locality type="whole"/>ISO 712, Whole of text</eref>
|
372
|
-
<eref bibitemid="ISO712" type="inline">
|
373
|
-
<locality type="locality:prelude">
|
374
|
-
<referenceFrom>7</referenceFrom>
|
375
|
-
</locality>ISO 712, Prelude 7</eref>
|
376
|
-
<eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
|
377
|
-
<eref bibitemid='ISO712' citeas='ISO/IEC DIR 1' type='inline'>
|
378
|
-
<span class='stdpublisher'>ISO/IEC</span>
|
379
|
-
<span class='stddocNumber'>DIR</span>
|
380
|
-
<span class='stddocNumber'>1</span>
|
381
|
-
</eref>
|
382
|
-
</p>
|
383
|
-
</foreword>
|
384
|
-
</preface>
|
385
|
-
<bibliography>
|
386
|
-
<references id="_normative_references" normative="true" obligation="informative" displayorder="2">
|
387
|
-
<title depth="1">1<tab/>
|
388
|
-
Normative References</title>
|
389
|
-
<bibitem id="ISO712" type="standard">
|
390
|
-
<formattedref><em><span class='stddocTitle'>Cereals and cereal products</span></em></formattedref>
|
391
|
-
<docidentifier>ISO 712</docidentifier>
|
392
|
-
</bibitem>
|
393
|
-
</references>
|
394
|
-
</bibliography>
|
395
|
-
</iso-standard>
|
396
|
-
OUTPUT
|
397
|
-
end
|
398
|
-
|
399
|
-
it "processes concept markup" do
|
400
|
-
input = <<~INPUT
|
401
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
402
|
-
<sections>
|
403
|
-
<terms id="Terms">
|
404
|
-
<term id="B"><preferred><expression><name>B</name></expression></preferred>
|
405
|
-
<p>
|
406
|
-
<ul>
|
407
|
-
<li><concept><refterm>term0</refterm>
|
408
|
-
<xref target='clause1'/>
|
409
|
-
</concept></li>
|
410
|
-
<li><concept><refterm>term1</refterm>
|
411
|
-
<renderterm>term</renderterm>
|
412
|
-
<xref target='clause1'/>
|
413
|
-
</concept></li>
|
414
|
-
<li><concept><refterm>term2</refterm>
|
415
|
-
<renderterm>w[o]rd</renderterm>
|
416
|
-
<xref target='clause1'>Clause #1</xref>
|
417
|
-
</concept></li>
|
418
|
-
<li><concept><refterm>term3</refterm>
|
419
|
-
<renderterm>term</renderterm>
|
420
|
-
<eref bibitemid="ISO712" type="inline" citeas="ISO 712"/>
|
421
|
-
</concept></li>
|
422
|
-
<li><concept><refterm>term4</refterm>
|
423
|
-
<renderterm>word</renderterm>
|
424
|
-
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">The Aforementioned Citation</eref>
|
425
|
-
</concept></li>
|
426
|
-
<li><concept><refterm>term5</refterm>
|
427
|
-
<renderterm>word</renderterm>
|
428
|
-
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
429
|
-
<locality type='clause'>
|
430
|
-
<referenceFrom>3.1</referenceFrom>
|
431
|
-
</locality>
|
432
|
-
<locality type='figure'>
|
433
|
-
<referenceFrom>a</referenceFrom>
|
434
|
-
</locality>
|
435
|
-
</eref>
|
436
|
-
</concept></li>
|
437
|
-
<li><concept><refterm>term6</refterm>
|
438
|
-
<renderterm>word</renderterm>
|
439
|
-
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
440
|
-
<localityStack connective="and">
|
441
|
-
<locality type='clause'>
|
442
|
-
<referenceFrom>3.1</referenceFrom>
|
443
|
-
</locality>
|
444
|
-
</localityStack>
|
445
|
-
<localityStack connective="and">
|
446
|
-
<locality type='figure'>
|
447
|
-
<referenceFrom>b</referenceFrom>
|
448
|
-
</locality>
|
449
|
-
</localityStack>
|
450
|
-
</eref>
|
451
|
-
</concept></li>
|
452
|
-
<li><concept><refterm>term7</refterm>
|
453
|
-
<renderterm>word</renderterm>
|
454
|
-
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
455
|
-
<localityStack connective="and">
|
456
|
-
<locality type='clause'>
|
457
|
-
<referenceFrom>3.1</referenceFrom>
|
458
|
-
</locality>
|
459
|
-
</localityStack>
|
460
|
-
<localityStack connective="and">
|
461
|
-
<locality type='figure'>
|
462
|
-
<referenceFrom>b</referenceFrom>
|
463
|
-
</locality>
|
464
|
-
</localityStack>
|
465
|
-
The Aforementioned Citation
|
466
|
-
</eref>
|
467
|
-
</concept></li>
|
468
|
-
<li><concept><refterm>term8</refterm>
|
469
|
-
<renderterm>word</renderterm>
|
470
|
-
<termref base='IEV' target='135-13-13'/>
|
471
|
-
</concept></li>
|
472
|
-
<li><concept><refterm>term9</refterm>
|
473
|
-
<renderterm>word</renderterm>
|
474
|
-
<termref base='IEV' target='135-13-13'>The IEV database</termref>
|
475
|
-
</concept></li>
|
476
|
-
<li><concept><refterm>term10</refterm>
|
477
|
-
<renderterm>word</renderterm>
|
478
|
-
<strong>error!</strong>
|
479
|
-
</concept></li>
|
480
|
-
</ul>
|
481
|
-
</p>
|
482
|
-
</term>
|
483
|
-
</terms>
|
484
|
-
<clause id="clause1"><title>Clause 1</title></clause>
|
485
|
-
</sections>
|
486
|
-
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
487
|
-
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
488
|
-
<bibitem id="ISO712" type="standard">
|
489
|
-
<title format="text/plain">Cereals or cereal products</title>
|
490
|
-
<title type="main" format="text/plain">Cereals and cereal products</title>
|
491
|
-
<docidentifier type="ISO">ISO 712</docidentifier>
|
492
|
-
<contributor>
|
493
|
-
<role type="publisher"/>
|
494
|
-
<organization>
|
495
|
-
<name>International Organization for Standardization</name>
|
496
|
-
</organization>
|
497
|
-
</contributor>
|
498
|
-
</bibitem>
|
499
|
-
</references></bibliography>
|
500
|
-
</iso-standard>
|
501
|
-
INPUT
|
502
|
-
presxml = <<~OUTPUT
|
503
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
504
|
-
<sections>
|
505
|
-
<terms id="Terms" displayorder="2"><title>2</title>
|
506
|
-
<term id='B'>
|
507
|
-
<name>2.1</name>
|
508
|
-
<preferred><strong>B</strong></preferred>
|
509
|
-
<p>
|
510
|
-
<ul>
|
511
|
-
<li>
|
512
|
-
(<xref target="clause1"><span class='citesec'>Clause 3</span></xref>)
|
513
|
-
</li>
|
514
|
-
<li>
|
515
|
-
<em>term</em>
|
516
|
-
(<xref target="clause1"><span class='citesec'>Clause 3</span></xref>)
|
517
|
-
</li>
|
518
|
-
<li>
|
519
|
-
<em>w[o]rd</em>
|
520
|
-
(<xref target="clause1">Clause #1</xref>)
|
521
|
-
</li>
|
522
|
-
<li>
|
523
|
-
<em>term</em>
|
524
|
-
(<eref bibitemid="ISO712" type="inline" citeas="ISO 712"><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span></eref>)
|
525
|
-
</li>
|
526
|
-
<li>
|
527
|
-
<em>word</em>
|
528
|
-
(<eref bibitemid="ISO712" type="inline" citeas="ISO 712">The Aforementioned Citation</eref>)
|
529
|
-
</li>
|
530
|
-
<li>
|
531
|
-
<em>word</em>
|
532
|
-
(<eref bibitemid="ISO712" type="inline" citeas="ISO 712"><locality type="clause">
|
533
|
-
<referenceFrom>3.1</referenceFrom>
|
534
|
-
</locality><locality type="figure">
|
535
|
-
<referenceFrom>a</referenceFrom>
|
536
|
-
</locality><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span>, <span class="citesec">3.1</span>, <span class="citefig">Figure a</span></eref>)
|
537
|
-
</li>
|
538
|
-
<li>
|
539
|
-
<em>word</em>
|
540
|
-
(<eref bibitemid="ISO712" type="inline" citeas="ISO 712"><localityStack connective="and">
|
541
|
-
<locality type="clause">
|
542
|
-
<referenceFrom>3.1</referenceFrom>
|
543
|
-
</locality>
|
544
|
-
</localityStack><localityStack connective="and">
|
545
|
-
<locality type="figure">
|
546
|
-
<referenceFrom>b</referenceFrom>
|
547
|
-
</locality>
|
548
|
-
</localityStack><span class='stdpublisher'>ISO</span> <span class='stddocNumber'>712</span>, <span class="citesec">3.1</span> and <span class="citefig">Figure b</span></eref>)
|
549
|
-
</li>
|
550
|
-
<li>
|
551
|
-
<em>word</em>
|
552
|
-
(<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
553
|
-
<localityStack connective="and">
|
554
|
-
<locality type="clause">
|
555
|
-
<referenceFrom>3.1</referenceFrom>
|
556
|
-
</locality>
|
557
|
-
</localityStack>
|
558
|
-
<localityStack connective="and">
|
559
|
-
<locality type="figure">
|
560
|
-
<referenceFrom>b</referenceFrom>
|
561
|
-
</locality>
|
562
|
-
</localityStack>
|
563
|
-
The Aforementioned Citation
|
564
|
-
</eref>)
|
565
|
-
</li>
|
566
|
-
<li>
|
567
|
-
<em>word</em>
|
568
|
-
[term defined in <termref base="IEV" target="135-13-13"/>]
|
569
|
-
</li>
|
570
|
-
<li>
|
571
|
-
<em>word</em>
|
572
|
-
[term defined in <termref base="IEV" target="135-13-13">The IEV database</termref>]
|
573
|
-
</li>
|
574
|
-
<li>
|
575
|
-
<em>word</em>
|
576
|
-
<strong>error!</strong>
|
577
|
-
</li>
|
578
|
-
</ul>
|
579
|
-
</p>
|
580
|
-
</term>
|
581
|
-
</terms>
|
582
|
-
<clause id="clause1" displayorder="3"><title depth="1">3<tab/>Clause 1</title></clause>
|
583
|
-
</sections>
|
584
|
-
<bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder="1"><title depth="1">1<tab/>Normative References</title>
|
585
|
-
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
586
|
-
<bibitem id="ISO712" type="standard">
|
587
|
-
<formattedref><em><span class='stddocTitle'>Cereals and cereal products</span></em></formattedref>
|
588
|
-
<docidentifier type="ISO">ISO 712</docidentifier>
|
589
|
-
</bibitem>
|
590
|
-
</references></bibliography>
|
591
|
-
</iso-standard>
|
592
|
-
OUTPUT
|
593
|
-
output = <<~OUTPUT
|
594
|
-
#{HTML_HDR}
|
595
|
-
<p class='zzSTDTitle1'/>
|
596
|
-
<div>
|
597
|
-
<h1>1  Normative References</h1>
|
598
|
-
<p>
|
599
|
-
The following documents are referred to in the text in such a way that
|
600
|
-
some or all of their content constitutes requirements of this
|
601
|
-
document. For dated references, only the edition cited applies. For
|
602
|
-
undated references, the latest edition of the referenced document
|
603
|
-
(including any amendments) applies.
|
604
|
-
</p>
|
605
|
-
<p id='ISO712' class='NormRef'>
|
606
|
-
ISO 712,
|
607
|
-
<i>Cereals and cereal products</i>
|
608
|
-
</p>
|
609
|
-
</div>
|
610
|
-
<div id='Terms'>
|
611
|
-
<h1>2</h1>
|
612
|
-
<p class='TermNum' id='B'>2.1</p>
|
613
|
-
<p class='Terms' style='text-align:left;'><b>B</b></p>
|
614
|
-
<p>
|
615
|
-
<ul>
|
616
|
-
<li>
|
617
|
-
(
|
618
|
-
<a href='#clause1'>Clause 3</a>
|
619
|
-
)
|
620
|
-
</li>
|
621
|
-
<li>
|
622
|
-
<i>term</i>
|
623
|
-
(
|
624
|
-
<a href='#clause1'>Clause 3</a>
|
625
|
-
)
|
626
|
-
</li>
|
627
|
-
<li>
|
628
|
-
<i>w[o]rd</i>
|
629
|
-
(
|
630
|
-
<a href='#clause1'>Clause #1</a>
|
631
|
-
)
|
632
|
-
</li>
|
633
|
-
<li>
|
634
|
-
<i>term</i>
|
635
|
-
(
|
636
|
-
<a href='#ISO712'>ISO 712</a>
|
637
|
-
)
|
638
|
-
</li>
|
639
|
-
<li>
|
640
|
-
<i>word</i>
|
641
|
-
(
|
642
|
-
<a href='#ISO712'>The Aforementioned Citation</a>
|
643
|
-
)
|
644
|
-
</li>
|
645
|
-
<li>
|
646
|
-
<i>word</i>
|
647
|
-
(
|
648
|
-
<a href='#ISO712'>ISO 712, 3.1, Figure a</a>
|
649
|
-
)
|
650
|
-
</li>
|
651
|
-
<li>
|
652
|
-
<i>word</i>
|
653
|
-
(
|
654
|
-
<a href='#ISO712'>ISO 712, 3.1 and Figure b</a>
|
655
|
-
)
|
656
|
-
</li>
|
657
|
-
<li>
|
658
|
-
<i>word</i>
|
659
|
-
(
|
660
|
-
<a href='#ISO712'> The Aforementioned Citation </a>
|
661
|
-
)
|
662
|
-
</li>
|
663
|
-
<li>
|
664
|
-
<i>word</i>
|
665
|
-
[term defined in Termbase IEV, term ID 135-13-13]
|
666
|
-
</li>
|
667
|
-
<li>
|
668
|
-
<i>word</i>
|
669
|
-
[term defined in The IEV database]
|
670
|
-
</li>
|
671
|
-
<li>
|
672
|
-
<i>word</i>
|
673
|
-
<b>error!</b>
|
674
|
-
</li>
|
675
|
-
</ul>
|
676
|
-
</p>
|
677
|
-
</div>
|
678
|
-
<div id='clause1'>
|
679
|
-
<h1>3  Clause 1</h1>
|
680
|
-
</div>
|
681
|
-
</div>
|
682
|
-
</body>
|
683
|
-
</html>
|
684
|
-
OUTPUT
|
685
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
686
|
-
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
687
|
-
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
688
|
-
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
689
|
-
end
|
690
|
-
|
691
|
-
it "processes concept markup by context" do
|
692
|
-
input = <<~INPUT
|
693
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
694
|
-
<preface><foreword id="A">
|
695
|
-
<ul>
|
696
|
-
<li><concept><refterm>term1</refterm>
|
697
|
-
<renderterm>term</renderterm>
|
698
|
-
<xref target='clause1'/>
|
699
|
-
</concept></li>
|
700
|
-
</ul>
|
701
|
-
</foreword></preface>
|
702
|
-
<sections>
|
703
|
-
<terms id="Terms">
|
704
|
-
<clause id="A">
|
705
|
-
<ul>
|
706
|
-
<li><concept><refterm>term1</refterm>
|
707
|
-
<renderterm>term</renderterm>
|
708
|
-
<xref target='clause1'/>
|
709
|
-
</concept></li>
|
710
|
-
</ul>
|
711
|
-
</clause>
|
712
|
-
<term id="clause1">
|
713
|
-
<ul>
|
714
|
-
<li><concept><refterm>term1</refterm>
|
715
|
-
<renderterm>term</renderterm>
|
716
|
-
<xref target='clause1'/>
|
717
|
-
</concept></li>
|
718
|
-
<li><concept><refterm>term1</refterm>
|
719
|
-
<renderterm>term</renderterm>
|
720
|
-
<xref target='clause1'/>
|
721
|
-
</concept></li>
|
722
|
-
</ul>
|
723
|
-
</term>
|
724
|
-
<term id="clause2">
|
725
|
-
<ul>
|
726
|
-
<li><concept><refterm>term1</refterm>
|
727
|
-
<renderterm>term</renderterm>
|
728
|
-
<xref target='clause1'/>
|
729
|
-
</concept></li>
|
730
|
-
<li><concept><refterm>term1</refterm>
|
731
|
-
<renderterm>term</renderterm>
|
732
|
-
<xref target='clause1'/>
|
733
|
-
</concept></li>
|
734
|
-
</ul>
|
735
|
-
</term>
|
736
|
-
</terms>
|
737
|
-
</sections>
|
738
|
-
</iso-standard>
|
739
|
-
INPUT
|
740
|
-
presxml = <<~OUTPUT
|
741
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
742
|
-
<preface>
|
743
|
-
<foreword id='A' displayorder='1'>
|
744
|
-
<ul>
|
745
|
-
<li>term</li>
|
746
|
-
</ul>
|
747
|
-
</foreword>
|
748
|
-
</preface>
|
749
|
-
<sections>
|
750
|
-
<terms id='Terms' displayorder='2'>
|
751
|
-
<title>1</title>
|
752
|
-
<clause id='A' inline-header='true'>
|
753
|
-
<title>1.1</title>
|
754
|
-
<ul>
|
755
|
-
<li> term </li>
|
756
|
-
</ul>
|
757
|
-
</clause>
|
758
|
-
<term id='clause1'>
|
759
|
-
<name>1.2</name>
|
760
|
-
<ul>
|
761
|
-
<li>
|
762
|
-
<em>term</em>
|
763
|
-
(
|
764
|
-
<xref target='clause1'><span class='citesec'>1.2</span></xref>
|
765
|
-
)
|
766
|
-
</li>
|
767
|
-
<li> term </li>
|
768
|
-
</ul>
|
769
|
-
</term>
|
770
|
-
<term id='clause2'>
|
771
|
-
<name>1.3</name>
|
772
|
-
<ul>
|
773
|
-
<li>
|
774
|
-
<em>term</em>
|
775
|
-
(
|
776
|
-
<xref target='clause1'><span class='citesec'>1.2</span></xref>
|
777
|
-
)
|
778
|
-
</li>
|
779
|
-
<li> term </li>
|
780
|
-
</ul>
|
781
|
-
</term>
|
782
|
-
</terms>
|
783
|
-
</sections>
|
784
|
-
</iso-standard>
|
785
|
-
OUTPUT
|
786
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
787
|
-
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
788
|
-
end
|
789
|
-
|
790
|
-
it "processes concept attributes" do
|
791
|
-
input = <<~INPUT
|
792
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
793
|
-
<sections>
|
794
|
-
<clause id="clause1"><title>Clause 1</title></clause>
|
795
|
-
<terms id="A">
|
796
|
-
<term id="B"><preferred><expression><name>B</name></expression></preferred<
|
797
|
-
<p>
|
798
|
-
<ul>
|
799
|
-
<li>
|
800
|
-
<concept ital="true"><refterm>term</refterm>
|
801
|
-
<renderterm>term</renderterm>
|
802
|
-
<xref target='clause1'/>
|
803
|
-
</concept></li>
|
804
|
-
<li><concept ref="true"><refterm>term</refterm>
|
805
|
-
<renderterm>term</renderterm>
|
806
|
-
<xref target='clause1'/>
|
807
|
-
</concept></li>
|
808
|
-
<li><concept ital="true" ref="true"><refterm>term</refterm>
|
809
|
-
<renderterm>term</renderterm>
|
810
|
-
<xref target='clause1'/>
|
811
|
-
</concept></li>
|
812
|
-
<li><concept ital="false"><refterm>term</refterm>
|
813
|
-
<renderterm>term</renderterm>
|
814
|
-
<xref target='clause1'/>
|
815
|
-
</concept></li>
|
816
|
-
<li><concept ref="false"><refterm>term</refterm>
|
817
|
-
<renderterm>term</renderterm>
|
818
|
-
<xref target='clause1'/>
|
819
|
-
</concept></li>
|
820
|
-
<li><concept ital="false" ref="false"><refterm>term</refterm>
|
821
|
-
<renderterm>term</renderterm>
|
822
|
-
<xref target='clause1'/>
|
823
|
-
</concept></li>
|
824
|
-
<li><concept ital="true" ref="true" linkmention="true" linkref="true"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept></li>
|
825
|
-
<li><concept ital="true" ref="true" linkmention="true" linkref="false"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept></li>
|
826
|
-
<li><concept ital="true" ref="true" linkmention="false" linkref="true"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept></li>
|
827
|
-
<li><concept ital="true" ref="true" linkmention="false" linkref="false"><refterm>term</refterm><renderterm>term</renderterm><xref target='clause1'/></concept></li>
|
828
|
-
</ul></p>
|
829
|
-
</term>
|
830
|
-
</terms>
|
831
|
-
</sections>
|
832
|
-
</iso-standard>
|
833
|
-
INPUT
|
834
|
-
presxml = <<~OUTPUT
|
835
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
836
|
-
<sections>
|
837
|
-
<clause id="clause1" displayorder="1"><title depth="1">1<tab/>Clause 1</title></clause>
|
838
|
-
<terms id="A" displayorder="2"><title>2</title>
|
839
|
-
<term id='B'>
|
840
|
-
<name>2.1</name>
|
841
|
-
<preferred><strong>B</strong></preferred>
|
842
|
-
<p>
|
843
|
-
<ul>
|
844
|
-
<li>
|
845
|
-
<em>term</em>
|
846
|
-
(<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)
|
847
|
-
</li>
|
848
|
-
<li>
|
849
|
-
term
|
850
|
-
(<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)
|
851
|
-
</li>
|
852
|
-
<li>
|
853
|
-
<em>term</em>
|
854
|
-
(<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)
|
855
|
-
</li>
|
856
|
-
<li>
|
857
|
-
term
|
858
|
-
</li>
|
859
|
-
<li>
|
860
|
-
term
|
861
|
-
</li>
|
862
|
-
<li>
|
863
|
-
term
|
864
|
-
</li>
|
865
|
-
<li><xref target="clause1"><em>term</em></xref> (<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)</li>
|
866
|
-
<li><xref target="clause1"><em>term</em></xref> (<span class='citesec'>Clause 1</span>)</li>
|
867
|
-
<li><em>term</em> (<xref target="clause1"><span class='citesec'>Clause 1</span></xref>)</li>
|
868
|
-
<li><em>term</em> (<span class='citesec'>Clause 1</span>)</li>
|
869
|
-
</ul></p>
|
870
|
-
</term>
|
871
|
-
</terms>
|
872
|
-
</sections>
|
873
|
-
</iso-standard>
|
874
|
-
OUTPUT
|
875
|
-
output = <<~OUTPUT
|
876
|
-
#{HTML_HDR}
|
877
|
-
<p class='zzSTDTitle1'/>
|
878
|
-
<div id='clause1'>
|
879
|
-
<h1>1  Clause 1</h1>
|
880
|
-
</div>
|
881
|
-
<div id='A'>
|
882
|
-
<h1>2</h1>
|
883
|
-
<p class='TermNum' id='B'>2.1</p>
|
884
|
-
<p class='Terms' style='text-align:left;'><b>B</b></p>
|
885
|
-
<p>
|
886
|
-
<ul>
|
887
|
-
<li>
|
888
|
-
<i>term</i>
|
889
|
-
(
|
890
|
-
<a href='#clause1'>Clause 1</a>
|
891
|
-
)
|
892
|
-
</li>
|
893
|
-
<li>
|
894
|
-
term (
|
895
|
-
<a href='#clause1'>Clause 1</a>
|
896
|
-
)
|
897
|
-
</li>
|
898
|
-
<li>
|
899
|
-
<i>term</i>
|
900
|
-
(
|
901
|
-
<a href='#clause1'>Clause 1</a>
|
902
|
-
)
|
903
|
-
</li>
|
904
|
-
<li> term </li>
|
905
|
-
<li> term </li>
|
906
|
-
<li> term </li>
|
907
|
-
<li>
|
908
|
-
<a href='#clause1'>
|
909
|
-
<i>term</i>
|
910
|
-
</a>
|
911
|
-
(
|
912
|
-
<a href='#clause1'>Clause 1</a>
|
913
|
-
)
|
914
|
-
</li>
|
915
|
-
<li>
|
916
|
-
<a href='#clause1'>
|
917
|
-
<i>term</i>
|
918
|
-
</a>
|
919
|
-
(Clause 1)
|
920
|
-
</li>
|
921
|
-
<li>
|
922
|
-
<i>term</i>
|
923
|
-
(
|
924
|
-
<a href='#clause1'>Clause 1</a>
|
925
|
-
)
|
926
|
-
</li>
|
927
|
-
<li>
|
928
|
-
<i>term</i>
|
929
|
-
(Clause 1)
|
930
|
-
</li>
|
931
|
-
</ul>
|
932
|
-
</p>
|
933
|
-
</div>
|
934
|
-
</div>
|
935
|
-
</body>
|
936
|
-
</html>
|
937
|
-
OUTPUT
|
938
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
939
|
-
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
940
|
-
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
941
|
-
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
942
|
-
end
|
943
|
-
|
944
|
-
it "combines locality stacks with connectives, omitting subclauses" do
|
945
|
-
input = <<~INPUT
|
946
|
-
<itu-standard xmlns="https://www.calconnect.org/standards/itu">
|
947
|
-
<p id='_'>
|
948
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ'>
|
949
|
-
<localityStack connective='from'>
|
950
|
-
<locality type='clause'>
|
951
|
-
<referenceFrom>3</referenceFrom>
|
952
|
-
</locality>
|
953
|
-
</localityStack>
|
954
|
-
<localityStack connective='to'>
|
955
|
-
<locality type='clause'>
|
956
|
-
<referenceFrom>5</referenceFrom>
|
957
|
-
</locality>
|
958
|
-
</localityStack>
|
959
|
-
</eref>
|
960
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ'>
|
961
|
-
<localityStack connective='from'>
|
962
|
-
<locality type='clause'>
|
963
|
-
<referenceFrom>3.1</referenceFrom>
|
964
|
-
</locality>
|
965
|
-
</localityStack>
|
966
|
-
<localityStack connective='to'>
|
967
|
-
<locality type='clause'>
|
968
|
-
<referenceFrom>5.1</referenceFrom>
|
969
|
-
</locality>
|
970
|
-
</localityStack>
|
971
|
-
</eref>
|
972
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ'>
|
973
|
-
<localityStack connective='from'>
|
974
|
-
<locality type='clause'>
|
975
|
-
<referenceFrom>3.1</referenceFrom>
|
976
|
-
</locality>
|
977
|
-
</localityStack>
|
978
|
-
<localityStack connective='to'>
|
979
|
-
<locality type='clause'>
|
980
|
-
<referenceFrom>5</referenceFrom>
|
981
|
-
</locality>
|
982
|
-
</localityStack>
|
983
|
-
</eref>
|
984
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ'>
|
985
|
-
<localityStack connective='from'>
|
986
|
-
<locality type='clause'>
|
987
|
-
<referenceFrom>3.1</referenceFrom>
|
988
|
-
</locality>
|
989
|
-
</localityStack>
|
990
|
-
<localityStack connective='to'>
|
991
|
-
<locality type='table'>
|
992
|
-
<referenceFrom>5</referenceFrom>
|
993
|
-
</locality>
|
994
|
-
</localityStack>
|
995
|
-
</eref>
|
996
|
-
</p>
|
997
|
-
</itu-standard>
|
998
|
-
INPUT
|
999
|
-
output = <<~OUTPUT
|
1000
|
-
<itu-standard xmlns='https://www.calconnect.org/standards/itu' type='presentation'>
|
1001
|
-
<p id='_'>
|
1002
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ' droploc=''>
|
1003
|
-
<localityStack connective='from'>
|
1004
|
-
<locality type='clause'>
|
1005
|
-
<referenceFrom>3</referenceFrom>
|
1006
|
-
</locality>
|
1007
|
-
</localityStack>
|
1008
|
-
<localityStack connective='to'>
|
1009
|
-
<locality type='clause'>
|
1010
|
-
<referenceFrom>5</referenceFrom>
|
1011
|
-
</locality>
|
1012
|
-
</localityStack>
|
1013
|
-
<span class='stdpublisher'>XYZ</span>, <span class="citesec">Clause <span class="citesec">3</span> to <span class="citesec">5</span></span>
|
1014
|
-
</eref>
|
1015
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ' droploc=''>
|
1016
|
-
<localityStack connective='from'>
|
1017
|
-
<locality type='clause'>
|
1018
|
-
<referenceFrom>3.1</referenceFrom>
|
1019
|
-
</locality>
|
1020
|
-
</localityStack>
|
1021
|
-
<localityStack connective='to'>
|
1022
|
-
<locality type='clause'>
|
1023
|
-
<referenceFrom>5.1</referenceFrom>
|
1024
|
-
</locality>
|
1025
|
-
</localityStack>
|
1026
|
-
<span class='stdpublisher'>XYZ</span>, <span class="citesec">3.1</span> to <span class="citesec">5.1</span>
|
1027
|
-
</eref>
|
1028
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ'>
|
1029
|
-
<localityStack connective='from'>
|
1030
|
-
<locality type='clause'>
|
1031
|
-
<referenceFrom>3.1</referenceFrom>
|
1032
|
-
</locality>
|
1033
|
-
</localityStack>
|
1034
|
-
<localityStack connective='to'>
|
1035
|
-
<locality type='clause'>
|
1036
|
-
<referenceFrom>5</referenceFrom>
|
1037
|
-
</locality>
|
1038
|
-
</localityStack>
|
1039
|
-
<span class='stdpublisher'>XYZ</span>, <span class="citesec">3.1</span> to <span class="citesec">Clause 5</span>
|
1040
|
-
</eref>
|
1041
|
-
<eref type='inline' bibitemid='ref1' citeas='XYZ'>
|
1042
|
-
<localityStack connective='from'>
|
1043
|
-
<locality type='clause'>
|
1044
|
-
<referenceFrom>3.1</referenceFrom>
|
1045
|
-
</locality>
|
1046
|
-
</localityStack>
|
1047
|
-
<localityStack connective='to'>
|
1048
|
-
<locality type='table'>
|
1049
|
-
<referenceFrom>5</referenceFrom>
|
1050
|
-
</locality>
|
1051
|
-
</localityStack>
|
1052
|
-
<span class='stdpublisher'>XYZ</span>, <span class="citesec">3.1</span> to <span class="citetbl">Table 5</span>
|
1053
|
-
</eref>
|
1054
|
-
</p>
|
1055
|
-
</itu-standard>
|
1056
|
-
OUTPUT
|
1057
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
1058
|
-
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1059
|
-
end
|
1060
|
-
end
|