metanorma-iso 1.5.14 → 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/.github/workflows/rake.yml +17 -0
- data/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +13 -13
- data/lib/asciidoctor/iso/basicdoc.rng +20 -3
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/front.rb +5 -5
- data/lib/asciidoctor/iso/isodoc.rng +118 -4
- data/lib/asciidoctor/iso/isostandard-amd.rng +11 -4
- data/lib/asciidoctor/iso/isostandard.rng +22 -10
- data/lib/asciidoctor/iso/validate.rb +78 -0
- data/lib/asciidoctor/iso/validate_section.rb +12 -9
- 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 +2 -0
- data/lib/isodoc/iso/i18n-fr.yaml +1 -1
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +451 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +451 -208
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/isodoc/iso/word_convert.rb +2 -2
- data/lib/isodoc/iso/xref.rb +28 -12
- data/lib/metanorma/iso/processor.rb +11 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -2
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +449 -458
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +814 -699
- 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 +1223 -919
- 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 +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 +184 -189
- metadata +7 -10
- data/.rubocop.ribose.yml +0 -66
- data/lib/metanorma/iso/fonts_manifest.yaml +0 -6
- 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,403 +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
|
-
|
97
|
-
IsoDoc::Iso::PdfConvert.new(
|
112
|
+
it "generates Pdf output docs with null configuration from file" do
|
113
|
+
mock_pdf
|
114
|
+
IsoDoc::Iso::PdfConvert.new(WORD_HTML_CSS.dup).convert("spec/assets/iso.xml", nil, false)
|
98
115
|
expect(File.exist?("spec/assets/iso.pdf")).to be true
|
99
116
|
end
|
100
117
|
|
101
118
|
it "converts annex subheadings to h2Annex class for Word" do
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
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>
|
116
135
|
INPUT
|
117
|
-
|
118
|
-
|
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
|
+
|
119
141
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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>
|
133
164
|
OUTPUT
|
134
165
|
end
|
135
166
|
|
136
167
|
it "populates Word template with terms reference labels" do
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
<term id="paddy1">
|
145
|
-
<name>1.1</name>
|
146
|
-
<preferred>paddy</preferred>
|
147
|
-
<definition
|
148
|
-
<
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
</
|
154
|
-
|
155
|
-
|
156
|
-
</
|
157
|
-
</
|
158
|
-
|
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>
|
159
194
|
INPUT
|
160
|
-
|
161
|
-
|
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
|
+
|
162
200
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
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>
|
170
218
|
OUTPUT
|
171
219
|
end
|
172
220
|
|
173
221
|
it "populates Word header" do
|
174
|
-
|
175
|
-
|
176
|
-
<
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
</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>
|
181
228
|
</bibdata>
|
182
|
-
</iso-standard>
|
183
|
-
|
229
|
+
</iso-standard>
|
184
230
|
INPUT
|
185
|
-
word = File.read("test.doc", encoding: "UTF-8")
|
186
|
-
sub(
|
187
|
-
|
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, "")
|
188
235
|
expect(word).to include(%{Content-Location: file:///C:/Doc/test_files/header.html})
|
189
236
|
end
|
190
237
|
|
191
238
|
it "populates Word ToC" do
|
192
|
-
|
193
|
-
|
194
|
-
<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">
|
195
241
|
<sections>
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
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>
|
208
266
|
</sections>
|
209
|
-
|
210
|
-
|
267
|
+
</iso-standard>
|
211
268
|
INPUT
|
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
|
-
|
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>
|
266
357
|
OUTPUT
|
267
358
|
end
|
268
359
|
|
269
360
|
it "reorders footnote numbers" do
|
270
|
-
FileUtils.rm_f "test.html"
|
271
361
|
input = <<~INPUT
|
272
|
-
|
362
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
273
363
|
<sections>
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
</fn
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
</
|
287
|
-
|
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>
|
288
387
|
</sections>
|
289
|
-
|
388
|
+
</iso-standard>
|
290
389
|
INPUT
|
291
|
-
|
292
|
-
|
293
|
-
|
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
|
+
|
294
397
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
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>
|
321
435
|
OUTPUT
|
322
436
|
|
323
|
-
|
324
|
-
|
325
|
-
html = File.read("test.doc", encoding: "UTF-8")
|
326
|
-
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
|
+
|
327
443
|
expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
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
|
-
|
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
|
-
<div style='mso-element:footnote' id='ftn3'>
|
411
|
-
<p class='MsoFootnoteText'>
|
412
|
-
<a name='_ff27c067-2785-4551-96cf-0a73530ff1e6' id='_ff27c067-2785-4551-96cf-0a73530ff1e6'/>
|
413
|
-
<a style='mso-footnote-id:ftn3' href='#_ftn3' name='_ftnref3' title='' id='_ftnref3'>
|
414
|
-
<span class='MsoFootnoteReference'>
|
415
|
-
<span style='mso-special-character:footnote'/>
|
416
|
-
</span>
|
417
|
-
<span class='MsoFootnoteReference'>)</span>
|
418
|
-
</a>
|
419
|
-
Formerly denoted as 15 % (m/m).
|
420
|
-
</p>
|
421
|
-
</div>
|
422
|
-
</div>
|
423
|
-
</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>
|
424
526
|
OUTPUT
|
425
527
|
end
|
426
528
|
|
427
|
-
|
428
529
|
it "processes IsoXML terms for HTML" do
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
<
|
437
|
-
<
|
438
|
-
<
|
439
|
-
<
|
440
|
-
|
441
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
</termexample>
|
447
|
-
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
</termexample>
|
452
|
-
|
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
|
-
</
|
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>
|
484
598
|
INPUT
|
485
599
|
expect(File.exist?("test.html")).to be true
|
486
600
|
html = File.read("test.html", encoding: "UTF-8")
|
@@ -488,296 +602,360 @@ RSpec.describe IsoDoc do
|
|
488
602
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
|
489
603
|
end
|
490
604
|
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
</
|
503
|
-
</annex>
|
504
|
-
</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>
|
505
617
|
INPUT
|
506
|
-
word = File.read("test.doc", encoding: "UTF-8")
|
507
|
-
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, "")
|
508
621
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
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>
|
523
641
|
OUTPUT
|
524
642
|
end
|
525
643
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
IsoDoc::Iso::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
|
530
|
-
<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">
|
531
647
|
<annex id="P" inline-header="false" obligation="normative">
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
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>
|
542
662
|
INPUT
|
543
|
-
word = File.read("test.doc", encoding: "UTF-8")
|
544
|
-
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, "")
|
545
666
|
expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
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>
|
560
699
|
OUTPUT
|
561
700
|
end
|
562
701
|
|
563
|
-
|
564
|
-
|
565
|
-
|
702
|
+
it "processes boilerplate" do
|
703
|
+
input = <<~INPUT
|
704
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
566
705
|
<bibdata type="standard">
|
567
|
-
|
706
|
+
<status>
|
707
|
+
<stage>30</stage>
|
708
|
+
</status>
|
568
709
|
</bibdata>
|
569
|
-
|
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
|
-
relevant patent rights of which they are aware and to provide supporting
|
605
|
-
documentation.</p>
|
606
|
-
</clause>
|
607
|
-
</license-statement>
|
608
|
-
|
609
|
-
</boilerplate>
|
610
|
-
</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>
|
611
745
|
INPUT
|
612
746
|
|
613
747
|
presxml = <<~OUTPUT
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
</boilerplate>
|
659
|
-
</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>
|
660
791
|
OUTPUT
|
661
792
|
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
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
|
+
|
666
800
|
word = File.read("test.html", encoding: "UTF-8")
|
667
801
|
expect((word)).to include '<h1 class="IntroTitle">Warning for Stuff</h1>'
|
668
802
|
expect((word)).to include "I am the Walrus."
|
669
|
-
|
803
|
+
|
804
|
+
IsoDoc::Iso::WordConvert.new(WORD_HTML_CSS.dup).convert("test", presxml, false)
|
670
805
|
word = File.read("test.doc", encoding: "UTF-8")
|
671
|
-
expect(xmlpp(word
|
672
|
-
<div class=
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
<p style='text-align:left;' align='left' class='zzAddress'>
|
687
|
-
<a name='boilerplate-address' id='boilerplate-address'/>
|
688
|
-
ISO copyright office
|
689
|
-
<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/>
|
690
821
|
Ch. de Blandonnet 8 ?~@? CP 401
|
691
|
-
|
822
|
+
|
823
|
+
<br/>
|
692
824
|
CH-1214 Vernier, Geneva, Switzerland
|
693
|
-
|
825
|
+
|
826
|
+
<br/>
|
694
827
|
Tel. + 41 22 749 01 11
|
695
|
-
|
828
|
+
|
829
|
+
<br/>
|
696
830
|
Fax + 41 22 749 09 47
|
697
|
-
|
831
|
+
|
832
|
+
<br/>
|
698
833
|
copyright@iso.org
|
699
|
-
<br/>
|
700
|
-
www.iso.org
|
701
|
-
</p>
|
702
|
-
</div>
|
703
|
-
</div>
|
704
|
-
OUTPUT
|
705
|
-
expect(word).to include '<p class="zzWarning">This document is not an ISO International Standard'
|
706
|
-
end
|
707
834
|
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
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">
|
712
846
|
<sections>
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
</
|
723
|
-
<clause id="
|
724
|
-
<title>Clause 4.2
|
725
|
-
|
726
|
-
|
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>
|
727
868
|
</sections>
|
728
|
-
|
869
|
+
</iso-standard>
|
729
870
|
INPUT
|
730
|
-
word = File.read("test.doc")
|
731
|
-
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
|
+
|
732
875
|
expect(xmlpp(word.gsub(/_Toc\d\d+/, "_Toc"))).to be_equivalent_to xmlpp(<<~'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
|
-
<span
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
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>
|
780
959
|
OUTPUT
|
781
960
|
end
|
782
|
-
|
783
961
|
end
|