isodoc 1.6.1 → 1.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +2 -12
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/Rakefile +2 -2
- data/isodoc.gemspec +4 -3
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc.rb +0 -2
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +8 -2
- data/lib/isodoc/function/blocks.rb +15 -4
- data/lib/isodoc/function/cleanup.rb +52 -43
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +8 -7
- data/lib/isodoc/function/references.rb +71 -77
- data/lib/isodoc/function/section.rb +28 -16
- data/lib/isodoc/function/table.rb +22 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/function/to_word_html.rb +19 -25
- data/lib/isodoc/function/utils.rb +181 -163
- data/lib/isodoc/gem_tasks.rb +8 -9
- data/lib/isodoc/headlesshtml_convert.rb +8 -7
- data/lib/isodoc/html_convert.rb +6 -0
- data/lib/isodoc/html_function/comments.rb +14 -12
- data/lib/isodoc/html_function/footnotes.rb +14 -7
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/html.rb +30 -26
- data/lib/isodoc/html_function/postprocess.rb +191 -182
- data/lib/isodoc/html_function/sectionsplit.rb +230 -0
- data/lib/isodoc/i18n.rb +13 -11
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/pdf_convert.rb +11 -13
- data/lib/isodoc/presentation_function/bibdata.rb +54 -30
- data/lib/isodoc/presentation_function/inline.rb +70 -120
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +55 -19
- data/lib/isodoc/presentation_xml_convert.rb +3 -0
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/postprocess.rb +50 -36
- data/lib/isodoc/xref.rb +2 -0
- data/lib/isodoc/xref/xref_counter.rb +1 -2
- data/lib/isodoc/xref/xref_gen.rb +21 -14
- data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
- data/lib/isodoc/xref/xref_sect_gen.rb +15 -15
- data/spec/assets/scripts_override.html +3 -0
- data/spec/isodoc/blocks_spec.rb +624 -997
- data/spec/isodoc/cleanup_spec.rb +40 -42
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +694 -821
- data/spec/isodoc/inline_spec.rb +1105 -921
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +461 -333
- data/spec/isodoc/presentation_xml_spec.rb +355 -278
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +84 -84
- data/spec/isodoc/xref_spec.rb +974 -932
- metadata +32 -7
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -1,95 +1,80 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
</clause>
|
16
|
-
</sections>
|
17
|
-
</iso-standard>
|
18
|
-
INPUT
|
19
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
20
|
-
<sections>
|
21
|
-
<clause id='A'>
|
22
|
-
<title>1.</title>
|
23
|
-
<formula id='B'>
|
24
|
-
<name>1</name>
|
25
|
-
</formula>
|
26
|
-
</clause>
|
27
|
-
<clause id='C'>
|
28
|
-
<title>2.</title>
|
29
|
-
<p>
|
30
|
-
This is
|
31
|
-
<xref target='A'>klaŭzo 1</xref>
|
32
|
-
and
|
33
|
-
<xref target='B'>klaŭzo 1, Formula (1)</xref>
|
34
|
-
. This is
|
35
|
-
<xref target='A' droploc='true'>1</xref>
|
36
|
-
and
|
37
|
-
<xref target='B' droploc='true'>(1)</xref>
|
38
|
-
.
|
39
|
-
</p>
|
40
|
-
</clause>
|
41
|
-
</sections>
|
42
|
-
</iso-standard>
|
43
|
-
OUTPUT
|
44
|
-
end
|
45
|
-
|
46
|
-
it "processes inline formatting (HTML)" do
|
47
|
-
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
48
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
49
|
-
<preface><foreword>
|
50
|
-
<p>
|
51
|
-
<em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
|
52
|
-
<strike>F</strike> <smallcap>G</smallcap> <keyword>I</keyword> <br/> <hr/>
|
53
|
-
<bookmark id="H"/> <pagebreak/> <pagebreak orientation="landscape"/> <underline>J</underline>
|
54
|
-
</p>
|
55
|
-
</foreword></preface>
|
56
|
-
<sections>
|
57
|
-
</iso-standard>
|
4
|
+
it "droplocs xrefs" do
|
5
|
+
input = <<~INPUT
|
6
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
+
<sections>
|
8
|
+
<clause id="A">
|
9
|
+
<formula id="B">
|
10
|
+
</formula>
|
11
|
+
</clause>
|
12
|
+
<clause id="C">
|
13
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
14
|
+
This is <xref target="A" droploc="true"/> and <xref target="B" droploc="true"/>.</p>
|
15
|
+
</clause>
|
16
|
+
</sections>
|
17
|
+
</iso-standard>
|
58
18
|
INPUT
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
19
|
+
output = <<~OUTPUT
|
20
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
21
|
+
<sections>
|
22
|
+
<clause id='A' displayorder="1">
|
23
|
+
<title>1.</title>
|
24
|
+
<formula id='B'>
|
25
|
+
<name>1</name>
|
26
|
+
</formula>
|
27
|
+
</clause>
|
28
|
+
<clause id='C' displayorder="2">
|
29
|
+
<title>2.</title>
|
30
|
+
<p>
|
31
|
+
This is
|
32
|
+
<xref target='A'>klaŭzo 1</xref>
|
33
|
+
and
|
34
|
+
<xref target='B'>klaŭzo 1, Formula (1)</xref>
|
35
|
+
. This is
|
36
|
+
<xref target='A' droploc='true'>1</xref>
|
37
|
+
and
|
38
|
+
<xref target='B' droploc='true'>(1)</xref>
|
39
|
+
.
|
40
|
+
</p>
|
41
|
+
</clause>
|
42
|
+
</sections>
|
43
|
+
</iso-standard>
|
74
44
|
OUTPUT
|
45
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
46
|
+
.new({ i18nyaml: "spec/assets/i18n.yaml" })
|
47
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
75
48
|
end
|
76
49
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
50
|
+
it "processes inline formatting" do
|
51
|
+
input = <<~INPUT
|
52
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
53
|
+
<preface><foreword>
|
54
|
+
<p>
|
55
|
+
<em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
|
56
|
+
<strike>F</strike> <smallcap>G</smallcap> <keyword>I</keyword> <br/> <hr/>
|
57
|
+
<bookmark id="H"/> <pagebreak/> <pagebreak orientation="landscape"/> <underline>J</underline>
|
58
|
+
</p>
|
59
|
+
</foreword></preface>
|
60
|
+
<sections>
|
61
|
+
</iso-standard>
|
88
62
|
INPUT
|
89
|
-
|
90
|
-
|
63
|
+
html = <<~OUTPUT
|
64
|
+
<div>
|
65
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
66
|
+
<p>
|
67
|
+
<i>A</i> <b>B</b> <sup>C</sup> <sub>D</sub> <tt>E</tt>
|
68
|
+
<s>F</s> <span style="font-variant:small-caps;">G</span> <span class="keyword">I</span> <br/> <hr/>
|
69
|
+
<a id="H"/> <br/> <br/>
|
70
|
+
<span style='text-decoration: underline;'>J</span>
|
71
|
+
</p>
|
72
|
+
</div>
|
73
|
+
OUTPUT
|
74
|
+
|
75
|
+
doc = <<~OUTPUT
|
91
76
|
<div>
|
92
|
-
<h1
|
77
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
93
78
|
<p>
|
94
79
|
<i>A</i>
|
95
80
|
<b>B</b>
|
@@ -111,684 +96,861 @@ OUTPUT
|
|
111
96
|
<u>J</u>
|
112
97
|
</p>
|
113
98
|
</div>
|
114
|
-
</div>
|
115
|
-
</body>
|
116
|
-
</html>
|
117
|
-
|
118
99
|
OUTPUT
|
100
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
101
|
+
.convert("test", input, true))
|
102
|
+
.sub(/^.*<h1/m, "<div><h1").sub(%r{</div>.*$}m, "</div>"))
|
103
|
+
.to be_equivalent_to xmlpp(html)
|
104
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
105
|
+
.convert("test", input, true))
|
106
|
+
.sub(/^.*<h1/m, "<div><h1").sub(%r{</div>.*$}m, "</div>"))
|
107
|
+
.to be_equivalent_to xmlpp(doc)
|
119
108
|
end
|
120
109
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
110
|
+
it "ignores index entries" do
|
111
|
+
input = <<~INPUT
|
112
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
113
|
+
<preface><foreword>
|
114
|
+
<p><index primary="A" secondary="B" tertiary="C"/></p>
|
115
|
+
</foreword></preface>
|
116
|
+
<sections/>
|
117
|
+
<indexsect>
|
118
|
+
<title>Index</title>
|
119
|
+
</indexsect>
|
120
|
+
</iso-standard>
|
132
121
|
INPUT
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
</
|
122
|
+
output = <<~OUTPUT
|
123
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
124
|
+
<preface>
|
125
|
+
<foreword displayorder="1">
|
126
|
+
<p/>
|
127
|
+
</foreword>
|
128
|
+
</preface>
|
129
|
+
<sections> </sections>
|
130
|
+
</iso-standard>
|
141
131
|
OUTPUT
|
142
|
-
|
132
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
133
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
134
|
+
end
|
143
135
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
<bibitem id="ISO712" type="standard">
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
</bibitem>
|
226
|
-
</references></bibliography>
|
227
|
-
|
136
|
+
it "processes concept markup" do
|
137
|
+
input = <<~INPUT
|
138
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
139
|
+
<preface><foreword>
|
140
|
+
<p>
|
141
|
+
<ul>
|
142
|
+
<li><concept term='term'>
|
143
|
+
<xref target='clause1'/>
|
144
|
+
</concept></li>
|
145
|
+
<li><concept term='term'>
|
146
|
+
<xref target='clause1'>w[o]rd</xref>
|
147
|
+
</concept></li>
|
148
|
+
<li><concept term='term'>
|
149
|
+
<eref bibitemid="ISO712" type="inline" citeas="ISO 712"/>
|
150
|
+
</concept></li>
|
151
|
+
<li><concept term='term'>
|
152
|
+
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">word</eref>
|
153
|
+
</concept></li>
|
154
|
+
<li><concept>
|
155
|
+
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
156
|
+
<locality type='clause'>
|
157
|
+
<referenceFrom>3.1</referenceFrom>
|
158
|
+
</locality>
|
159
|
+
<locality type='figure'>
|
160
|
+
<referenceFrom>a</referenceFrom>
|
161
|
+
</locality>
|
162
|
+
</eref>
|
163
|
+
</concept></li>
|
164
|
+
<li><concept>
|
165
|
+
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
166
|
+
<localityStack>
|
167
|
+
<locality type='clause'>
|
168
|
+
<referenceFrom>3.1</referenceFrom>
|
169
|
+
</locality>
|
170
|
+
</localityStack>
|
171
|
+
<localityStack>
|
172
|
+
<locality type='figure'>
|
173
|
+
<referenceFrom>b</referenceFrom>
|
174
|
+
</locality>
|
175
|
+
</localityStack>
|
176
|
+
</eref>
|
177
|
+
</concept></li>
|
178
|
+
<li><concept>
|
179
|
+
<eref bibitemid="ISO712" type="inline" citeas="ISO 712">
|
180
|
+
<localityStack>
|
181
|
+
<locality type='clause'>
|
182
|
+
<referenceFrom>3.1</referenceFrom>
|
183
|
+
</locality>
|
184
|
+
</localityStack>
|
185
|
+
<localityStack>
|
186
|
+
<locality type='figure'>
|
187
|
+
<referenceFrom>b</referenceFrom>
|
188
|
+
</locality>
|
189
|
+
</localityStack>
|
190
|
+
<em>word</em>
|
191
|
+
</eref>
|
192
|
+
</concept></li>
|
193
|
+
<li><concept term='term'>
|
194
|
+
<termref base='IEV' target='135-13-13'/>
|
195
|
+
</concept></li>
|
196
|
+
<li><concept term='term'>
|
197
|
+
<termref base='IEV' target='135-13-13'><em>word</em> word</termref>
|
198
|
+
</concept></li>
|
199
|
+
</ul>
|
200
|
+
</p>
|
201
|
+
</foreword></preface>
|
202
|
+
<sections>
|
203
|
+
<clause id="clause1"><title>Clause 1</title></clause>
|
204
|
+
</sections>
|
205
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
206
|
+
<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>
|
207
|
+
<bibitem id="ISO712" type="standard">
|
208
|
+
<title format="text/plain">Cereals or cereal products</title>
|
209
|
+
<title type="main" format="text/plain">Cereals and cereal products</title>
|
210
|
+
<docidentifier type="ISO">ISO 712</docidentifier>
|
211
|
+
<contributor>
|
212
|
+
<role type="publisher"/>
|
213
|
+
<organization>
|
214
|
+
<name>International Organization for Standardization</name>
|
215
|
+
</organization>
|
216
|
+
</contributor>
|
217
|
+
</bibitem>
|
218
|
+
</references></bibliography>
|
219
|
+
</iso-standard>
|
228
220
|
INPUT
|
229
221
|
presxml = <<~OUTPUT
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
222
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
223
|
+
<preface>
|
224
|
+
<foreword displayorder="1">
|
225
|
+
<p>
|
226
|
+
<ul>
|
227
|
+
<li>
|
228
|
+
<em>
|
229
|
+
<xref target='clause1'>Clause 2</xref>
|
230
|
+
</em>
|
231
|
+
</li>
|
232
|
+
<li>
|
233
|
+
<em>
|
234
|
+
<xref target='clause1'>w[o]rd</xref>
|
235
|
+
</em>
|
236
|
+
</li>
|
237
|
+
<li>
|
238
|
+
<em>
|
239
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>ISO 712</eref>
|
240
|
+
</em>
|
241
|
+
</li>
|
242
|
+
<li>
|
243
|
+
<em>
|
244
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>word</eref>
|
245
|
+
</em>
|
246
|
+
</li>
|
247
|
+
<li>
|
248
|
+
<em>
|
249
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
250
|
+
<locality type='clause'>
|
251
|
+
<referenceFrom>3.1</referenceFrom>
|
252
|
+
</locality>
|
253
|
+
<locality type='figure'>
|
254
|
+
<referenceFrom>a</referenceFrom>
|
255
|
+
</locality>
|
256
|
+
ISO 712, Clause 3.1, Figure a
|
257
|
+
</eref>
|
258
|
+
</em>
|
259
|
+
</li>
|
260
|
+
<li>
|
261
|
+
<em>
|
262
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
263
|
+
<localityStack>
|
264
|
+
<locality type='clause'>
|
265
|
+
<referenceFrom>3.1</referenceFrom>
|
266
|
+
</locality>
|
267
|
+
</localityStack>
|
268
|
+
<localityStack>
|
269
|
+
<locality type='figure'>
|
270
|
+
<referenceFrom>b</referenceFrom>
|
271
|
+
</locality>
|
272
|
+
</localityStack>
|
273
|
+
ISO 712, Clause 3.1; Figure b
|
274
|
+
</eref>
|
275
|
+
</em>
|
276
|
+
</li>
|
277
|
+
<li>
|
278
|
+
<em>
|
279
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
280
|
+
<localityStack>
|
281
|
+
<locality type='clause'>
|
282
|
+
<referenceFrom>3.1</referenceFrom>
|
283
|
+
</locality>
|
284
|
+
</localityStack>
|
285
|
+
<localityStack>
|
286
|
+
<locality type='figure'>
|
287
|
+
<referenceFrom>b</referenceFrom>
|
288
|
+
</locality>
|
289
|
+
</localityStack>
|
290
|
+
<em>word</em>
|
291
|
+
</eref>
|
292
|
+
</em>
|
293
|
+
</li>
|
294
|
+
<li>
|
295
|
+
[term defined in
|
296
|
+
<termref base='IEV' target='135-13-13'/>
|
297
|
+
]
|
298
|
+
</li>
|
299
|
+
<li>
|
300
|
+
<em>
|
301
|
+
<termref base='IEV' target='135-13-13'>
|
302
|
+
<em>word</em>
|
303
|
+
word
|
304
|
+
</termref>
|
305
|
+
</em>
|
306
|
+
</li>
|
307
|
+
</ul>
|
308
|
+
</p>
|
309
|
+
</foreword>
|
310
|
+
</preface>
|
311
|
+
<sections>
|
312
|
+
<clause id='clause1' displayorder="3">
|
313
|
+
<title depth='1'>
|
314
|
+
2.
|
315
|
+
<tab/>
|
316
|
+
Clause 1
|
317
|
+
</title>
|
318
|
+
</clause>
|
319
|
+
</sections>
|
320
|
+
<bibliography>
|
321
|
+
<references id='_normative_references' obligation='informative' normative='true' displayorder="2">
|
322
|
+
<title depth='1'>
|
323
|
+
1.
|
324
|
+
<tab/>
|
325
|
+
Normative References
|
326
|
+
</title>
|
327
|
+
<p>
|
328
|
+
The following documents are referred to in the text in such a way that
|
329
|
+
some or all of their content constitutes requirements of this document.
|
330
|
+
For dated references, only the edition cited applies. For undated
|
331
|
+
references, the latest edition of the referenced document (including any
|
332
|
+
amendments) applies.
|
333
|
+
</p>
|
334
|
+
<bibitem id='ISO712' type='standard'>
|
335
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
336
|
+
<title type='main' format='text/plain'>Cereals and cereal products</title>
|
337
|
+
<docidentifier type='ISO'>ISO 712</docidentifier>
|
338
|
+
<contributor>
|
339
|
+
<role type='publisher'/>
|
340
|
+
<organization>
|
341
|
+
<name>International Organization for Standardization</name>
|
342
|
+
</organization>
|
343
|
+
</contributor>
|
344
|
+
</bibitem>
|
345
|
+
</references>
|
346
|
+
</bibliography>
|
347
|
+
</iso-standard>
|
348
|
+
OUTPUT
|
349
|
+
output = <<~OUTPUT
|
350
|
+
#{HTML_HDR}
|
351
|
+
<br/>
|
352
|
+
<div>
|
353
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
354
|
+
<p>
|
355
|
+
<ul>
|
356
|
+
<li>
|
357
|
+
<i>
|
358
|
+
<a href='#clause1'>Clause 2</a>
|
359
|
+
</i>
|
360
|
+
</li>
|
361
|
+
<li>
|
362
|
+
<i>
|
363
|
+
<a href='#clause1'>w[o]rd</a>
|
364
|
+
</i>
|
365
|
+
</li>
|
366
|
+
<li>
|
367
|
+
<i>
|
368
|
+
<a href='#ISO712'>ISO 712</a>
|
369
|
+
</i>
|
370
|
+
</li>
|
371
|
+
<li>
|
372
|
+
<i>
|
373
|
+
<a href='#ISO712'>word</a>
|
374
|
+
</i>
|
375
|
+
</li>
|
376
|
+
<li>
|
377
|
+
<i>
|
378
|
+
<a href='#ISO712'> ISO 712, Clause 3.1, Figure a </a>
|
379
|
+
</i>
|
380
|
+
</li>
|
381
|
+
<li>
|
382
|
+
<i>
|
383
|
+
<a href='#ISO712'> ISO 712, Clause 3.1; Figure b </a>
|
384
|
+
</i>
|
385
|
+
</li>
|
386
|
+
<li>
|
387
|
+
<i>
|
388
|
+
<a href='#ISO712'>
|
389
|
+
<i>word</i>
|
390
|
+
</a>
|
391
|
+
</i>
|
392
|
+
</li>
|
393
|
+
<li> [term defined in Termbase IEV, term ID 135-13-13 ] </li>
|
394
|
+
<li>
|
395
|
+
<i> Termbase IEV, term ID 135-13-13 </i>
|
396
|
+
</li>
|
397
|
+
</ul>
|
398
|
+
</p>
|
399
|
+
</div>
|
400
|
+
<p class='zzSTDTitle1'/>
|
401
|
+
<div>
|
402
|
+
<h1> 1.   Normative References </h1>
|
403
|
+
<p>
|
404
|
+
The following documents are referred to in the text in such a way
|
405
|
+
that some or all of their content constitutes requirements of this
|
406
|
+
document. For dated references, only the edition cited applies. For
|
407
|
+
undated references, the latest edition of the referenced document
|
408
|
+
(including any amendments) applies.
|
409
|
+
</p>
|
410
|
+
<p id='ISO712' class='NormRef'>
|
411
|
+
ISO 712,
|
412
|
+
<i>Cereals and cereal products</i>
|
413
|
+
</p>
|
414
|
+
</div>
|
415
|
+
<div id='clause1'>
|
416
|
+
<h1> 2.   Clause 1 </h1>
|
417
|
+
</div>
|
418
|
+
</div>
|
419
|
+
</body>
|
420
|
+
</html>
|
421
|
+
OUTPUT
|
422
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
423
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
424
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
425
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
426
|
+
end
|
357
427
|
|
358
428
|
it "processes embedded inline formatting" do
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
429
|
+
input = <<~INPUT
|
430
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
431
|
+
<preface><foreword>
|
432
|
+
<p>
|
433
|
+
<em><strong><</strong></em> <tt><link target="B"/></tt> <xref target="_http_1_1">Requirement <tt>/req/core/http</tt></xref> <eref type="inline" bibitemid="ISO712" citeas="ISO 712">Requirement <tt>/req/core/http</tt></eref>
|
434
|
+
</p>
|
435
|
+
</foreword></preface>
|
436
|
+
<sections>
|
437
|
+
</iso-standard>
|
368
438
|
INPUT
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
<
|
373
|
-
|
374
|
-
|
375
|
-
|
439
|
+
output = <<~OUTPUT
|
440
|
+
#{HTML_HDR}
|
441
|
+
<br/>
|
442
|
+
<div>
|
443
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
444
|
+
<p>
|
445
|
+
<i><b><</b></i> <tt><a href="B">B</a></tt> <a href="#_http_1_1">Requirement <tt>/req/core/http</tt></a> <a href="#ISO712">Requirement <tt>/req/core/http</tt></a>
|
446
|
+
</p>
|
447
|
+
</div>
|
448
|
+
<p class="zzSTDTitle1"/>
|
376
449
|
</div>
|
377
|
-
|
378
|
-
|
379
|
-
</body>
|
380
|
-
</html>
|
450
|
+
</body>
|
451
|
+
</html>
|
381
452
|
OUTPUT
|
453
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
454
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
382
455
|
end
|
383
456
|
|
384
457
|
it "processes inline images" do
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
<p>
|
389
|
-
<image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
|
390
|
-
</p>
|
391
|
-
</foreword></preface>
|
392
|
-
</iso-standard>
|
393
|
-
INPUT
|
394
|
-
#{HTML_HDR}
|
395
|
-
<br/>
|
396
|
-
<div>
|
397
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
458
|
+
input = <<~INPUT
|
459
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
460
|
+
<preface><foreword>
|
398
461
|
<p>
|
399
|
-
|
400
|
-
|
401
|
-
</
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
462
|
+
<image src="rice_images/rice_image1.png" height="20" width="30" id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" alt="alttext" title="titletxt"/>
|
463
|
+
</p>
|
464
|
+
</foreword></preface>
|
465
|
+
</iso-standard>
|
466
|
+
INPUT
|
467
|
+
output = <<~OUTPUT
|
468
|
+
#{HTML_HDR}
|
469
|
+
<br/>
|
470
|
+
<div>
|
471
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
472
|
+
<p>
|
473
|
+
<img src='rice_images/rice_image1.png' height='20' width='30' title='titletxt' alt='alttext'/>
|
474
|
+
</p>
|
475
|
+
</div>
|
476
|
+
<p class='zzSTDTitle1'/>
|
477
|
+
</div>
|
478
|
+
</body>
|
479
|
+
</html>
|
480
|
+
OUTPUT
|
481
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
482
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
407
483
|
end
|
408
484
|
|
409
485
|
it "processes links" do
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
486
|
+
input = <<~INPUT
|
487
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
488
|
+
<preface><foreword>
|
489
|
+
<p>
|
490
|
+
<link target="http://example.com"/>
|
491
|
+
<link target="http://example.com">example</link>
|
492
|
+
<link target="http://example.com" alt="tip">example</link>
|
493
|
+
<link target="mailto:fred@example.com"/>
|
494
|
+
<link target="mailto:fred@example.com">mailto:fred@example.com</link>
|
495
|
+
</p>
|
496
|
+
</foreword></preface>
|
497
|
+
<sections>
|
498
|
+
</iso-standard>
|
423
499
|
INPUT
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
<
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
500
|
+
output = <<~OUTPUT
|
501
|
+
#{HTML_HDR}
|
502
|
+
<br/>
|
503
|
+
<div>
|
504
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
505
|
+
<p>
|
506
|
+
<a href="http://example.com">http://example.com</a>
|
507
|
+
<a href="http://example.com">example</a>
|
508
|
+
<a href="http://example.com" title="tip">example</a>
|
509
|
+
<a href="mailto:fred@example.com">fred@example.com</a>
|
510
|
+
<a href="mailto:fred@example.com">mailto:fred@example.com</a>
|
511
|
+
</p>
|
512
|
+
</div>
|
513
|
+
<p class="zzSTDTitle1"/>
|
435
514
|
</div>
|
436
|
-
|
437
|
-
|
438
|
-
</body>
|
439
|
-
</html>
|
515
|
+
</body>
|
516
|
+
</html>
|
440
517
|
OUTPUT
|
518
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
519
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
520
|
+
end
|
521
|
+
|
522
|
+
it "processes updatetype links" do
|
523
|
+
input = <<~INPUT
|
524
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
525
|
+
<preface><foreword>
|
526
|
+
<p>
|
527
|
+
<link updatetype="true" target="http://example.com"/>
|
528
|
+
<link updatetype="true" target="list.adoc">example</link>
|
529
|
+
<link updatetype="true" target="list" alt="tip">example</link>
|
530
|
+
</p>
|
531
|
+
</foreword></preface>
|
532
|
+
<sections>
|
533
|
+
</iso-standard>
|
534
|
+
INPUT
|
535
|
+
html = <<~OUTPUT
|
536
|
+
<div>
|
537
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
538
|
+
<p>
|
539
|
+
<a href="http://example.com">http://example.com</a>
|
540
|
+
<a href='list.adoc'>example</a>
|
541
|
+
<a href='list.html' title='tip'>example</a>
|
542
|
+
</p>
|
543
|
+
</div>
|
544
|
+
OUTPUT
|
545
|
+
doc = <<~OUTPUT
|
546
|
+
<div>
|
547
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
548
|
+
<p>
|
549
|
+
<a href="http://example.com">http://example.com</a>
|
550
|
+
<a href='list.adoc'>example</a>
|
551
|
+
<a href='list.doc' title='tip'>example</a>
|
552
|
+
</p>
|
553
|
+
</div>
|
554
|
+
OUTPUT
|
555
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
556
|
+
.convert("test", input, true))
|
557
|
+
.sub(/^.*<h1/m, "<div><h1").sub(%r{</div>.*$}m, "</div>"))
|
558
|
+
.to be_equivalent_to xmlpp(html)
|
559
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
560
|
+
.convert("test", input, true))
|
561
|
+
.sub(/^.*<h1/m, "<div><h1").sub(%r{</div>.*$}m, "</div>"))
|
562
|
+
.to be_equivalent_to xmlpp(doc)
|
441
563
|
end
|
442
564
|
|
443
565
|
it "processes unrecognised markup" do
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
566
|
+
input = <<~INPUT
|
567
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
568
|
+
<preface><foreword>
|
569
|
+
<p>
|
570
|
+
<barry fred="http://example.com">example</barry>
|
571
|
+
</p>
|
572
|
+
</foreword></preface>
|
573
|
+
<sections>
|
574
|
+
</iso-standard>
|
453
575
|
INPUT
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
<
|
458
|
-
|
459
|
-
|
460
|
-
|
576
|
+
output = <<~OUTPUT
|
577
|
+
#{HTML_HDR}
|
578
|
+
<br/>
|
579
|
+
<div>
|
580
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
581
|
+
<p>
|
582
|
+
<para><b role="strong"><barry fred="http://example.com">example</barry></b></para>
|
583
|
+
</p>
|
584
|
+
</div>
|
585
|
+
<p class="zzSTDTitle1"/>
|
461
586
|
</div>
|
462
|
-
|
463
|
-
|
464
|
-
</body>
|
465
|
-
</html>
|
587
|
+
</body>
|
588
|
+
</html>
|
466
589
|
OUTPUT
|
590
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
591
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
467
592
|
end
|
468
593
|
|
469
594
|
it "processes AsciiMath and MathML" do
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
595
|
+
input = <<~INPUT
|
596
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
597
|
+
<preface><foreword>
|
598
|
+
<p>
|
599
|
+
<stem type="AsciiMath"><A></stem>
|
600
|
+
<stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
|
601
|
+
<stem type="None">Latex?</stem>
|
602
|
+
</p>
|
603
|
+
</foreword></preface>
|
604
|
+
<sections>
|
605
|
+
</iso-standard>
|
481
606
|
INPUT
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
<
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
<m:
|
490
|
-
|
491
|
-
|
492
|
-
|
607
|
+
output = <<~OUTPUT
|
608
|
+
#{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
|
609
|
+
<br/>
|
610
|
+
<div>
|
611
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
612
|
+
<p>
|
613
|
+
<span class="stem">(#(<A>)#)</span>
|
614
|
+
<span class="stem"><m:math>
|
615
|
+
<m:row>X</m:row>
|
616
|
+
</m:math></span>
|
617
|
+
<span class="stem">Latex?</span>
|
618
|
+
</p>
|
619
|
+
</div>
|
620
|
+
<p class="zzSTDTitle1"/>
|
493
621
|
</div>
|
494
|
-
|
495
|
-
|
496
|
-
</body>
|
497
|
-
</html>
|
622
|
+
</body>
|
623
|
+
</html>
|
498
624
|
OUTPUT
|
625
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
626
|
+
.convert("test", input, true).sub(/<html/, "<html xmlns:m='m'")))
|
627
|
+
.to be_equivalent_to xmlpp(output)
|
499
628
|
end
|
500
629
|
|
501
630
|
it "overrides AsciiMath delimiters" do
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
631
|
+
input = <<~INPUT
|
632
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
633
|
+
<preface><foreword>
|
634
|
+
<p>
|
635
|
+
<stem type="AsciiMath">A</stem>
|
636
|
+
(#((Hello))#)
|
637
|
+
</p>
|
638
|
+
</foreword></preface>
|
639
|
+
<sections>
|
640
|
+
</iso-standard>
|
512
641
|
INPUT
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
<
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
642
|
+
output = <<~OUTPUT
|
643
|
+
#{HTML_HDR}
|
644
|
+
<br/>
|
645
|
+
<div>
|
646
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
647
|
+
<p>
|
648
|
+
<span class="stem">(#(((A)#)))</span>
|
649
|
+
(#((Hello))#)
|
650
|
+
</p>
|
651
|
+
</div>
|
652
|
+
<p class="zzSTDTitle1"/>
|
521
653
|
</div>
|
522
|
-
|
523
|
-
|
524
|
-
</body>
|
525
|
-
</html>
|
654
|
+
</body>
|
655
|
+
</html>
|
526
656
|
OUTPUT
|
657
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
658
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
527
659
|
end
|
528
660
|
|
529
661
|
it "processes eref types" do
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
<bibitem id="ISO712" type="standard">
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
</bibitem>
|
549
|
-
|
550
|
-
|
551
|
-
|
662
|
+
input = <<~INPUT
|
663
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
664
|
+
<preface><foreword>
|
665
|
+
<p>
|
666
|
+
<eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
|
667
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
|
668
|
+
</p>
|
669
|
+
</foreword></preface>
|
670
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
671
|
+
<bibitem id="ISO712" type="standard">
|
672
|
+
<title format="text/plain">Cereals and cereal products</title>
|
673
|
+
<docidentifier>ISO 712</docidentifier>
|
674
|
+
<contributor>
|
675
|
+
<role type="publisher"/>
|
676
|
+
<organization>
|
677
|
+
<abbreviation>ISO</abbreviation>
|
678
|
+
</organization>
|
679
|
+
</contributor>
|
680
|
+
</bibitem>
|
681
|
+
</references>
|
682
|
+
</bibliography>
|
683
|
+
</iso-standard>
|
552
684
|
INPUT
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
<
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
<
|
565
|
-
|
685
|
+
output = <<~OUTPUT
|
686
|
+
#{HTML_HDR}
|
687
|
+
<br/>
|
688
|
+
<div>
|
689
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
690
|
+
<p>
|
691
|
+
<sup><a href="#ISO712">A</a></sup>
|
692
|
+
<a href="#ISO712">A</a>
|
693
|
+
</p>
|
694
|
+
</div>
|
695
|
+
<p class="zzSTDTitle1"/>
|
696
|
+
<div>
|
697
|
+
<h1>Normative References</h1>
|
698
|
+
<p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
|
699
|
+
</div>
|
566
700
|
</div>
|
567
|
-
</
|
568
|
-
|
569
|
-
</html>
|
701
|
+
</body>
|
702
|
+
</html>
|
570
703
|
OUTPUT
|
704
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
705
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
571
706
|
end
|
572
707
|
|
573
708
|
it "processes eref content" do
|
574
709
|
input = <<~INPUT
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
<bibitem id="ISO712" type="standard">
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
</bibitem>
|
608
|
-
|
609
|
-
|
610
|
-
|
710
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
711
|
+
<preface><foreword>
|
712
|
+
<p>
|
713
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
|
714
|
+
<eref type="inline" bibitemid="ISO712"/>
|
715
|
+
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
716
|
+
<eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
717
|
+
<eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
718
|
+
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
|
719
|
+
<eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
720
|
+
<eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
721
|
+
<eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
|
722
|
+
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
723
|
+
<eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
|
724
|
+
<eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
725
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
|
726
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality></eref>
|
727
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
728
|
+
<eref type="inline" droploc="true" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
729
|
+
<eref type="inline" case="lowercase" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
730
|
+
</p>
|
731
|
+
</foreword></preface>
|
732
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
733
|
+
<bibitem id="ISO712" type="standard">
|
734
|
+
<title format="text/plain">Cereals and cereal products</title>
|
735
|
+
<docidentifier>ISO 712</docidentifier>
|
736
|
+
<contributor>
|
737
|
+
<role type="publisher"/>
|
738
|
+
<organization>
|
739
|
+
<abbreviation>ISO</abbreviation>
|
740
|
+
</organization>
|
741
|
+
</contributor>
|
742
|
+
</bibitem>
|
743
|
+
</references>
|
744
|
+
</bibliography>
|
745
|
+
</iso-standard>
|
611
746
|
INPUT
|
612
747
|
presxml = <<~OUTPUT
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
748
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
749
|
+
<preface><foreword displayorder="1">
|
750
|
+
<p>
|
751
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">ISO 712</eref>
|
752
|
+
<eref type="inline" bibitemid="ISO712">ISO 712</eref>
|
753
|
+
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>ISO 712, Table 1</eref>
|
754
|
+
<eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack>ISO 712, Table 1</eref>
|
755
|
+
<eref type="inline" bibitemid="ISO712"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack>ISO 712, Table 1; Clause 1</eref>
|
756
|
+
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, Table 1–1</eref>
|
757
|
+
<eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1, Table 1</eref>
|
758
|
+
<eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
|
759
|
+
<eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality>ISO 712, Clause 1.5</eref>
|
760
|
+
<eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
761
|
+
<eref type="inline" bibitemid="ISO712"><locality type="whole"/>ISO 712, Whole of text</eref>
|
762
|
+
<eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality>ISO 712, Prelude 7</eref>
|
763
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
|
764
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality>ISO 712</eref>
|
765
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, Clause 1</eref>
|
766
|
+
<eref type="inline" droploc="true" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, 1</eref>
|
767
|
+
<eref type="inline" case="lowercase" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality>ISO 712, clause 1</eref>
|
768
|
+
</p>
|
769
|
+
</foreword></preface>
|
770
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true" displayorder=
|
771
|
+
"2"><title depth='1'>1.<tab/>Normative References</title>
|
772
|
+
<bibitem id="ISO712" type="standard">
|
773
|
+
<title format="text/plain">Cereals and cereal products</title>
|
774
|
+
<docidentifier>ISO 712</docidentifier>
|
775
|
+
<contributor>
|
776
|
+
<role type="publisher"/>
|
777
|
+
<organization>
|
778
|
+
<abbreviation>ISO</abbreviation>
|
779
|
+
</organization>
|
780
|
+
</contributor>
|
781
|
+
</bibitem>
|
782
|
+
</references>
|
783
|
+
</bibliography>
|
784
|
+
</iso-standard>
|
785
|
+
OUTPUT
|
650
786
|
|
651
|
-
html = <<~OUTPUT
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
<a href='#ISO712'>ISO 712, Table 1; Clause 1</a>
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
787
|
+
html = <<~OUTPUT
|
788
|
+
#{HTML_HDR}
|
789
|
+
<br/>
|
790
|
+
<div>
|
791
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
792
|
+
<p>
|
793
|
+
<a href="#ISO712">ISO 712</a>
|
794
|
+
<a href="#ISO712">ISO 712</a>
|
795
|
+
<a href="#ISO712">ISO 712, Table 1</a>
|
796
|
+
<a href='#ISO712'>ISO 712, Table 1</a>
|
797
|
+
<a href='#ISO712'>ISO 712, Table 1; Clause 1</a>
|
798
|
+
<a href="#ISO712">ISO 712, Table 1–1</a>
|
799
|
+
<a href="#ISO712">ISO 712, Clause 1, Table 1</a>
|
800
|
+
<a href="#ISO712">ISO 712, Clause 1</a>
|
801
|
+
<a href="#ISO712">ISO 712, Clause 1.5</a>
|
802
|
+
<a href="#ISO712">A</a>
|
803
|
+
<a href="#ISO712">ISO 712, Whole of text</a>
|
804
|
+
<a href="#ISO712">ISO 712, Prelude 7</a>
|
805
|
+
<a href="#ISO712">A</a>
|
806
|
+
<a href='#ISO712'>ISO 712</a>
|
807
|
+
<a href='#ISO712'>ISO 712, Clause 1</a>
|
808
|
+
<a href='#ISO712'>ISO 712, 1</a>
|
809
|
+
<a href='#ISO712'>ISO 712, clause 1</a>
|
810
|
+
</p>
|
811
|
+
</div>
|
812
|
+
<p class="zzSTDTitle1"/>
|
813
|
+
<div>
|
814
|
+
<h1>1.  Normative References</h1>
|
815
|
+
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
|
816
|
+
</div>
|
817
|
+
</div>
|
818
|
+
</body>
|
819
|
+
</html>
|
684
820
|
OUTPUT
|
685
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
686
|
-
|
821
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
822
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
823
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
824
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
687
825
|
end
|
688
826
|
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
<
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
</
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
</
|
734
|
-
|
735
|
-
|
736
|
-
|
827
|
+
it "processes eref content pointing to reference with citation URL" do
|
828
|
+
input = <<~INPUT
|
829
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
830
|
+
<preface><foreword>
|
831
|
+
<p>
|
832
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
|
833
|
+
<eref type="inline" bibitemid="ISO712"/>
|
834
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
835
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
836
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
837
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
|
838
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
839
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
840
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
|
841
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
842
|
+
<eref type="inline" bibitemid="ISO713"><locality type="whole"></locality></eref>
|
843
|
+
<eref type="inline" bibitemid="ISO713"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
844
|
+
<eref type="inline" bibitemid="ISO713" citeas="ISO 713">A</eref>
|
845
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality></eref>
|
846
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
847
|
+
<eref type="inline" bibitemid="ISO714"/>
|
848
|
+
</p>
|
849
|
+
</foreword></preface>
|
850
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
851
|
+
<bibitem id="ISO712" type="standard">
|
852
|
+
<title format="text/plain">Cereals and cereal products</title>
|
853
|
+
<uri type="citation">http://www.example.com</uri>
|
854
|
+
<docidentifier>ISO 712</docidentifier>
|
855
|
+
<contributor>
|
856
|
+
<role type="publisher"/>
|
857
|
+
<organization>
|
858
|
+
<abbreviation>ISO</abbreviation>
|
859
|
+
</organization>
|
860
|
+
</contributor>
|
861
|
+
</bibitem>
|
862
|
+
<bibitem id="ISO713" type="standard">
|
863
|
+
<title format="text/plain">Cereals and cereal products</title>
|
864
|
+
<uri type="citation">spec/assets/iso713</uri>
|
865
|
+
<docidentifier>ISO 713</docidentifier>
|
866
|
+
<contributor>
|
867
|
+
<role type="publisher"/>
|
868
|
+
<organization>
|
869
|
+
<abbreviation>ISO</abbreviation>
|
870
|
+
</organization>
|
871
|
+
</contributor>
|
872
|
+
</bibitem>
|
873
|
+
<bibitem id="ISO714" type="standard">
|
874
|
+
<title format="text/plain">Cereals and cereal products</title>
|
875
|
+
<uri type="citation">spec/assets/iso714.svg</uri>
|
876
|
+
<docidentifier>ISO 714</docidentifier>
|
877
|
+
<contributor>
|
878
|
+
<role type="publisher"/>
|
879
|
+
<organization>
|
880
|
+
<abbreviation>ISO</abbreviation>
|
881
|
+
</organization>
|
882
|
+
</contributor>
|
883
|
+
</bibitem>
|
884
|
+
</references>
|
885
|
+
</bibliography>
|
886
|
+
</iso-standard>
|
737
887
|
INPUT
|
738
888
|
presxml = <<~OUTPUT
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
889
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
890
|
+
<preface>
|
891
|
+
<foreword displayorder="1">
|
892
|
+
<p>
|
893
|
+
<eref type='inline' bibitemid='ISO712' citeas='ISO 712'>ISO 712</eref>
|
894
|
+
<eref type='inline' bibitemid='ISO712'>ISO 712</eref>
|
895
|
+
<eref type='inline' bibitemid='ISO713'><locality type='table'>
|
896
|
+
<referenceFrom>1</referenceFrom>
|
897
|
+
</locality>ISO 713, Table 1</eref>
|
898
|
+
<eref type='inline' bibitemid='ISO713'><localityStack><locality type='table'><referenceFrom>1</referenceFrom></locality></localityStack>ISO 713, Table 1</eref>
|
899
|
+
<eref type='inline' bibitemid='ISO713'><localityStack><locality type='table'><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type='clause'><referenceFrom>1</referenceFrom></locality></localityStack>ISO 713, Table 1; Clause 1</eref>
|
900
|
+
<eref type='inline' bibitemid='ISO713'><locality type='table'>
|
901
|
+
<referenceFrom>1</referenceFrom>
|
902
|
+
<referenceTo>1</referenceTo>
|
903
|
+
</locality>ISO 713, Table 1–1</eref>
|
904
|
+
<eref type='inline' bibitemid='ISO713'><locality type='clause'><referenceFrom>1</referenceFrom></locality><locality type='table'><referenceFrom>1</referenceFrom></locality>ISO 713, Clause 1, Table 1</eref>
|
905
|
+
<eref type='inline' bibitemid='ISO713'><locality type='clause'>
|
906
|
+
<referenceFrom>1</referenceFrom>
|
907
|
+
</locality>ISO 713, Clause 1</eref>
|
908
|
+
<eref type='inline' bibitemid='ISO713'><locality type='clause'>
|
909
|
+
<referenceFrom>1.5</referenceFrom>
|
910
|
+
</locality>ISO 713, Clause 1.5</eref>
|
911
|
+
<eref type='inline' bibitemid='ISO713'><locality type='table'>
|
912
|
+
<referenceFrom>1</referenceFrom>
|
913
|
+
</locality>A</eref>
|
914
|
+
<eref type='inline' bibitemid='ISO713'><locality type='whole'/>ISO 713, Whole of text</eref>
|
915
|
+
<eref type='inline' bibitemid='ISO713'><locality type='locality:prelude'>
|
916
|
+
<referenceFrom>7</referenceFrom>
|
917
|
+
</locality>ISO 713, Prelude 7</eref>
|
918
|
+
<eref type='inline' bibitemid='ISO713' citeas='ISO 713'>A</eref>
|
919
|
+
<eref type='inline' bibitemid='ISO713'><locality type='anchor'><referenceFrom>xyz</referenceFrom></locality>ISO 713</eref>
|
920
|
+
<eref type='inline' bibitemid='ISO713'><locality type='anchor'><referenceFrom>xyz</referenceFrom></locality><locality type='clause'><referenceFrom>1</referenceFrom></locality>ISO 713, Clause 1</eref>
|
921
|
+
<eref type='inline' bibitemid='ISO714'>ISO 714</eref>
|
922
|
+
</p>
|
923
|
+
</foreword>
|
924
|
+
</preface>
|
925
|
+
<bibliography>
|
926
|
+
<references id='_normative_references' obligation='informative' normative='true' displayorder="2">
|
927
|
+
<title depth='1'>1.<tab/>Normative References</title>
|
928
|
+
<bibitem id='ISO712' type='standard'>
|
929
|
+
<title format='text/plain'>Cereals and cereal products</title>
|
930
|
+
<uri type='citation'>http://www.example.com</uri>
|
931
|
+
<docidentifier>ISO 712</docidentifier>
|
932
|
+
<contributor>
|
933
|
+
<role type='publisher'/>
|
934
|
+
<organization>
|
935
|
+
<abbreviation>ISO</abbreviation>
|
936
|
+
</organization>
|
937
|
+
</contributor>
|
938
|
+
</bibitem>
|
939
|
+
<bibitem id='ISO713' type='standard'>
|
940
|
+
<title format='text/plain'>Cereals and cereal products</title>
|
941
|
+
<uri type='citation'>spec/assets/iso713</uri>
|
942
|
+
<docidentifier>ISO 713</docidentifier>
|
943
|
+
<contributor>
|
944
|
+
<role type='publisher'/>
|
945
|
+
<organization>
|
946
|
+
<abbreviation>ISO</abbreviation>
|
947
|
+
</organization>
|
948
|
+
</contributor>
|
949
|
+
</bibitem>
|
950
|
+
<bibitem id='ISO714' type='standard'>
|
789
951
|
<title format='text/plain'>Cereals and cereal products</title>
|
790
|
-
<uri type='citation'>spec/assets/
|
791
|
-
<docidentifier>ISO
|
952
|
+
<uri type='citation'>spec/assets/iso714.svg</uri>
|
953
|
+
<docidentifier>ISO 714</docidentifier>
|
792
954
|
<contributor>
|
793
955
|
<role type='publisher'/>
|
794
956
|
<organization>
|
@@ -796,241 +958,263 @@ html = <<~OUTPUT
|
|
796
958
|
</organization>
|
797
959
|
</contributor>
|
798
960
|
</bibitem>
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
OUTPUT
|
961
|
+
</references>
|
962
|
+
</bibliography>
|
963
|
+
</iso-standard>
|
964
|
+
OUTPUT
|
803
965
|
|
804
966
|
html = <<~OUTPUT
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
</
|
838
|
-
</div>
|
839
|
-
</div>
|
840
|
-
</body>
|
841
|
-
</html>
|
842
|
-
OUTPUT
|
843
|
-
|
844
|
-
word = <<~OUTPUT
|
845
|
-
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
846
|
-
<head>
|
847
|
-
<style>
|
848
|
-
</style>
|
849
|
-
</head>
|
850
|
-
<body lang='EN-US' link='blue' vlink='#954F72'>
|
851
|
-
<div class='WordSection1'>
|
852
|
-
<p> </p>
|
853
|
-
</div>
|
854
|
-
<p>
|
855
|
-
<br clear='all' class='section'/>
|
856
|
-
</p>
|
857
|
-
<div class='WordSection2'>
|
858
|
-
<p>
|
859
|
-
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
967
|
+
#{HTML_HDR}
|
968
|
+
<br/>
|
969
|
+
<div>
|
970
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
971
|
+
<p>
|
972
|
+
<a href='http://www.example.com'>ISO 712</a>
|
973
|
+
<a href='http://www.example.com'>ISO 712</a>
|
974
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
|
975
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
|
976
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1; Clause 1</a>
|
977
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1–1</a>
|
978
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1, Table 1</a>
|
979
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1</a>
|
980
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1.5</a>
|
981
|
+
<a href='spec/assets/iso713.html'>A</a>
|
982
|
+
<a href='spec/assets/iso713.html'>ISO 713, Whole of text</a>
|
983
|
+
<a href='spec/assets/iso713.html'>ISO 713, Prelude 7</a>
|
984
|
+
<a href='spec/assets/iso713.html'>A</a>
|
985
|
+
<a href='spec/assets/iso713.html#xyz'>ISO 713</a>
|
986
|
+
<a href='spec/assets/iso713.html#xyz'>ISO 713, Clause 1</a>
|
987
|
+
<a href='spec/assets/iso714.svg'>ISO 714</a>
|
988
|
+
</p>
|
989
|
+
</div>
|
990
|
+
<p class='zzSTDTitle1'/>
|
991
|
+
<div>
|
992
|
+
<h1>1.  Normative References</h1>
|
993
|
+
<p id='ISO712' class='NormRef'>
|
994
|
+
ISO 712,
|
995
|
+
<i>Cereals and cereal products</i>
|
996
|
+
</p>
|
997
|
+
<p id='ISO713' class='NormRef'>
|
998
|
+
ISO 713,
|
999
|
+
<i>Cereals and cereal products</i>
|
860
1000
|
</p>
|
861
|
-
<
|
862
|
-
|
863
|
-
<
|
864
|
-
<a href='http://www.example.com'>ISO 712</a>
|
865
|
-
<a href='http://www.example.com'>ISO 712</a>
|
866
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
867
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
868
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Table 1; Clause 1</a>
|
869
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Table 1–1</a>
|
870
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1, Table 1</a>
|
871
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1</a>
|
872
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1.5</a>
|
873
|
-
<a href='spec/assets/iso713.doc'>A</a>
|
874
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Whole of text</a>
|
875
|
-
<a href='spec/assets/iso713.doc'>ISO 713, Prelude 7</a>
|
876
|
-
<a href='spec/assets/iso713.doc'>A</a>
|
877
|
-
<a href='spec/assets/iso713.doc#xyz'>ISO 713</a>
|
878
|
-
<a href='spec/assets/iso713.doc#xyz'>ISO 713, Clause 1</a>
|
1001
|
+
<p id='ISO714' class='NormRef'>
|
1002
|
+
ISO 714,
|
1003
|
+
<i>Cereals and cereal products</i>
|
879
1004
|
</p>
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
</p>
|
886
|
-
<div class='WordSection3'>
|
887
|
-
<p class='zzSTDTitle1'/>
|
888
|
-
<div>
|
889
|
-
<h1>
|
890
|
-
1.
|
891
|
-
<span style='mso-tab-count:1'>  </span>
|
892
|
-
Normative References
|
893
|
-
</h1>
|
894
|
-
<p id='ISO712' class='NormRef'>
|
895
|
-
ISO 712,
|
896
|
-
<i>Cereals and cereal products</i>
|
897
|
-
</p>
|
898
|
-
<p id='ISO713' class='NormRef'>
|
899
|
-
ISO 713,
|
900
|
-
<i>Cereals and cereal products</i>
|
901
|
-
</p>
|
902
|
-
</div>
|
903
|
-
</div>
|
904
|
-
</body>
|
905
|
-
</html>
|
1005
|
+
</div>
|
1006
|
+
</div>
|
1007
|
+
</body>
|
1008
|
+
</html>
|
1009
|
+
OUTPUT
|
906
1010
|
|
907
|
-
OUTPUT
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
1011
|
+
word = <<~OUTPUT
|
1012
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
1013
|
+
<head>
|
1014
|
+
<style>
|
1015
|
+
</style>
|
1016
|
+
</head>
|
1017
|
+
<body lang='EN-US' link='blue' vlink='#954F72'>
|
1018
|
+
<div class='WordSection1'>
|
1019
|
+
<p> </p>
|
1020
|
+
</div>
|
1021
|
+
<p>
|
1022
|
+
<br clear='all' class='section'/>
|
1023
|
+
</p>
|
1024
|
+
<div class='WordSection2'>
|
1025
|
+
<p>
|
1026
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
1027
|
+
</p>
|
1028
|
+
<div>
|
1029
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
1030
|
+
<p>
|
1031
|
+
<a href='http://www.example.com'>ISO 712</a>
|
1032
|
+
<a href='http://www.example.com'>ISO 712</a>
|
1033
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
1034
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
1035
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1; Clause 1</a>
|
1036
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1–1</a>
|
1037
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1, Table 1</a>
|
1038
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1</a>
|
1039
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1.5</a>
|
1040
|
+
<a href='spec/assets/iso713.doc'>A</a>
|
1041
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Whole of text</a>
|
1042
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Prelude 7</a>
|
1043
|
+
<a href='spec/assets/iso713.doc'>A</a>
|
1044
|
+
<a href='spec/assets/iso713.doc#xyz'>ISO 713</a>
|
1045
|
+
<a href='spec/assets/iso713.doc#xyz'>ISO 713, Clause 1</a>
|
1046
|
+
<a href='spec/assets/iso714.svg'>ISO 714</a>
|
1047
|
+
</p>
|
1048
|
+
</div>
|
1049
|
+
<p> </p>
|
1050
|
+
</div>
|
1051
|
+
<p>
|
1052
|
+
<br clear='all' class='section'/>
|
1053
|
+
</p>
|
1054
|
+
<div class='WordSection3'>
|
1055
|
+
<p class='zzSTDTitle1'/>
|
1056
|
+
<div>
|
1057
|
+
<h1>
|
1058
|
+
1.
|
1059
|
+
<span style='mso-tab-count:1'>  </span>
|
1060
|
+
Normative References
|
1061
|
+
</h1>
|
1062
|
+
<p id='ISO712' class='NormRef'>
|
1063
|
+
ISO 712,
|
1064
|
+
<i>Cereals and cereal products</i>
|
1065
|
+
</p>
|
1066
|
+
<p id='ISO713' class='NormRef'>
|
1067
|
+
ISO 713,
|
1068
|
+
<i>Cereals and cereal products</i>
|
1069
|
+
</p>
|
1070
|
+
<p id='ISO714' class='NormRef'>
|
1071
|
+
ISO 714,
|
1072
|
+
<i>Cereals and cereal products</i>
|
1073
|
+
</p>
|
1074
|
+
</div>
|
1075
|
+
</div>
|
1076
|
+
</body>
|
1077
|
+
</html>
|
1078
|
+
OUTPUT
|
1079
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1080
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1081
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1082
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
1083
|
+
expect(xmlpp(IsoDoc::WordConvert.new({})
|
1084
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(word)
|
1085
|
+
end
|
912
1086
|
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
1087
|
+
it "processes variant" do
|
1088
|
+
input = <<~INPUT
|
1089
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1090
|
+
<bibdata>
|
1091
|
+
<language>en</language>
|
1092
|
+
<script>Latn</script>
|
1093
|
+
</bibdata>
|
1094
|
+
<preface>
|
1095
|
+
<clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
|
1096
|
+
<clause id="A1"><title><variant lang="en" script="Grek">ABC</variant><variant lang="fr" script="Grek">DEF</variant></title></clause>
|
1097
|
+
<clause id="A2"><title><variant lang="en">ABC</variant><variant lang="fr">DEF</variant></title></clause>
|
1098
|
+
<clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
|
1099
|
+
<clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
|
1100
|
+
<clause id="C1"><title><variant lang="fr" script="Grek">ABC</variant><variant lang="en" script="Grek">DEF</variant></title></clause>
|
1101
|
+
<clause id="C2"><title><variant lang="fr">ABC</variant><variant lang="en">DEF</variant></title></clause>
|
1102
|
+
<p>A <variant><variant lang="en">B</variant><variant lang="fr">C</variant></variant> D <variant><variant lang="en" script="Latn">E</variant><variant lang="fr" script="Latn">F</variant></variant></p>
|
1103
|
+
</preface>
|
1104
|
+
</iso-standard>
|
931
1105
|
INPUT
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
</
|
1106
|
+
output = <<~OUTPUT
|
1107
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1108
|
+
<bibdata>
|
1109
|
+
<language current='true'>en</language>
|
1110
|
+
<script current='true'>Latn</script>
|
1111
|
+
</bibdata>
|
1112
|
+
<preface>
|
1113
|
+
<clause id='A' displayorder='1'>
|
1114
|
+
<title depth='1'>ABC</title>
|
1115
|
+
</clause>
|
1116
|
+
<clause id='A1' displayorder='2'>
|
1117
|
+
<title depth='1'>ABC/DEF</title>
|
1118
|
+
</clause>
|
1119
|
+
<clause id='A2' displayorder='3'>
|
1120
|
+
<title depth='1'>ABC</title>
|
1121
|
+
</clause>
|
1122
|
+
<clause id='B' displayorder='4'>
|
1123
|
+
<title depth='1'>GHI/JKL</title>
|
1124
|
+
</clause>
|
1125
|
+
<clause id='C' displayorder='5'>
|
1126
|
+
<title depth='1'>DEF</title>
|
1127
|
+
</clause>
|
1128
|
+
<clause id='C1' displayorder='6'>
|
1129
|
+
<title depth='1'>ABC/DEF</title>
|
1130
|
+
</clause>
|
1131
|
+
<clause id='C2' displayorder='7'>
|
1132
|
+
<title depth='1'>DEF</title>
|
1133
|
+
</clause>
|
1134
|
+
<p displayorder='8'>A B D E</p>
|
1135
|
+
</preface>
|
1136
|
+
</iso-standard>
|
962
1137
|
OUTPUT
|
963
|
-
|
1138
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1139
|
+
.convert("test", input, true)
|
1140
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
1141
|
+
.to be_equivalent_to xmlpp(output)
|
1142
|
+
end
|
964
1143
|
|
965
|
-
it "cases xrefs" do
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
</clause>
|
981
|
-
</sections>
|
982
|
-
</iso-standard>
|
983
|
-
INPUT
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
</
|
1023
|
-
|
1024
|
-
|
1144
|
+
it "cases xrefs" do
|
1145
|
+
input = <<~INPUT
|
1146
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1147
|
+
<sections>
|
1148
|
+
<clause id="A">
|
1149
|
+
<table id="B">
|
1150
|
+
</table>
|
1151
|
+
</clause>
|
1152
|
+
<clause id="C">
|
1153
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
1154
|
+
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
1155
|
+
This is <xref target="A" case="lowercase"/> and <xref target="B" case="capital"/>.
|
1156
|
+
<xref target="A"/> is clause <em>initial.</em><br/>
|
1157
|
+
<xref target="A"/> is too. </p>
|
1158
|
+
<p><xref target="A"/> is also.</p>
|
1159
|
+
</clause>
|
1160
|
+
</sections>
|
1161
|
+
</iso-standard>
|
1162
|
+
INPUT
|
1163
|
+
output = <<~OUTPUT
|
1164
|
+
<?xml version='1.0'?>
|
1165
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1166
|
+
<sections>
|
1167
|
+
<clause id='A' displayorder="1">
|
1168
|
+
<title>1.</title>
|
1169
|
+
<table id='B'>
|
1170
|
+
<name>Tabelo 1</name>
|
1171
|
+
</table>
|
1172
|
+
</clause>
|
1173
|
+
<clause id='C' displayorder="2">
|
1174
|
+
<title>2.</title>
|
1175
|
+
<p>
|
1176
|
+
This is
|
1177
|
+
<xref target='A'>klaŭzo 1</xref>
|
1178
|
+
and
|
1179
|
+
<xref target='B'>tabelo 1</xref>
|
1180
|
+
. This is
|
1181
|
+
<xref target='A' case='capital'>Klaŭzo 1</xref>
|
1182
|
+
and
|
1183
|
+
<xref target='B' case='lowercase'>tabelo 1</xref>
|
1184
|
+
. This is
|
1185
|
+
<xref target='A' case='lowercase'>klaŭzo 1</xref>
|
1186
|
+
and
|
1187
|
+
<xref target='B' case='capital'>Tabelo 1</xref>
|
1188
|
+
.
|
1189
|
+
<xref target='A'>Klaŭzo 1</xref>
|
1190
|
+
is clause
|
1191
|
+
<em>initial.</em>
|
1192
|
+
<br/>
|
1193
|
+
<xref target='A'>Klaŭzo 1</xref>
|
1194
|
+
is too.
|
1195
|
+
</p>
|
1196
|
+
<p>
|
1197
|
+
<xref target='A'>Klaŭzo 1</xref>
|
1198
|
+
is also.
|
1199
|
+
</p>
|
1200
|
+
</clause>
|
1201
|
+
</sections>
|
1202
|
+
</iso-standard>
|
1203
|
+
OUTPUT
|
1204
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
1205
|
+
.new({ i18nyaml: "spec/assets/i18n.yaml" })
|
1206
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1207
|
+
end
|
1025
1208
|
|
1026
1209
|
it "processes add, del" do
|
1027
|
-
|
1210
|
+
input = <<~INPUT
|
1028
1211
|
<itu-standard xmlns="https://www.calconnect.org/standards/itu">
|
1029
1212
|
<preface><foreword id="A">
|
1030
1213
|
<add>ABC <xref target="A"></add> <del><strong>B</strong></del>
|
1031
1214
|
</foreword></preface>
|
1032
1215
|
</itu-standard>
|
1033
1216
|
INPUT
|
1217
|
+
output = <<~OUTPUT
|
1034
1218
|
#{HTML_HDR}
|
1035
1219
|
<br/>
|
1036
1220
|
<div id='A'>
|
@@ -1048,7 +1232,7 @@ end
|
|
1048
1232
|
</body>
|
1049
1233
|
</html>
|
1050
1234
|
OUTPUT
|
1235
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
1236
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1051
1237
|
end
|
1052
|
-
|
1053
|
-
|
1054
1238
|
end
|