metanorma-iso 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +12 -12
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/isodoc.rng +19 -1
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +6 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +445 -454
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +813 -704
- data/spec/asciidoctor-iso/inline_spec.rb +116 -91
- data/spec/asciidoctor-iso/lists_spec.rb +128 -121
- data/spec/asciidoctor-iso/refs_spec.rb +308 -250
- data/spec/asciidoctor-iso/section_spec.rb +273 -242
- data/spec/asciidoctor-iso/table_spec.rb +258 -242
- data/spec/asciidoctor-iso/validate_spec.rb +1099 -1165
- 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 +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +833 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +608 -525
- 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 +176 -193
- metadata +2 -4
- data/.rubocop.ribose.yml +0 -66
- data/spec/assets/xref_error.adoc +0 -7
@@ -1,71 +1,91 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "fileutils"
|
3
3
|
|
4
|
-
|
4
|
+
WORD_HTML_CSS = {
|
5
|
+
wordstylesheet: "spec/assets/word.css",
|
6
|
+
htmlstylesheet: "spec/assets/html.css",
|
7
|
+
}.freeze
|
8
|
+
|
9
|
+
WORD_HTML_CSS_HEADER_HTML = {
|
10
|
+
wordstylesheet: "spec/assets/word.css",
|
11
|
+
htmlstylesheet: "spec/assets/html.css",
|
12
|
+
header: "spec/assets/header.html",
|
13
|
+
}.freeze
|
14
|
+
|
15
|
+
WORD_HTML_CSS_WORDINTRO = {
|
16
|
+
wordstylesheet: "spec/assets/word.css",
|
17
|
+
htmlstylesheet: "spec/assets/html.css",
|
18
|
+
wordintropage: "spec/assets/wordintro.html",
|
19
|
+
}.freeze
|
5
20
|
|
21
|
+
RSpec.describe IsoDoc do
|
6
22
|
it "generates file based on string input" do
|
7
|
-
|
8
|
-
|
9
|
-
IsoDoc::Iso::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", filename: "test"}).convert("test", <<~"INPUT", false)
|
10
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
23
|
+
IsoDoc::Iso::HtmlConvert.new(WORD_HTML_CSS.merge(filename: "test")).convert("test", <<~"INPUT", false)
|
24
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
11
25
|
<bibdata>
|
12
|
-
|
13
|
-
<title
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
26
|
+
<title>
|
27
|
+
<title format="text/plain" language="en" type="title-intro">Cereals and pulses</title>
|
28
|
+
<title format="text/plain" language="en" type="title-main">Specifications and test methods</title>
|
29
|
+
<title format="text/plain" language="en" type="title-part">Rice</title>
|
30
|
+
</title>
|
31
|
+
</bibdata>
|
32
|
+
<preface>
|
33
|
+
<foreword>
|
34
|
+
<note>
|
35
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
36
|
+
</note>
|
37
|
+
</foreword>
|
38
|
+
</preface>
|
39
|
+
</iso-standard>
|
24
40
|
INPUT
|
25
41
|
expect(File.exist?("test.html")).to be true
|
26
42
|
html = File.read("test.html", encoding: "UTF-8")
|
27
|
-
expect(html).to match(
|
43
|
+
expect(html).to match(
|
44
|
+
%r{<title>Cereals and pulses — Specifications and test methods — Rice</title>}
|
45
|
+
)
|
28
46
|
expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
|
29
47
|
expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
|
30
48
|
end
|
31
49
|
|
32
50
|
it "generates HTML output docs with null configuration" do
|
33
|
-
|
34
|
-
|
35
|
-
IsoDoc::Iso::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
|
36
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
51
|
+
IsoDoc::Iso::HtmlConvert.new(WORD_HTML_CSS.dup).convert("test", <<~"INPUT", false)
|
52
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
37
53
|
<bibdata>
|
38
|
-
|
39
|
-
<title
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
54
|
+
<title>
|
55
|
+
<title format="text/plain" language="en" type="title-intro">Cereals and pulses</title>
|
56
|
+
<title format="text/plain" language="en" type="title-main">Specifications and test methods</title>
|
57
|
+
<title format="text/plain" language="en" type="title-part">Rice</title>
|
58
|
+
</title>
|
59
|
+
</bibdata>
|
60
|
+
<preface>
|
61
|
+
<foreword>
|
62
|
+
<note>
|
63
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
64
|
+
</note>
|
65
|
+
</foreword>
|
66
|
+
</preface>
|
67
|
+
</iso-standard>
|
50
68
|
INPUT
|
51
69
|
expect(File.exist?("test.html")).to be true
|
52
70
|
html = File.read("test.html", encoding: "UTF-8")
|
53
|
-
expect(html).to match(
|
71
|
+
expect(html).to match(
|
72
|
+
%r{<title>Cereals and pulses — Specifications and test methods — Rice</title>}
|
73
|
+
)
|
54
74
|
expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
|
55
75
|
expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
|
56
76
|
end
|
57
77
|
|
58
78
|
it "generates Word output docs with null configuration" do
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
</
|
67
|
-
|
68
|
-
|
79
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("test", <<~"INPUT", false)
|
80
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
81
|
+
<preface>
|
82
|
+
<foreword>
|
83
|
+
<note>
|
84
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
85
|
+
</note>
|
86
|
+
</foreword>
|
87
|
+
</preface>
|
88
|
+
</iso-standard>
|
69
89
|
INPUT
|
70
90
|
expect(File.exist?("test.doc")).to be true
|
71
91
|
word = File.read("test.doc", encoding: "UTF-8")
|
@@ -73,9 +93,7 @@ RSpec.describe IsoDoc do
|
|
73
93
|
end
|
74
94
|
|
75
95
|
it "generates HTML output docs with null configuration from file" do
|
76
|
-
|
77
|
-
FileUtils.rm_f "spec/assets/iso.html"
|
78
|
-
IsoDoc::Iso::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
|
96
|
+
IsoDoc::Iso::HtmlConvert.new(WORD_HTML_CSS.dup).convert("spec/assets/iso.xml", nil, false)
|
79
97
|
expect(File.exist?("spec/assets/iso.html")).to be true
|
80
98
|
html = File.read("spec/assets/iso.html", encoding: "UTF-8")
|
81
99
|
expect(html).to match(/<style>/)
|
@@ -84,404 +102,499 @@ RSpec.describe IsoDoc do
|
|
84
102
|
end
|
85
103
|
|
86
104
|
it "generates Word output docs with null configuration from file" do
|
87
|
-
|
88
|
-
IsoDoc::Iso::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
|
105
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("spec/assets/iso.xml", nil, false)
|
89
106
|
expect(File.exist?("spec/assets/iso.doc")).to be true
|
90
107
|
word = File.read("spec/assets/iso.doc", encoding: "UTF-8")
|
91
108
|
expect(word).to match(/<w:WordDocument>/)
|
92
109
|
expect(word).to match(/<style>/)
|
93
110
|
end
|
94
111
|
|
95
|
-
|
96
|
-
FileUtils.rm_f "spec/assets/iso.pdf"
|
112
|
+
it "generates Pdf output docs with null configuration from file" do
|
97
113
|
mock_pdf
|
98
|
-
IsoDoc::Iso::PdfConvert.new(
|
114
|
+
IsoDoc::Iso::PdfConvert.new(WORD_HTML_CSS.dup).convert("spec/assets/iso.xml", nil, false)
|
99
115
|
expect(File.exist?("spec/assets/iso.pdf")).to be true
|
100
116
|
end
|
101
117
|
|
102
118
|
it "converts annex subheadings to h2Annex class for Word" do
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
119
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("test", <<~"INPUT", false)
|
120
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
121
|
+
<annex id="P" inline-header="false" obligation="normative">
|
122
|
+
<title>Annex</title>
|
123
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
124
|
+
<title>A.1
|
125
|
+
<tab/>
|
126
|
+
Annex A.1</title>
|
127
|
+
</clause>
|
128
|
+
<appendix id="Q2" inline-header="false" obligation="normative">
|
129
|
+
<title>Appendix 1
|
130
|
+
<tab/>
|
131
|
+
An Appendix</title>
|
132
|
+
</appendix>
|
133
|
+
</annex>
|
134
|
+
</iso-standard>
|
117
135
|
INPUT
|
118
|
-
|
119
|
-
|
136
|
+
|
137
|
+
word = File.read("test.doc", encoding: "UTF-8")
|
138
|
+
.sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
|
139
|
+
.sub(%r{<br[^>]*>\s*<div class="colophon".*$}m, "")
|
140
|
+
|
120
141
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
142
|
+
<div class="WordSection3">
|
143
|
+
<p class="zzSTDTitle1"/>
|
144
|
+
<p class="MsoNormal">
|
145
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
146
|
+
</p>
|
147
|
+
<div class="Section3">
|
148
|
+
<a id="P" name="P"/>
|
149
|
+
<h1 class="Annex">Annex</h1>
|
150
|
+
<div>
|
151
|
+
<a id="Q" name="Q"/>
|
152
|
+
<p class="h2Annex">A.1
|
153
|
+
<span style="mso-tab-count:1"> </span>
|
154
|
+
Annex A.1</p>
|
155
|
+
</div>
|
156
|
+
<div>
|
157
|
+
<a id="Q2" name="Q2"/>
|
158
|
+
<p class="h2Annex">Appendix 1
|
159
|
+
<span style="mso-tab-count:1"> </span>
|
160
|
+
An Appendix</p>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
</div>
|
134
164
|
OUTPUT
|
135
165
|
end
|
136
166
|
|
137
167
|
it "populates Word template with terms reference labels" do
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<term id="paddy1">
|
146
|
-
<name>1.1</name>
|
147
|
-
<preferred>paddy</preferred>
|
148
|
-
<definition
|
149
|
-
<
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
</
|
155
|
-
|
156
|
-
|
157
|
-
</
|
158
|
-
</
|
159
|
-
|
168
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("test", <<~"INPUT", false)
|
169
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
170
|
+
<sections>
|
171
|
+
<terms id="_terms_and_definitions" obligation="normative">
|
172
|
+
<title>1
|
173
|
+
<tab/>
|
174
|
+
Terms and Definitions</title>
|
175
|
+
<term id="paddy1">
|
176
|
+
<name>1.1</name>
|
177
|
+
<preferred>paddy</preferred>
|
178
|
+
<definition>
|
179
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
180
|
+
</definition>
|
181
|
+
<termsource status="modified">
|
182
|
+
<origin bibitemid="ISO7301" citeas="ISO 7301:2011" type="inline">
|
183
|
+
<locality type="clause">
|
184
|
+
<referenceFrom>3.1</referenceFrom>
|
185
|
+
</locality>ISO 7301:2011, 3.1</origin>
|
186
|
+
<modification>
|
187
|
+
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
188
|
+
</modification>
|
189
|
+
</termsource>
|
190
|
+
</term>
|
191
|
+
</terms>
|
192
|
+
</sections>
|
193
|
+
</iso-standard>
|
160
194
|
INPUT
|
161
|
-
|
162
|
-
|
195
|
+
|
196
|
+
word = File.read("test.doc", encoding: "UTF-8")
|
197
|
+
.sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
|
198
|
+
.sub(%r{<br[^>]*>\s*<div class="colophon".*$}m, "")
|
199
|
+
|
163
200
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
201
|
+
<div class="WordSection3">
|
202
|
+
<p class="zzSTDTitle1"/>
|
203
|
+
<div>
|
204
|
+
<a id="_terms_and_definitions" name="_terms_and_definitions"/>
|
205
|
+
<h1>1
|
206
|
+
<span style="mso-tab-count:1"> </span>
|
207
|
+
Terms and Definitions</h1>
|
208
|
+
<p class="TermNum">
|
209
|
+
<a id="paddy1" name="paddy1"/>1.1</p>
|
210
|
+
<p class="Terms" style="text-align:left;">paddy</p>
|
211
|
+
<p class="MsoNormal">
|
212
|
+
<a id="_eb29b35e-123e-4d1c-b50b-2714d41e747f" name="_eb29b35e-123e-4d1c-b50b-2714d41e747f"/>rice retaining its husk after threshing</p>
|
213
|
+
<p class="MsoNormal">[SOURCE:
|
214
|
+
<a href="#ISO7301">ISO 7301:2011, 3.1</a>
|
215
|
+
, modified — The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p>
|
216
|
+
</div>
|
217
|
+
</div>
|
171
218
|
OUTPUT
|
172
219
|
end
|
173
220
|
|
174
221
|
it "populates Word header" do
|
175
|
-
|
176
|
-
|
177
|
-
<
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
</docidentifier>
|
222
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS_HEADER_HTML.dup).convert("test", <<~"INPUT", false)
|
223
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
224
|
+
<bibdata type="article">
|
225
|
+
<docidentifier>
|
226
|
+
<project-number part="1">1000</project-number>
|
227
|
+
</docidentifier>
|
182
228
|
</bibdata>
|
183
|
-
</iso-standard>
|
184
|
-
|
229
|
+
</iso-standard>
|
185
230
|
INPUT
|
186
|
-
word = File.read("test.doc", encoding: "UTF-8")
|
187
|
-
sub(
|
188
|
-
|
231
|
+
word = File.read("test.doc", encoding: "UTF-8")
|
232
|
+
.sub(%r{^.*Content-Location: file:///C:/Doc/test_files/header.html}m,
|
233
|
+
"Content-Location: file:///C:/Doc/test_files/header.html")
|
234
|
+
.sub(/------=_NextPart.*$/m, "")
|
189
235
|
expect(word).to include(%{Content-Location: file:///C:/Doc/test_files/header.html})
|
190
236
|
end
|
191
237
|
|
192
238
|
it "populates Word ToC" do
|
193
|
-
|
194
|
-
|
195
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
239
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS_WORDINTRO.dup).convert("test", <<~"INPUT", false)
|
240
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
196
241
|
<sections>
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
242
|
+
<clause id="A" inline-header="false" obligation="normative">
|
243
|
+
<title>1
|
244
|
+
<tab/>
|
245
|
+
Clause 4</title>
|
246
|
+
<clause id="N" inline-header="false" obligation="normative">
|
247
|
+
<title>1.1
|
248
|
+
<tab/>
|
249
|
+
Introduction
|
250
|
+
<bookmark id="Q"/>
|
251
|
+
to this
|
252
|
+
<fn reference="1">
|
253
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p></fn>
|
254
|
+
</title>
|
255
|
+
</clause>
|
256
|
+
<clause id="O" inline-header="false" obligation="normative">
|
257
|
+
<title>1.2
|
258
|
+
<tab/>
|
259
|
+
Clause 4.2</title>
|
260
|
+
<p>A
|
261
|
+
<fn reference="1">
|
262
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p></fn>
|
263
|
+
</p>
|
264
|
+
</clause>
|
265
|
+
</clause>
|
209
266
|
</sections>
|
210
|
-
|
211
|
-
|
267
|
+
</iso-standard>
|
212
268
|
INPUT
|
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
|
-
|
269
|
+
|
270
|
+
word = File.read("test.doc", encoding: "UTF-8")
|
271
|
+
.sub(/^.*An empty word intro page\./m, "")
|
272
|
+
.sub(%r{</div>.*$}m, "</div>")
|
273
|
+
|
274
|
+
expect(xmlpp("<div>#{word.gsub(/_Toc\d\d+/, '_Toc')}")).to be_equivalent_to xmlpp(<<~'OUTPUT')
|
275
|
+
<div>
|
276
|
+
<p class="MsoToc1">
|
277
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
278
|
+
<span style="mso-element:field-begin"/>
|
279
|
+
<span style="mso-spacerun:yes"> </span>TOC
|
280
|
+
\o "1-3" \h \z \u
|
281
|
+
<span style="mso-element:field-separator"/></span>
|
282
|
+
<span class="MsoHyperlink">
|
283
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
284
|
+
<a href="#_Toc">1 Clause 4
|
285
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
286
|
+
<span style="mso-tab-count:1 dotted">. </span></span>
|
287
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
288
|
+
<span style="mso-element:field-begin"/>
|
289
|
+
</span>
|
290
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">PAGEREF _Toc \h </span>
|
291
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
292
|
+
<span style="mso-element:field-separator"/>
|
293
|
+
</span>
|
294
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">1</span>
|
295
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB"/>
|
296
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
297
|
+
<span style="mso-element:field-end"/>
|
298
|
+
</span>
|
299
|
+
</a>
|
300
|
+
</span>
|
301
|
+
</span>
|
302
|
+
</p>
|
303
|
+
<p class="MsoToc2">
|
304
|
+
<span class="MsoHyperlink">
|
305
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
306
|
+
<a href="#_Toc">1.1 Introduction to this
|
307
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
308
|
+
<span style="mso-tab-count:1 dotted">. </span></span>
|
309
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
310
|
+
<span style="mso-element:field-begin"/>
|
311
|
+
</span>
|
312
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">PAGEREF _Toc \h </span>
|
313
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
314
|
+
<span style="mso-element:field-separator"/>
|
315
|
+
</span>
|
316
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">1</span>
|
317
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB"/>
|
318
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
319
|
+
<span style="mso-element:field-end"/>
|
320
|
+
</span>
|
321
|
+
</a>
|
322
|
+
</span>
|
323
|
+
</span>
|
324
|
+
</p>
|
325
|
+
<p class="MsoToc2">
|
326
|
+
<span class="MsoHyperlink">
|
327
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
328
|
+
<a href="#_Toc">1.2 Clause 4.2
|
329
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
330
|
+
<span style="mso-tab-count:1 dotted">. </span></span>
|
331
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
332
|
+
<span style="mso-element:field-begin"/>
|
333
|
+
</span>
|
334
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">PAGEREF _Toc \h </span>
|
335
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
336
|
+
<span style="mso-element:field-separator"/>
|
337
|
+
</span>
|
338
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">1</span>
|
339
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB"/>
|
340
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
341
|
+
<span style="mso-element:field-end"/>
|
342
|
+
</span>
|
343
|
+
</a>
|
344
|
+
</span>
|
345
|
+
</span>
|
346
|
+
</p>
|
347
|
+
<p class="MsoToc1">
|
348
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
349
|
+
<span style="mso-element:field-end"/>
|
350
|
+
</span>
|
351
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
352
|
+
<p class="MsoNormal"> </p>
|
353
|
+
</span>
|
354
|
+
</p>
|
355
|
+
<p class="MsoNormal"> </p>
|
356
|
+
</div>
|
267
357
|
OUTPUT
|
268
358
|
end
|
269
359
|
|
270
360
|
it "reorders footnote numbers" do
|
271
|
-
FileUtils.rm_f "test.html"
|
272
361
|
input = <<~INPUT
|
273
|
-
|
362
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
274
363
|
<sections>
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
</fn
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
</
|
288
|
-
|
364
|
+
<clause id="A" inline-header="false" obligation="normative">
|
365
|
+
<title>1
|
366
|
+
<tab/>
|
367
|
+
Clause 4</title>
|
368
|
+
<fn reference="3">
|
369
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">This is a footnote.</p>
|
370
|
+
</fn>
|
371
|
+
<clause id="N" inline-header="false" obligation="normative">
|
372
|
+
<title>1.1 <tab/>
|
373
|
+
Introduction to this
|
374
|
+
<fn reference="2">
|
375
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p></fn>
|
376
|
+
</title>
|
377
|
+
</clause>
|
378
|
+
<clause id="O" inline-header="false" obligation="normative">
|
379
|
+
<title>1.2 <tab/>
|
380
|
+
Clause 4.2</title>
|
381
|
+
<p>A
|
382
|
+
<fn reference="1">
|
383
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p></fn>
|
384
|
+
</p>
|
385
|
+
</clause>
|
386
|
+
</clause>
|
289
387
|
</sections>
|
290
|
-
|
388
|
+
</iso-standard>
|
291
389
|
INPUT
|
292
|
-
|
293
|
-
|
294
|
-
|
390
|
+
|
391
|
+
IsoDoc::Iso::HtmlConvert.new(WORD_HTML_CSS_WORDINTRO.dup).convert("test", input, false)
|
392
|
+
|
393
|
+
html = File.read("test.html", encoding: "UTF-8")
|
394
|
+
.sub(/^.*<main class="main-section">/m, '<main xmlns:epub="epub" class="main-section">')
|
395
|
+
.sub(%r{</main>.*$}m, "</main>")
|
396
|
+
|
295
397
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
398
|
+
<main class="main-section" xmlns:epub="epub">
|
399
|
+
<button id="myBtn" onclick="topFunction()" title="Go to top">Top</button>
|
400
|
+
<p class="zzSTDTitle1"/>
|
401
|
+
<div id="A">
|
402
|
+
<h1 id="toc0">1   Clause 4</h1>
|
403
|
+
<a class="FootnoteRef" href="#fn:3" id="fnref:1">
|
404
|
+
<sup>1)</sup>
|
405
|
+
</a>
|
406
|
+
<div id="N">
|
407
|
+
<h2 id="toc1">1.1   Introduction to this
|
408
|
+
<a class="FootnoteRef" href="#fn:2" id="fnref:2">
|
409
|
+
<sup>2)</sup></a>
|
410
|
+
</h2>
|
411
|
+
</div>
|
412
|
+
<div id="O">
|
413
|
+
<h2 id="toc2">1.2   Clause 4.2</h2>
|
414
|
+
<p>A
|
415
|
+
<a class="FootnoteRef" href="#fn:2">
|
416
|
+
<sup>2)</sup></a>
|
417
|
+
</p>
|
418
|
+
</div>
|
419
|
+
</div>
|
420
|
+
<aside class="footnote" id="fn:3">
|
421
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">
|
422
|
+
<a class="FootnoteRef" href="#fn:3">
|
423
|
+
<sup>1)</sup>
|
424
|
+
</a>This is a footnote.</p>
|
425
|
+
<a href="#fnref:1">↩</a>
|
426
|
+
</aside>
|
427
|
+
<aside class="footnote" id="fn:2">
|
428
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">
|
429
|
+
<a class="FootnoteRef" href="#fn:2">
|
430
|
+
<sup>2)</sup>
|
431
|
+
</a>Formerly denoted as 15 % (m/m).</p>
|
432
|
+
<a href="#fnref:2">↩</a>
|
433
|
+
</aside>
|
434
|
+
</main>
|
322
435
|
OUTPUT
|
323
436
|
|
324
|
-
|
325
|
-
|
326
|
-
html = File.read("test.doc", encoding: "UTF-8")
|
327
|
-
sub(
|
437
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS_WORDINTRO.dup).convert("test", input, false)
|
438
|
+
|
439
|
+
html = File.read("test.doc", encoding: "UTF-8")
|
440
|
+
.sub(/^.*<div class="WordSection3"/m, '<body xmlns:epub="epub"><div class="WordSection3"')
|
441
|
+
.sub(%r{</body>.*$}m, "</body>").gsub(/mso-bookmark:_Ref\d+/, "mso-bookmark:_Ref")
|
442
|
+
|
328
443
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
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
|
-
|
360
|
-
|
361
|
-
|
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
|
-
<div style='mso-element:footnote' id='ftn3'>
|
412
|
-
<p class='MsoFootnoteText'>
|
413
|
-
<a name='_ff27c067-2785-4551-96cf-0a73530ff1e6' id='_ff27c067-2785-4551-96cf-0a73530ff1e6'/>
|
414
|
-
<a style='mso-footnote-id:ftn3' href='#_ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
415
|
-
<span class='MsoFootnoteReference'>
|
416
|
-
<span style='mso-special-character:footnote'/>
|
417
|
-
</span>
|
418
|
-
<span class='MsoFootnoteReference'>)</span>
|
419
|
-
</a>
|
420
|
-
Formerly denoted as 15 % (m/m).
|
421
|
-
</p>
|
422
|
-
</div>
|
423
|
-
</div>
|
424
|
-
</body>
|
444
|
+
<body xmlns:epub="epub">
|
445
|
+
<div class="WordSection3">
|
446
|
+
<p class="zzSTDTitle1"/>
|
447
|
+
<div>
|
448
|
+
<a id="A" name="A"/>
|
449
|
+
<h1>1
|
450
|
+
<span style="mso-tab-count:1"> </span>
|
451
|
+
Clause 4</h1>
|
452
|
+
<span style="mso-bookmark:_Ref">
|
453
|
+
<a class="FootnoteRef" epub:type="footnote" href="#_ftn1" id="_ftnref1" name="_ftnref1" style="mso-footnote-id:ftn1" title="">
|
454
|
+
<span class="MsoFootnoteReference">
|
455
|
+
<span style="mso-special-character:footnote"/>
|
456
|
+
</span>
|
457
|
+
<span class="MsoFootnoteReference">)</span>
|
458
|
+
</a>
|
459
|
+
</span>
|
460
|
+
<div>
|
461
|
+
<a id="N" name="N"/>
|
462
|
+
<h2>1.1
|
463
|
+
<span style="mso-tab-count:1"> </span>
|
464
|
+
Introduction to this
|
465
|
+
<span style="mso-bookmark:_Ref">
|
466
|
+
<a class="FootnoteRef" epub:type="footnote" href="#_ftn2" id="_ftnref2" name="_ftnref2" style="mso-footnote-id:ftn2" title="">
|
467
|
+
<span class="MsoFootnoteReference">
|
468
|
+
<span style="mso-special-character:footnote"/></span>
|
469
|
+
<span class="MsoFootnoteReference">)</span>
|
470
|
+
</a>
|
471
|
+
</span>
|
472
|
+
</h2>
|
473
|
+
</div>
|
474
|
+
<div>
|
475
|
+
<a id="O" name="O"/>
|
476
|
+
<h2>1.2
|
477
|
+
<span style="mso-tab-count:1"> </span>
|
478
|
+
Clause 4.2</h2>
|
479
|
+
<p class="MsoNormal">A
|
480
|
+
<span style="mso-bookmark:_Ref">
|
481
|
+
<a class="FootnoteRef" epub:type="footnote" href="#_ftn3" id="_ftnref3" name="_ftnref3" style="mso-footnote-id:ftn3" title="">
|
482
|
+
<span class="MsoFootnoteReference">
|
483
|
+
<span style="mso-special-character:footnote"/></span>
|
484
|
+
<span class="MsoFootnoteReference">)</span>
|
485
|
+
</a>
|
486
|
+
</span>
|
487
|
+
</p>
|
488
|
+
</div>
|
489
|
+
</div>
|
490
|
+
</div>
|
491
|
+
<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
|
492
|
+
<div class="colophon"/>
|
493
|
+
<div style="mso-element:footnote-list">
|
494
|
+
<div id="ftn1" style="mso-element:footnote">
|
495
|
+
<p class="MsoFootnoteText">
|
496
|
+
<a id="_ff27c067-2785-4551-96cf-0a73530ff1e6" name="_ff27c067-2785-4551-96cf-0a73530ff1e6"/>
|
497
|
+
<a href="#_ftn1" id="_ftnref1" name="_ftnref1" style="mso-footnote-id:ftn1" title="">
|
498
|
+
<span class="MsoFootnoteReference">
|
499
|
+
<span style="mso-special-character:footnote"/>
|
500
|
+
</span>
|
501
|
+
<span class="MsoFootnoteReference">)</span>
|
502
|
+
</a>This is a footnote.</p>
|
503
|
+
</div>
|
504
|
+
<div id="ftn2" style="mso-element:footnote">
|
505
|
+
<p class="MsoFootnoteText">
|
506
|
+
<a id="_ff27c067-2785-4551-96cf-0a73530ff1e6" name="_ff27c067-2785-4551-96cf-0a73530ff1e6"/>
|
507
|
+
<a href="#_ftn2" id="_ftnref2" name="_ftnref2" style="mso-footnote-id:ftn2" title="">
|
508
|
+
<span class="MsoFootnoteReference">
|
509
|
+
<span style="mso-special-character:footnote"/>
|
510
|
+
</span>
|
511
|
+
<span class="MsoFootnoteReference">)</span>
|
512
|
+
</a>Formerly denoted as 15 % (m/m).</p>
|
513
|
+
</div>
|
514
|
+
<div id="ftn3" style="mso-element:footnote">
|
515
|
+
<p class="MsoFootnoteText">
|
516
|
+
<a id="_ff27c067-2785-4551-96cf-0a73530ff1e6" name="_ff27c067-2785-4551-96cf-0a73530ff1e6"/>
|
517
|
+
<a href="#_ftn3" id="_ftnref3" name="_ftnref3" style="mso-footnote-id:ftn3" title="">
|
518
|
+
<span class="MsoFootnoteReference">
|
519
|
+
<span style="mso-special-character:footnote"/>
|
520
|
+
</span>
|
521
|
+
<span class="MsoFootnoteReference">)</span>
|
522
|
+
</a>Formerly denoted as 15 % (m/m).</p>
|
523
|
+
</div>
|
524
|
+
</div>
|
525
|
+
</body>
|
425
526
|
OUTPUT
|
426
527
|
end
|
427
528
|
|
428
|
-
|
429
529
|
it "processes IsoXML terms for HTML" do
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
<
|
438
|
-
<
|
439
|
-
<
|
440
|
-
<
|
441
|
-
|
442
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
</termexample>
|
448
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
</termexample>
|
453
|
-
|
454
|
-
<
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
<
|
465
|
-
<
|
466
|
-
<
|
467
|
-
<
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
</
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
<
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
<
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
</
|
484
|
-
</
|
530
|
+
IsoDoc::Iso::HtmlConvert.new(WORD_HTML_CSS.dup).convert("test", <<~"INPUT", false)
|
531
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
532
|
+
<sections>
|
533
|
+
<terms id="_terms_and_definitions" obligation="normative">
|
534
|
+
<title>Terms and Definitions</title>
|
535
|
+
<term id="paddy1">
|
536
|
+
<name>1.1</name>
|
537
|
+
<preferred>paddy</preferred>
|
538
|
+
<domain>rice</domain>
|
539
|
+
<definition>
|
540
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
541
|
+
</definition>
|
542
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
543
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
544
|
+
<ul>
|
545
|
+
<li>A</li>
|
546
|
+
</ul>
|
547
|
+
</termexample>
|
548
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
549
|
+
<ul>
|
550
|
+
<li>A</li>
|
551
|
+
</ul>
|
552
|
+
</termexample>
|
553
|
+
<termsource status="modified">
|
554
|
+
<origin bibitemid="ISO7301" citeas="ISO 7301:2011" type="inline">
|
555
|
+
<locality type="clause">
|
556
|
+
<referenceFrom>3.1</referenceFrom>
|
557
|
+
</locality>
|
558
|
+
</origin>
|
559
|
+
<modification>
|
560
|
+
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
|
561
|
+
</modification>
|
562
|
+
</termsource>
|
563
|
+
</term>
|
564
|
+
<term id="paddy">
|
565
|
+
<name>1.2</name>
|
566
|
+
<preferred>paddy</preferred>
|
567
|
+
<admitted>paddy rice</admitted>
|
568
|
+
<admitted>rough rice</admitted>
|
569
|
+
<deprecates>cargo rice</deprecates>
|
570
|
+
<definition>
|
571
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
572
|
+
</definition>
|
573
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
|
574
|
+
<ul>
|
575
|
+
<li>A</li>
|
576
|
+
</ul>
|
577
|
+
</termexample>
|
578
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
|
579
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
580
|
+
</termnote>
|
581
|
+
<termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
|
582
|
+
<ul>
|
583
|
+
<li>A</li>
|
584
|
+
</ul>
|
585
|
+
<p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
|
586
|
+
</termnote>
|
587
|
+
<termsource status="identical">
|
588
|
+
<origin bibitemid="ISO7301" citeas="ISO 7301:2011" type="inline">
|
589
|
+
<locality type="clause">
|
590
|
+
<referenceFrom>3.1</referenceFrom>
|
591
|
+
</locality>
|
592
|
+
</origin>
|
593
|
+
</termsource>
|
594
|
+
</term>
|
595
|
+
</terms>
|
596
|
+
</sections>
|
597
|
+
</iso-standard>
|
485
598
|
INPUT
|
486
599
|
expect(File.exist?("test.html")).to be true
|
487
600
|
html = File.read("test.html", encoding: "UTF-8")
|
@@ -489,296 +602,360 @@ RSpec.describe IsoDoc do
|
|
489
602
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
|
490
603
|
end
|
491
604
|
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
</
|
504
|
-
</annex>
|
505
|
-
</iso-standard>
|
605
|
+
it "inserts default paragraph between two tables for Word" do
|
606
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("test", <<~"INPUT", false)
|
607
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
608
|
+
<annex id="P" inline-header="false" obligation="normative">
|
609
|
+
<example id="_63112cbc-cde0-435f-9553-e0b8c4f5851c">
|
610
|
+
<p id="_158d4efa-b1c9-4aec-b325-756de8e4c968">'1M', '01M', and '0001M' all describe the calendar month January.</p>
|
611
|
+
</example>
|
612
|
+
<example id="_63112cbc-cde0-435f-9553-e0b8c4f5851d">
|
613
|
+
<p id="_158d4efa-b1c9-4aec-b325-756de8e4c969">'2M', '02M', and '0002M' all describe the calendar month February.</p>
|
614
|
+
</example>
|
615
|
+
</annex>
|
616
|
+
</iso-standard>
|
506
617
|
INPUT
|
507
|
-
word = File.read("test.doc", encoding: "UTF-8")
|
508
|
-
sub(
|
618
|
+
word = File.read("test.doc", encoding: "UTF-8")
|
619
|
+
.sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
|
620
|
+
.sub(%r{<br[^>]*>\s*<div class="colophon".*$}m, "")
|
509
621
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
622
|
+
<div class="WordSection3">
|
623
|
+
<p class="zzSTDTitle1"/>
|
624
|
+
<p class="MsoNormal">
|
625
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
626
|
+
</p>
|
627
|
+
<div class="Section3">
|
628
|
+
<a id="P" name="P"/>
|
629
|
+
<div class="example">
|
630
|
+
<a id="_63112cbc-cde0-435f-9553-e0b8c4f5851c" name="_63112cbc-cde0-435f-9553-e0b8c4f5851c"/>
|
631
|
+
<p class="example">
|
632
|
+
<span style="mso-tab-count:1"> </span>'1M', '01M', and '0001M' all describe the calendar month January.</p>
|
633
|
+
</div>
|
634
|
+
<div class="example">
|
635
|
+
<a id="_63112cbc-cde0-435f-9553-e0b8c4f5851d" name="_63112cbc-cde0-435f-9553-e0b8c4f5851d"/>
|
636
|
+
<p class="example">
|
637
|
+
<span style="mso-tab-count:1"> </span>'2M', '02M', and '0002M' all describe the calendar month February.</p>
|
638
|
+
</div>
|
639
|
+
</div>
|
640
|
+
</div>
|
524
641
|
OUTPUT
|
525
642
|
end
|
526
643
|
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
IsoDoc::Iso::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
|
531
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
644
|
+
it "processes figure keys (Word)" do
|
645
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("test", <<~"INPUT", false)
|
646
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
532
647
|
<annex id="P" inline-header="false" obligation="normative">
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
648
|
+
<figure id="samplecode">
|
649
|
+
<p>Hello</p>
|
650
|
+
<p>Key</p>
|
651
|
+
<dl>
|
652
|
+
<dt>
|
653
|
+
<p>A</p>
|
654
|
+
</dt>
|
655
|
+
<dd>
|
656
|
+
<p>B</p>
|
657
|
+
</dd>
|
658
|
+
</dl>
|
659
|
+
</figure>
|
660
|
+
</annex>
|
661
|
+
</iso-standard>
|
543
662
|
INPUT
|
544
|
-
word = File.read("test.doc", encoding: "UTF-8")
|
545
|
-
sub(
|
663
|
+
word = File.read("test.doc", encoding: "UTF-8")
|
664
|
+
.sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">')
|
665
|
+
.sub(%r{<br[^>]*>\s*<div class="colophon".*$}m, "")
|
546
666
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
667
|
+
<div class="WordSection3">
|
668
|
+
<p class="zzSTDTitle1"/>
|
669
|
+
<p class="MsoNormal">
|
670
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
671
|
+
</p>
|
672
|
+
<div class="Section3">
|
673
|
+
<a id="P" name="P"/>
|
674
|
+
<div class="figure">
|
675
|
+
<a id="samplecode" name="samplecode"/>
|
676
|
+
<p class="MsoNormal">Hello</p>
|
677
|
+
<p class="MsoNormal">Key</p>
|
678
|
+
<p class="MsoNormal" style="page-break-after:avoid;">
|
679
|
+
<b>Key</b>
|
680
|
+
</p>
|
681
|
+
<div class="figdl" style="page-break-after:avoid;">
|
682
|
+
<table class="figdl">
|
683
|
+
<tr>
|
684
|
+
<td align="left" valign="top">
|
685
|
+
<p align="left" class="MsoNormal" style="margin-left:0pt;text-align:left;">
|
686
|
+
<p class="MsoNormal">A</p>
|
687
|
+
</p>
|
688
|
+
</td>
|
689
|
+
<td valign="top">
|
690
|
+
<p class="MsoNormal">B</p>
|
691
|
+
</td>
|
692
|
+
</tr>
|
693
|
+
</table>
|
694
|
+
</div>
|
695
|
+
<p class="FigureTitle" style="text-align:center;"/>
|
696
|
+
</div>
|
697
|
+
</div>
|
698
|
+
</div>
|
561
699
|
OUTPUT
|
562
700
|
end
|
563
701
|
|
564
|
-
|
565
|
-
|
566
|
-
|
702
|
+
it "processes boilerplate" do
|
703
|
+
input = <<~INPUT
|
704
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
567
705
|
<bibdata type="standard">
|
568
|
-
|
706
|
+
<status>
|
707
|
+
<stage>30</stage>
|
708
|
+
</status>
|
569
709
|
</bibdata>
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
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
|
-
relevant patent rights of which they are aware and to provide supporting
|
606
|
-
documentation.</p>
|
607
|
-
</clause>
|
608
|
-
</license-statement>
|
609
|
-
|
610
|
-
</boilerplate>
|
611
|
-
</iso-standard>
|
710
|
+
<boilerplate>
|
711
|
+
<copyright-statement>
|
712
|
+
<clause>
|
713
|
+
<p id="boilerplate-year">© ISO 2019, Published in Switzerland</p>
|
714
|
+
<p id="boilerplate-message">I am the Walrus.</p>
|
715
|
+
<p id="boilerplate-name">ISO copyright office</p>
|
716
|
+
<p align="left" id="boilerplate-address">ISO copyright office
|
717
|
+
<br/>
|
718
|
+
Ch. de Blandonnet 8 ?~@? CP 401
|
719
|
+
<br/>
|
720
|
+
CH-1214 Vernier, Geneva, Switzerland
|
721
|
+
<br/>
|
722
|
+
Tel. + 41 22 749 01 11
|
723
|
+
<br/>
|
724
|
+
Fax + 41 22 749 09 47
|
725
|
+
<br/>
|
726
|
+
copyright@iso.org
|
727
|
+
<br/>
|
728
|
+
www.iso.org</p>
|
729
|
+
</clause>
|
730
|
+
</copyright-statement>
|
731
|
+
<license-statement>
|
732
|
+
<clause>
|
733
|
+
<title>Warning for Stuff</title>
|
734
|
+
<p>This document is not an ISO International Standard. It is distributed for review and
|
735
|
+
comment. It is subject to change without notice and may not be referred to as
|
736
|
+
an International Standard.</p>
|
737
|
+
<p>Recipients
|
738
|
+
of this draft are invited to submit, with their comments, notification of any
|
739
|
+
relevant patent rights of which they are aware and to provide supporting
|
740
|
+
documentation.</p>
|
741
|
+
</clause>
|
742
|
+
</license-statement>
|
743
|
+
</boilerplate>
|
744
|
+
</iso-standard>
|
612
745
|
INPUT
|
613
746
|
|
614
747
|
presxml = <<~OUTPUT
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
</boilerplate>
|
660
|
-
</iso-standard>
|
748
|
+
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
749
|
+
<bibdata type="standard">
|
750
|
+
<status>
|
751
|
+
<stage language="">30</stage>
|
752
|
+
</status>
|
753
|
+
</bibdata>
|
754
|
+
<boilerplate>
|
755
|
+
<copyright-statement>
|
756
|
+
<clause inline-header="true">
|
757
|
+
<p id="boilerplate-year">© ISO 2019, Published in Switzerland
|
758
|
+
</p>
|
759
|
+
<p id="boilerplate-message">I am the Walrus.
|
760
|
+
</p>
|
761
|
+
<p id="boilerplate-name">ISO copyright office</p>
|
762
|
+
<p align="left" id="boilerplate-address">ISO copyright office
|
763
|
+
<br/>
|
764
|
+
Ch. de Blandonnet 8 ?~@? CP 401
|
765
|
+
<br/>
|
766
|
+
CH-1214 Vernier, Geneva, Switzerland
|
767
|
+
<br/>
|
768
|
+
Tel. + 41 22 749 01 11
|
769
|
+
<br/>
|
770
|
+
Fax + 41 22 749 09 47
|
771
|
+
<br/>
|
772
|
+
copyright@iso.org
|
773
|
+
<br/>
|
774
|
+
www.iso.org</p>
|
775
|
+
</clause>
|
776
|
+
</copyright-statement>
|
777
|
+
<license-statement>
|
778
|
+
<clause>
|
779
|
+
<title depth="1">Warning for Stuff</title>
|
780
|
+
<p>This document is not an ISO International Standard. It is distributed for review and
|
781
|
+
comment. It is subject to change without notice and may not be referred to as
|
782
|
+
an International Standard.</p>
|
783
|
+
<p>Recipients
|
784
|
+
of this draft are invited to submit, with their comments, notification of any
|
785
|
+
relevant patent rights of which they are aware and to provide supporting
|
786
|
+
documentation.</p>
|
787
|
+
</clause>
|
788
|
+
</license-statement>
|
789
|
+
</boilerplate>
|
790
|
+
</iso-standard>
|
661
791
|
OUTPUT
|
662
792
|
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
793
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new(WORD_HTML_CSS.dup)
|
794
|
+
.convert("test", input, true))
|
795
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
796
|
+
.to be_equivalent_to xmlpp(presxml)
|
797
|
+
|
798
|
+
IsoDoc::Iso::HtmlConvert.new(WORD_HTML_CSS.dup).convert("test", presxml, false)
|
799
|
+
|
667
800
|
word = File.read("test.html", encoding: "UTF-8")
|
668
801
|
expect((word)).to include '<h1 class="IntroTitle">Warning for Stuff</h1>'
|
669
802
|
expect((word)).to include "I am the Walrus."
|
670
|
-
|
803
|
+
|
804
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("test", presxml, false)
|
671
805
|
word = File.read("test.doc", encoding: "UTF-8")
|
672
|
-
expect(xmlpp(word
|
673
|
-
<div class=
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
<p style='text-align:left;' align='left' class='zzAddress'>
|
688
|
-
<a name='boilerplate-address' id='boilerplate-address'/>
|
689
|
-
ISO copyright office
|
690
|
-
<br/>
|
806
|
+
expect(xmlpp(word
|
807
|
+
.sub(%r{^.*<div class="boilerplate-copyright">}m, '<div class="boilerplate-copyright">')
|
808
|
+
.sub(%r{</div>.*$}m, "</div></div>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
809
|
+
<div class="boilerplate-copyright">
|
810
|
+
<div>
|
811
|
+
<p class="zzCopyright">
|
812
|
+
<a id="boilerplate-year" name="boilerplate-year"/>© ISO 2019, Published in Switzerland#{' '}</p>
|
813
|
+
<p class="zzCopyright1">
|
814
|
+
<a id="boilerplate-message" name="boilerplate-message"/>I am the Walrus.#{' '}</p>
|
815
|
+
<p class="zzCopyright">
|
816
|
+
<a id="boilerplate-name" name="boilerplate-name"/>ISO copyright office</p>
|
817
|
+
<p align="left" class="zzAddress" style="text-align:left;">
|
818
|
+
<a id="boilerplate-address" name="boilerplate-address"/>ISO copyright office
|
819
|
+
|
820
|
+
<br/>
|
691
821
|
Ch. de Blandonnet 8 ?~@? CP 401
|
692
|
-
|
822
|
+
|
823
|
+
<br/>
|
693
824
|
CH-1214 Vernier, Geneva, Switzerland
|
694
|
-
|
825
|
+
|
826
|
+
<br/>
|
695
827
|
Tel. + 41 22 749 01 11
|
696
|
-
|
828
|
+
|
829
|
+
<br/>
|
697
830
|
Fax + 41 22 749 09 47
|
698
|
-
|
831
|
+
|
832
|
+
<br/>
|
699
833
|
copyright@iso.org
|
700
|
-
<br/>
|
701
|
-
www.iso.org
|
702
|
-
</p>
|
703
|
-
</div>
|
704
|
-
</div>
|
705
|
-
OUTPUT
|
706
|
-
expect(word).to include '<p class="zzWarning">This document is not an ISO International Standard'
|
707
|
-
end
|
708
834
|
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
835
|
+
<br/>
|
836
|
+
www.iso.org#{' '}</p>
|
837
|
+
</div>
|
838
|
+
</div>
|
839
|
+
OUTPUT
|
840
|
+
expect(word).to include '<p class="zzWarning">This document is not an ISO International Standard'
|
841
|
+
end
|
842
|
+
|
843
|
+
it "populates Word ToC" do
|
844
|
+
IsoDoc::WordConvert.new(WORD_HTML_CSS_WORDINTRO.dup).convert("test", <<~"INPUT", false)
|
845
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
713
846
|
<sections>
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
</
|
724
|
-
<clause id="
|
725
|
-
<title>Clause 4.2
|
726
|
-
|
727
|
-
|
847
|
+
<clause id="A" inline-header="false" obligation="normative">
|
848
|
+
<title>Clause 4</title>
|
849
|
+
<clause id="N" inline-header="false" obligation="normative">
|
850
|
+
<title>Introduction
|
851
|
+
<bookmark id="Q"/>
|
852
|
+
to this
|
853
|
+
<fn reference="1">
|
854
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p></fn>
|
855
|
+
</title>
|
856
|
+
</clause>
|
857
|
+
<clause id="O" inline-header="false" obligation="normative">
|
858
|
+
<title>Clause 4.2</title>
|
859
|
+
<p>A
|
860
|
+
<fn reference="1">
|
861
|
+
<p id="_ff27c067-2785-4551-96cf-0a73530ff1e6">Formerly denoted as 15 % (m/m).</p></fn>
|
862
|
+
</p>
|
863
|
+
<clause id="P" inline-header="false" obligation="normative">
|
864
|
+
<title>Clause 4.2.1</title>
|
865
|
+
</clause>
|
866
|
+
</clause>
|
867
|
+
</clause>
|
728
868
|
</sections>
|
729
|
-
|
869
|
+
</iso-standard>
|
730
870
|
INPUT
|
731
|
-
word = File.read("test.doc")
|
732
|
-
sub(
|
871
|
+
word = File.read("test.doc")
|
872
|
+
.sub(/^.*<div class="WordSection2">/m, '<div class="WordSection2">')
|
873
|
+
.sub(%r{<p class="MsoNormal">\s*<br clear="all" class="section"/>\s*</p>\s*<div class="WordSection3">.*$}m, "")
|
874
|
+
|
733
875
|
expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc"))).to be_equivalent_to xmlpp(<<~'OUTPUT')
|
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
|
-
<span
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
876
|
+
<div class="WordSection2">An empty word intro page.
|
877
|
+
<p class="MsoToc1">
|
878
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
879
|
+
<span style="mso-element:field-begin"/>
|
880
|
+
<span style="mso-spacerun:yes"> </span>
|
881
|
+
TOC
|
882
|
+
\o "1-2" \h \z \u
|
883
|
+
<span style="mso-element:field-separator"/></span>
|
884
|
+
<span class="MsoHyperlink">
|
885
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
886
|
+
<a href="#_Toc">Clause 4
|
887
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
888
|
+
<span style="mso-tab-count:1 dotted">. </span></span>
|
889
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
890
|
+
<span style="mso-element:field-begin"/>
|
891
|
+
</span>
|
892
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">PAGEREF _Toc \h </span>
|
893
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
894
|
+
<span style="mso-element:field-separator"/>
|
895
|
+
</span>
|
896
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">1</span>
|
897
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB"/>
|
898
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
899
|
+
<span style="mso-element:field-end"/>
|
900
|
+
</span>
|
901
|
+
</a>
|
902
|
+
</span>
|
903
|
+
</span>
|
904
|
+
</p>
|
905
|
+
<p class="MsoToc2">
|
906
|
+
<span class="MsoHyperlink">
|
907
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
908
|
+
<a href="#_Toc">Introduction to this
|
909
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
910
|
+
<span style="mso-tab-count:1 dotted">. </span></span>
|
911
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
912
|
+
<span style="mso-element:field-begin"/>
|
913
|
+
</span>
|
914
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">PAGEREF _Toc \h </span>
|
915
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
916
|
+
<span style="mso-element:field-separator"/>
|
917
|
+
</span>
|
918
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">1</span>
|
919
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB"/>
|
920
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
921
|
+
<span style="mso-element:field-end"/>
|
922
|
+
</span>
|
923
|
+
</a>
|
924
|
+
</span>
|
925
|
+
</span>
|
926
|
+
</p>
|
927
|
+
<p class="MsoToc2">
|
928
|
+
<span class="MsoHyperlink">
|
929
|
+
<span lang="EN-GB" style="mso-no-proof:yes" xml:lang="EN-GB">
|
930
|
+
<a href="#_Toc">Clause 4.2
|
931
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
932
|
+
<span style="mso-tab-count:1 dotted">. </span></span>
|
933
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
934
|
+
<span style="mso-element:field-begin"/>
|
935
|
+
</span>
|
936
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">PAGEREF _Toc \h </span>
|
937
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
938
|
+
<span style="mso-element:field-separator"/>
|
939
|
+
</span>
|
940
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">1</span>
|
941
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB"/>
|
942
|
+
<span class="MsoTocTextSpan" lang="EN-GB" xml:lang="EN-GB">
|
943
|
+
<span style="mso-element:field-end"/>
|
944
|
+
</span>
|
945
|
+
</a>
|
946
|
+
</span>
|
947
|
+
</span>
|
948
|
+
</p>
|
949
|
+
<p class="MsoToc1">
|
950
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
951
|
+
<span style="mso-element:field-end"/>
|
952
|
+
</span>
|
953
|
+
<span lang="EN-GB" xml:lang="EN-GB">
|
954
|
+
<p class="MsoNormal"> </p>
|
955
|
+
</span>
|
956
|
+
</p>
|
957
|
+
<p class="MsoNormal"> </p>
|
958
|
+
</div>
|
781
959
|
OUTPUT
|
782
960
|
end
|
783
|
-
|
784
961
|
end
|