metanorma-iso 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/iso/base.rb +12 -12
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/front.rb +1 -1
- data/lib/asciidoctor/iso/front_id.rb +30 -25
- data/lib/asciidoctor/iso/isodoc.rng +235 -3
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +17 -97
- data/lib/asciidoctor/iso/validate.rb +1 -0
- data/lib/asciidoctor/iso/validate_title.rb +21 -13
- data/lib/isodoc/iso/base_convert.rb +11 -0
- data/lib/isodoc/iso/html/style-human.css +7 -0
- data/lib/isodoc/iso/html/style-iso.css +7 -0
- data/lib/isodoc/iso/html_convert.rb +0 -1
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1010 -324
- data/lib/isodoc/iso/iso.international-standard.xsl +1010 -324
- data/lib/isodoc/iso/presentation_xml_convert.rb +32 -25
- data/lib/isodoc/iso/word_convert.rb +0 -1
- data/lib/isodoc/iso/xref.rb +13 -5
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +8 -8
- data/spec/asciidoctor/amd_spec.rb +696 -0
- data/spec/asciidoctor/base_spec.rb +704 -0
- data/spec/asciidoctor/blocks_spec.rb +527 -0
- data/spec/asciidoctor/cleanup_spec.rb +1134 -0
- data/spec/asciidoctor/inline_spec.rb +195 -0
- data/spec/asciidoctor/lists_spec.rb +197 -0
- data/spec/asciidoctor/refs_spec.rb +375 -0
- data/spec/asciidoctor/section_spec.rb +393 -0
- data/spec/asciidoctor/table_spec.rb +329 -0
- data/spec/asciidoctor/validate_spec.rb +1572 -0
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +837 -657
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +821 -519
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +186 -189
- metadata +65 -67
- data/.rubocop.ribose.yml +0 -66
- data/lib/isodoc/iso/html/scripts.html +0 -178
- data/spec/asciidoctor-iso/amd_spec.rb +0 -694
- data/spec/asciidoctor-iso/base_spec.rb +0 -713
- data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
- data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
- data/spec/asciidoctor-iso/inline_spec.rb +0 -170
- data/spec/asciidoctor-iso/lists_spec.rb +0 -190
- data/spec/asciidoctor-iso/refs_spec.rb +0 -317
- data/spec/asciidoctor-iso/section_spec.rb +0 -362
- data/spec/asciidoctor-iso/table_spec.rb +0 -313
- data/spec/asciidoctor-iso/validate_spec.rb +0 -1619
- data/spec/assets/xref_error.adoc +0 -7
data/spec/isodoc/section_spec.rb
CHANGED
@@ -4,572 +4,874 @@ RSpec.describe IsoDoc do
|
|
4
4
|
it "processes section names" do
|
5
5
|
input = <<~INPUT
|
6
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
7
|
+
<preface>
|
8
|
+
<foreword obligation="informative">
|
9
|
+
<title>Foreword</title>
|
10
|
+
<p id="A">This is a preamble</p>
|
11
|
+
</foreword>
|
12
|
+
<introduction id="B" obligation="informative">
|
13
|
+
<title>Introduction</title>
|
14
|
+
<clause id="C" inline-header="false" obligation="informative">
|
15
|
+
<title>Introduction Subsection</title>
|
16
|
+
</clause>
|
17
|
+
<p>This is patent boilerplate</p>
|
18
|
+
</introduction>
|
19
|
+
</preface>
|
20
|
+
<sections>
|
21
|
+
<clause id="D" obligation="normative" type="scope">
|
22
|
+
<title>Scope</title>
|
23
|
+
<p id="E">Text</p>
|
24
|
+
</clause>
|
25
|
+
<clause id="H" obligation="normative">
|
26
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
27
|
+
<terms id="I" obligation="normative">
|
28
|
+
<title>Normal Terms</title>
|
29
|
+
<term id="J">
|
30
|
+
<preferred>Term2</preferred>
|
31
|
+
</term>
|
32
|
+
</terms>
|
33
|
+
<definitions id="K">
|
34
|
+
<dl>
|
35
|
+
<dt>Symbol</dt>
|
36
|
+
<dd>Definition</dd>
|
37
|
+
</dl>
|
38
|
+
</definitions>
|
39
|
+
</clause>
|
40
|
+
<definitions id="L">
|
41
|
+
<dl>
|
42
|
+
<dt>Symbol</dt>
|
43
|
+
<dd>Definition</dd>
|
44
|
+
</dl>
|
45
|
+
</definitions>
|
46
|
+
<clause id="M" inline-header="false" obligation="normative">
|
47
|
+
<title>Clause 4</title>
|
48
|
+
<clause id="N" inline-header="false" obligation="normative">
|
49
|
+
<title>Introduction</title>
|
50
|
+
</clause>
|
51
|
+
<clause id="O" inline-header="false" obligation="normative">
|
52
|
+
<title>Clause 4.2</title>
|
53
|
+
</clause>
|
54
|
+
</clause>
|
55
|
+
</sections>
|
56
|
+
<annex id="P" inline-header="false" obligation="normative">
|
57
|
+
<title>Annex</title>
|
58
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
59
|
+
<title>Annex A.1</title>
|
60
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
61
|
+
<title>Annex A.1a</title>
|
62
|
+
</clause>
|
63
|
+
</clause>
|
64
|
+
<appendix id="Q2" inline-header="false" obligation="normative">
|
65
|
+
<title>An Appendix</title>
|
66
|
+
<clause id="Q2a" inline-header="false" obligation="normative">
|
67
|
+
<title>Appendix subclause</title>
|
68
|
+
</clause>
|
69
|
+
</appendix>
|
70
|
+
<references id="Q3" normative="false">
|
71
|
+
<title>Annex Bibliography</title>
|
72
|
+
</references>
|
73
|
+
</annex>
|
74
|
+
<bibliography>
|
75
|
+
<references id="R" normative="true" obligation="informative">
|
76
|
+
<title>Normative References</title>
|
77
|
+
</references>
|
78
|
+
<clause id="S" obligation="informative">
|
79
|
+
<title>Bibliography</title>
|
80
|
+
<references id="T" normative="false" obligation="informative">
|
81
|
+
<title>Bibliography Subsection</title>
|
82
|
+
</references>
|
83
|
+
</clause>
|
84
|
+
</bibliography>
|
85
|
+
</iso-standard>
|
73
86
|
INPUT
|
74
87
|
|
75
88
|
presxml = <<~OUTPUT
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
</clause>
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
89
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
90
|
+
<preface>
|
91
|
+
<foreword obligation='informative'>
|
92
|
+
<title>Foreword</title>
|
93
|
+
<p id='A'>This is a preamble</p>
|
94
|
+
</foreword>
|
95
|
+
<introduction id='B' obligation='informative'>
|
96
|
+
<title depth='1'>0<tab/>Introduction</title>
|
97
|
+
<clause id='C' inline-header='false' obligation='informative'>
|
98
|
+
<title depth='2'>0.1<tab/>Introduction Subsection</title>
|
99
|
+
</clause>
|
100
|
+
<p>This is patent boilerplate</p>
|
101
|
+
</introduction>
|
102
|
+
</preface>
|
103
|
+
<sections>
|
104
|
+
<clause id='D' obligation='normative' type="scope">
|
105
|
+
<title depth='1'>1<tab/>Scope</title>
|
106
|
+
<p id='E'>Text</p>
|
107
|
+
</clause>
|
108
|
+
<clause id='H' obligation='normative'>
|
109
|
+
<title depth='1'>3<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
110
|
+
<terms id='I' obligation='normative'>
|
111
|
+
<title depth='2'>3.1<tab/>Normal Terms</title>
|
112
|
+
<term id='J'>
|
113
|
+
<name>3.1.1</name>
|
114
|
+
<preferred>Term2</preferred>
|
115
|
+
</term>
|
116
|
+
</terms>
|
117
|
+
<definitions id='K' inline-header='true'>
|
118
|
+
<title>3.2</title>
|
119
|
+
<dl>
|
120
|
+
<dt>Symbol</dt>
|
121
|
+
<dd>Definition</dd>
|
122
|
+
</dl>
|
123
|
+
</definitions>
|
124
|
+
</clause>
|
125
|
+
<definitions id='L'>
|
126
|
+
<title>4</title>
|
127
|
+
<dl>
|
128
|
+
<dt>Symbol</dt>
|
129
|
+
<dd>Definition</dd>
|
130
|
+
</dl>
|
131
|
+
</definitions>
|
132
|
+
<clause id='M' inline-header='false' obligation='normative'>
|
133
|
+
<title depth='1'>5<tab/>Clause 4</title>
|
134
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
135
|
+
<title depth='2'>5.1<tab/>Introduction</title>
|
136
|
+
</clause>
|
137
|
+
<clause id='O' inline-header='false' obligation='normative'>
|
138
|
+
<title depth='2'>5.2<tab/>Clause 4.2</title>
|
139
|
+
</clause>
|
140
|
+
</clause>
|
141
|
+
</sections>
|
142
|
+
<annex id='P' inline-header='false' obligation='normative'>
|
143
|
+
<title>
|
144
|
+
<strong>Annex A</strong>
|
145
|
+
<br/>
|
146
|
+
(normative)
|
147
|
+
<br/>
|
148
|
+
<br/>
|
149
|
+
<strong>Annex</strong>
|
150
|
+
</title>
|
151
|
+
<clause id='Q' inline-header='false' obligation='normative'>
|
152
|
+
<title depth='2'>A.1<tab/>Annex A.1</title>
|
153
|
+
<clause id='Q1' inline-header='false' obligation='normative'>
|
154
|
+
<title depth='3'>A.1.1<tab/>Annex A.1a</title>
|
155
|
+
</clause>
|
156
|
+
</clause>
|
157
|
+
<appendix id='Q2' inline-header='false' obligation='normative'>
|
158
|
+
<title depth='2'>Appendix 1<tab/>An Appendix</title>
|
159
|
+
<clause id='Q2a' inline-header='false' obligation='normative'>
|
160
|
+
<title depth='3'>
|
161
|
+
Appendix 1.1
|
162
|
+
<tab/>
|
163
|
+
Appendix subclause
|
164
|
+
</title>
|
165
|
+
</clause>
|
166
|
+
</appendix>
|
167
|
+
<references id='Q3' normative='false'>
|
168
|
+
<title depth='2'>A.2<tab/>Annex Bibliography</title>
|
169
|
+
</references>
|
170
|
+
</annex>
|
171
|
+
<bibliography>
|
172
|
+
<references id='R' obligation='informative' normative='true'>
|
173
|
+
<title depth='1'>2<tab/>Normative References</title>
|
174
|
+
</references>
|
175
|
+
<clause id='S' obligation='informative'>
|
176
|
+
<title depth='1'>Bibliography</title>
|
177
|
+
<references id='T' obligation='informative' normative='false'>
|
178
|
+
<title depth='2'>Bibliography Subsection</title>
|
179
|
+
</references>
|
180
|
+
</clause>
|
181
|
+
</bibliography>
|
182
|
+
</iso-standard>
|
183
|
+
OUTPUT
|
171
184
|
|
172
185
|
html = <<~OUTPUT
|
173
|
-
|
186
|
+
#{HTML_HDR}
|
187
|
+
<br/>
|
188
|
+
<div>
|
189
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
190
|
+
<p id="A">This is a preamble</p>
|
191
|
+
</div>
|
192
|
+
<br/>
|
193
|
+
<div class="Section3" id="B">
|
194
|
+
<h1 class="IntroTitle">0  Introduction</h1>
|
195
|
+
<div id="C">
|
196
|
+
<h2>0.1  Introduction Subsection</h2>
|
197
|
+
</div>
|
198
|
+
<p>This is patent boilerplate</p>
|
199
|
+
</div>
|
200
|
+
<p class="zzSTDTitle1"/>
|
201
|
+
<div id="D">
|
202
|
+
<h1>1  Scope</h1>
|
203
|
+
<p id="E">Text</p>
|
204
|
+
</div>
|
205
|
+
<div>
|
206
|
+
<h1>2  Normative References</h1>
|
207
|
+
</div>
|
208
|
+
<div id="H">
|
209
|
+
<h1>3  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
210
|
+
<div id="I">
|
211
|
+
<h2>3.1  Normal Terms</h2>
|
212
|
+
<p class="TermNum" id="J">3.1.1</p>
|
213
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
214
|
+
</div>
|
215
|
+
<div id="K">
|
216
|
+
<span class="zzMoveToFollowing">
|
217
|
+
<b>3.2  </b>
|
218
|
+
</span>
|
219
|
+
<dl>
|
220
|
+
<dt>
|
221
|
+
<p>Symbol</p>
|
222
|
+
</dt>
|
223
|
+
<dd>Definition</dd>
|
224
|
+
</dl>
|
225
|
+
</div>
|
226
|
+
</div>
|
227
|
+
<div class="Symbols" id="L">
|
228
|
+
<h1>4</h1>
|
229
|
+
<dl>
|
230
|
+
<dt>
|
231
|
+
<p>Symbol</p>
|
232
|
+
</dt>
|
233
|
+
<dd>Definition</dd>
|
234
|
+
</dl>
|
235
|
+
</div>
|
236
|
+
<div id="M">
|
237
|
+
<h1>5  Clause 4</h1>
|
238
|
+
<div id="N">
|
239
|
+
<h2>5.1  Introduction</h2>
|
240
|
+
</div>
|
241
|
+
<div id="O">
|
242
|
+
<h2>5.2  Clause 4.2</h2>
|
243
|
+
</div>
|
244
|
+
</div>
|
245
|
+
<br/>
|
246
|
+
<div class="Section3" id="P">
|
247
|
+
<h1 class="Annex">
|
248
|
+
<b>Annex A</b>
|
249
|
+
<br/>(normative)
|
174
250
|
<br/>
|
175
|
-
<div>
|
176
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
177
|
-
<p id="A">This is a preamble</p>
|
178
|
-
</div>
|
179
251
|
<br/>
|
180
|
-
<
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
<p>This is patent boilerplate</p>
|
186
|
-
</div>
|
187
|
-
<p class="zzSTDTitle1"/>
|
188
|
-
<div id="D">
|
189
|
-
<h1>1  Scope</h1>
|
190
|
-
<p id="E">Text</p>
|
191
|
-
</div>
|
192
|
-
<div>
|
193
|
-
<h1>2  Normative References</h1>
|
194
|
-
</div>
|
195
|
-
<div id="H"><h1>3  Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
196
|
-
<div id="I">
|
197
|
-
<h2>3.1  Normal Terms</h2>
|
198
|
-
<p class="TermNum" id="J">3.1.1</p>
|
199
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
200
|
-
|
201
|
-
</div><div id="K"><span class='zzMoveToFollowing'>
|
202
|
-
<b>3.2  </b>
|
203
|
-
</span>
|
204
|
-
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
205
|
-
</div></div>
|
206
|
-
<div id="L" class="Symbols">
|
207
|
-
<h1>4</h1>
|
208
|
-
<dl>
|
209
|
-
<dt>
|
210
|
-
<p>Symbol</p>
|
211
|
-
</dt>
|
212
|
-
<dd>Definition</dd>
|
213
|
-
</dl>
|
252
|
+
<b>Annex</b></h1>
|
253
|
+
<div id="Q">
|
254
|
+
<h2>A.1  Annex A.1</h2>
|
255
|
+
<div id="Q1">
|
256
|
+
<h3>A.1.1  Annex A.1a</h3>
|
214
257
|
</div>
|
215
|
-
|
216
|
-
|
217
|
-
<div id="N">
|
218
|
-
<h2>5.1  Introduction</h2>
|
219
|
-
</div>
|
220
|
-
<div id="O">
|
221
|
-
<h2>5.2  Clause 4.2</h2>
|
222
|
-
</div>
|
223
|
-
</div>
|
224
|
-
<br/>
|
225
|
-
<div id="P" class="Section3">
|
226
|
-
<h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
|
227
|
-
<div id="Q">
|
228
|
-
<h2>A.1  Annex A.1</h2>
|
229
|
-
<div id="Q1">
|
230
|
-
<h3>A.1.1  Annex A.1a</h3>
|
231
|
-
</div>
|
232
|
-
</div>
|
233
|
-
<div id="Q2">
|
258
|
+
</div>
|
259
|
+
<div id="Q2">
|
234
260
|
<h2>Appendix 1  An Appendix</h2>
|
235
|
-
<div id=
|
236
|
-
|
237
|
-
</div>
|
261
|
+
<div id="Q2a">
|
262
|
+
<h3>Appendix 1.1   Appendix subclause </h3>
|
238
263
|
</div>
|
239
|
-
|
264
|
+
</div>
|
265
|
+
<div>
|
240
266
|
<h2 class="Section3">A.2  Annex Bibliography</h2>
|
241
|
-
</div>
|
242
|
-
|
243
|
-
</div>
|
244
|
-
<br/>
|
245
|
-
<div>
|
246
|
-
<h1 class="Section3">Bibliography</h1>
|
247
|
-
<div>
|
248
|
-
<h2 class="Section3">Bibliography Subsection</h2>
|
249
|
-
</div>
|
250
|
-
</div>
|
251
267
|
</div>
|
252
|
-
</
|
253
|
-
|
254
|
-
|
268
|
+
</div>
|
269
|
+
<br/>
|
270
|
+
<div>
|
271
|
+
<h1 class="Section3">Bibliography</h1>
|
272
|
+
<div>
|
273
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
274
|
+
</div>
|
275
|
+
</div>
|
276
|
+
</div>
|
277
|
+
</body>
|
278
|
+
</html>
|
279
|
+
OUTPUT
|
255
280
|
|
256
281
|
word = <<~OUTPUT
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
</div>
|
261
|
-
<p><br clear="all" class="section"/></p>
|
262
|
-
<div class="WordSection2">
|
263
|
-
<p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
|
264
|
-
<div>
|
265
|
-
<h1 class="ForewordTitle">Foreword</h1>
|
266
|
-
<p id="A">This is a preamble</p>
|
267
|
-
</div>
|
268
|
-
<p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
|
269
|
-
<div class="Section3" id="B">
|
270
|
-
<h1 class="IntroTitle">0<span style="mso-tab-count:1">  </span>Introduction</h1>
|
271
|
-
<div id="C">
|
272
|
-
<h2>0.1<span style="mso-tab-count:1">  </span>Introduction Subsection</h2>
|
273
|
-
</div>
|
274
|
-
<p>This is patent boilerplate</p>
|
275
|
-
</div>
|
276
|
-
<p> </p>
|
277
|
-
</div>
|
278
|
-
<p><br clear="all" class="section"/></p>
|
279
|
-
<div class="WordSection3">
|
280
|
-
<p class="zzSTDTitle1"/>
|
281
|
-
<div id="D">
|
282
|
-
<h1>1<span style="mso-tab-count:1">  </span>Scope</h1>
|
283
|
-
<p id="E">Text</p>
|
284
|
-
</div>
|
285
|
-
<div>
|
286
|
-
<h1>2<span style="mso-tab-count:1">  </span>Normative References</h1>
|
287
|
-
</div>
|
288
|
-
<div id="H"><h1>3<span style="mso-tab-count:1">  </span>Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
289
|
-
<div id="I">
|
290
|
-
<h2>3.1<span style="mso-tab-count:1">  </span>Normal Terms</h2>
|
291
|
-
<p class="TermNum" id="J">3.1.1</p>
|
292
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
293
|
-
|
294
|
-
</div><div id="K">
|
295
|
-
<span class='zzMoveToFollowing'>
|
296
|
-
<b>
|
297
|
-
3.2
|
298
|
-
<span style='mso-tab-count:1'>  </span>
|
299
|
-
</b>
|
300
|
-
</span>
|
301
|
-
<table class="dl"><tr><td valign="top" align="left"><p align="left" style="margin-left:0pt;text-align:left;">Symbol</p></td><td valign="top">Definition</td></tr></table>
|
302
|
-
</div></div>
|
303
|
-
<div id="L" class="Symbols">
|
304
|
-
<h1>4</h1>
|
305
|
-
<table class="dl">
|
306
|
-
<tr>
|
307
|
-
<td valign="top" align="left">
|
308
|
-
<p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
|
309
|
-
</td>
|
310
|
-
<td valign="top">Definition</td>
|
311
|
-
</tr>
|
312
|
-
</table>
|
313
|
-
</div>
|
314
|
-
<div id="M">
|
315
|
-
<h1>5<span style="mso-tab-count:1">  </span>Clause 4</h1>
|
316
|
-
<div id="N">
|
317
|
-
<h2>5.1<span style="mso-tab-count:1">  </span>Introduction</h2>
|
282
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
283
|
+
<div class="WordSection1">
|
284
|
+
<p> </p>
|
318
285
|
</div>
|
319
|
-
|
320
|
-
<
|
321
|
-
</
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
286
|
+
<p>
|
287
|
+
<br class="section" clear="all"/>
|
288
|
+
</p>
|
289
|
+
<div class="WordSection2">
|
290
|
+
<p>
|
291
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
292
|
+
</p>
|
293
|
+
<div>
|
294
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
295
|
+
<p id="A">This is a preamble</p>
|
296
|
+
</div>
|
297
|
+
<p>
|
298
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
299
|
+
</p>
|
300
|
+
<div class="Section3" id="B">
|
301
|
+
<h1 class="IntroTitle">0
|
302
|
+
<span style="mso-tab-count:1">  </span>
|
303
|
+
Introduction</h1>
|
304
|
+
<div id="C">
|
305
|
+
<h2>0.1
|
306
|
+
<span style="mso-tab-count:1">  </span>
|
307
|
+
Introduction Subsection</h2>
|
308
|
+
</div>
|
309
|
+
<p>This is patent boilerplate</p>
|
330
310
|
</div>
|
311
|
+
<p> </p>
|
331
312
|
</div>
|
332
|
-
|
333
|
-
<
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
</
|
313
|
+
<p>
|
314
|
+
<br class="section" clear="all"/>
|
315
|
+
</p>
|
316
|
+
<div class="WordSection3">
|
317
|
+
<p class="zzSTDTitle1"/>
|
318
|
+
<div id="D">
|
319
|
+
<h1>1
|
320
|
+
<span style="mso-tab-count:1">  </span>
|
321
|
+
Scope</h1>
|
322
|
+
<p id="E">Text</p>
|
323
|
+
</div>
|
324
|
+
<div>
|
325
|
+
<h1>2
|
326
|
+
<span style="mso-tab-count:1">  </span>
|
327
|
+
Normative References</h1>
|
328
|
+
</div>
|
329
|
+
<div id="H">
|
330
|
+
<h1>3
|
331
|
+
<span style="mso-tab-count:1">  </span>
|
332
|
+
Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
333
|
+
<div id="I">
|
334
|
+
<h2>3.1
|
335
|
+
<span style="mso-tab-count:1">  </span>
|
336
|
+
Normal Terms</h2>
|
337
|
+
<p class="TermNum" id="J">3.1.1</p>
|
338
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
339
|
+
</div>
|
340
|
+
<div id="K">
|
341
|
+
<span class="zzMoveToFollowing">
|
342
|
+
<b>3.2
|
343
|
+
<span style="mso-tab-count:1">  </span></b>
|
344
|
+
</span>
|
345
|
+
<table class="dl">
|
346
|
+
<tr>
|
347
|
+
<td align="left" valign="top">
|
348
|
+
<p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
|
349
|
+
</td>
|
350
|
+
<td valign="top">Definition</td>
|
351
|
+
</tr>
|
352
|
+
</table>
|
353
|
+
</div>
|
354
|
+
</div>
|
355
|
+
<div class="Symbols" id="L">
|
356
|
+
<h1>4</h1>
|
357
|
+
<table class="dl">
|
358
|
+
<tr>
|
359
|
+
<td align="left" valign="top">
|
360
|
+
<p align="left" style="margin-left:0pt;text-align:left;">Symbol</p>
|
361
|
+
</td>
|
362
|
+
<td valign="top">Definition</td>
|
363
|
+
</tr>
|
364
|
+
</table>
|
365
|
+
</div>
|
366
|
+
<div id="M">
|
367
|
+
<h1>5
|
368
|
+
<span style="mso-tab-count:1">  </span>
|
369
|
+
Clause 4</h1>
|
370
|
+
<div id="N">
|
371
|
+
<h2>5.1
|
372
|
+
<span style="mso-tab-count:1">  </span>
|
373
|
+
Introduction</h2>
|
374
|
+
</div>
|
375
|
+
<div id="O">
|
376
|
+
<h2>5.2
|
377
|
+
<span style="mso-tab-count:1">  </span>
|
378
|
+
Clause 4.2</h2>
|
379
|
+
</div>
|
380
|
+
</div>
|
381
|
+
<p>
|
382
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
383
|
+
</p>
|
384
|
+
<div class="Section3" id="P">
|
385
|
+
<h1 class="Annex">
|
386
|
+
<b>Annex A</b>
|
387
|
+
<br/>(normative)
|
388
|
+
<br/>
|
389
|
+
<br/>
|
390
|
+
<b>Annex</b></h1>
|
391
|
+
<div id="Q">
|
392
|
+
<h2>A.1
|
393
|
+
<span style="mso-tab-count:1">  </span>
|
394
|
+
Annex A.1</h2>
|
395
|
+
<div id="Q1">
|
396
|
+
<h3>A.1.1
|
397
|
+
<span style="mso-tab-count:1">  </span>
|
398
|
+
Annex A.1a</h3>
|
399
|
+
</div>
|
400
|
+
</div>
|
401
|
+
<div id="Q2">
|
402
|
+
<h2>Appendix 1
|
403
|
+
<span style="mso-tab-count:1">  </span>
|
404
|
+
An Appendix</h2>
|
405
|
+
<div id="Q2a">
|
406
|
+
<h3>Appendix 1.1
|
407
|
+
<span style="mso-tab-count:1">  </span>
|
408
|
+
Appendix subclause</h3>
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
<div>
|
412
|
+
<h2 class="Section3">A.2
|
413
|
+
<span style="mso-tab-count:1">  </span>
|
414
|
+
Annex Bibliography</h2>
|
415
|
+
</div>
|
416
|
+
</div>
|
417
|
+
<p>
|
418
|
+
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
419
|
+
</p>
|
420
|
+
<div>
|
421
|
+
<h1 class="Section3">Bibliography</h1>
|
422
|
+
<div>
|
423
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
424
|
+
</div>
|
341
425
|
</div>
|
342
|
-
<div>
|
343
|
-
<h2 class='Section3'>
|
344
|
-
A.2
|
345
|
-
<span style='mso-tab-count:1'>  </span>
|
346
|
-
Annex Bibliography
|
347
|
-
</h2>
|
348
426
|
</div>
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
<div class="colophon"/>
|
360
|
-
</body>
|
361
|
-
OUTPUT
|
362
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
363
|
-
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
364
|
-
expect(xmlpp(IsoDoc::Iso::WordConvert.new({}).convert("test", presxml, true).sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(word)
|
427
|
+
<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
|
428
|
+
<div class="colophon"/>
|
429
|
+
</body>
|
430
|
+
OUTPUT
|
431
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)))
|
432
|
+
.to be_equivalent_to xmlpp(presxml)
|
433
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true)))
|
434
|
+
.to be_equivalent_to xmlpp(html)
|
435
|
+
expect(xmlpp(IsoDoc::Iso::WordConvert.new({}).convert("test", presxml, true)
|
436
|
+
.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(word)
|
365
437
|
end
|
366
438
|
|
367
|
-
|
368
|
-
|
439
|
+
it "processes subclauses with and without titles" do
|
440
|
+
input = <<~INPUT
|
369
441
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
<clause id="D1" obligation="normative">
|
374
|
-
|
375
|
-
|
376
|
-
<clause id="D2" obligation="normative">
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
INPUT
|
442
|
+
<sections>
|
443
|
+
<clause id="D" obligation="normative">
|
444
|
+
<title>Scope</title>
|
445
|
+
<clause id="D1" obligation="normative">
|
446
|
+
<title>Scope 1</title>
|
447
|
+
</clause>
|
448
|
+
<clause id="D2" obligation="normative">
|
449
|
+
</clause>
|
450
|
+
</clause>
|
451
|
+
</sections>
|
452
|
+
</iso-standard>
|
453
|
+
INPUT
|
382
454
|
|
383
|
-
presxml = <<~OUTPUT
|
384
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
</iso-standard>
|
397
|
-
OUTPUT
|
455
|
+
presxml = <<~OUTPUT
|
456
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
457
|
+
<sections>
|
458
|
+
<clause id='D' obligation='normative'>
|
459
|
+
<title depth='1'>1<tab/>Scope</title>
|
460
|
+
<clause id='D1' obligation='normative'>
|
461
|
+
<title depth='2'>1.1<tab/>Scope 1</title>
|
462
|
+
</clause>
|
463
|
+
<clause id='D2' obligation='normative' inline-header="true">
|
464
|
+
<title>1.2</title>
|
465
|
+
</clause>
|
466
|
+
</clause>
|
467
|
+
</sections>
|
468
|
+
</iso-standard>
|
469
|
+
OUTPUT
|
398
470
|
|
399
|
-
html = <<~OUTPUT
|
400
|
-
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
</html>
|
427
|
-
OUTPUT
|
428
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)))
|
429
|
-
|
430
|
-
|
471
|
+
html = <<~OUTPUT
|
472
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
473
|
+
<head/>
|
474
|
+
<body lang='en'>
|
475
|
+
<div class='title-section'>
|
476
|
+
<p> </p>
|
477
|
+
</div>
|
478
|
+
<br/>
|
479
|
+
<div class='prefatory-section'>
|
480
|
+
<p> </p>
|
481
|
+
</div>
|
482
|
+
<br/>
|
483
|
+
<div class='main-section'>
|
484
|
+
<p class='zzSTDTitle1'/>
|
485
|
+
<div id='D'>
|
486
|
+
<h1>1  Scope</h1>
|
487
|
+
<div id='D1'>
|
488
|
+
<h2>1.1  Scope 1</h2>
|
489
|
+
</div>
|
490
|
+
<div id='D2'>
|
491
|
+
<span class='zzMoveToFollowing'>
|
492
|
+
<b>1.2  </b>
|
493
|
+
</span>
|
494
|
+
</div>
|
495
|
+
</div>
|
496
|
+
</div>
|
497
|
+
</body>
|
498
|
+
</html>
|
499
|
+
OUTPUT
|
500
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)))
|
501
|
+
.to be_equivalent_to xmlpp(presxml)
|
502
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true)))
|
503
|
+
.to be_equivalent_to xmlpp(html)
|
504
|
+
end
|
431
505
|
|
432
506
|
it "processes simple terms & definitions" do
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
507
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
508
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
509
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
510
|
+
<sections>
|
511
|
+
<terms id="H" obligation="normative">
|
512
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
513
|
+
<term id="J">
|
514
|
+
<name>1.1</name>
|
515
|
+
<preferred>Term2</preferred>
|
516
|
+
</term>
|
517
|
+
</terms>
|
518
|
+
</sections>
|
442
519
|
</iso-standard>
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
520
|
+
INPUT
|
521
|
+
#{HTML_HDR}
|
522
|
+
<p class="zzSTDTitle1"/>
|
523
|
+
<div id="H">
|
524
|
+
<h1>Terms, Definitions, Symbols and Abbreviated Terms</h1>
|
525
|
+
<p class="TermNum" id="J">1.1</p>
|
526
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
527
|
+
</div>
|
528
|
+
</div>
|
529
|
+
</body>
|
530
|
+
</html>
|
531
|
+
OUTPUT
|
454
532
|
end
|
455
533
|
|
456
|
-
|
457
|
-
|
534
|
+
it "processes inline section headers" do
|
535
|
+
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
458
536
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
537
|
+
<sections>
|
538
|
+
<clause id="M" inline-header="false" obligation="normative">
|
539
|
+
<title>Clause 4</title>
|
540
|
+
<clause id="N" inline-header="false" obligation="normative">
|
541
|
+
<title>Introduction</title>
|
542
|
+
</clause>
|
543
|
+
<clause id="O" inline-header="true" obligation="normative">
|
544
|
+
<title>Clause 4.2</title>
|
545
|
+
<p>Hello</p>
|
546
|
+
</clause>
|
547
|
+
</clause>
|
548
|
+
</sections>
|
469
549
|
</iso-standard>
|
470
550
|
INPUT
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
551
|
+
expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
552
|
+
#{HTML_HDR}
|
553
|
+
<p class="zzSTDTitle1"/>
|
554
|
+
<div id="M">
|
555
|
+
<h1>Clause 4</h1>
|
556
|
+
<div id="N">
|
557
|
+
<h2>Introduction</h2>
|
558
|
+
</div>
|
559
|
+
<div id="O">
|
560
|
+
<span class="zzMoveToFollowing"><b>Clause 4.2  </b></span>
|
561
|
+
<p>Hello</p>
|
562
|
+
</div>
|
563
|
+
</div>
|
564
|
+
</div>
|
565
|
+
</body>
|
566
|
+
</html>
|
567
|
+
OUTPUT
|
568
|
+
end
|
488
569
|
|
489
|
-
|
490
|
-
|
570
|
+
it "adds colophon to published standard (Word)" do
|
571
|
+
output = IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true)
|
491
572
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
</sections>
|
573
|
+
<bibdata>
|
574
|
+
<status>
|
575
|
+
<stage>60</stage>
|
576
|
+
</status>
|
577
|
+
</bibdata>
|
578
|
+
<sections/>
|
499
579
|
</iso-standard>
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
<p
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
<p
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
<
|
514
|
-
|
515
|
-
|
580
|
+
INPUT
|
581
|
+
expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>")))
|
582
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
583
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
584
|
+
<div class="WordSection1">
|
585
|
+
<p> </p>
|
586
|
+
</div>
|
587
|
+
<p><br clear="all" class="section"/></p>
|
588
|
+
<div class="WordSection2">
|
589
|
+
<p> </p>
|
590
|
+
</div>
|
591
|
+
<p><br clear="all" class="section"/></p>
|
592
|
+
<div class="WordSection3">
|
593
|
+
<p class="zzSTDTitle1"/>
|
594
|
+
</div>
|
595
|
+
<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
|
596
|
+
<div class="colophon"/>
|
597
|
+
</body>
|
516
598
|
OUTPUT
|
517
|
-
|
599
|
+
end
|
518
600
|
|
519
|
-
|
520
|
-
|
601
|
+
it "does not add colophon to draft standard (Word)" do
|
602
|
+
output = IsoDoc::Iso::WordConvert.new({}).convert("test", <<~"INPUT", true)
|
521
603
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
</sections>
|
604
|
+
<bibdata>
|
605
|
+
<status>
|
606
|
+
<stage>30</stage>
|
607
|
+
</status>
|
608
|
+
</bibdata>
|
609
|
+
<sections/>
|
529
610
|
</iso-standard>
|
611
|
+
INPUT
|
612
|
+
expect(xmlpp(output.sub(/^.*<body /m, "<body ").sub(%r{</body>.*$}m, "</body>")))
|
613
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
614
|
+
<body lang="EN-US" link="blue" vlink="#954F72">
|
615
|
+
<div class="WordSection1">
|
616
|
+
<p> </p>
|
617
|
+
</div>
|
618
|
+
<p><br clear="all" class="section"/></p>
|
619
|
+
<div class="WordSection2">
|
620
|
+
<p> </p>
|
621
|
+
</div>
|
622
|
+
<p><br clear="all" class="section"/></p>
|
623
|
+
<div class="WordSection3">
|
624
|
+
<p class="zzSTDTitle1"/>
|
625
|
+
</div>
|
626
|
+
</body>
|
627
|
+
OUTPUT
|
628
|
+
end
|
629
|
+
|
630
|
+
it "processes middle title" do
|
631
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
632
|
+
.convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
633
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
634
|
+
<bibdata>
|
635
|
+
<title format="text/plain" language="en" type="title-intro">Introduction</title>
|
636
|
+
<title format="text/plain" language="en" type="title-main">Main Title — Title</title>
|
637
|
+
<title format="text/plain" language="en" type="title-part">Title Part</title>
|
638
|
+
<ext>
|
639
|
+
<structuredidentifier>
|
640
|
+
<project-number origyr="2016-05-01" part="1">17301</project-number>
|
641
|
+
</structuredidentifier>
|
642
|
+
</ext>
|
643
|
+
</bibdata>
|
644
|
+
<sections/>
|
645
|
+
</iso-standard>
|
530
646
|
INPUT
|
531
|
-
|
532
|
-
|
533
|
-
<p
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
<p> </p>
|
538
|
-
</div>
|
539
|
-
<p><br clear="all" class="section"/></p>
|
540
|
-
<div class="WordSection3">
|
541
|
-
<p class="zzSTDTitle1"/>
|
647
|
+
#{HTML_HDR}
|
648
|
+
<p class='zzSTDTitle1'>Introduction — Main Title — Title — </p>
|
649
|
+
<p class='zzSTDTitle2'>
|
650
|
+
Part 1:
|
651
|
+
<br/><b>Title Part</b>
|
652
|
+
</p>
|
542
653
|
</div>
|
543
654
|
</body>
|
655
|
+
</html>
|
544
656
|
OUTPUT
|
545
|
-
|
657
|
+
end
|
546
658
|
|
547
|
-
|
548
|
-
|
549
|
-
<iso-standard xmlns="
|
550
|
-
|
551
|
-
<
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
<
|
556
|
-
|
557
|
-
|
558
|
-
</
|
559
|
-
|
560
|
-
|
561
|
-
|
659
|
+
it "generates an index in English" do
|
660
|
+
input = <<~INPUT
|
661
|
+
<iso-standard xmlns="https://open.ribose.com/standards/bipm">
|
662
|
+
<bibdata>
|
663
|
+
<language>en</language>
|
664
|
+
<script>Latn</script>
|
665
|
+
</bibdata>
|
666
|
+
<sections>
|
667
|
+
<clause id="A">
|
668
|
+
<index><primary>élongé</primary></index>
|
669
|
+
<index><primary>être</primary><secondary>Husserl</secondary><tertiary>en allemand</tertiary></index>
|
670
|
+
<index><primary><em>Eman</em>cipation</primary></index>
|
671
|
+
<index><primary><em>Eman</em>cipation</primary><secondary>dans la France</secondary></index>
|
672
|
+
<index><primary><em>Eman</em>cipation</primary><secondary>dans la France</secondary><tertiary>en Bretagne</tertiary></index>
|
673
|
+
<clause id="B">
|
674
|
+
<index><primary><em>Eman</em>cipation</primary></index>
|
675
|
+
<index><primary>zebra</primary></index>
|
676
|
+
<index><primary><em>Eman</em>cipation</primary><secondary>dans les États-Unis</secondary></index>
|
677
|
+
<index><primary><em>Eman</em>cipation</primary><secondary>dans la France</secondary><tertiary>à Paris</tertiary></index>
|
678
|
+
<index-xref also="true"><primary>être</primary><secondary>Husserl</secondary><target>zebra</target></index-xref>
|
679
|
+
<index-xref also="true"><primary>être</primary><secondary>Husserl</secondary><target><em>Eman</em>cipation</target></index-xref>
|
680
|
+
<index-xref also="false"><primary>être</primary><secondary>Husserl</secondary><target>zebra</target></index-xref>
|
681
|
+
<index-xref also="false"><primary><em>Dasein</em></primary><target>être</target></index-xref>
|
682
|
+
<index-xref also="false"><primary><em>Dasein</em></primary><target><em>Eman</em>cipation</target></index-xref>
|
683
|
+
</clause>
|
684
|
+
</clause>
|
685
|
+
</sections>
|
686
|
+
</bipm-standard>
|
562
687
|
INPUT
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
688
|
+
presxml = <<~OUTPUT
|
689
|
+
<iso-standard xmlns='https://open.ribose.com/standards/bipm' type='presentation'>
|
690
|
+
<bibdata>
|
691
|
+
<language current='true'>en</language>
|
692
|
+
<script current='true'>Latn</script>
|
693
|
+
</bibdata>
|
694
|
+
<sections>
|
695
|
+
<clause id='A'>
|
696
|
+
<title>1</title>
|
697
|
+
<bookmark id='_'/>
|
698
|
+
<bookmark id='_'/>
|
699
|
+
<bookmark id='_'/>
|
700
|
+
<bookmark id='_'/>
|
701
|
+
<bookmark id='_'/>
|
702
|
+
<clause id='B' inline-header='true'>
|
703
|
+
<title>1.1</title>
|
704
|
+
<bookmark id='_'/>
|
705
|
+
<bookmark id='_'/>
|
706
|
+
<bookmark id='_'/>
|
707
|
+
<bookmark id='_'/>
|
708
|
+
</clause>
|
709
|
+
</clause>
|
710
|
+
</sections>
|
711
|
+
<indexsect id='_'>
|
712
|
+
<title>Index</title>
|
713
|
+
<ul>
|
714
|
+
<li>
|
715
|
+
<em>Dasein</em>
|
716
|
+
, see
|
717
|
+
<em>Eman</em>
|
718
|
+
cipation, être
|
719
|
+
</li>
|
720
|
+
<li>
|
721
|
+
élongé,
|
722
|
+
<xref target='_' pagenumber='true'>Clause 1</xref>
|
723
|
+
</li>
|
724
|
+
<li>
|
725
|
+
<em>Eman</em>
|
726
|
+
cipation,
|
727
|
+
<xref target='_' pagenumber='true'>Clause 1</xref>
|
728
|
+
,
|
729
|
+
<xref target='_' pagenumber='true'>1.1</xref>
|
730
|
+
<ul>
|
731
|
+
<li>
|
732
|
+
dans la France,
|
733
|
+
<xref target='_' pagenumber='true'>Clause 1</xref>
|
734
|
+
<ul>
|
735
|
+
<li>
|
736
|
+
à Paris,
|
737
|
+
<xref target='_' pagenumber='true'>1.1</xref>
|
738
|
+
</li>
|
739
|
+
<li>
|
740
|
+
en Bretagne,
|
741
|
+
<xref target='_' pagenumber='true'>Clause 1</xref>
|
742
|
+
</li>
|
743
|
+
</ul>
|
744
|
+
</li>
|
745
|
+
<li>
|
746
|
+
dans les États-Unis,
|
747
|
+
<xref target='_' pagenumber='true'>1.1</xref>
|
748
|
+
</li>
|
749
|
+
</ul>
|
750
|
+
</li>
|
751
|
+
<li>
|
752
|
+
être
|
753
|
+
<ul>
|
754
|
+
<li>
|
755
|
+
Husserl, see zebra, see also
|
756
|
+
<em>Eman</em>
|
757
|
+
cipation, zebra
|
758
|
+
<ul>
|
759
|
+
<li>
|
760
|
+
en allemand,
|
761
|
+
<xref target='_' pagenumber='true'>Clause 1</xref>
|
762
|
+
</li>
|
763
|
+
</ul>
|
764
|
+
</li>
|
765
|
+
</ul>
|
766
|
+
</li>
|
767
|
+
<li>
|
768
|
+
zebra,
|
769
|
+
<xref target='_' pagenumber='true'>1.1</xref>
|
770
|
+
</li>
|
771
|
+
</ul>
|
772
|
+
</indexsect>
|
773
|
+
</iso-standard>
|
774
|
+
OUTPUT
|
775
|
+
html = <<~OUTPUT
|
776
|
+
<html lang='en'>
|
777
|
+
<head/>
|
778
|
+
<body lang='en'>
|
779
|
+
<div class='title-section'>
|
780
|
+
<p> </p>
|
781
|
+
</div>
|
782
|
+
<br/>
|
783
|
+
<div class='prefatory-section'>
|
784
|
+
<p> </p>
|
785
|
+
</div>
|
786
|
+
<br/>
|
787
|
+
<div class='main-section'>
|
788
|
+
<p class='zzSTDTitle1'/>
|
789
|
+
<div id='A'>
|
790
|
+
<h1>1</h1>
|
791
|
+
<a id='_'/>
|
792
|
+
<a id='_'/>
|
793
|
+
<a id='_'/>
|
794
|
+
<a id='_'/>
|
795
|
+
<a id='_'/>
|
796
|
+
<div id='B'>
|
797
|
+
<span class='zzMoveToFollowing'>
|
798
|
+
<b>1.1  </b>
|
799
|
+
</span>
|
800
|
+
<a id='_'/>
|
801
|
+
<a id='_'/>
|
802
|
+
<a id='_'/>
|
803
|
+
<a id='_'/>
|
804
|
+
</div>
|
805
|
+
</div>
|
806
|
+
<div id='_'>
|
807
|
+
<h1>Index</h1>
|
808
|
+
<ul>
|
809
|
+
<li>
|
810
|
+
<i>Dasein</i>
|
811
|
+
, see
|
812
|
+
<i>Eman</i>
|
813
|
+
cipation, être
|
814
|
+
</li>
|
815
|
+
<li>
|
816
|
+
élongé,
|
817
|
+
<a href='#_'>Clause 1</a>
|
818
|
+
</li>
|
819
|
+
<li>
|
820
|
+
<i>Eman</i>
|
821
|
+
cipation,
|
822
|
+
<a href='#_'>Clause 1</a>
|
823
|
+
,
|
824
|
+
<a href='#_'>1.1</a>
|
825
|
+
<ul>
|
826
|
+
<li>
|
827
|
+
dans la France,
|
828
|
+
<a href='#_'>Clause 1</a>
|
829
|
+
<ul>
|
830
|
+
<li>
|
831
|
+
à Paris,
|
832
|
+
<a href='#_'>1.1</a>
|
833
|
+
</li>
|
834
|
+
<li>
|
835
|
+
en Bretagne,
|
836
|
+
<a href='#_'>Clause 1</a>
|
837
|
+
</li>
|
838
|
+
</ul>
|
839
|
+
</li>
|
840
|
+
<li>
|
841
|
+
dans les États-Unis,
|
842
|
+
<a href='#_'>1.1</a>
|
843
|
+
</li>
|
844
|
+
</ul>
|
845
|
+
</li>
|
846
|
+
<li>
|
847
|
+
être
|
848
|
+
<ul>
|
849
|
+
<li>
|
850
|
+
Husserl, see zebra, see also
|
851
|
+
<i>Eman</i>
|
852
|
+
cipation, zebra
|
853
|
+
<ul>
|
854
|
+
<li>
|
855
|
+
en allemand,
|
856
|
+
<a href='#_'>Clause 1</a>
|
857
|
+
</li>
|
858
|
+
</ul>
|
859
|
+
</li>
|
860
|
+
</ul>
|
861
|
+
</li>
|
862
|
+
<li>
|
863
|
+
zebra,
|
864
|
+
<a href='#_'>1.1</a>
|
865
|
+
</li>
|
866
|
+
</ul>
|
867
|
+
</div>
|
569
868
|
</div>
|
570
869
|
</body>
|
571
870
|
</html>
|
572
871
|
OUTPUT
|
573
|
-
|
574
|
-
|
872
|
+
expect(xmlpp(strip_guid(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)
|
873
|
+
.gsub(%r{<localized-strings>.*</localized-strings>}m, "")))).to be_equivalent_to xmlpp(presxml)
|
874
|
+
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
|
875
|
+
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
876
|
+
end
|
575
877
|
end
|