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/amd_spec.rb
CHANGED
@@ -2,981 +2,1002 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
4
|
it "cross-references notes in amendments" do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
</
|
34
|
-
|
35
|
-
|
36
|
-
</
|
37
|
-
<
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
5
|
+
output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
|
6
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
+
<bibdata>
|
8
|
+
<ext>
|
9
|
+
<doctype>amendment</doctype>
|
10
|
+
</ext>
|
11
|
+
</bibdata>
|
12
|
+
<preface>
|
13
|
+
<foreword>
|
14
|
+
<p>
|
15
|
+
<xref target="N"/>
|
16
|
+
<xref target="note1"/>
|
17
|
+
<xref target="note2"/>
|
18
|
+
<xref target="AN"/>
|
19
|
+
<xref target="Anote1"/>
|
20
|
+
<xref target="Anote2"/>
|
21
|
+
</p>
|
22
|
+
</foreword>
|
23
|
+
</preface>
|
24
|
+
<sections>
|
25
|
+
<clause id="scope">
|
26
|
+
<title>Scope</title>
|
27
|
+
<note id="N">
|
28
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
29
|
+
</note>
|
30
|
+
<p>
|
31
|
+
<xref target="N"/>
|
32
|
+
</p>
|
33
|
+
</clause>
|
34
|
+
<terms id="terms"/>
|
35
|
+
<clause id="widgets">
|
36
|
+
<title>Widgets</title>
|
37
|
+
<clause id="widgets1">
|
38
|
+
<note id="note1">
|
39
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
40
|
+
</note>
|
41
|
+
<note id="note2">
|
42
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
|
43
|
+
</note>
|
44
|
+
<p>
|
45
|
+
<xref target="note1"/>
|
46
|
+
<xref target="note2"/>
|
47
|
+
</p>
|
48
|
+
</clause>
|
49
|
+
</clause>
|
50
|
+
</sections>
|
51
|
+
<annex id="annex1">
|
52
|
+
<clause id="annex1a">
|
53
|
+
<note id="AN">
|
54
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
55
|
+
</note>
|
56
|
+
</clause>
|
57
|
+
<clause id="annex1b">
|
58
|
+
<note id="Anote1">
|
59
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
|
60
|
+
</note>
|
61
|
+
<note id="Anote2">
|
62
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
|
63
|
+
</note>
|
64
|
+
</clause>
|
65
|
+
</annex>
|
66
|
+
</iso-standard>
|
58
67
|
INPUT
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
<
|
71
|
-
<xref target=
|
72
|
-
<xref target=
|
73
|
-
<xref target=
|
74
|
-
<xref target=
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<
|
124
|
-
<
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
</p>
|
148
|
-
</note>
|
149
|
-
</clause>
|
150
|
-
</annex>
|
151
|
-
</iso-standard>
|
152
|
-
OUTPUT
|
68
|
+
expect(xmlpp(output).sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
69
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
70
|
+
<?xml version='1.0'?>
|
71
|
+
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
72
|
+
<bibdata>
|
73
|
+
<ext>
|
74
|
+
<doctype language="">amendment</doctype>
|
75
|
+
</ext>
|
76
|
+
</bibdata>
|
77
|
+
<preface>
|
78
|
+
<foreword>
|
79
|
+
<p>
|
80
|
+
<xref target="N">Scope, Note</xref>
|
81
|
+
<xref target="note1">Widgets, 1, Note 1</xref>
|
82
|
+
<xref target="note2">Widgets, 1, Note 2</xref>
|
83
|
+
<xref target="AN">A.1, Note</xref>
|
84
|
+
<xref target="Anote1">A.2, Note 1</xref>
|
85
|
+
<xref target="Anote2">A.2, Note 2</xref>
|
86
|
+
</p>
|
87
|
+
</foreword>
|
88
|
+
</preface>
|
89
|
+
<sections>
|
90
|
+
<clause id="scope">
|
91
|
+
<title depth="1">Scope</title>
|
92
|
+
<note id="N">
|
93
|
+
<name>NOTE</name>
|
94
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
|
95
|
+
types of kernel.
|
96
|
+
</p>
|
97
|
+
</note>
|
98
|
+
<p>
|
99
|
+
<xref target="N">Note</xref>
|
100
|
+
</p>
|
101
|
+
</clause>
|
102
|
+
<terms id="terms"/>
|
103
|
+
<clause id="widgets">
|
104
|
+
<title depth="1">Widgets</title>
|
105
|
+
<clause id="widgets1" inline-header="true">
|
106
|
+
<note id="note1">
|
107
|
+
<name>NOTE 1</name>
|
108
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
|
109
|
+
types of kernel.
|
110
|
+
</p>
|
111
|
+
</note>
|
112
|
+
<note id="note2">
|
113
|
+
<name>NOTE 2</name>
|
114
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
|
115
|
+
types of kernel.
|
116
|
+
</p>
|
117
|
+
</note>
|
118
|
+
<p>
|
119
|
+
<xref target="note1">Note 1</xref>
|
120
|
+
<xref target="note2">Note 2</xref>
|
121
|
+
</p>
|
122
|
+
</clause>
|
123
|
+
</clause>
|
124
|
+
</sections>
|
125
|
+
<annex id="annex1">
|
126
|
+
<title>
|
127
|
+
<strong>Annex A</strong>
|
128
|
+
<br/>(informative)</title>
|
129
|
+
<clause id="annex1a" inline-header="true">
|
130
|
+
<title>A.1</title>
|
131
|
+
<note id="AN">
|
132
|
+
<name>NOTE</name>
|
133
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
|
134
|
+
types of kernel.
|
135
|
+
</p>
|
136
|
+
</note>
|
137
|
+
</clause>
|
138
|
+
<clause id="annex1b" inline-header="true">
|
139
|
+
<title>A.2</title>
|
140
|
+
<note id="Anote1">
|
141
|
+
<name>NOTE 1</name>
|
142
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
|
143
|
+
types of kernel.
|
144
|
+
</p>
|
145
|
+
</note>
|
146
|
+
<note id="Anote2">
|
147
|
+
<name>NOTE 2</name>
|
148
|
+
<p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
|
149
|
+
types of kernel.
|
150
|
+
</p>
|
151
|
+
</note>
|
152
|
+
</clause>
|
153
|
+
</annex>
|
154
|
+
</iso-standard>
|
155
|
+
OUTPUT
|
153
156
|
end
|
154
157
|
|
155
158
|
it "cross-references sections" do
|
156
|
-
|
159
|
+
output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
|
157
160
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
<xref target="I"/>
|
168
|
-
<xref target="J"/>
|
169
|
-
<xref target="K"/>
|
170
|
-
<xref target="L"/>
|
171
|
-
<xref target="M"/>
|
172
|
-
<xref target="N"/>
|
173
|
-
<xref target="O"/>
|
174
|
-
<xref target="P"/>
|
175
|
-
<xref target="Q"/>
|
176
|
-
<xref target="Q1"/>
|
177
|
-
<xref target="Q2"/>
|
178
|
-
<xref target="R"/>
|
179
|
-
</p>
|
180
|
-
</foreword>
|
181
|
-
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
182
|
-
<title>Introduction Subsection</title>
|
183
|
-
</clause>
|
184
|
-
<clause id="C1" inline-header="false" obligation="informative">Text</clause>
|
185
|
-
</introduction></preface><sections>
|
186
|
-
<clause id="D" obligation="normative" type="scope">
|
187
|
-
<title>Scope</title>
|
188
|
-
<p id="E">Text</p>
|
189
|
-
</clause>
|
161
|
+
<bibdata>
|
162
|
+
<ext>
|
163
|
+
<doctype>amendment</doctype>
|
164
|
+
</ext>
|
165
|
+
</bibdata>
|
166
|
+
<preface>
|
167
|
+
<foreword obligation="informative">
|
168
|
+
<title>Foreword</title>
|
169
|
+
<p id="A">This is a preamble
|
190
170
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
<
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
171
|
+
<xref target="C"/>
|
172
|
+
<xref target="C1"/>
|
173
|
+
<xref target="D"/>
|
174
|
+
<xref target="H"/>
|
175
|
+
<xref target="I"/>
|
176
|
+
<xref target="J"/>
|
177
|
+
<xref target="K"/>
|
178
|
+
<xref target="L"/>
|
179
|
+
<xref target="M"/>
|
180
|
+
<xref target="N"/>
|
181
|
+
<xref target="O"/>
|
182
|
+
<xref target="P"/>
|
183
|
+
<xref target="Q"/>
|
184
|
+
<xref target="Q1"/>
|
185
|
+
<xref target="Q2"/>
|
186
|
+
<xref target="R"/></p>
|
187
|
+
</foreword>
|
188
|
+
<introduction id="B" obligation="informative">
|
189
|
+
<title>Introduction</title>
|
190
|
+
<clause id="C" inline-header="false" obligation="informative">
|
191
|
+
<title>Introduction Subsection</title>
|
192
|
+
</clause>
|
193
|
+
<clause id="C1" inline-header="false" obligation="informative">Text</clause>
|
194
|
+
</introduction>
|
195
|
+
</preface>
|
196
|
+
<sections>
|
197
|
+
<clause id="D" obligation="normative" type="scope">
|
198
|
+
<title>Scope</title>
|
199
|
+
<p id="E">Text</p>
|
200
|
+
</clause>
|
201
|
+
<clause id="M" inline-header="false" obligation="normative">
|
202
|
+
<title>Clause 4</title>
|
203
|
+
<clause id="N" inline-header="false" obligation="normative">
|
204
|
+
<title>Introduction</title>
|
205
|
+
</clause>
|
206
|
+
<clause id="O" inline-header="false" obligation="normative">
|
207
|
+
<title>Clause 4.2</title>
|
208
|
+
</clause>
|
209
|
+
</clause>
|
210
|
+
</sections>
|
211
|
+
<annex id="P" inline-header="false" obligation="normative">
|
212
|
+
<title>Annex</title>
|
213
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
214
|
+
<title>Annex A.1</title>
|
215
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
216
|
+
<title>Annex A.1a</title>
|
217
|
+
</clause>
|
218
|
+
</clause>
|
219
|
+
<appendix id="Q2" inline-header="false" obligation="normative">
|
220
|
+
<title>An Appendix</title>
|
221
|
+
</appendix>
|
222
|
+
</annex>
|
223
|
+
<bibliography>
|
224
|
+
<references id="R" normative="true" obligation="informative">
|
225
|
+
<title>Normative References</title>
|
226
|
+
</references>
|
227
|
+
<clause id="S" obligation="informative">
|
228
|
+
<title>Bibliography</title>
|
229
|
+
<references id="T" normative="false" obligation="informative">
|
230
|
+
<title>Bibliography Subsection</title>
|
231
|
+
</references>
|
232
|
+
</clause>
|
233
|
+
</bibliography>
|
234
|
+
</iso-standard>
|
219
235
|
INPUT
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
</title>
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
</
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
</bibliography>
|
315
|
-
</iso-standard>
|
316
|
-
OUTPUT
|
236
|
+
expect(xmlpp(output).sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
237
|
+
.to be_equivalent_to xmlpp(<<~"OUTPUT")
|
238
|
+
<?xml version='1.0'?>
|
239
|
+
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
240
|
+
<bibdata>
|
241
|
+
<ext>
|
242
|
+
<doctype language="">amendment</doctype>
|
243
|
+
</ext>
|
244
|
+
</bibdata>
|
245
|
+
<preface>
|
246
|
+
<foreword obligation="informative">
|
247
|
+
<title>Foreword</title>
|
248
|
+
<p id="A">This is a preamble
|
249
|
+
|
250
|
+
<xref target="C">0.1</xref>
|
251
|
+
<xref target="C1">0.2</xref>
|
252
|
+
<xref target="D">Scope</xref>
|
253
|
+
<xref target="H">[H]</xref>
|
254
|
+
<xref target="I">[I]</xref>
|
255
|
+
<xref target="J">[J]</xref>
|
256
|
+
<xref target="K">[K]</xref>
|
257
|
+
<xref target="L">[L]</xref>
|
258
|
+
<xref target="M">Clause 4</xref>
|
259
|
+
<xref target="N">Introduction</xref>
|
260
|
+
<xref target="O">Clause 4.2</xref>
|
261
|
+
<xref target="P">Annex A</xref>
|
262
|
+
<xref target="Q">A.1</xref>
|
263
|
+
<xref target="Q1">A.1.1</xref>
|
264
|
+
<xref target="Q2">Annex A, Appendix 1</xref>
|
265
|
+
<xref target="R">[R]</xref></p>
|
266
|
+
</foreword>
|
267
|
+
<introduction id="B" obligation="informative">
|
268
|
+
<title depth="1">Introduction</title>
|
269
|
+
<clause id="C" inline-header="false" obligation="informative">
|
270
|
+
<title depth="2">Introduction Subsection</title>
|
271
|
+
</clause>
|
272
|
+
<clause id="C1" inline-header="true" obligation="informative">Text</clause>
|
273
|
+
</introduction>
|
274
|
+
</preface>
|
275
|
+
<sections>
|
276
|
+
<clause id="D" obligation="normative" type="scope">
|
277
|
+
<title depth="1">Scope</title>
|
278
|
+
<p id="E">Text</p>
|
279
|
+
</clause>
|
280
|
+
<clause id="M" inline-header="false" obligation="normative">
|
281
|
+
<title depth="1">Clause 4</title>
|
282
|
+
<clause id="N" inline-header="false" obligation="normative">
|
283
|
+
<title depth="2">Introduction</title>
|
284
|
+
</clause>
|
285
|
+
<clause id="O" inline-header="false" obligation="normative">
|
286
|
+
<title depth="2">Clause 4.2</title>
|
287
|
+
</clause>
|
288
|
+
</clause>
|
289
|
+
</sections>
|
290
|
+
<annex id="P" inline-header="false" obligation="normative">
|
291
|
+
<title>
|
292
|
+
<strong>Annex A</strong>
|
293
|
+
<br/>(normative)
|
294
|
+
|
295
|
+
<br/>
|
296
|
+
<br/>
|
297
|
+
<strong>Annex</strong></title>
|
298
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
299
|
+
<title depth="2">A.1
|
300
|
+
|
301
|
+
<tab/>
|
302
|
+
Annex A.1</title>
|
303
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
304
|
+
<title depth="3">A.1.1
|
305
|
+
|
306
|
+
<tab/>
|
307
|
+
Annex A.1a</title>
|
308
|
+
</clause>
|
309
|
+
</clause>
|
310
|
+
<appendix id="Q2" inline-header="false" obligation="normative">
|
311
|
+
<title depth="2">Appendix 1
|
312
|
+
|
313
|
+
<tab/>
|
314
|
+
An Appendix</title>
|
315
|
+
</appendix>
|
316
|
+
</annex>
|
317
|
+
<bibliography>
|
318
|
+
<references id="R" normative="true" obligation="informative">
|
319
|
+
<title depth="1">Normative References</title>
|
320
|
+
</references>
|
321
|
+
<clause id="S" obligation="informative">
|
322
|
+
<title depth="1">Bibliography</title>
|
323
|
+
<references id="T" normative="false" obligation="informative">
|
324
|
+
<title depth="2">Bibliography Subsection</title>
|
325
|
+
</references>
|
326
|
+
</clause>
|
327
|
+
</bibliography>
|
328
|
+
</iso-standard>
|
329
|
+
OUTPUT
|
317
330
|
end
|
318
331
|
|
319
|
-
|
320
|
-
|
332
|
+
it "processes section names" do
|
333
|
+
input = <<~INPUT
|
321
334
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
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
|
-
|
335
|
+
<bibdata>
|
336
|
+
<ext>
|
337
|
+
<doctype>amendment</doctype>
|
338
|
+
</ext>
|
339
|
+
</bibdata>
|
340
|
+
<boilerplate>
|
341
|
+
<copyright-statement>
|
342
|
+
<clause>
|
343
|
+
<title>Copyright</title>
|
344
|
+
</clause>
|
345
|
+
</copyright-statement>
|
346
|
+
<license-statement>
|
347
|
+
<clause>
|
348
|
+
<title>License</title>
|
349
|
+
</clause>
|
350
|
+
</license-statement>
|
351
|
+
<legal-statement>
|
352
|
+
<clause>
|
353
|
+
<title>Legal</title>
|
354
|
+
</clause>
|
355
|
+
</legal-statement>
|
356
|
+
<feedback-statement>
|
357
|
+
<clause>
|
358
|
+
<title>Feedback</title>
|
359
|
+
</clause>
|
360
|
+
</feedback-statement>
|
361
|
+
</boilerplate>
|
362
|
+
<preface>
|
363
|
+
<abstract obligation="informative">
|
364
|
+
<title>Abstract</title>
|
365
|
+
</abstract>
|
366
|
+
<foreword obligation="informative">
|
367
|
+
<title>Foreword</title>
|
368
|
+
<p id="A">This is a preamble</p>
|
369
|
+
</foreword>
|
370
|
+
<introduction id="B" obligation="informative">
|
371
|
+
<title>Introduction</title>
|
372
|
+
<clause id="C" inline-header="false" obligation="informative">
|
373
|
+
<title>Introduction Subsection</title>
|
374
|
+
</clause>
|
375
|
+
</introduction>
|
376
|
+
<clause id="B1">
|
377
|
+
<title>Dedication</title>
|
378
|
+
</clause>
|
379
|
+
<clause id="B2">
|
380
|
+
<title>Note to reader</title>
|
381
|
+
</clause>
|
382
|
+
<acknowledgements obligation="informative">
|
383
|
+
<title>Acknowledgements</title>
|
384
|
+
</acknowledgements>
|
385
|
+
</preface>
|
386
|
+
<sections>
|
387
|
+
<clause id="M" inline-header="false" obligation="normative">
|
388
|
+
<title>Clause 4</title>
|
389
|
+
<clause id="N" inline-header="false" obligation="normative">
|
390
|
+
<title>Introduction</title>
|
391
|
+
</clause>
|
392
|
+
<clause id="O" inline-header="false" obligation="normative">
|
393
|
+
<title>Clause 4.2</title>
|
394
|
+
</clause>
|
395
|
+
<clause id="O1" inline-header="false" obligation="normative"/>
|
396
|
+
</clause>
|
397
|
+
<clause id="D" obligation="normative">
|
398
|
+
<title>Scope</title>
|
399
|
+
<p id="E">Text</p>
|
400
|
+
</clause>
|
401
|
+
</sections>
|
402
|
+
<annex id="P" inline-header="false" obligation="normative">
|
403
|
+
<title>Annex</title>
|
404
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
405
|
+
<title>Annex A.1</title>
|
406
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
407
|
+
<title>Annex A.1a</title>
|
408
|
+
</clause>
|
409
|
+
</clause>
|
410
|
+
</annex>
|
411
|
+
<annex id="P1" inline-header="false" obligation="normative"/>
|
412
|
+
<bibliography>
|
413
|
+
<references id="R" normative="true" obligation="informative">
|
414
|
+
<title>Normative References</title>
|
415
|
+
</references>
|
416
|
+
<clause id="S" obligation="informative">
|
417
|
+
<title>Bibliography</title>
|
418
|
+
<references id="T" normative="false" obligation="informative">
|
419
|
+
<title>Bibliography Subsection</title>
|
420
|
+
</references>
|
421
|
+
</clause>
|
422
|
+
</bibliography>
|
423
|
+
</iso-standard>
|
397
424
|
INPUT
|
398
425
|
presxml = <<~OUTPUT
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
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
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
426
|
+
<iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
|
427
|
+
<bibdata>
|
428
|
+
<ext>
|
429
|
+
<doctype language="">amendment</doctype>
|
430
|
+
</ext>
|
431
|
+
</bibdata>
|
432
|
+
<boilerplate>
|
433
|
+
<copyright-statement>
|
434
|
+
<clause>
|
435
|
+
<title depth="1">Copyright</title>
|
436
|
+
</clause>
|
437
|
+
</copyright-statement>
|
438
|
+
<license-statement>
|
439
|
+
<clause>
|
440
|
+
<title depth="1">License</title>
|
441
|
+
</clause>
|
442
|
+
</license-statement>
|
443
|
+
<legal-statement>
|
444
|
+
<clause>
|
445
|
+
<title depth="1">Legal</title>
|
446
|
+
</clause>
|
447
|
+
</legal-statement>
|
448
|
+
<feedback-statement>
|
449
|
+
<clause>
|
450
|
+
<title depth="1">Feedback</title>
|
451
|
+
</clause>
|
452
|
+
</feedback-statement>
|
453
|
+
</boilerplate>
|
454
|
+
<preface>
|
455
|
+
<abstract obligation="informative">
|
456
|
+
<title>Abstract</title>
|
457
|
+
</abstract>
|
458
|
+
<foreword obligation="informative">
|
459
|
+
<title>Foreword</title>
|
460
|
+
<p id="A">This is a preamble</p>
|
461
|
+
</foreword>
|
462
|
+
<introduction id="B" obligation="informative">
|
463
|
+
<title depth="1">Introduction</title>
|
464
|
+
<clause id="C" inline-header="false" obligation="informative">
|
465
|
+
<title depth="2">Introduction Subsection</title>
|
466
|
+
</clause>
|
467
|
+
</introduction>
|
468
|
+
<clause id="B1">
|
469
|
+
<title depth="1">Dedication</title>
|
470
|
+
</clause>
|
471
|
+
<clause id="B2">
|
472
|
+
<title depth="1">Note to reader</title>
|
473
|
+
</clause>
|
474
|
+
<acknowledgements obligation="informative">
|
475
|
+
<title>Acknowledgements</title>
|
476
|
+
</acknowledgements>
|
477
|
+
</preface>
|
478
|
+
<sections>
|
479
|
+
<clause id="M" inline-header="false" obligation="normative">
|
480
|
+
<title depth="1">Clause 4</title>
|
481
|
+
<clause id="N" inline-header="false" obligation="normative">
|
482
|
+
<title depth="2">Introduction</title>
|
483
|
+
</clause>
|
484
|
+
<clause id="O" inline-header="false" obligation="normative">
|
485
|
+
<title depth="2">Clause 4.2</title>
|
486
|
+
</clause>
|
487
|
+
<clause id="O1" inline-header="true" obligation="normative"/>
|
488
|
+
</clause>
|
489
|
+
<clause id="D" obligation="normative">
|
490
|
+
<title depth="1">Scope</title>
|
491
|
+
<p id="E">Text</p>
|
492
|
+
</clause>
|
493
|
+
</sections>
|
494
|
+
<annex id="P" inline-header="false" obligation="normative">
|
495
|
+
<title>
|
496
|
+
<strong>Annex A</strong>
|
497
|
+
<br/>(normative)
|
498
|
+
<br/>
|
499
|
+
<br/>
|
500
|
+
<strong>Annex</strong></title>
|
501
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
502
|
+
<title depth="2">A.1
|
503
|
+
<tab/>
|
504
|
+
Annex A.1</title>
|
505
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
506
|
+
<title depth="3">A.1.1
|
507
|
+
<tab/>
|
508
|
+
Annex A.1a</title>
|
509
|
+
</clause>
|
510
|
+
</clause>
|
511
|
+
</annex>
|
512
|
+
<annex id="P1" inline-header="false" obligation="normative">
|
513
|
+
<title>
|
514
|
+
<strong>Annex B</strong>
|
515
|
+
<br/>(normative)</title>
|
516
|
+
</annex>
|
517
|
+
<bibliography>
|
518
|
+
<references id="R" normative="true" obligation="informative">
|
519
|
+
<title depth="1">Normative References</title>
|
520
|
+
</references>
|
521
|
+
<clause id="S" obligation="informative">
|
522
|
+
<title depth="1">Bibliography</title>
|
523
|
+
<references id="T" normative="false" obligation="informative">
|
524
|
+
<title depth="2">Bibliography Subsection</title>
|
525
|
+
</references>
|
526
|
+
</clause>
|
527
|
+
</bibliography>
|
528
|
+
</iso-standard>
|
529
|
+
OUTPUT
|
503
530
|
html = <<~OUTPUT
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
</div>
|
510
|
-
<br/>
|
511
|
-
<div class='prefatory-section'>
|
512
|
-
<p> </p>
|
513
|
-
</div>
|
514
|
-
<br/>
|
515
|
-
<div class='main-section'>
|
516
|
-
<div class='authority'>
|
517
|
-
<div class='boilerplate-copyright'>
|
518
|
-
<div>
|
519
|
-
<h1>Copyright</h1>
|
520
|
-
</div>
|
521
|
-
</div>
|
522
|
-
<div class='boilerplate-license'>
|
523
|
-
<div>
|
524
|
-
<h1>License</h1>
|
525
|
-
</div>
|
526
|
-
</div>
|
527
|
-
<div class='boilerplate-legal'>
|
528
|
-
<div>
|
529
|
-
<h1>Legal</h1>
|
530
|
-
</div>
|
531
|
-
</div>
|
532
|
-
<div class='boilerplate-feedback'>
|
533
|
-
<div>
|
534
|
-
<h1>Feedback</h1>
|
531
|
+
<html lang="en" xmlns:epub="http://www.idpf.org/2007/ops">
|
532
|
+
<head/>
|
533
|
+
<body lang="en">
|
534
|
+
<div class="title-section">
|
535
|
+
<p> </p>
|
535
536
|
</div>
|
536
|
-
</div>
|
537
|
-
</div>
|
538
|
-
<br/>
|
539
|
-
<div>
|
540
|
-
<h1 class='AbstractTitle'>Abstract</h1>
|
541
|
-
</div>
|
542
|
-
<br/>
|
543
|
-
<div>
|
544
|
-
<h1 class='ForewordTitle'>Foreword</h1>
|
545
|
-
<p id='A'>This is a preamble</p>
|
546
|
-
</div>
|
547
|
-
<br/>
|
548
|
-
<div class='Section3' id='B'>
|
549
|
-
<h1 class='IntroTitle'>Introduction</h1>
|
550
|
-
<div id='C'>
|
551
|
-
<h2>Introduction Subsection</h2>
|
552
|
-
</div>
|
553
|
-
</div>
|
554
|
-
<br/>
|
555
|
-
<div class='Section3' id='B1'>
|
556
|
-
<h1 class='IntroTitle'>Dedication</h1>
|
557
|
-
</div>
|
558
|
-
<br/>
|
559
|
-
<div class='Section3' id='B2'>
|
560
|
-
<h1 class='IntroTitle'>Note to reader</h1>
|
561
|
-
</div>
|
562
|
-
<br/>
|
563
|
-
<div class='Section3' id=''>
|
564
|
-
<h1 class='IntroTitle'>Acknowledgements</h1>
|
565
|
-
</div>
|
566
|
-
<p class='zzSTDTitle1'/>
|
567
|
-
<div>
|
568
|
-
<h1>Normative References</h1>
|
569
|
-
</div>
|
570
|
-
<div id='M'>
|
571
|
-
<h1>Clause 4</h1>
|
572
|
-
<div id='N'>
|
573
|
-
<h2>Introduction</h2>
|
574
|
-
</div>
|
575
|
-
<div id='O'>
|
576
|
-
<h2>Clause 4.2</h2>
|
577
|
-
</div>
|
578
|
-
<div id='O1'>
|
579
|
-
</div>
|
580
|
-
</div>
|
581
|
-
<div id='D'>
|
582
|
-
<h1>Scope</h1>
|
583
|
-
<p id='E'>Text</p>
|
584
|
-
</div>
|
585
|
-
<br/>
|
586
|
-
<div id='P' class='Section3'>
|
587
|
-
<h1 class='Annex'>
|
588
|
-
<b>Annex A</b>
|
589
|
-
<br/>
|
590
|
-
(normative)
|
591
537
|
<br/>
|
538
|
+
<div class="prefatory-section">
|
539
|
+
<p> </p>
|
540
|
+
</div>
|
592
541
|
<br/>
|
593
|
-
<
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
542
|
+
<div class="main-section">
|
543
|
+
<div class="authority">
|
544
|
+
<div class="boilerplate-copyright">
|
545
|
+
<div>
|
546
|
+
<h1>Copyright</h1>
|
547
|
+
</div>
|
548
|
+
</div>
|
549
|
+
<div class="boilerplate-license">
|
550
|
+
<div>
|
551
|
+
<h1>License</h1>
|
552
|
+
</div>
|
553
|
+
</div>
|
554
|
+
<div class="boilerplate-legal">
|
555
|
+
<div>
|
556
|
+
<h1>Legal</h1>
|
557
|
+
</div>
|
558
|
+
</div>
|
559
|
+
<div class="boilerplate-feedback">
|
560
|
+
<div>
|
561
|
+
<h1>Feedback</h1>
|
562
|
+
</div>
|
563
|
+
</div>
|
564
|
+
</div>
|
565
|
+
<br/>
|
566
|
+
<div>
|
567
|
+
<h1 class="AbstractTitle">Abstract</h1>
|
568
|
+
</div>
|
569
|
+
<br/>
|
570
|
+
<div>
|
571
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
572
|
+
<p id="A">This is a preamble</p>
|
573
|
+
</div>
|
574
|
+
<br/>
|
575
|
+
<div class="Section3" id="B">
|
576
|
+
<h1 class="IntroTitle">Introduction</h1>
|
577
|
+
<div id="C">
|
578
|
+
<h2>Introduction Subsection</h2>
|
579
|
+
</div>
|
580
|
+
</div>
|
581
|
+
<br/>
|
582
|
+
<div class="Section3" id="B1">
|
583
|
+
<h1 class="IntroTitle">Dedication</h1>
|
584
|
+
</div>
|
585
|
+
<br/>
|
586
|
+
<div class="Section3" id="B2">
|
587
|
+
<h1 class="IntroTitle">Note to reader</h1>
|
588
|
+
</div>
|
589
|
+
<br/>
|
590
|
+
<div class="Section3" id="">
|
591
|
+
<h1 class="IntroTitle">Acknowledgements</h1>
|
592
|
+
</div>
|
593
|
+
<p class="zzSTDTitle1"/>
|
594
|
+
<div>
|
595
|
+
<h1>Normative References</h1>
|
596
|
+
</div>
|
597
|
+
<div id="M">
|
598
|
+
<h1>Clause 4</h1>
|
599
|
+
<div id="N">
|
600
|
+
<h2>Introduction</h2>
|
601
|
+
</div>
|
602
|
+
<div id="O">
|
603
|
+
<h2>Clause 4.2</h2>
|
604
|
+
</div>
|
605
|
+
<div id="O1"/>
|
606
|
+
</div>
|
607
|
+
<div id="D">
|
608
|
+
<h1>Scope</h1>
|
609
|
+
<p id="E">Text</p>
|
610
|
+
</div>
|
611
|
+
<br/>
|
612
|
+
<div class="Section3" id="P">
|
613
|
+
<h1 class="Annex">
|
614
|
+
<b>Annex A</b>
|
615
|
+
<br/>(normative)
|
616
|
+
<br/>
|
617
|
+
<br/>
|
618
|
+
<b>Annex</b></h1>
|
619
|
+
<div id="Q">
|
620
|
+
<h2>A.1   Annex A.1</h2>
|
621
|
+
<div id="Q1">
|
622
|
+
<h3>A.1.1   Annex A.1a</h3>
|
623
|
+
</div>
|
624
|
+
</div>
|
625
|
+
</div>
|
626
|
+
<br/>
|
627
|
+
<div class="Section3" id="P1">
|
628
|
+
<h1 class="Annex">
|
629
|
+
<b>Annex B</b>
|
630
|
+
<br/>(normative)</h1>
|
631
|
+
</div>
|
632
|
+
<br/>
|
633
|
+
<div>
|
634
|
+
<h1 class="Section3">Bibliography</h1>
|
635
|
+
<div>
|
636
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
637
|
+
</div>
|
638
|
+
</div>
|
599
639
|
</div>
|
600
|
-
</
|
601
|
-
</
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
<b>Annex B</b>
|
606
|
-
<br/>
|
607
|
-
(normative)
|
608
|
-
</h1>
|
609
|
-
</div>
|
610
|
-
<br/>
|
611
|
-
<div>
|
612
|
-
<h1 class='Section3'>Bibliography</h1>
|
613
|
-
<div>
|
614
|
-
<h2 class='Section3'>Bibliography Subsection</h2>
|
615
|
-
</div>
|
616
|
-
</div>
|
617
|
-
</div>
|
618
|
-
</body>
|
619
|
-
</html>
|
620
|
-
OUTPUT
|
621
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
|
640
|
+
</body>
|
641
|
+
</html>
|
642
|
+
OUTPUT
|
643
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))
|
644
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
|
622
645
|
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
623
|
-
|
646
|
+
end
|
624
647
|
|
625
|
-
|
648
|
+
it "processes IsoXML metadata" do
|
626
649
|
c = IsoDoc::Iso::HtmlConvert.new({})
|
627
|
-
|
628
|
-
|
650
|
+
_ = c.convert_init(<<~"INPUT", "test", false)
|
651
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
629
652
|
INPUT
|
630
|
-
|
631
|
-
<iso-standard xmlns=
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
<title
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
</title>
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
:
|
724
|
-
:
|
725
|
-
:
|
726
|
-
:
|
727
|
-
:
|
728
|
-
:
|
729
|
-
:
|
730
|
-
:
|
731
|
-
:
|
732
|
-
:
|
733
|
-
:
|
734
|
-
:
|
735
|
-
:
|
736
|
-
:
|
737
|
-
:
|
738
|
-
:
|
739
|
-
:
|
740
|
-
:
|
741
|
-
:
|
742
|
-
:
|
743
|
-
:
|
744
|
-
:
|
745
|
-
:
|
746
|
-
:
|
747
|
-
:
|
748
|
-
:
|
749
|
-
:
|
750
|
-
:
|
751
|
-
:
|
752
|
-
:
|
753
|
-
:
|
754
|
-
:
|
755
|
-
:
|
756
|
-
:
|
757
|
-
:
|
758
|
-
:
|
759
|
-
:
|
760
|
-
:
|
761
|
-
:
|
762
|
-
:
|
763
|
-
:
|
764
|
-
:
|
765
|
-
:
|
766
|
-
:
|
767
|
-
:
|
768
|
-
:
|
769
|
-
:
|
770
|
-
:
|
771
|
-
:
|
772
|
-
:
|
773
|
-
:
|
774
|
-
:
|
775
|
-
:
|
776
|
-
:
|
777
|
-
:
|
778
|
-
:
|
779
|
-
|
780
|
-
OUTPUT
|
653
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
654
|
+
<iso-standard xmlns="https://www.metanorma.org/ns/iso">
|
655
|
+
<bibdata type="standard">
|
656
|
+
<title format="text/plain" language="en" type="main">Introduction — Main Title — Title — Title Part — Mass fraction of
|
657
|
+
extraneous matter, milled rice (nonglutinous), sample dividers and
|
658
|
+
recommendations relating to storage and transport conditions</title>
|
659
|
+
<title format="text/plain" language="en" type="title-intro">Introduction</title>
|
660
|
+
<title format="text/plain" language="en" type="title-main">Main Title — Title</title>
|
661
|
+
<title format="text/plain" language="en" type="title-part">Title Part</title>
|
662
|
+
<title format="text/plain" language="en" type="title-amd">Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
|
663
|
+
<title format="text/plain" language="fr" type="main">Introduction Française — Titre Principal — Part du Titre — Fraction
|
664
|
+
massique de matière étrangère, riz usiné (non gluant), diviseurs
|
665
|
+
d’échantillon et recommandations relatives aux conditions d’entreposage et
|
666
|
+
de transport
|
667
|
+
</title>
|
668
|
+
<title format="text/plain" language="fr" type="title-intro">Introduction Française</title>
|
669
|
+
<title format="text/plain" language="fr" type="title-main">Titre Principal</title>
|
670
|
+
<title format="text/plain" language="fr" type="title-part">Part du Titre</title>
|
671
|
+
<title format="text/plain" language="fr" type="title-amd">Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
|
672
|
+
<docidentifier type="ISO">ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
|
673
|
+
<docidentifier type="iso-with-lang">ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
|
674
|
+
<docidentifier type="iso-reference">ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
|
675
|
+
<docnumber>17301</docnumber>
|
676
|
+
<date type="created">
|
677
|
+
<on>2016-05-01</on>
|
678
|
+
</date>
|
679
|
+
<contributor>
|
680
|
+
<role type="author"/>
|
681
|
+
<organization>
|
682
|
+
<name>International Organization for Standardization</name>
|
683
|
+
<abbreviation>ISO</abbreviation>
|
684
|
+
</organization>
|
685
|
+
</contributor>
|
686
|
+
<contributor>
|
687
|
+
<role type="publisher"/>
|
688
|
+
<organization>
|
689
|
+
<name>International Organization for Standardization</name>
|
690
|
+
<abbreviation>ISO</abbreviation>
|
691
|
+
</organization>
|
692
|
+
</contributor>
|
693
|
+
<edition>2</edition>
|
694
|
+
<version>
|
695
|
+
<revision-date>2000-01-01</revision-date>
|
696
|
+
<draft>0.3.4</draft>
|
697
|
+
</version>
|
698
|
+
<language>en</language>
|
699
|
+
<script>Latn</script>
|
700
|
+
<status>
|
701
|
+
<stage abbreviation="NWIP">10</stage>
|
702
|
+
<substage>20</substage>
|
703
|
+
<iteration>3</iteration>
|
704
|
+
</status>
|
705
|
+
<copyright>
|
706
|
+
<from>2017</from>
|
707
|
+
<owner>
|
708
|
+
<organization>
|
709
|
+
<name>International Organization for Standardization</name>
|
710
|
+
<abbreviation>ISO</abbreviation>
|
711
|
+
</organization>
|
712
|
+
</owner>
|
713
|
+
</copyright>
|
714
|
+
<ext>
|
715
|
+
<doctype>amendment</doctype>
|
716
|
+
<editorialgroup>
|
717
|
+
<technical-committee number="1" type="A">TC</technical-committee>
|
718
|
+
<technical-committee number="11" type="A1">TC1</technical-committee>
|
719
|
+
<subcommittee number="2" type="B">SC</subcommittee>
|
720
|
+
<subcommittee number="21" type="B1">SC1</subcommittee>
|
721
|
+
<workgroup number="3" type="C">WG</workgroup>
|
722
|
+
<workgroup number="31" type="C1">WG1</workgroup>
|
723
|
+
<secretariat>SECRETARIAT</secretariat>
|
724
|
+
</editorialgroup>
|
725
|
+
<ics>
|
726
|
+
<code>1</code>
|
727
|
+
</ics>
|
728
|
+
<ics>
|
729
|
+
<code>2</code>
|
730
|
+
</ics>
|
731
|
+
<ics>
|
732
|
+
<code>3</code>
|
733
|
+
</ics>
|
734
|
+
<structuredidentifier>
|
735
|
+
<project-number amendment="1" corrigendum="2" origyr="2016-05-01" part="1">17301</project-number>
|
736
|
+
</structuredidentifier>
|
737
|
+
<stagename>New work item proposal</stagename>
|
738
|
+
<updates-document-type>international-standard</updates-document-type>
|
739
|
+
</ext>
|
740
|
+
</bibdata>
|
741
|
+
<sections/>
|
742
|
+
</iso-standard>
|
743
|
+
INPUT
|
744
|
+
{:accesseddate=>"XXX",
|
745
|
+
:agency=>"ISO",
|
746
|
+
:circulateddate=>"XXX",
|
747
|
+
:confirmeddate=>"XXX",
|
748
|
+
:copieddate=>"XXX",
|
749
|
+
:createddate=>"2016-05-01",
|
750
|
+
:docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
|
751
|
+
:docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
|
752
|
+
:docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
|
753
|
+
:docnumeric=>"17301",
|
754
|
+
:docsubtitle=>"Introduction Française — Titre Principal — Partie 1: Part du Titre",
|
755
|
+
:docsubtitleamd=>"Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport",
|
756
|
+
:docsubtitleamdlabel=>"AMENDMENT 1",
|
757
|
+
:docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE 2",
|
758
|
+
:docsubtitleintro=>"Introduction Française",
|
759
|
+
:docsubtitlemain=>"Titre Principal",
|
760
|
+
:docsubtitlepart=>"Part du Titre",
|
761
|
+
:docsubtitlepartlabel=>"Partie 1",
|
762
|
+
:doctitle=>"Introduction — Main Title — Title — Part 1: Title Part",
|
763
|
+
:doctitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
|
764
|
+
:doctitleamdlabel=>"AMENDMENT 1",
|
765
|
+
:doctitlecorrlabel=>"TECHNICAL CORRIGENDUM 2",
|
766
|
+
:doctitleintro=>"Introduction",
|
767
|
+
:doctitlemain=>"Main Title — Title",
|
768
|
+
:doctitlepart=>"Title Part",
|
769
|
+
:doctitlepartlabel=>"Part 1",
|
770
|
+
:doctype=>"Amendment",
|
771
|
+
:doctype_display=>"Amendment",
|
772
|
+
:docyear=>"2017",
|
773
|
+
:draft=>"0.3.4",
|
774
|
+
:draftinfo=>" (draft 0.3.4, 2000-01-01)",
|
775
|
+
:edition=>"2",
|
776
|
+
:editorialgroup=>["A 1", "B 2", "C 3"],
|
777
|
+
:ics=>"1, 2, 3",
|
778
|
+
:implementeddate=>"XXX",
|
779
|
+
:issueddate=>"XXX",
|
780
|
+
:lang=>"en",
|
781
|
+
:obsoleteddate=>"XXX",
|
782
|
+
:publisheddate=>"XXX",
|
783
|
+
:publisher=>"International Organization for Standardization",
|
784
|
+
:receiveddate=>"XXX",
|
785
|
+
:revdate=>"2000-01-01",
|
786
|
+
:revdate_monthyear=>"January 2000",
|
787
|
+
:sc=>"B 2",
|
788
|
+
:script=>"Latn",
|
789
|
+
:secretariat=>"SECRETARIAT",
|
790
|
+
:stage=>"10",
|
791
|
+
:stage_int=>10,
|
792
|
+
:stageabbr=>"NWIP",
|
793
|
+
:statusabbr=>"PreNWIP3",
|
794
|
+
:tc=>"A 1",
|
795
|
+
:transmitteddate=>"XXX",
|
796
|
+
:unchangeddate=>"XXX",
|
797
|
+
:unpublished=>true,
|
798
|
+
:updateddate=>"XXX",
|
799
|
+
:vote_endeddate=>"XXX",
|
800
|
+
:vote_starteddate=>"XXX",
|
801
|
+
:wg=>"C 3"}
|
802
|
+
OUTPUT
|
781
803
|
end
|
782
804
|
|
783
|
-
|
805
|
+
it "processes IsoXML metadata in French" do
|
784
806
|
c = IsoDoc::Iso::HtmlConvert.new({})
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
807
|
+
_ = c.convert_init(<<~"INPUT", "test", false)
|
808
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
809
|
+
<bibdata>
|
810
|
+
<language>fr</language>
|
811
|
+
</bibdata>
|
812
|
+
</iso-standard>
|
791
813
|
INPUT
|
792
|
-
|
793
|
-
<iso-standard xmlns=
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
<title
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
</title>
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
:
|
887
|
-
:
|
888
|
-
:
|
889
|
-
:
|
890
|
-
:
|
891
|
-
:
|
892
|
-
:
|
893
|
-
:
|
894
|
-
:
|
895
|
-
:
|
896
|
-
:
|
897
|
-
:
|
898
|
-
:
|
899
|
-
:
|
900
|
-
:
|
901
|
-
:
|
902
|
-
:
|
903
|
-
:
|
904
|
-
:
|
905
|
-
:
|
906
|
-
:
|
907
|
-
:
|
908
|
-
:
|
909
|
-
:
|
910
|
-
:
|
911
|
-
:
|
912
|
-
:
|
913
|
-
:
|
914
|
-
:
|
915
|
-
:
|
916
|
-
:
|
917
|
-
:
|
918
|
-
:
|
919
|
-
:
|
920
|
-
:
|
921
|
-
:
|
922
|
-
:
|
923
|
-
:
|
924
|
-
:
|
925
|
-
:
|
926
|
-
:
|
927
|
-
:
|
928
|
-
:
|
929
|
-
:
|
930
|
-
:
|
931
|
-
:
|
932
|
-
:
|
933
|
-
:
|
934
|
-
:
|
935
|
-
:
|
936
|
-
:
|
937
|
-
:
|
938
|
-
:
|
939
|
-
:
|
940
|
-
:
|
941
|
-
:
|
942
|
-
|
943
|
-
|
944
|
-
end
|
814
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
815
|
+
<iso-standard xmlns="https://www.metanorma.org/ns/iso">
|
816
|
+
<bibdata type="standard">
|
817
|
+
<title format="text/plain" language="en" type="main">Introduction — Main Title — Title — Title Part — Mass fraction of
|
818
|
+
extraneous matter, milled rice (nonglutinous), sample dividers and
|
819
|
+
recommendations relating to storage and transport conditions</title>
|
820
|
+
<title format="text/plain" language="en" type="title-intro">Introduction</title>
|
821
|
+
<title format="text/plain" language="en" type="title-main">Main Title — Title</title>
|
822
|
+
<title format="text/plain" language="en" type="title-part">Title Part</title>
|
823
|
+
<title format="text/plain" language="en" type="title-amd">Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
|
824
|
+
<title format="text/plain" language="fr" type="main">Introduction Française — Titre Principal — Part du Titre — Fraction
|
825
|
+
massique de matière étrangère, riz usiné (non gluant), diviseurs
|
826
|
+
d’échantillon et recommandations relatives aux conditions d’entreposage et
|
827
|
+
de transport
|
828
|
+
</title>
|
829
|
+
<title format="text/plain" language="fr" type="title-intro">Introduction Française</title>
|
830
|
+
<title format="text/plain" language="fr" type="title-main">Titre Principal</title>
|
831
|
+
<title format="text/plain" language="fr" type="title-part">Part du Titre</title>
|
832
|
+
<title format="text/plain" language="fr" type="title-amd">Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
|
833
|
+
<docidentifier type="ISO">ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
|
834
|
+
<docidentifier type="iso-with-lang">ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
|
835
|
+
<docidentifier type="iso-reference">ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
|
836
|
+
<docnumber>17301</docnumber>
|
837
|
+
<date type="created">
|
838
|
+
<on>2016-05-01</on>
|
839
|
+
</date>
|
840
|
+
<contributor>
|
841
|
+
<role type="author"/>
|
842
|
+
<organization>
|
843
|
+
<name>International Organization for Standardization</name>
|
844
|
+
<abbreviation>ISO</abbreviation>
|
845
|
+
</organization>
|
846
|
+
</contributor>
|
847
|
+
<contributor>
|
848
|
+
<role type="publisher"/>
|
849
|
+
<organization>
|
850
|
+
<name>International Organization for Standardization</name>
|
851
|
+
<abbreviation>ISO</abbreviation>
|
852
|
+
</organization>
|
853
|
+
</contributor>
|
854
|
+
<edition>2</edition>
|
855
|
+
<version>
|
856
|
+
<revision-date>2000-01-01</revision-date>
|
857
|
+
<draft>0.3.4</draft>
|
858
|
+
</version>
|
859
|
+
<language>fr</language>
|
860
|
+
<script>Latn</script>
|
861
|
+
<status>
|
862
|
+
<stage abbreviation="NWIP">10</stage>
|
863
|
+
<substage>20</substage>
|
864
|
+
<iteration>3</iteration>
|
865
|
+
</status>
|
866
|
+
<copyright>
|
867
|
+
<from>2017</from>
|
868
|
+
<owner>
|
869
|
+
<organization>
|
870
|
+
<name>International Organization for Standardization</name>
|
871
|
+
<abbreviation>ISO</abbreviation>
|
872
|
+
</organization>
|
873
|
+
</owner>
|
874
|
+
</copyright>
|
875
|
+
<ext>
|
876
|
+
<doctype language="">amendment</doctype>
|
877
|
+
<doctype language="fr">Amendment</doctype>
|
878
|
+
<editorialgroup>
|
879
|
+
<technical-committee number="1" type="A">TC</technical-committee>
|
880
|
+
<technical-committee number="11" type="A1">TC1</technical-committee>
|
881
|
+
<subcommittee number="2" type="B">SC</subcommittee>
|
882
|
+
<subcommittee number="21" type="B1">SC1</subcommittee>
|
883
|
+
<workgroup number="3" type="C">WG</workgroup>
|
884
|
+
<workgroup number="31" type="C1">WG1</workgroup>
|
885
|
+
<secretariat>SECRETARIAT</secretariat>
|
886
|
+
</editorialgroup>
|
887
|
+
<ics>
|
888
|
+
<code>1</code>
|
889
|
+
</ics>
|
890
|
+
<ics>
|
891
|
+
<code>2</code>
|
892
|
+
</ics>
|
893
|
+
<ics>
|
894
|
+
<code>3</code>
|
895
|
+
</ics>
|
896
|
+
<structuredidentifier>
|
897
|
+
<project-number amendment="1" corrigendum="2" origyr="2016-05-01" part="1">17301</project-number>
|
898
|
+
</structuredidentifier>
|
899
|
+
<stagename>New work item proposal</stagename>
|
900
|
+
<updates-document-type>international-standard</updates-document-type>
|
901
|
+
</ext>
|
902
|
+
</bibdata>
|
903
|
+
<sections/>
|
904
|
+
</iso-standard>
|
905
|
+
INPUT
|
906
|
+
{:accesseddate=>"XXX",
|
907
|
+
:agency=>"ISO",
|
908
|
+
:circulateddate=>"XXX",
|
909
|
+
:confirmeddate=>"XXX",
|
910
|
+
:copieddate=>"XXX",
|
911
|
+
:createddate=>"2016-05-01",
|
912
|
+
:docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
|
913
|
+
:docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
|
914
|
+
:docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
|
915
|
+
:docnumeric=>"17301",
|
916
|
+
:docsubtitle=>"Introduction — Main Title — Title — Part 1: Title Part",
|
917
|
+
:docsubtitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
|
918
|
+
:docsubtitleamdlabel=>"AMENDMENT 1",
|
919
|
+
:docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM 2",
|
920
|
+
:docsubtitleintro=>"Introduction",
|
921
|
+
:docsubtitlemain=>"Main Title — Title",
|
922
|
+
:docsubtitlepart=>"Title Part",
|
923
|
+
:docsubtitlepartlabel=>"Part 1",
|
924
|
+
:doctitle=>"Introduction Française — Titre Principal — Partie 1: Part du Titre",
|
925
|
+
:doctitleamd=>"Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport",
|
926
|
+
:doctitleamdlabel=>"AMENDMENT 1",
|
927
|
+
:doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE 2",
|
928
|
+
:doctitleintro=>"Introduction Française",
|
929
|
+
:doctitlemain=>"Titre Principal",
|
930
|
+
:doctitlepart=>"Part du Titre",
|
931
|
+
:doctitlepartlabel=>"Partie 1",
|
932
|
+
:doctype=>"Amendment",
|
933
|
+
:doctype_display=>"Amendment",
|
934
|
+
:docyear=>"2017",
|
935
|
+
:draft=>"0.3.4",
|
936
|
+
:draftinfo=>" (brouillon 0.3.4, 2000-01-01)",
|
937
|
+
:edition=>"2",
|
938
|
+
:editorialgroup=>["A 1", "B 2", "C 3"],
|
939
|
+
:ics=>"1, 2, 3",
|
940
|
+
:implementeddate=>"XXX",
|
941
|
+
:issueddate=>"XXX",
|
942
|
+
:lang=>"fr",
|
943
|
+
:obsoleteddate=>"XXX",
|
944
|
+
:publisheddate=>"XXX",
|
945
|
+
:publisher=>"International Organization for Standardization",
|
946
|
+
:receiveddate=>"XXX",
|
947
|
+
:revdate=>"2000-01-01",
|
948
|
+
:revdate_monthyear=>"Janvier 2000",
|
949
|
+
:sc=>"B 2",
|
950
|
+
:script=>"Latn",
|
951
|
+
:secretariat=>"SECRETARIAT",
|
952
|
+
:stage=>"10",
|
953
|
+
:stage_int=>10,
|
954
|
+
:stageabbr=>"NWIP",
|
955
|
+
:statusabbr=>"PreNWIP3",
|
956
|
+
:tc=>"A 1",
|
957
|
+
:transmitteddate=>"XXX",
|
958
|
+
:unchangeddate=>"XXX",
|
959
|
+
:unpublished=>true,
|
960
|
+
:updateddate=>"XXX",
|
961
|
+
:vote_endeddate=>"XXX",
|
962
|
+
:vote_starteddate=>"XXX",
|
963
|
+
:wg=>"C 3"}
|
964
|
+
OUTPUT
|
965
|
+
end
|
945
966
|
|
946
967
|
it "processes middle title" do
|
947
|
-
|
968
|
+
output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
|
948
969
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
949
|
-
|
950
|
-
<title
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
</ext>
|
959
|
-
|
960
|
-
|
970
|
+
<bibdata>
|
971
|
+
<title format="text/plain" language="en" type="title-intro">Introduction</title>
|
972
|
+
<title format="text/plain" language="en" type="title-main">Main Title — Title</title>
|
973
|
+
<title format="text/plain" language="en" type="title-part">Title Part</title>
|
974
|
+
<title format="text/plain" language="en" type="title-amd">Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
|
975
|
+
<ext>
|
976
|
+
<structuredidentifier>
|
977
|
+
<project-number amendment="1" corrigendum="2" origyr="2016-05-01" part="1">17301</project-number>
|
978
|
+
</structuredidentifier>
|
979
|
+
</ext>
|
980
|
+
</bibdata>
|
981
|
+
<sections/>
|
961
982
|
</iso-standard>
|
962
983
|
INPUT
|
963
|
-
|
964
|
-
<p class='zzSTDTitle1'>Introduction — Main Title — Title — </p>
|
965
|
-
<p class='zzSTDTitle2'>
|
966
|
-
Part 1:
|
967
|
-
<br/><b>Title Part</b>
|
968
|
-
</p>
|
969
|
-
<p class='zzSTDTitle2'>
|
970
|
-
AMENDMENT 1: Mass fraction of extraneous matter, milled rice
|
971
|
-
(nonglutinous), sample dividers and recommendations relating to storage
|
972
|
-
and transport conditions
|
973
|
-
</p>
|
974
|
-
<p class='zzSTDTitle2'>TECHNICAL CORRIGENDUM 2</p>
|
975
|
-
</div>
|
976
|
-
</body>
|
977
|
-
</html>
|
978
|
-
OUTPUT
|
979
|
-
end
|
980
|
-
|
984
|
+
expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
981
985
|
|
986
|
+
#{HTML_HDR}
|
987
|
+
<p class='zzSTDTitle1'>Introduction — Main Title — Title — </p>
|
988
|
+
<p class='zzSTDTitle2'>
|
989
|
+
Part 1:
|
990
|
+
<br/><b>Title Part</b>
|
991
|
+
</p>
|
992
|
+
<p class='zzSTDTitle2'>
|
993
|
+
AMENDMENT 1: Mass fraction of extraneous matter, milled rice
|
994
|
+
(nonglutinous), sample dividers and recommendations relating to storage
|
995
|
+
and transport conditions
|
996
|
+
</p>
|
997
|
+
<p class='zzSTDTitle2'>TECHNICAL CORRIGENDUM 2</p>
|
998
|
+
</div>
|
999
|
+
</body>
|
1000
|
+
</html>
|
1001
|
+
OUTPUT
|
1002
|
+
end
|
982
1003
|
end
|