isodoc 1.6.4 → 1.6.5
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 +1 -1
- data/.rubocop.yml +1 -1
- data/isodoc.gemspec +2 -1
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc/convert.rb +3 -1
- data/lib/isodoc/function/blocks.rb +5 -4
- data/lib/isodoc/function/references.rb +32 -51
- data/lib/isodoc/function/section.rb +0 -1
- data/lib/isodoc/function/table.rb +21 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/gem_tasks.rb +8 -9
- data/lib/isodoc/html_convert.rb +5 -1
- data/lib/isodoc/html_function/comments.rb +12 -12
- data/lib/isodoc/html_function/html.rb +2 -2
- data/lib/isodoc/html_function/postprocess.rb +191 -185
- data/lib/isodoc/html_function/sectionsplit.rb +230 -0
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/presentation_function/section.rb +39 -1
- data/lib/isodoc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref.rb +2 -0
- data/spec/isodoc/blocks_spec.rb +184 -447
- data/spec/isodoc/cleanup_spec.rb +40 -42
- data/spec/isodoc/i18n_spec.rb +694 -821
- data/spec/isodoc/inline_spec.rb +43 -42
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +53 -6
- data/spec/isodoc/presentation_xml_spec.rb +4 -4
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/isodoc/xref_spec.rb +974 -932
- metadata +19 -3
data/spec/isodoc/cleanup_spec.rb
CHANGED
@@ -1058,49 +1058,47 @@ RSpec.describe IsoDoc do
|
|
1058
1058
|
c = IsoDoc::HtmlConvert.new({ i18nyaml: "spec/assets/i18n.yaml" })
|
1059
1059
|
c.i18n_init("en", "Latn")
|
1060
1060
|
expect(xmlpp(c.textcleanup(<<~"INPUT").to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1061
|
+
#{HTML_HDR}
|
1062
|
+
<p class="zzSTDTitle1"/>
|
1063
|
+
<div id="_terms_and_definitions"><h1>1.  Terms and Definitions</h1><p>For the purposes of this document,
|
1064
|
+
the following terms and definitions apply.</p>
|
1065
|
+
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
1066
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
1067
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
|
1068
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
1069
|
+
<ul>
|
1070
|
+
<li>A</li>
|
1071
|
+
</ul>
|
1072
|
+
</div>
|
1073
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
1074
|
+
<ul>
|
1075
|
+
<li>A</li>
|
1076
|
+
</ul>
|
1077
|
+
</div>
|
1078
|
+
<p>[TERMREF]
|
1079
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1080
|
+
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
1081
|
+
[/TERMREF]</p>
|
1082
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
1083
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION] [/TERMREF]</p>
|
1084
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
1085
|
+
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
1086
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
1087
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
1088
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
1089
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
1090
|
+
<ul>
|
1091
|
+
<li>A</li>
|
1092
|
+
</ul>
|
1093
|
+
</div>
|
1094
|
+
<div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
1095
|
+
<div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
|
1096
|
+
<p>[TERMREF]
|
1097
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1098
|
+
[/TERMREF]</p></div>
|
1073
1099
|
</div>
|
1074
|
-
|
1075
|
-
|
1076
|
-
<li>A</li>
|
1077
|
-
</ul>
|
1078
|
-
</div>
|
1079
|
-
#{' '}
|
1080
|
-
<p>[TERMREF]
|
1081
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1082
|
-
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
1083
|
-
[/TERMREF]</p>
|
1084
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
1085
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION] [/TERMREF]</p>
|
1086
|
-
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
1087
|
-
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
1088
|
-
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
1089
|
-
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
1090
|
-
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
1091
|
-
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
1092
|
-
<ul>
|
1093
|
-
<li>A</li>
|
1094
|
-
</ul>
|
1095
|
-
</div>
|
1096
|
-
<div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
1097
|
-
<div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
|
1098
|
-
<p>[TERMREF]
|
1099
|
-
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1100
|
-
[/TERMREF]</p></div>
|
1101
|
-
</div>
|
1102
|
-
</body>
|
1103
|
-
</html>
|
1100
|
+
</body>
|
1101
|
+
</html>
|
1104
1102
|
INPUT
|
1105
1103
|
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
1106
1104
|
<head/>
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -68,162 +68,139 @@ RSpec.describe IsoDoc do
|
|
68
68
|
INPUT
|
69
69
|
|
70
70
|
presxml = <<~"PRESXML"
|
71
|
-
<iso-standard xmlns=
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<br/>
|
132
|
-
<br/>
|
133
|
-
<strong>Annex</strong>
|
134
|
-
</title>
|
135
|
-
<clause id='Q' inline-header='false' obligation='normative'>
|
136
|
-
<title depth='2'>A.1.<tab/>Annex A.1</title>
|
137
|
-
<clause id='Q1' inline-header='false' obligation='normative'>
|
138
|
-
<title depth='3'>A.1.1.<tab/>Annex A.1a</title>
|
139
|
-
</clause>
|
140
|
-
</clause>
|
141
|
-
</annex>
|
142
|
-
<bibliography>
|
143
|
-
<references id='R' obligation='informative' normative='true'>
|
144
|
-
<title depth='1'>2.<tab/>Normative References</title>
|
145
|
-
</references>
|
146
|
-
<clause id='S' obligation='informative'>
|
147
|
-
<title depth="1">Bibliography</title>
|
148
|
-
<references id='T' obligation='informative' normative='false'>
|
149
|
-
<title depth="2">Bibliography Subsection</title>
|
150
|
-
</references>
|
151
|
-
</clause>
|
152
|
-
</bibliography>
|
153
|
-
</iso-standard>
|
71
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
72
|
+
<bibdata>
|
73
|
+
<language current="true">en</language>
|
74
|
+
</bibdata>
|
75
|
+
<preface>
|
76
|
+
<foreword obligation="informative" displayorder="1">
|
77
|
+
<title>Foreword</title>
|
78
|
+
<p id="A">See <xref target="M">Clause 5</xref></p>
|
79
|
+
</foreword>
|
80
|
+
<introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
81
|
+
<title depth="2">Introduction Subsection</title>
|
82
|
+
</clause>
|
83
|
+
</introduction></preface><sections>
|
84
|
+
<clause id="D" obligation="normative" type="scope" displayorder="3">
|
85
|
+
<title depth="1">1.<tab/>Scope</title>
|
86
|
+
<p id="E">Text</p>
|
87
|
+
</clause>
|
88
|
+
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
89
|
+
<title depth="2">3.1.<tab/>Normal Terms</title>
|
90
|
+
<term id="J"><name>3.1.1.</name>
|
91
|
+
<preferred>Term2</preferred>
|
92
|
+
</term>
|
93
|
+
</terms>
|
94
|
+
<definitions id="K"><title>3.2.</title>
|
95
|
+
<dl>
|
96
|
+
<dt>Symbol</dt>
|
97
|
+
<dd>Definition</dd>
|
98
|
+
</dl>
|
99
|
+
</definitions>
|
100
|
+
</clause>
|
101
|
+
<definitions id="L" displayorder="6"><title>4.</title>
|
102
|
+
<dl>
|
103
|
+
<dt>Symbol</dt>
|
104
|
+
<dd>Definition</dd>
|
105
|
+
</dl>
|
106
|
+
</definitions>
|
107
|
+
<clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
108
|
+
<title depth="2">5.1.<tab/>Introduction</title>
|
109
|
+
</clause>
|
110
|
+
<clause id="O" inline-header="false" obligation="normative">
|
111
|
+
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
112
|
+
</clause></clause>
|
113
|
+
</sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
|
114
|
+
<title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
115
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
116
|
+
<title depth="2">A.1.<tab/>Annex A.1</title>
|
117
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
118
|
+
<title depth="3">A.1.1.<tab/>Annex A.1a</title>
|
119
|
+
</clause>
|
120
|
+
</clause>
|
121
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
|
122
|
+
<title depth="1">2.<tab/>Normative References</title>
|
123
|
+
</references><clause id="S" obligation="informative" displayorder="9">
|
124
|
+
<title depth="1">Bibliography</title>
|
125
|
+
<references id="T" obligation="informative" normative="false">
|
126
|
+
<title depth="2">Bibliography Subsection</title>
|
127
|
+
</references>
|
128
|
+
</clause>
|
129
|
+
</bibliography>
|
130
|
+
</iso-standard>
|
154
131
|
PRESXML
|
155
132
|
|
156
133
|
output = <<~"OUTPUT"
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
134
|
+
#{HTML_HDR}
|
135
|
+
<br/>
|
136
|
+
<div>
|
137
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
138
|
+
<p id='A'>
|
139
|
+
See
|
140
|
+
<a href='#M'>Clause 5</a>
|
141
|
+
</p>
|
142
|
+
</div>
|
143
|
+
<br/>
|
144
|
+
<div class="Section3" id="B">
|
145
|
+
<h1 class="IntroTitle">Introduction</h1>
|
146
|
+
<div id="C">
|
147
|
+
<h2>Introduction Subsection</h2>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
<p class="zzSTDTitle1"/>
|
151
|
+
<div id="D">
|
152
|
+
<h1>1.  Scope</h1>
|
153
|
+
<p id="E">Text</p>
|
154
|
+
</div>
|
155
|
+
<div>
|
156
|
+
<h1>2.  Normative References</h1>
|
157
|
+
</div>
|
158
|
+
<div id="H"><h1>3.  Terms, definitions, symbols and abbreviated terms</h1>
|
159
|
+
<div id="I">
|
160
|
+
<h2>3.1.  Normal Terms</h2>
|
161
|
+
<p class="TermNum" id="J">3.1.1.</p>
|
162
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
163
|
+
</div><div id="K"><h2>3.2.</h2>
|
164
|
+
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
165
|
+
</div></div>
|
166
|
+
<div id="L" class="Symbols">
|
167
|
+
<h1>4.</h1>
|
168
|
+
<dl>
|
169
|
+
<dt>
|
170
|
+
<p>Symbol</p>
|
171
|
+
</dt>
|
172
|
+
<dd>Definition</dd>
|
173
|
+
</dl>
|
174
|
+
</div>
|
175
|
+
<div id="M">
|
176
|
+
<h1>5.  Clause 4</h1>
|
177
|
+
<div id="N">
|
178
|
+
<h2>5.1.  Introduction</h2>
|
179
|
+
</div>
|
180
|
+
<div id="O">
|
181
|
+
<h2>5.2.  Clause 4.2</h2>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
<br/>
|
185
|
+
<div id="P" class="Section3">
|
186
|
+
<h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
|
187
|
+
<div id="Q">
|
188
|
+
<h2>A.1.  Annex A.1</h2>
|
189
|
+
<div id="Q1">
|
190
|
+
<h3>A.1.1.  Annex A.1a</h3>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
<br/>
|
195
|
+
<div>
|
196
|
+
<h1 class="Section3">Bibliography</h1>
|
197
|
+
<div>
|
198
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
</body>
|
203
|
+
</html>
|
227
204
|
OUTPUT
|
228
205
|
expect(xmlpp(IsoDoc::PresentationXMLConvert
|
229
206
|
.new({}).convert("test", input, true)
|
@@ -298,90 +275,66 @@ RSpec.describe IsoDoc do
|
|
298
275
|
</bibliography>
|
299
276
|
</iso-standard>
|
300
277
|
INPUT
|
301
|
-
|
302
|
-
<
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
(normative)
|
362
|
-
<br/>
|
363
|
-
<br/>
|
364
|
-
<strong>Annex</strong>
|
365
|
-
</title>
|
366
|
-
<clause id='Q' inline-header='false' obligation='normative'>
|
367
|
-
<title depth='2'>A.1.<tab/>Annex A.1</title>
|
368
|
-
<clause id='Q1' inline-header='false' obligation='normative'>
|
369
|
-
<title depth='3'>A.1.1.<tab/>Annex A.1a</title>
|
370
|
-
</clause>
|
371
|
-
</clause>
|
372
|
-
</annex>
|
373
|
-
<bibliography>
|
374
|
-
<references id='R' obligation='informative' normative='true'>
|
375
|
-
<title depth='1'>2.<tab/>Normative References</title>
|
376
|
-
</references>
|
377
|
-
<clause id='S' obligation='informative'>
|
378
|
-
<title depth="1">Bibliography</title>
|
379
|
-
<references id='T' obligation='informative' normative='false'>
|
380
|
-
<title depth="2">Bibliography Subsection</title>
|
381
|
-
</references>
|
382
|
-
</clause>
|
383
|
-
</bibliography>
|
384
|
-
</iso-standard>
|
278
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
279
|
+
<bibdata>
|
280
|
+
<language current="true">tlh</language>
|
281
|
+
</bibdata>
|
282
|
+
<preface>
|
283
|
+
<foreword obligation="informative" displayorder="1">
|
284
|
+
<title>Foreword</title>
|
285
|
+
<p id="A">See <xref target="M">Clause 5</xref></p>
|
286
|
+
</foreword>
|
287
|
+
<introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
288
|
+
<title depth="2">Introduction Subsection</title>
|
289
|
+
</clause>
|
290
|
+
</introduction></preface><sections>
|
291
|
+
<clause id="D" obligation="normative" type="scope" displayorder="3">
|
292
|
+
<title depth="1">1.<tab/>Scope</title>
|
293
|
+
<p id="E">Text</p>
|
294
|
+
</clause>
|
295
|
+
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
296
|
+
<title depth="2">3.1.<tab/>Normal Terms</title>
|
297
|
+
<term id="J"><name>3.1.1.</name>
|
298
|
+
<preferred>Term2</preferred>
|
299
|
+
</term>
|
300
|
+
</terms>
|
301
|
+
<definitions id="K"><title>3.2.</title>
|
302
|
+
<dl>
|
303
|
+
<dt>Symbol</dt>
|
304
|
+
<dd>Definition</dd>
|
305
|
+
</dl>
|
306
|
+
</definitions>
|
307
|
+
</clause>
|
308
|
+
<definitions id="L" displayorder="6"><title>4.</title>
|
309
|
+
<dl>
|
310
|
+
<dt>Symbol</dt>
|
311
|
+
<dd>Definition</dd>
|
312
|
+
</dl>
|
313
|
+
</definitions>
|
314
|
+
<clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
315
|
+
<title depth="2">5.1.<tab/>Introduction</title>
|
316
|
+
</clause>
|
317
|
+
<clause id="O" inline-header="false" obligation="normative">
|
318
|
+
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
319
|
+
</clause></clause>
|
320
|
+
</sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
|
321
|
+
<title><strong>Annex A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
322
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
323
|
+
<title depth="2">A.1.<tab/>Annex A.1</title>
|
324
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
325
|
+
<title depth="3">A.1.1.<tab/>Annex A.1a</title>
|
326
|
+
</clause>
|
327
|
+
</clause>
|
328
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
|
329
|
+
<title depth="1">2.<tab/>Normative References</title>
|
330
|
+
</references><clause id="S" obligation="informative" displayorder="9">
|
331
|
+
<title depth="1">Bibliography</title>
|
332
|
+
<references id="T" obligation="informative" normative="false">
|
333
|
+
<title depth="2">Bibliography Subsection</title>
|
334
|
+
</references>
|
335
|
+
</clause>
|
336
|
+
</bibliography>
|
337
|
+
</iso-standard>
|
385
338
|
OUTPUT
|
386
339
|
end
|
387
340
|
|
@@ -452,162 +405,139 @@ RSpec.describe IsoDoc do
|
|
452
405
|
INPUT
|
453
406
|
|
454
407
|
presxml = <<~"PRESXML"
|
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
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
<br/>
|
516
|
-
<br/>
|
517
|
-
<strong>Annex</strong>
|
518
|
-
</title>
|
519
|
-
<clause id='Q' inline-header='false' obligation='normative'>
|
520
|
-
<title depth='2'>A.1.<tab/>Annex A.1</title>
|
521
|
-
<clause id='Q1' inline-header='false' obligation='normative'>
|
522
|
-
<title depth='3'>A.1.1.<tab/>Annex A.1a</title>
|
523
|
-
</clause>
|
524
|
-
</clause>
|
525
|
-
</annex>
|
526
|
-
<bibliography>
|
527
|
-
<references id='R' obligation='informative' normative='true'>
|
528
|
-
<title depth='1'>2.<tab/>Normative References</title>
|
529
|
-
</references>
|
530
|
-
<clause id='S' obligation='informative'>
|
531
|
-
<title depth="1">Bibliographie</title>
|
532
|
-
<references id='T' obligation='informative' normative='false'>
|
533
|
-
<title depth="2">Bibliography Subsection</title>
|
534
|
-
</references>
|
535
|
-
</clause>
|
536
|
-
</bibliography>
|
537
|
-
</iso-standard>
|
408
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
409
|
+
<bibdata>
|
410
|
+
<language current="true">fr</language>
|
411
|
+
</bibdata>
|
412
|
+
<preface>
|
413
|
+
<foreword obligation="informative" displayorder="1">
|
414
|
+
<title>Foreword</title>
|
415
|
+
<p id="A">See <xref target="M">Article 5</xref></p>
|
416
|
+
</foreword>
|
417
|
+
<introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
418
|
+
<title depth="2">Introduction Subsection</title>
|
419
|
+
</clause>
|
420
|
+
</introduction></preface><sections>
|
421
|
+
<clause id="D" obligation="normative" type="scope" displayorder="3">
|
422
|
+
<title depth="1">1.<tab/>Scope</title>
|
423
|
+
<p id="E">Text</p>
|
424
|
+
</clause>
|
425
|
+
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
426
|
+
<title depth="2">3.1.<tab/>Normal Terms</title>
|
427
|
+
<term id="J"><name>3.1.1.</name>
|
428
|
+
<preferred>Term2</preferred>
|
429
|
+
</term>
|
430
|
+
</terms>
|
431
|
+
<definitions id="K"><title>3.2.</title>
|
432
|
+
<dl>
|
433
|
+
<dt>Symbol</dt>
|
434
|
+
<dd>Definition</dd>
|
435
|
+
</dl>
|
436
|
+
</definitions>
|
437
|
+
</clause>
|
438
|
+
<definitions id="L" displayorder="6"><title>4.</title>
|
439
|
+
<dl>
|
440
|
+
<dt>Symbol</dt>
|
441
|
+
<dd>Definition</dd>
|
442
|
+
</dl>
|
443
|
+
</definitions>
|
444
|
+
<clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
445
|
+
<title depth="2">5.1.<tab/>Introduction</title>
|
446
|
+
</clause>
|
447
|
+
<clause id="O" inline-header="false" obligation="normative">
|
448
|
+
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
449
|
+
</clause></clause>
|
450
|
+
</sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
|
451
|
+
<title><strong>Annexe A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
452
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
453
|
+
<title depth="2">A.1.<tab/>Annex A.1</title>
|
454
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
455
|
+
<title depth="3">A.1.1.<tab/>Annex A.1a</title>
|
456
|
+
</clause>
|
457
|
+
</clause>
|
458
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
|
459
|
+
<title depth="1">2.<tab/>Normative References</title>
|
460
|
+
</references><clause id="S" obligation="informative" displayorder="9">
|
461
|
+
<title depth="1">Bibliographie</title>
|
462
|
+
<references id="T" obligation="informative" normative="false">
|
463
|
+
<title depth="2">Bibliography Subsection</title>
|
464
|
+
</references>
|
465
|
+
</clause>
|
466
|
+
</bibliography>
|
467
|
+
</iso-standard>
|
538
468
|
PRESXML
|
539
469
|
|
540
470
|
output = <<~"OUTPUT"
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
471
|
+
#{HTML_HDR.gsub(/ lang="en">/, ' lang="fr">')}
|
472
|
+
<br/>
|
473
|
+
<div>
|
474
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
475
|
+
<p id='A'>
|
476
|
+
See
|
477
|
+
<a href='#M'>Article 5</a>
|
478
|
+
</p>
|
479
|
+
</div>
|
480
|
+
<br/>
|
481
|
+
<div class="Section3" id="B">
|
482
|
+
<h1 class="IntroTitle">Introduction</h1>
|
483
|
+
<div id="C">
|
484
|
+
<h2>Introduction Subsection</h2>
|
485
|
+
</div>
|
486
|
+
</div>
|
487
|
+
<p class="zzSTDTitle1"/>
|
488
|
+
<div id="D">
|
489
|
+
<h1>1.  Scope</h1>
|
490
|
+
<p id="E">Text</p>
|
491
|
+
</div>
|
492
|
+
<div>
|
493
|
+
<h1>2.  Normative References</h1>
|
494
|
+
</div>
|
495
|
+
<div id="H"><h1>3.  Terms, definitions, symbols and abbreviated terms</h1>
|
496
|
+
<div id="I">
|
497
|
+
<h2>3.1.  Normal Terms</h2>
|
498
|
+
<p class="TermNum" id="J">3.1.1.</p>
|
499
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
500
|
+
</div><div id="K"><h2>3.2.</h2>
|
501
|
+
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
502
|
+
</div></div>
|
503
|
+
<div id="L" class="Symbols">
|
504
|
+
<h1>4.</h1>
|
505
|
+
<dl>
|
506
|
+
<dt>
|
507
|
+
<p>Symbol</p>
|
508
|
+
</dt>
|
509
|
+
<dd>Definition</dd>
|
510
|
+
</dl>
|
511
|
+
</div>
|
512
|
+
<div id="M">
|
513
|
+
<h1>5.  Clause 4</h1>
|
514
|
+
<div id="N">
|
515
|
+
<h2>5.1.  Introduction</h2>
|
516
|
+
</div>
|
517
|
+
<div id="O">
|
518
|
+
<h2>5.2.  Clause 4.2</h2>
|
519
|
+
</div>
|
520
|
+
</div>
|
521
|
+
<br/>
|
522
|
+
<div id="P" class="Section3">
|
523
|
+
<h1 class="Annex"><b>Annexe A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
|
524
|
+
<div id="Q">
|
525
|
+
<h2>A.1.  Annex A.1</h2>
|
526
|
+
<div id="Q1">
|
527
|
+
<h3>A.1.1.  Annex A.1a</h3>
|
528
|
+
</div>
|
529
|
+
</div>
|
530
|
+
</div>
|
531
|
+
<br/>
|
532
|
+
<div>
|
533
|
+
<h1 class="Section3">Bibliographie</h1>
|
534
|
+
<div>
|
535
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
536
|
+
</div>
|
537
|
+
</div>
|
538
|
+
</div>
|
539
|
+
</body>
|
540
|
+
</html>
|
611
541
|
OUTPUT
|
612
542
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
613
543
|
.convert("test", input, true)
|
@@ -619,251 +549,227 @@ RSpec.describe IsoDoc do
|
|
619
549
|
|
620
550
|
it "processes Simplified Chinese" do
|
621
551
|
input = <<~"INPUT"
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
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
|
-
|
552
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
553
|
+
<bibdata>
|
554
|
+
<language>zh</language>
|
555
|
+
<script>Hans</script>
|
556
|
+
</bibdata>
|
557
|
+
<preface>
|
558
|
+
<foreword obligation="informative">
|
559
|
+
<title>Foreword</title>
|
560
|
+
<p id="A">See <xref target="M"/></p>
|
561
|
+
</foreword>
|
562
|
+
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
563
|
+
<title>Introduction Subsection</title>
|
564
|
+
</clause>
|
565
|
+
</introduction></preface><sections>
|
566
|
+
<clause id="D" obligation="normative" type="scope">
|
567
|
+
<title>Scope</title>
|
568
|
+
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
|
569
|
+
</clause>
|
570
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
571
|
+
<title>Normal Terms</title>
|
572
|
+
<term id="J">
|
573
|
+
<preferred>Term2</preferred>
|
574
|
+
</term>
|
575
|
+
</terms>
|
576
|
+
<definitions id="K">
|
577
|
+
<dl>
|
578
|
+
<dt>Symbol</dt>
|
579
|
+
<dd>Definition</dd>
|
580
|
+
</dl>
|
581
|
+
</definitions>
|
582
|
+
</clause>
|
583
|
+
<definitions id="L">
|
584
|
+
<dl>
|
585
|
+
<dt>Symbol</dt>
|
586
|
+
<dd>Definition</dd>
|
587
|
+
</dl>
|
588
|
+
</definitions>
|
589
|
+
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
590
|
+
<title>Introduction</title>
|
591
|
+
</clause>
|
592
|
+
<clause id="O" inline-header="false" obligation="normative">
|
593
|
+
<title>Clause 4.2</title>
|
594
|
+
</clause></clause>
|
595
|
+
</sections><annex id="P" inline-header="false" obligation="normative">
|
596
|
+
<title>Annex</title>
|
597
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
598
|
+
<title>Annex A.1</title>
|
599
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
600
|
+
<title>Annex A.1a</title>
|
601
|
+
</clause>
|
602
|
+
</clause>
|
603
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
604
|
+
<title>Normative References</title>
|
605
|
+
<bibitem id="ISO712" type="standard">
|
606
|
+
<title format="text/plain">Cereals and cereal products</title>
|
607
|
+
<docidentifier>ISO 712</docidentifier>
|
608
|
+
<contributor>
|
609
|
+
<role type="publisher"/>
|
610
|
+
<organization>
|
611
|
+
<abbreviation>ISO</abbreviation>
|
612
|
+
</organization>
|
613
|
+
</contributor>
|
614
|
+
</bibitem>
|
615
|
+
</references><clause id="S" obligation="informative">
|
616
|
+
<title>Bibliography</title>
|
617
|
+
<references id="T" obligation="informative" normative="false">
|
618
|
+
<title>Bibliography Subsection</title>
|
619
|
+
</references>
|
620
|
+
</clause>
|
621
|
+
</bibliography>
|
622
|
+
</iso-standard>
|
693
623
|
INPUT
|
694
624
|
|
695
625
|
presxml = <<~"PRESXML"
|
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
|
-
</clause>
|
768
|
-
</annex>
|
769
|
-
<bibliography>
|
770
|
-
<references id='R' obligation='informative' normative='true'>
|
771
|
-
<title depth='1'>2.<tab/>Normative References</title>
|
772
|
-
<bibitem id='ISO712' type='standard'>
|
773
|
-
<title format='text/plain'>Cereals and cereal products</title>
|
774
|
-
<docidentifier>ISO 712</docidentifier>
|
775
|
-
<contributor>
|
776
|
-
<role type='publisher'/>
|
777
|
-
<organization>
|
778
|
-
<abbreviation>ISO</abbreviation>
|
779
|
-
</organization>
|
780
|
-
</contributor>
|
781
|
-
</bibitem>
|
782
|
-
</references>
|
783
|
-
<clause id='S' obligation='informative'>
|
784
|
-
<title depth="1">Bibliography</title>
|
785
|
-
<references id='T' obligation='informative' normative='false'>
|
786
|
-
<title depth="2">Bibliography Subsection</title>
|
787
|
-
</references>
|
788
|
-
</clause>
|
789
|
-
</bibliography>
|
790
|
-
</iso-standard>
|
626
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
627
|
+
<bibdata>
|
628
|
+
<language current="true">zh</language>
|
629
|
+
<script current="true">Hans</script>
|
630
|
+
</bibdata>
|
631
|
+
<preface>
|
632
|
+
<foreword obligation="informative" displayorder="1">
|
633
|
+
<title>Foreword</title>
|
634
|
+
<p id="A">See <xref target="M">条5</xref></p>
|
635
|
+
</foreword>
|
636
|
+
<introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
637
|
+
<title depth="2">Introduction Subsection</title>
|
638
|
+
</clause>
|
639
|
+
</introduction></preface><sections>
|
640
|
+
<clause id="D" obligation="normative" type="scope" displayorder="3">
|
641
|
+
<title depth="1">1.<tab/>Scope</title>
|
642
|
+
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712、第1–1表</eref></p>
|
643
|
+
</clause>
|
644
|
+
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
645
|
+
<title depth="2">3.1.<tab/>Normal Terms</title>
|
646
|
+
<term id="J"><name>3.1.1.</name>
|
647
|
+
<preferred>Term2</preferred>
|
648
|
+
</term>
|
649
|
+
</terms>
|
650
|
+
<definitions id="K"><title>3.2.</title>
|
651
|
+
<dl>
|
652
|
+
<dt>Symbol</dt>
|
653
|
+
<dd>Definition</dd>
|
654
|
+
</dl>
|
655
|
+
</definitions>
|
656
|
+
</clause>
|
657
|
+
<definitions id="L" displayorder="6"><title>4.</title>
|
658
|
+
<dl>
|
659
|
+
<dt>Symbol</dt>
|
660
|
+
<dd>Definition</dd>
|
661
|
+
</dl>
|
662
|
+
</definitions>
|
663
|
+
<clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
664
|
+
<title depth="2">5.1.<tab/>Introduction</title>
|
665
|
+
</clause>
|
666
|
+
<clause id="O" inline-header="false" obligation="normative">
|
667
|
+
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
668
|
+
</clause></clause>
|
669
|
+
</sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
|
670
|
+
<title><strong>附件A</strong><br/>(规范性附录)<br/><br/><strong>Annex</strong></title>
|
671
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
672
|
+
<title depth="2">A.1.<tab/>Annex A.1</title>
|
673
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
674
|
+
<title depth="3">A.1.1.<tab/>Annex A.1a</title>
|
675
|
+
</clause>
|
676
|
+
</clause>
|
677
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
|
678
|
+
<title depth="1">2.<tab/>Normative References</title>
|
679
|
+
<bibitem id="ISO712" type="standard">
|
680
|
+
<title format="text/plain">Cereals and cereal products</title>
|
681
|
+
<docidentifier>ISO 712</docidentifier>
|
682
|
+
<contributor>
|
683
|
+
<role type="publisher"/>
|
684
|
+
<organization>
|
685
|
+
<abbreviation>ISO</abbreviation>
|
686
|
+
</organization>
|
687
|
+
</contributor>
|
688
|
+
</bibitem>
|
689
|
+
</references><clause id="S" obligation="informative" displayorder="9">
|
690
|
+
<title depth="1">Bibliography</title>
|
691
|
+
<references id="T" obligation="informative" normative="false">
|
692
|
+
<title depth="2">Bibliography Subsection</title>
|
693
|
+
</references>
|
694
|
+
</clause>
|
695
|
+
</bibliography>
|
696
|
+
</iso-standard>
|
791
697
|
PRESXML
|
792
698
|
|
793
699
|
output = <<~"OUTPUT"
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
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
|
-
|
700
|
+
#{HTML_HDR.gsub(/ lang="en">/, ' lang="zh">')}
|
701
|
+
<br/>
|
702
|
+
<div>
|
703
|
+
<h1 class="ForewordTitle">Foreword</h1>
|
704
|
+
<p id='A'>
|
705
|
+
See
|
706
|
+
<a href='#M'>条5</a>
|
707
|
+
</p>
|
708
|
+
</div>
|
709
|
+
<br/>
|
710
|
+
<div class="Section3" id="B">
|
711
|
+
<h1 class="IntroTitle">Introduction</h1>
|
712
|
+
<div id="C">
|
713
|
+
<h2>Introduction Subsection</h2>
|
714
|
+
</div>
|
715
|
+
</div>
|
716
|
+
<p class="zzSTDTitle1"/>
|
717
|
+
<div id="D">
|
718
|
+
<h1>1. Scope</h1>
|
719
|
+
<p id="E">
|
720
|
+
<a href='#ISO712'>ISO 712、第1–1表</a>
|
721
|
+
</p>
|
722
|
+
</div>
|
723
|
+
<div>
|
724
|
+
<h1>2. Normative References</h1>
|
725
|
+
<p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
|
726
|
+
</div>
|
727
|
+
<div id="H"><h1>3. Terms, definitions, symbols and abbreviated terms</h1>
|
728
|
+
<div id="I">
|
729
|
+
<h2>3.1. Normal Terms</h2>
|
730
|
+
<p class="TermNum" id="J">3.1.1.</p>
|
731
|
+
<p class="Terms" style="text-align:left;">Term2</p>
|
732
|
+
</div><div id="K"><h2>3.2.</h2>
|
733
|
+
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
734
|
+
</div></div>
|
735
|
+
<div id="L" class="Symbols">
|
736
|
+
<h1>4.</h1>
|
737
|
+
<dl>
|
738
|
+
<dt>
|
739
|
+
<p>Symbol</p>
|
740
|
+
</dt>
|
741
|
+
<dd>Definition</dd>
|
742
|
+
</dl>
|
743
|
+
</div>
|
744
|
+
<div id="M">
|
745
|
+
<h1>5. Clause 4</h1>
|
746
|
+
<div id="N">
|
747
|
+
<h2>5.1. Introduction</h2>
|
748
|
+
</div>
|
749
|
+
<div id="O">
|
750
|
+
<h2>5.2. Clause 4.2</h2>
|
751
|
+
</div>
|
752
|
+
</div>
|
753
|
+
<br/>
|
754
|
+
<div id="P" class="Section3">
|
755
|
+
<h1 class="Annex"><b>附件A</b><br/>(规范性附录)<br/><br/><b>Annex</b></h1>
|
756
|
+
<div id="Q">
|
757
|
+
<h2>A.1. Annex A.1</h2>
|
758
|
+
<div id="Q1">
|
759
|
+
<h3>A.1.1. Annex A.1a</h3>
|
760
|
+
</div>
|
761
|
+
</div>
|
762
|
+
</div>
|
763
|
+
<br/>
|
764
|
+
<div>
|
765
|
+
<h1 class="Section3">Bibliography</h1>
|
766
|
+
<div>
|
767
|
+
<h2 class="Section3">Bibliography Subsection</h2>
|
768
|
+
</div>
|
769
|
+
</div>
|
770
|
+
</div>
|
771
|
+
</body>
|
772
|
+
</html>
|
867
773
|
OUTPUT
|
868
774
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
869
775
|
.convert("test", input, true)
|
@@ -876,204 +782,171 @@ RSpec.describe IsoDoc do
|
|
876
782
|
it "processes i18n file" do
|
877
783
|
mock_i18n
|
878
784
|
input = <<~"INPUT"
|
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
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
785
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
786
|
+
<bibdata>
|
787
|
+
<language>eo</language>
|
788
|
+
<script>Latn</script>
|
789
|
+
<status>
|
790
|
+
<stage>published</stage>
|
791
|
+
<substage>withdrawn</substage>
|
792
|
+
</status>
|
793
|
+
<ext>
|
794
|
+
<doctype>brochure</doctype>
|
795
|
+
</ext>
|
796
|
+
</bibdata>
|
797
|
+
<preface>
|
798
|
+
<foreword obligation="informative">
|
799
|
+
<title>Foreword</title>
|
800
|
+
<p id="A">See <xref target="M"/></p>
|
801
|
+
<p id="A">See <xref target="tab"/></p>
|
802
|
+
<table id="tab"/>
|
803
|
+
</foreword>
|
804
|
+
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
805
|
+
<title>Introduction Subsection</title>
|
806
|
+
</clause>
|
807
|
+
</introduction></preface><sections>
|
808
|
+
<clause id="D" obligation="normative" type="scope">
|
809
|
+
<title>Scope</title>
|
810
|
+
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
|
811
|
+
</clause>
|
812
|
+
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
813
|
+
<title>Normal Terms</title>
|
814
|
+
<term id="J">
|
815
|
+
<preferred>Term2</preferred>
|
816
|
+
</term>
|
817
|
+
</terms>
|
818
|
+
<definitions id="K">
|
819
|
+
<dl>
|
820
|
+
<dt>Symbol</dt>
|
821
|
+
<dd>Definition</dd>
|
822
|
+
</dl>
|
823
|
+
</definitions>
|
824
|
+
</clause>
|
825
|
+
<definitions id="L">
|
826
|
+
<dl>
|
827
|
+
<dt>Symbol</dt>
|
828
|
+
<dd>Definition</dd>
|
829
|
+
</dl>
|
830
|
+
</definitions>
|
831
|
+
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
832
|
+
<title>Introduction</title>
|
833
|
+
<note id="M-n1"/>
|
834
|
+
</clause>
|
835
|
+
<clause id="O" inline-header="false" obligation="normative">
|
836
|
+
<title>Clause 4.2</title>
|
837
|
+
</clause></clause>
|
838
|
+
</sections><annex id="P" inline-header="false" obligation="normative">
|
839
|
+
<title>Annex</title>
|
840
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
841
|
+
<title>Annex A.1</title>
|
842
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
843
|
+
<title>Annex A.1a</title>
|
844
|
+
</clause>
|
845
|
+
</clause>
|
846
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
847
|
+
<title>Normative References</title>
|
848
|
+
<bibitem id="ISO712" type="standard">
|
849
|
+
<title format="text/plain">Cereals and cereal products</title>
|
850
|
+
<docidentifier>ISO 712</docidentifier>
|
851
|
+
<contributor>
|
852
|
+
<role type="publisher"/>
|
853
|
+
<organization>
|
854
|
+
<abbreviation>ISO</abbreviation>
|
855
|
+
</organization>
|
856
|
+
</contributor>
|
857
|
+
</bibitem>
|
858
|
+
</references><clause id="S" obligation="informative">
|
859
|
+
<title>Bibliography</title>
|
860
|
+
<references id="T" obligation="informative" normative="false">
|
861
|
+
<title>Bibliography Subsection</title>
|
862
|
+
</references>
|
863
|
+
</clause>
|
864
|
+
</bibliography>
|
865
|
+
</iso-standard>
|
960
866
|
INPUT
|
961
867
|
|
962
868
|
presxml = <<~OUTPUT
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
<
|
970
|
-
<substage language=''>withdrawn</substage>
|
971
|
-
<substage language='eo'>fortirita</substage>
|
869
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
870
|
+
<bibdata>
|
871
|
+
<language current="true">eo</language>
|
872
|
+
<script current="true">Latn</script>
|
873
|
+
<status>
|
874
|
+
<stage language="">published</stage><stage language="eo">publikigita</stage>
|
875
|
+
<substage language="">withdrawn</substage><substage language="eo">fortirita</substage>
|
972
876
|
</status>
|
973
877
|
<ext>
|
974
|
-
<doctype language=
|
975
|
-
<doctype language='eo'>broŝuro</doctype>
|
878
|
+
<doctype language="">brochure</doctype><doctype language="eo">broŝuro</doctype>
|
976
879
|
</ext>
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
1048
|
-
</clause></clause>
|
1049
|
-
</sections><annex id="P" inline-header="false" obligation="normative">
|
1050
|
-
<title><strong>Aldono A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
1051
|
-
<clause id="Q" inline-header="false" obligation="normative">
|
1052
|
-
<title depth="2">A.1.<tab/>Annex A.1</title>
|
1053
|
-
<clause id="Q1" inline-header="false" obligation="normative">
|
1054
|
-
<title depth="3">A.1.1.<tab/>Annex A.1a</title>
|
1055
|
-
</clause>
|
1056
|
-
</clause>
|
1057
|
-
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
1058
|
-
<title depth="1">2.<tab/>Normative References</title>
|
1059
|
-
<bibitem id="ISO712" type="standard">
|
1060
|
-
<title format="text/plain">Cereals and cereal products</title>
|
1061
|
-
<docidentifier>ISO 712</docidentifier>
|
1062
|
-
<contributor>
|
1063
|
-
<role type="publisher"/>
|
1064
|
-
<organization>
|
1065
|
-
<abbreviation>ISO</abbreviation>
|
1066
|
-
</organization>
|
1067
|
-
</contributor>
|
1068
|
-
</bibitem>
|
1069
|
-
</references><clause id="S" obligation="informative">
|
1070
|
-
<title depth="1">Bibliography</title>
|
1071
|
-
<references id="T" obligation="informative" normative="false">
|
1072
|
-
<title depth="2">Bibliography Subsection</title>
|
1073
|
-
</references>
|
1074
|
-
</clause>
|
1075
|
-
</bibliography>
|
1076
|
-
</iso-standard>
|
880
|
+
</bibdata><localized-strings><localized-string key="foreword" language="eo">Antaŭparolo</localized-string><localized-string key="introduction" language="eo">Enkonduko</localized-string><localized-string key="clause" language="eo">klaŭzo</localized-string><localized-string key="table" language="eo">tabelo</localized-string><localized-string key="source" language="eo">SOURCE</localized-string><localized-string key="modified" language="eo">modified</localized-string><localized-string key="scope" language="eo">Amplekso</localized-string><localized-string key="symbols" language="eo">Simboloj kai mallongigitaj terminoj</localized-string><localized-string key="annex" language="eo">Aldono</localized-string><localized-string key="normref" language="eo">Normaj citaĵoj</localized-string><localized-string key="bibliography" language="eo">Bibliografio</localized-string><localized-string key="inform_annex" language="eo">informa</localized-string><localized-string key="all_parts" language="eo">ĉiuj partoj</localized-string><localized-string key="norm_annex" language="eo">normative</localized-string><localized-string key="note" language="eo">NOTO</localized-string><localized-string key="locality.table" language="eo">Tabelo</localized-string><localized-string key="doctype_dict.brochure" language="eo">broŝuro</localized-string><localized-string key="doctype_dict.conference_proceedings" language="eo">konferencaktoj</localized-string><localized-string key="stage_dict.published" language="eo">publikigita</localized-string><localized-string key="substage_dict.withdrawn" language="eo">fortirita</localized-string><localized-string key="array.0" language="eo">elem1</localized-string><localized-string key="array.1" language="eo">elem2</localized-string><localized-string key="array.2.elem3" language="eo">elem4</localized-string><localized-string key="array.2.elem5" language="eo">elem6</localized-string><localized-string key="language" language="eo">eo</localized-string><localized-string key="script" language="eo">Latn</localized-string></localized-strings>
|
881
|
+
<preface>
|
882
|
+
<foreword obligation="informative" displayorder="1">
|
883
|
+
<title>Foreword</title>
|
884
|
+
<p id="A">See <xref target="M">klaŭzo 5</xref></p>
|
885
|
+
<p id="A">See <xref target="tab">tabelo 1</xref></p>
|
886
|
+
<table id="tab"><name>Tabelo 1</name></table>
|
887
|
+
</foreword>
|
888
|
+
<introduction id="B" obligation="informative" displayorder="2"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
889
|
+
<title depth="2">Introduction Subsection</title>
|
890
|
+
</clause>
|
891
|
+
</introduction></preface><sections>
|
892
|
+
<clause id="D" obligation="normative" type="scope" displayorder="3">
|
893
|
+
<title depth="1">1.<tab/>Scope</title>
|
894
|
+
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, Tabelo 1–1</eref></p>
|
895
|
+
</clause>
|
896
|
+
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
897
|
+
<title depth="2">3.1.<tab/>Normal Terms</title>
|
898
|
+
<term id="J"><name>3.1.1.</name>
|
899
|
+
<preferred>Term2</preferred>
|
900
|
+
</term>
|
901
|
+
</terms>
|
902
|
+
<definitions id="K"><title>3.2.</title>
|
903
|
+
<dl>
|
904
|
+
<dt>Symbol</dt>
|
905
|
+
<dd>Definition</dd>
|
906
|
+
</dl>
|
907
|
+
</definitions>
|
908
|
+
</clause>
|
909
|
+
<definitions id="L" displayorder="6"><title>4.</title>
|
910
|
+
<dl>
|
911
|
+
<dt>Symbol</dt>
|
912
|
+
<dd>Definition</dd>
|
913
|
+
</dl>
|
914
|
+
</definitions>
|
915
|
+
<clause id="M" inline-header="false" obligation="normative" displayorder="7"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
916
|
+
<title depth="2">5.1.<tab/>Introduction</title>
|
917
|
+
<note id="M-n1"><name>NOTO </name></note>
|
918
|
+
</clause>
|
919
|
+
<clause id="O" inline-header="false" obligation="normative">
|
920
|
+
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
921
|
+
</clause></clause>
|
922
|
+
</sections><annex id="P" inline-header="false" obligation="normative" displayorder="8">
|
923
|
+
<title><strong>Aldono A</strong><br/>(normative)<br/><br/><strong>Annex</strong></title>
|
924
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
925
|
+
<title depth="2">A.1.<tab/>Annex A.1</title>
|
926
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
927
|
+
<title depth="3">A.1.1.<tab/>Annex A.1a</title>
|
928
|
+
</clause>
|
929
|
+
</clause>
|
930
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true" displayorder="4">
|
931
|
+
<title depth="1">2.<tab/>Normative References</title>
|
932
|
+
<bibitem id="ISO712" type="standard">
|
933
|
+
<title format="text/plain">Cereals and cereal products</title>
|
934
|
+
<docidentifier>ISO 712</docidentifier>
|
935
|
+
<contributor>
|
936
|
+
<role type="publisher"/>
|
937
|
+
<organization>
|
938
|
+
<abbreviation>ISO</abbreviation>
|
939
|
+
</organization>
|
940
|
+
</contributor>
|
941
|
+
</bibitem>
|
942
|
+
</references><clause id="S" obligation="informative" displayorder="9">
|
943
|
+
<title depth="1">Bibliography</title>
|
944
|
+
<references id="T" obligation="informative" normative="false">
|
945
|
+
<title depth="2">Bibliography Subsection</title>
|
946
|
+
</references>
|
947
|
+
</clause>
|
948
|
+
</bibliography>
|
949
|
+
</iso-standard>
|
1077
950
|
OUTPUT
|
1078
951
|
|
1079
952
|
output = <<~OUTPUT
|