metanorma-iso 1.6.1 → 1.7.4
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 +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/iso/base.rb +13 -13
- data/lib/asciidoctor/iso/basicdoc.rng +5 -3
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/front.rb +6 -6
- data/lib/asciidoctor/iso/front_id.rb +30 -25
- data/lib/asciidoctor/iso/isodoc.rng +108 -2
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +17 -97
- data/lib/asciidoctor/iso/validate.rb +68 -1
- data/lib/asciidoctor/iso/validate_title.rb +21 -13
- data/lib/isodoc/iso/base_convert.rb +11 -0
- data/lib/isodoc/iso/html/header.html +12 -12
- data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html_convert.rb +2 -2
- data/lib/isodoc/iso/i18n-en.yaml +6 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1009 -321
- data/lib/isodoc/iso/iso.international-standard.xsl +1009 -321
- data/lib/isodoc/iso/presentation_xml_convert.rb +1 -4
- data/lib/isodoc/iso/word_convert.rb +2 -2
- data/lib/isodoc/iso/xref.rb +5 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +4 -4
- data/spec/asciidoctor/amd_spec.rb +696 -0
- data/spec/asciidoctor/base_spec.rb +704 -0
- data/spec/asciidoctor/blocks_spec.rb +527 -0
- data/spec/asciidoctor/cleanup_spec.rb +1134 -0
- data/spec/asciidoctor/inline_spec.rb +195 -0
- data/spec/asciidoctor/lists_spec.rb +197 -0
- data/spec/asciidoctor/refs_spec.rb +375 -0
- data/spec/asciidoctor/section_spec.rb +393 -0
- data/spec/asciidoctor/table_spec.rb +329 -0
- data/spec/asciidoctor/validate_spec.rb +1572 -0
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +340 -316
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +834 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +821 -519
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +186 -189
- metadata +26 -27
- data/.rubocop.ribose.yml +0 -66
- data/spec/asciidoctor-iso/amd_spec.rb +0 -694
- data/spec/asciidoctor-iso/base_spec.rb +0 -713
- data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
- data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
- data/spec/asciidoctor-iso/inline_spec.rb +0 -170
- data/spec/asciidoctor-iso/lists_spec.rb +0 -190
- data/spec/asciidoctor-iso/refs_spec.rb +0 -317
- data/spec/asciidoctor-iso/section_spec.rb +0 -362
- data/spec/asciidoctor-iso/table_spec.rb +0 -313
- data/spec/asciidoctor-iso/validate_spec.rb +0 -1550
- data/spec/assets/xref_error.adoc +0 -7
data/spec/isodoc/table_spec.rb
CHANGED
@@ -2,425 +2,486 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
4
|
it "processes IsoXML tables (Presentation XML)" do
|
5
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
</
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
</
|
56
|
-
<
|
57
|
-
</
|
58
|
-
|
59
|
-
</
|
60
|
-
</
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
5
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
|
6
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
7
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
8
|
+
<preface>
|
9
|
+
<foreword>
|
10
|
+
<table alt="tool tip" id="tableD-1" summary="long desc">
|
11
|
+
<name>Repeatability and reproducibility of
|
12
|
+
<em>husked</em>
|
13
|
+
rice yield</name>
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<td align="left" rowspan="2">Description</td>
|
17
|
+
<td align="center" colspan="4">Rice sample</td>
|
18
|
+
</tr>
|
19
|
+
<tr>
|
20
|
+
<td align="left">Arborio</td>
|
21
|
+
<td align="center">Drago
|
22
|
+
<fn reference="a">
|
23
|
+
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p></fn>
|
24
|
+
</td>
|
25
|
+
<td align="center">Balilla
|
26
|
+
<fn reference="a">
|
27
|
+
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p></fn>
|
28
|
+
</td>
|
29
|
+
<td align="center">Thaibonnet</td>
|
30
|
+
</tr>
|
31
|
+
</thead>
|
32
|
+
<tbody>
|
33
|
+
<tr>
|
34
|
+
<th align="left">Number of laboratories retained after eliminating outliers</th>
|
35
|
+
<td align="center">13</td>
|
36
|
+
<td align="center">11</td>
|
37
|
+
<td align="center">13</td>
|
38
|
+
<td align="center">13</td>
|
39
|
+
</tr>
|
40
|
+
<tr>
|
41
|
+
<td align="left">Mean value, g/100 g</td>
|
42
|
+
<td align="center">81,2</td>
|
43
|
+
<td align="center">82,0</td>
|
44
|
+
<td align="center">81,8</td>
|
45
|
+
<td align="center">77,7</td>
|
46
|
+
</tr>
|
47
|
+
</tbody>
|
48
|
+
<tfoot>
|
49
|
+
<tr>
|
50
|
+
<td align="left">Reproducibility limit,
|
51
|
+
<stem type="AsciiMath">R</stem>
|
52
|
+
(= 2,83
|
53
|
+
<stem type="AsciiMath">s_R</stem>
|
54
|
+
)</td>
|
55
|
+
<td align="center">2,89</td>
|
56
|
+
<td align="center">0,57</td>
|
57
|
+
<td align="center">2,26</td>
|
58
|
+
<td align="center">6,06</td>
|
59
|
+
</tr>
|
60
|
+
</tfoot>
|
61
|
+
<dl>
|
62
|
+
<dt>Drago</dt>
|
63
|
+
<dd>A type of rice</dd>
|
64
|
+
</dl>
|
65
|
+
<note>
|
66
|
+
<p>This is a table about rice</p>
|
67
|
+
</note>
|
68
|
+
</table>
|
69
|
+
</foreword>
|
70
|
+
</preface>
|
71
|
+
</iso-standard>
|
72
|
+
INPUT
|
73
|
+
<?xml version='1.0'?>
|
74
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
75
|
+
<preface>
|
76
|
+
<foreword>
|
77
|
+
<table id='tableD-1' alt='tool tip' summary='long desc'>
|
78
|
+
<name>
|
79
|
+
Table 1 — Repeatability and reproducibility of
|
80
|
+
<em>husked</em>
|
81
|
+
rice yield
|
82
|
+
</name>
|
83
|
+
<thead>
|
84
|
+
<tr>
|
85
|
+
<td rowspan='2' align='left'>Description</td>
|
86
|
+
<td colspan='4' align='center'>Rice sample</td>
|
87
|
+
</tr>
|
88
|
+
<tr>
|
89
|
+
<td align='left'>Arborio</td>
|
90
|
+
<td align='center'>
|
91
|
+
Drago
|
92
|
+
<fn reference='a'>
|
93
|
+
<p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
|
94
|
+
</fn>
|
95
|
+
</td>
|
96
|
+
<td align='center'>
|
97
|
+
Balilla
|
98
|
+
<fn reference='a'>
|
99
|
+
<p id='_0fe65e9a-5531-408e-8295-eeff35f41a55'>Parboiled rice.</p>
|
100
|
+
</fn>
|
101
|
+
</td>
|
102
|
+
<td align='center'>Thaibonnet</td>
|
103
|
+
</tr>
|
104
|
+
</thead>
|
105
|
+
<tbody>
|
106
|
+
<tr>
|
107
|
+
<th align='left'>Number of laboratories retained after eliminating outliers</th>
|
108
|
+
<td align='center'>13</td>
|
109
|
+
<td align='center'>11</td>
|
110
|
+
<td align='center'>13</td>
|
111
|
+
<td align='center'>13</td>
|
112
|
+
</tr>
|
113
|
+
<tr>
|
114
|
+
<td align='left'>Mean value, g/100 g</td>
|
115
|
+
<td align='center'>81,2</td>
|
116
|
+
<td align='center'>82,0</td>
|
117
|
+
<td align='center'>81,8</td>
|
118
|
+
<td align='center'>77,7</td>
|
119
|
+
</tr>
|
120
|
+
</tbody>
|
121
|
+
<tfoot>
|
122
|
+
<tr>
|
123
|
+
<td align='left'>
|
124
|
+
Reproducibility limit,
|
125
|
+
<stem type='AsciiMath'>R</stem>
|
126
|
+
(= 2,83
|
127
|
+
<stem type='AsciiMath'>s_R</stem>
|
128
|
+
)
|
129
|
+
</td>
|
130
|
+
<td align='center'>2,89</td>
|
131
|
+
<td align='center'>0,57</td>
|
132
|
+
<td align='center'>2,26</td>
|
133
|
+
<td align='center'>6,06</td>
|
134
|
+
</tr>
|
135
|
+
</tfoot>
|
136
|
+
<dl>
|
137
|
+
<dt>Drago</dt>
|
138
|
+
<dd>A type of rice</dd>
|
139
|
+
</dl>
|
140
|
+
<note>
|
141
|
+
<name>NOTE</name>
|
142
|
+
<p>This is a table about rice</p>
|
143
|
+
</note>
|
144
|
+
</table>
|
145
|
+
</foreword>
|
146
|
+
</preface>
|
147
|
+
</iso-standard>
|
148
|
+
OUTPUT
|
139
149
|
end
|
140
150
|
|
141
151
|
it "processes IsoXML tables (HTML)" do
|
142
|
-
FileUtils.rm_f("test.html")
|
143
152
|
IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", false)
|
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
|
-
</
|
153
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
154
|
+
<preface>
|
155
|
+
<foreword>
|
156
|
+
<table alt="tool tip" id="tableD-1" summary="long desc">
|
157
|
+
<name>Table 1 — Repeatability and reproducibility of
|
158
|
+
<em>husked</em>
|
159
|
+
rice yield</name>
|
160
|
+
<thead>
|
161
|
+
<tr>
|
162
|
+
<td align="left" rowspan="2">Description</td>
|
163
|
+
<td align="center" colspan="4">Rice sample</td>
|
164
|
+
</tr>
|
165
|
+
<tr>
|
166
|
+
<td align="left">Arborio</td>
|
167
|
+
<td align="center">Drago
|
168
|
+
<fn reference="a">
|
169
|
+
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p></fn>
|
170
|
+
</td>
|
171
|
+
<td align="center">Balilla
|
172
|
+
<fn reference="a">
|
173
|
+
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p></fn>
|
174
|
+
</td>
|
175
|
+
<td align="center">Thaibonnet</td>
|
176
|
+
</tr>
|
177
|
+
</thead>
|
178
|
+
<tbody>
|
179
|
+
<tr>
|
180
|
+
<th align="left">Number of laboratories retained after eliminating outliers</th>
|
181
|
+
<td align="center">13</td>
|
182
|
+
<td align="center">11</td>
|
183
|
+
<td align="center">13</td>
|
184
|
+
<td align="center">13</td>
|
185
|
+
</tr>
|
186
|
+
<tr>
|
187
|
+
<td align="left">Mean value, g/100 g</td>
|
188
|
+
<td align="center">81,2</td>
|
189
|
+
<td align="center">82,0</td>
|
190
|
+
<td align="center">81,8</td>
|
191
|
+
<td align="center">77,7</td>
|
192
|
+
</tr>
|
193
|
+
</tbody>
|
194
|
+
<tfoot>
|
195
|
+
<tr>
|
196
|
+
<td align="left">Reproducibility limit,
|
197
|
+
<stem type="AsciiMath">R</stem>
|
198
|
+
(= 2,83
|
199
|
+
<stem type="AsciiMath">s_R</stem>
|
200
|
+
)</td>
|
201
|
+
<td align="center">2,89</td>
|
202
|
+
<td align="center">0,57</td>
|
203
|
+
<td align="center">2,26</td>
|
204
|
+
<td align="center">6,06</td>
|
205
|
+
</tr>
|
206
|
+
</tfoot>
|
207
|
+
<dl>
|
208
|
+
<dt>Drago</dt>
|
209
|
+
<dd>A type of rice</dd>
|
210
|
+
</dl>
|
211
|
+
<note>
|
212
|
+
<name>NOTE</name>
|
213
|
+
<p>This is a table about rice</p>
|
214
|
+
</note>
|
215
|
+
</table>
|
216
|
+
</foreword>
|
217
|
+
</preface>
|
218
|
+
</iso-standard>
|
200
219
|
INPUT
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
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
|
-
</main>
|
298
|
-
OUTPUT
|
220
|
+
expect(File.exist?("test.html")).to be true
|
221
|
+
html = File.read("test.html").sub(/^.*<main /m, '<main ').sub(%r{</main>.*$}m, "</main>")
|
222
|
+
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
223
|
+
<main class='main-section'>
|
224
|
+
<button onclick='topFunction()' id='myBtn' title='Go to top'>Top</button>
|
225
|
+
<br/>
|
226
|
+
<div>
|
227
|
+
<h1 class='ForewordTitle' id="toc0">Foreword</h1>
|
228
|
+
<p class='TableTitle' style='text-align:center;'>
|
229
|
+
Table 1 — Repeatability and reproducibility of
|
230
|
+
<i>husked</i>
|
231
|
+
rice yield
|
232
|
+
</p>
|
233
|
+
<table id='tableD-1' class='MsoISOTable' style='border-width:1px;border-spacing:0;' title='tool tip'>
|
234
|
+
<caption>
|
235
|
+
<span style='display:none'>long desc</span>
|
236
|
+
</caption>
|
237
|
+
<thead>
|
238
|
+
<tr>
|
239
|
+
<td rowspan='2' style='text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>Description</td>
|
240
|
+
<td colspan='4' style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;;text-align:center;vertical-align:middle;' scope='colgroup'>Rice sample</td>
|
241
|
+
</tr>
|
242
|
+
<tr>
|
243
|
+
<td style='text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>Arborio</td>
|
244
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>
|
245
|
+
Drago
|
246
|
+
<a href='#tableD-1a' class='TableFootnoteRef'>a</a>
|
247
|
+
</td>
|
248
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>
|
249
|
+
Balilla
|
250
|
+
<a href='#tableD-1a' class='TableFootnoteRef'>a</a>
|
251
|
+
</td>
|
252
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;;text-align:center;vertical-align:middle;' scope='col'>Thaibonnet</td>
|
253
|
+
</tr>
|
254
|
+
</thead>
|
255
|
+
<tbody>
|
256
|
+
<tr>
|
257
|
+
<th style='font-weight:bold;text-align:left;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;' scope='row'>Number of laboratories retained after eliminating outliers</th>
|
258
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>13</td>
|
259
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>11</td>
|
260
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>13</td>
|
261
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>13</td>
|
262
|
+
</tr>
|
263
|
+
<tr>
|
264
|
+
<td style='text-align:left;border-top:none;border-bottom:solid windowtext 1.5pt;'>Mean value, g/100 g</td>
|
265
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>81,2</td>
|
266
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>82,0</td>
|
267
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>81,8</td>
|
268
|
+
<td style='text-align:center;border-top:none;border-bottom:solid windowtext 1.5pt;'>77,7</td>
|
269
|
+
</tr>
|
270
|
+
</tbody>
|
271
|
+
<tfoot>
|
272
|
+
<tr>
|
273
|
+
<td style='text-align:left;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>
|
274
|
+
Reproducibility limit,
|
275
|
+
<span class='stem'>(#(R)#)</span>
|
276
|
+
(= 2,83
|
277
|
+
<span class='stem'>(#(s_R)#)</span>
|
278
|
+
)
|
279
|
+
</td>
|
280
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>2,89</td>
|
281
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>0,57</td>
|
282
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>2,26</td>
|
283
|
+
<td style='text-align:center;border-top:solid windowtext 1.5pt;border-bottom:0pt;'>6,06</td>
|
284
|
+
</tr>
|
285
|
+
<tr>
|
286
|
+
<td colspan='5' style='border-top:0pt;border-bottom:solid windowtext 1.5pt;'>
|
287
|
+
<div class='Note'>
|
288
|
+
<p>
|
289
|
+
<span class='note_label'>NOTE</span>
|
290
|
+
  This is a table about rice
|
291
|
+
</p>
|
292
|
+
</div>
|
293
|
+
<div class='TableFootnote'>
|
294
|
+
<div id='fn:tableD-1a'>
|
295
|
+
<p id='_0fe65e9a-5531-408e-8295-eeff35f41a55' class='TableFootnote'>
|
296
|
+
<span>
|
297
|
+
<span id='tableD-1a' class='TableFootnoteRef'>a</span>
|
298
|
+
 
|
299
|
+
</span>
|
300
|
+
Parboiled rice.
|
301
|
+
</p>
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
</td>
|
305
|
+
</tr>
|
306
|
+
</tfoot>
|
307
|
+
<dl>
|
308
|
+
<dt>
|
309
|
+
<p>Drago</p>
|
310
|
+
</dt>
|
311
|
+
<dd>A type of rice</dd>
|
312
|
+
</dl>
|
313
|
+
</table>
|
314
|
+
</div>
|
315
|
+
<p class='zzSTDTitle1'/>
|
316
|
+
</main>
|
317
|
+
OUTPUT
|
299
318
|
end
|
300
319
|
|
301
|
-
|
302
|
-
FileUtils.rm_f("test.doc")
|
320
|
+
it "processes IsoXML tables (Word)" do
|
303
321
|
IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", false)
|
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
|
-
|
357
|
-
</
|
358
|
-
</
|
359
|
-
</
|
322
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
323
|
+
<preface>
|
324
|
+
<foreword>
|
325
|
+
<table alt="tool tip" id="tableD-1" summary="long desc">
|
326
|
+
<name>Table 1 — Repeatability and reproducibility of <em>husked</em> rice yield</name>
|
327
|
+
<thead>
|
328
|
+
<tr>
|
329
|
+
<td align="left" rowspan="2">Description</td>
|
330
|
+
<td align="center" colspan="4">Rice sample</td>
|
331
|
+
</tr>
|
332
|
+
<tr>
|
333
|
+
<td align="left">Arborio</td>
|
334
|
+
<td align="center">Drago
|
335
|
+
<fn reference="a">
|
336
|
+
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p></fn>
|
337
|
+
</td>
|
338
|
+
<td align="center">Balilla
|
339
|
+
<fn reference="a">
|
340
|
+
<p id="_0fe65e9a-5531-408e-8295-eeff35f41a55">Parboiled rice.</p></fn>
|
341
|
+
</td>
|
342
|
+
<td align="center">Thaibonnet</td>
|
343
|
+
</tr>
|
344
|
+
</thead>
|
345
|
+
<tbody>
|
346
|
+
<tr>
|
347
|
+
<th align="left">Number of laboratories retained after eliminating outliers</th>
|
348
|
+
<td align="center">13</td>
|
349
|
+
<td align="center">11</td>
|
350
|
+
<td align="center">13</td>
|
351
|
+
<td align="center">13</td>
|
352
|
+
</tr>
|
353
|
+
<tr>
|
354
|
+
<td align="left">Mean value, g/100 g</td>
|
355
|
+
<td align="center">81,2</td>
|
356
|
+
<td align="center">82,0</td>
|
357
|
+
<td align="center">81,8</td>
|
358
|
+
<td align="center">77,7</td>
|
359
|
+
</tr>
|
360
|
+
</tbody>
|
361
|
+
<tfoot>
|
362
|
+
<tr>
|
363
|
+
<td align="left">Reproducibility limit,
|
364
|
+
<stem type="AsciiMath">R</stem>
|
365
|
+
(= 2,83
|
366
|
+
<stem type="AsciiMath">s_R</stem>
|
367
|
+
)</td>
|
368
|
+
<td align="center">2,89</td>
|
369
|
+
<td align="center">0,57</td>
|
370
|
+
<td align="center">2,26</td>
|
371
|
+
<td align="center">6,06</td>
|
372
|
+
</tr>
|
373
|
+
</tfoot>
|
374
|
+
<dl>
|
375
|
+
<dt>Drago</dt>
|
376
|
+
<dd>A type of rice</dd>
|
377
|
+
</dl>
|
378
|
+
<note>
|
379
|
+
<name>NOTE</name>
|
380
|
+
<p>This is a table about rice</p>
|
381
|
+
</note>
|
382
|
+
</table>
|
383
|
+
</foreword>
|
384
|
+
</preface>
|
385
|
+
</iso-standard>
|
360
386
|
INPUT
|
361
387
|
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
388
|
+
expect(File.exist?("test.doc")).to be true
|
389
|
+
html = File.read("test.doc").sub(/^.+?<table /m, '<table xmlns:m="m" ').sub(%r{</div>\s*<p class="MsoNormal">.*$}m, "")
|
390
|
+
expect(xmlpp("<div>#{html}")).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
391
|
+
<div>
|
392
|
+
<table class="MsoISOTable" style="mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;" summary="long desc" title="tool tip" xmlns:m="m">
|
393
|
+
<a id="tableD-1" name="tableD-1"/>
|
394
|
+
<thead>
|
395
|
+
<tr>
|
396
|
+
<td align="center" rowspan="2" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Description</td>
|
397
|
+
<td align="center" colspan="4" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;" valign="middle">Rice sample</td>
|
398
|
+
</tr>
|
399
|
+
<tr>
|
400
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Arborio</td>
|
401
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Drago
|
402
|
+
<a class="TableFootnoteRef" href="#tableD-1a">a</a></td>
|
403
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Balilla
|
404
|
+
<a class="TableFootnoteRef" href="#tableD-1a">a</a></td>
|
405
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" valign="middle">Thaibonnet</td>
|
406
|
+
</tr>
|
407
|
+
</thead>
|
408
|
+
<tbody>
|
409
|
+
<tr>
|
410
|
+
<th align="left" style="font-weight:bold;border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;">Number of laboratories retained after eliminating outliers</th>
|
411
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;">13</td>
|
412
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;">11</td>
|
413
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;">13</td>
|
414
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;">13</td>
|
415
|
+
</tr>
|
416
|
+
<tr>
|
417
|
+
<td align="left" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;">Mean value, g/100 g</td>
|
418
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;">81,2</td>
|
419
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;">82,0</td>
|
420
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;">81,8</td>
|
421
|
+
<td align="center" style="border-top:none;mso-border-top-alt:none;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;">77,7</td>
|
422
|
+
</tr>
|
423
|
+
</tbody>
|
424
|
+
<tfoot>
|
425
|
+
<tr>
|
426
|
+
<td align="left" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:0pt;mso-border-bottom-alt:0pt;">Reproducibility limit,
|
427
|
+
<span class="stem">
|
428
|
+
<m:oMath>
|
429
|
+
<m:r>
|
430
|
+
<m:t>R</m:t></m:r>
|
431
|
+
</m:oMath>
|
432
|
+
</span>(= 2,83
|
433
|
+
<span class="stem">
|
434
|
+
<m:oMath>
|
435
|
+
<m:sSub>
|
436
|
+
<m:e>
|
437
|
+
<m:r>
|
438
|
+
<m:t>s</m:t></m:r>
|
439
|
+
</m:e>
|
440
|
+
<m:sub>
|
441
|
+
<m:r>
|
442
|
+
<m:t>R</m:t>
|
443
|
+
</m:r>
|
444
|
+
</m:sub>
|
445
|
+
</m:sSub>
|
446
|
+
</m:oMath>
|
447
|
+
</span>)</td>
|
448
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:0pt;mso-border-bottom-alt:0pt;">2,89</td>
|
449
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:0pt;mso-border-bottom-alt:0pt;">0,57</td>
|
450
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:0pt;mso-border-bottom-alt:0pt;">2,26</td>
|
451
|
+
<td align="center" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:0pt;mso-border-bottom-alt:0pt;">6,06</td>
|
452
|
+
</tr>
|
453
|
+
<tr>
|
454
|
+
<td colspan="5" style="border-top:0pt;mso-border-top-alt:0pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;">
|
455
|
+
<div class="Note">
|
456
|
+
<p class="Note">
|
457
|
+
<span class="note_label">NOTE</span>
|
458
|
+
<span style="mso-tab-count:1"> </span>This is a table about rice</p>
|
459
|
+
</div>
|
460
|
+
<div class="TableFootnote">
|
461
|
+
<div>
|
462
|
+
<a id="ftntableD-1a" name="ftntableD-1a"/>
|
463
|
+
<p class="TableFootnote">
|
464
|
+
<a id="_0fe65e9a-5531-408e-8295-eeff35f41a55" name="_0fe65e9a-5531-408e-8295-eeff35f41a55"/>
|
465
|
+
<span>
|
466
|
+
<span class="TableFootnoteRef">
|
467
|
+
<a id="tableD-1a" name="tableD-1a"/>a</span>
|
468
|
+
<span style="mso-tab-count:1"> </span>
|
469
|
+
</span>Parboiled rice.</p>
|
470
|
+
</div>
|
471
|
+
</div>
|
472
|
+
</td>
|
473
|
+
</tr>
|
474
|
+
</tfoot>
|
475
|
+
</table>
|
476
|
+
<table class="dl">
|
477
|
+
<tr>
|
478
|
+
<td align="left" valign="top">
|
479
|
+
<p align="left" class="MsoNormal" style="margin-left:0pt;text-align:left;">Drago</p>
|
480
|
+
</td>
|
481
|
+
<td valign="top">A type of rice</td>
|
482
|
+
</tr>
|
483
|
+
</table>
|
484
|
+
</div>
|
485
|
+
OUTPUT
|
486
|
+
end
|
426
487
|
end
|