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