metanorma-iec 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/bin/rspec +18 -0
  4. data/lib/asciidoctor/iec/biblio.rng +949 -0
  5. data/lib/asciidoctor/iec/converter.rb +68 -0
  6. data/lib/asciidoctor/iec/iec_intro_en.xml +15 -0
  7. data/lib/asciidoctor/iec/iec_intro_fr.xml +15 -0
  8. data/lib/asciidoctor/iec/isodoc.rng +1132 -0
  9. data/lib/asciidoctor/iec/isostandard.rng +789 -0
  10. data/lib/asciidoctor/iec/reqt.rng +162 -0
  11. data/lib/isodoc/iec/base_convert.rb +69 -0
  12. data/lib/isodoc/iec/html/header.html +160 -0
  13. data/lib/isodoc/iec/html/html_iec_intro.html +34 -0
  14. data/lib/isodoc/iec/html/html_iec_titlepage.html +62 -0
  15. data/lib/isodoc/iec/html/htmlstyle.scss +840 -0
  16. data/lib/isodoc/iec/html/isodoc.scss +785 -0
  17. data/lib/isodoc/iec/html/scripts.html +176 -0
  18. data/lib/isodoc/iec/html/word_iec_intro.html +72 -0
  19. data/lib/isodoc/iec/html/word_iec_titlepage.html +92 -0
  20. data/lib/isodoc/iec/html/wordstyle.scss +1849 -0
  21. data/lib/isodoc/iec/html_convert.rb +33 -0
  22. data/lib/isodoc/iec/i18n-en.yaml +3 -0
  23. data/lib/isodoc/iec/i18n-fr.yaml +3 -0
  24. data/lib/isodoc/iec/i18n-zh-Hans.yaml +3 -0
  25. data/lib/isodoc/iec/metadata.rb +20 -0
  26. data/lib/isodoc/iec/word_convert.rb +165 -0
  27. data/lib/metanorma-iec.rb +12 -0
  28. data/lib/metanorma/iec.rb +8 -0
  29. data/lib/metanorma/iec/processor.rb +40 -0
  30. data/lib/metanorma/iec/version.rb +6 -0
  31. data/metanorma-iec.gemspec +47 -0
  32. data/spec/asciidoctor-iec/base_spec.rb +609 -0
  33. data/spec/asciidoctor-iec/blocks_spec.rb +467 -0
  34. data/spec/asciidoctor-iec/cleanup_spec.rb +766 -0
  35. data/spec/asciidoctor-iec/inline_spec.rb +162 -0
  36. data/spec/asciidoctor-iec/lists_spec.rb +190 -0
  37. data/spec/asciidoctor-iec/macros_spec.rb +21 -0
  38. data/spec/asciidoctor-iec/refs_spec.rb +268 -0
  39. data/spec/asciidoctor-iec/section_spec.rb +341 -0
  40. data/spec/asciidoctor-iec/table_spec.rb +307 -0
  41. data/spec/asciidoctor-iec/validate_spec.rb +132 -0
  42. data/spec/examples/rice.adoc +723 -0
  43. data/spec/examples/rice.doc +19162 -0
  44. data/spec/examples/rice.html +1787 -0
  45. data/spec/examples/rice.xml +1951 -0
  46. data/spec/isodoc/i18n_spec.rb +642 -0
  47. data/spec/isodoc/inline_spec.rb +265 -0
  48. data/spec/isodoc/iso_spec.rb +319 -0
  49. data/spec/isodoc/metadata_spec.rb +153 -0
  50. data/spec/isodoc/postproc_spec.rb +569 -0
  51. data/spec/isodoc/section_spec.rb +686 -0
  52. data/spec/isodoc/terms_spec.rb +206 -0
  53. data/spec/isodoc/xref_spec.rb +1323 -0
  54. data/spec/metanorma/processor_spec.rb +88 -0
  55. data/spec/spec_helper.rb +253 -0
  56. metadata +325 -0
@@ -0,0 +1,642 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe IsoDoc do
4
+ it "processes English" do
5
+ expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <bibdata>
8
+ <language>en</language>
9
+ </bibdata>
10
+ <preface>
11
+ <foreword obligation="informative">
12
+ <title>Foreword</title>
13
+ <p id="A">This is a preamble</p>
14
+ </foreword>
15
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
16
+ <title>Introduction Subsection</title>
17
+ </clause>
18
+ <patent-notice>
19
+ <p>This is patent boilerplate</p>
20
+ </patent-notice>
21
+ </introduction></preface><sections>
22
+ <clause id="D" obligation="normative">
23
+ <title>Scope</title>
24
+ <p id="E">Text</p>
25
+ </clause>
26
+
27
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
28
+ <title>Normal Terms</title>
29
+ <term id="J">
30
+ <preferred>Term2</preferred>
31
+ </term>
32
+ </terms>
33
+ <definitions id="K">
34
+ <dl>
35
+ <dt>Symbol</dt>
36
+ <dd>Definition</dd>
37
+ </dl>
38
+ </definitions>
39
+ </clause>
40
+ <definitions id="L">
41
+ <dl>
42
+ <dt>Symbol</dt>
43
+ <dd>Definition</dd>
44
+ </dl>
45
+ </definitions>
46
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
47
+ <title>Introduction</title>
48
+ </clause>
49
+ <clause id="O" inline-header="false" obligation="normative">
50
+ <title>Clause 4.2</title>
51
+ </clause></clause>
52
+
53
+ </sections><annex id="P" inline-header="false" obligation="normative">
54
+ <title>Annex</title>
55
+ <clause id="Q" inline-header="false" obligation="normative">
56
+ <title>Annex A.1</title>
57
+ <clause id="Q1" inline-header="false" obligation="normative">
58
+ <title>Annex A.1a</title>
59
+ </clause>
60
+ </clause>
61
+ <appendix id="Q2" inline-header="false" obligation="normative">
62
+ <title>An Appendix</title>
63
+ </appendix>
64
+ </annex><bibliography><references id="R" obligation="informative">
65
+ <title>Normative References</title>
66
+ </references><clause id="S" obligation="informative">
67
+ <title>Bibliography</title>
68
+ <references id="T" obligation="informative">
69
+ <title>Bibliography Subsection</title>
70
+ </references>
71
+ </clause>
72
+ </bibliography>
73
+ </iso-standard>
74
+ INPUT
75
+ #{HTML_HDR}
76
+ <div>
77
+ <h1 class="ForewordTitle">FOREWORD</h1>
78
+ <div class="boilerplate_legal"/>
79
+ <p id="A">This is a preamble</p>
80
+ </div>
81
+ <br/>
82
+ <div class="Section3" id="B">
83
+ <h1 class="IntroTitle">0&#160; INTRODUCTION</h1>
84
+ <div id="C"><h2>0.1 Introduction Subsection</h2>
85
+
86
+ </div>
87
+ <p>This is patent boilerplate</p>
88
+ </div>
89
+ #{IEC_TITLE}
90
+ <div id="D">
91
+ <h1>1&#160; Scope</h1>
92
+ <p id="E">Text</p>
93
+ </div>
94
+ <div>
95
+ <h1>2&#160; Normative references</h1>
96
+ <p>There are no normative references in this document.</p>
97
+ </div>
98
+ <div id="H"><h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
99
+ the following terms and definitions apply.</p>
100
+ <p>ISO and IEC maintain terminological databases for use in
101
+ standardization at the following addresses:</p>
102
+
103
+ <ul>
104
+ <li> <p>ISO Online browsing platform: available at
105
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
106
+ <li> <p>IEC Electropedia: available at
107
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
108
+ </p> </li> </ul>
109
+ <div id="I"><h2>3.1 Normal Terms</h2>
110
+
111
+ <p class="TermNum" id="J">3.1.1</p>
112
+ <p class="Terms" style="text-align:left;">Term2</p>
113
+
114
+ </div><div id="K"><h2>3.2 Symbols and abbreviated terms</h2>
115
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
116
+ </div></div>
117
+ <div id="L" class="Symbols">
118
+ <h1>4&#160; Symbols and abbreviated terms</h1>
119
+ <dl>
120
+ <dt>
121
+ <p>Symbol</p>
122
+ </dt>
123
+ <dd>Definition</dd>
124
+ </dl>
125
+ </div>
126
+ <div id="M">
127
+ <h1>5&#160; Clause 4</h1>
128
+ <div id="N"><h2>5.1 Introduction</h2>
129
+
130
+ </div>
131
+ <div id="O"><h2>5.2 Clause 4.2</h2>
132
+
133
+ </div>
134
+ </div>
135
+ <br/>
136
+ <div id="P" class="Section3">
137
+ <h1 class="Annex"><b>Annex A</b><br/><br/>(normative)<br/><br/><b>Annex</b></h1>
138
+ <div id="Q"><h2>A.1 Annex A.1</h2>
139
+
140
+ <div id="Q1"><h3>A.1.1 Annex A.1a</h3>
141
+
142
+ </div>
143
+ </div>
144
+ <div id="Q2"><h2>Appendix 1 An Appendix</h2>
145
+
146
+ </div>
147
+ </div>
148
+ <br/>
149
+ <div>
150
+ <h1 class="Section3">Bibliography</h1>
151
+ <div>
152
+ <h2 class="Section3">Bibliography Subsection</h2>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ </body>
157
+ </html>
158
+ OUTPUT
159
+ end
160
+
161
+ it "defaults to English" do
162
+ expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
163
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
164
+ <bibdata>
165
+ <language>tlh</language>
166
+ </bibdata>
167
+ <preface>
168
+ <foreword obligation="informative">
169
+ <title>Foreword</title>
170
+ <p id="A">This is a preamble</p>
171
+ </foreword>
172
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
173
+ <title>Introduction Subsection</title>
174
+ </clause>
175
+ <patent-notice>
176
+ <p>This is patent boilerplate</p>
177
+ </patent-notice>
178
+ </introduction></preface><sections>
179
+ <clause id="D" obligation="normative">
180
+ <title>Scope</title>
181
+ <p id="E">Text</p>
182
+ </clause>
183
+
184
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
185
+ <title>Normal Terms</title>
186
+ <term id="J">
187
+ <preferred>Term2</preferred>
188
+ </term>
189
+ </terms>
190
+ <definitions id="K">
191
+ <dl>
192
+ <dt>Symbol</dt>
193
+ <dd>Definition</dd>
194
+ </dl>
195
+ </definitions>
196
+ </clause>
197
+ <definitions id="L">
198
+ <dl>
199
+ <dt>Symbol</dt>
200
+ <dd>Definition</dd>
201
+ </dl>
202
+ </definitions>
203
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><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></clause>
209
+
210
+ </sections><annex id="P" inline-header="false" obligation="normative">
211
+ <title>Annex</title>
212
+ <clause id="Q" inline-header="false" obligation="normative">
213
+ <title>Annex A.1</title>
214
+ <clause id="Q1" inline-header="false" obligation="normative">
215
+ <title>Annex A.1a</title>
216
+ </clause>
217
+ </clause>
218
+ <appendix id="Q2" inline-header="false" obligation="normative">
219
+ <title>An Appendix</title>
220
+ </appendix>
221
+ </annex><bibliography><references id="R" obligation="informative">
222
+ <title>Normative References</title>
223
+ </references><clause id="S" obligation="informative">
224
+ <title>Bibliography</title>
225
+ <references id="T" obligation="informative">
226
+ <title>Bibliography Subsection</title>
227
+ </references>
228
+ </clause>
229
+ </bibliography>
230
+ </iso-standard>
231
+ INPUT
232
+ #{HTML_HDR}
233
+ <div>
234
+ <h1 class="ForewordTitle">FOREWORD</h1>
235
+ <div class="boilerplate_legal"/>
236
+ <p id="A">This is a preamble</p>
237
+ </div>
238
+ <br/>
239
+ <div class="Section3" id="B">
240
+ <h1 class="IntroTitle">0&#160; INTRODUCTION</h1>
241
+ <div id="C"><h2>0.1 Introduction Subsection</h2>
242
+
243
+ </div>
244
+ <p>This is patent boilerplate</p>
245
+ </div>
246
+ #{IEC_TITLE}
247
+ <div id="D">
248
+ <h1>1&#160; Scope</h1>
249
+ <p id="E">Text</p>
250
+ </div>
251
+ <div>
252
+ <h1>2&#160; Normative references</h1>
253
+ <p>There are no normative references in this document.</p>
254
+ </div>
255
+ <div id="H"><h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
256
+ the following terms and definitions apply.</p>
257
+ <p>ISO and IEC maintain terminological databases for use in
258
+ standardization at the following addresses:</p>
259
+
260
+ <ul>
261
+ <li> <p>ISO Online browsing platform: available at
262
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
263
+ <li> <p>IEC Electropedia: available at
264
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
265
+ </p> </li> </ul>
266
+ <div id="I"><h2>3.1 Normal Terms</h2>
267
+
268
+ <p class="TermNum" id="J">3.1.1</p>
269
+ <p class="Terms" style="text-align:left;">Term2</p>
270
+
271
+ </div><div id="K"><h2>3.2 Symbols and abbreviated terms</h2>
272
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
273
+ </div></div>
274
+ <div id="L" class="Symbols">
275
+ <h1>4&#160; Symbols and abbreviated terms</h1>
276
+ <dl>
277
+ <dt>
278
+ <p>Symbol</p>
279
+ </dt>
280
+ <dd>Definition</dd>
281
+ </dl>
282
+ </div>
283
+ <div id="M">
284
+ <h1>5&#160; Clause 4</h1>
285
+ <div id="N"><h2>5.1 Introduction</h2>
286
+
287
+ </div>
288
+ <div id="O"><h2>5.2 Clause 4.2</h2>
289
+
290
+ </div>
291
+ </div>
292
+ <br/>
293
+ <div id="P" class="Section3">
294
+ <h1 class="Annex"><b>Annex A</b><br/><br/>(normative)<br/><br/><b>Annex</b></h1>
295
+ <div id="Q"><h2>A.1 Annex A.1</h2>
296
+
297
+ <div id="Q1"><h3>A.1.1 Annex A.1a</h3>
298
+
299
+ </div>
300
+ </div>
301
+ <div id="Q2"><h2>Appendix 1 An Appendix</h2>
302
+
303
+ </div>
304
+ </div>
305
+ <br/>
306
+ <div>
307
+ <h1 class="Section3">Bibliography</h1>
308
+ <div>
309
+ <h2 class="Section3">Bibliography Subsection</h2>
310
+ </div>
311
+ </div>
312
+ </div>
313
+ </body>
314
+ </html>
315
+ OUTPUT
316
+ end
317
+
318
+ it "processes French" do
319
+ expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
320
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
321
+ <bibdata>
322
+ <language>fr</language>
323
+ </bibdata>
324
+ <preface>
325
+ <foreword obligation="informative">
326
+ <title>Foreword</title>
327
+ <p id="A">This is a preamble</p>
328
+ </foreword>
329
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
330
+ <title>Introduction Subsection</title>
331
+ </clause>
332
+ <patent-notice>
333
+ <p>This is patent boilerplate</p>
334
+ </patent-notice>
335
+ </introduction></preface><sections>
336
+ <clause id="D" obligation="normative">
337
+ <title>Scope</title>
338
+ <p id="E">Text</p>
339
+ </clause>
340
+
341
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
342
+ <title>Normal Terms</title>
343
+ <term id="J">
344
+ <preferred>Term2</preferred>
345
+ </term>
346
+ </terms>
347
+ <definitions id="K">
348
+ <dl>
349
+ <dt>Symbol</dt>
350
+ <dd>Definition</dd>
351
+ </dl>
352
+ </definitions>
353
+ </clause>
354
+ <definitions id="L">
355
+ <dl>
356
+ <dt>Symbol</dt>
357
+ <dd>Definition</dd>
358
+ </dl>
359
+ </definitions>
360
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
361
+ <title>Introduction</title>
362
+ </clause>
363
+ <clause id="O" inline-header="false" obligation="normative">
364
+ <title>Clause 4.2</title>
365
+ </clause></clause>
366
+
367
+ </sections><annex id="P" inline-header="false" obligation="normative">
368
+ <title>Annex</title>
369
+ <clause id="Q" inline-header="false" obligation="normative">
370
+ <title>Annex A.1</title>
371
+ <clause id="Q1" inline-header="false" obligation="normative">
372
+ <title>Annex A.1a</title>
373
+ </clause>
374
+ </clause>
375
+ <appendix id="Q2" inline-header="false" obligation="normative">
376
+ <title>An Appendix</title>
377
+ </appendix>
378
+ </annex><bibliography><references id="R" obligation="informative">
379
+ <title>Normative References</title>
380
+ </references><clause id="S" obligation="informative">
381
+ <title>Bibliography</title>
382
+ <references id="T" obligation="informative">
383
+ <title>Bibliography Subsection</title>
384
+ </references>
385
+ </clause>
386
+ </bibliography>
387
+ </iso-standard>
388
+ INPUT
389
+ #{HTML_HDR.sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "COMMISSION ELECTROTECHNIQUE INTERNATIONALE")}
390
+ <div>
391
+ <h1 class="ForewordTitle">AVANT-PROPOS</h1>
392
+ <div class="boilerplate_legal"/>
393
+ <p id="A">This is a preamble</p>
394
+ </div>
395
+ <br/>
396
+ <div class="Section3" id="B">
397
+ <h1 class="IntroTitle">0&#160; INTRODUCTION</h1>
398
+ <div id="C"><h2>0.1 Introduction Subsection</h2>
399
+
400
+ </div>
401
+ <p>This is patent boilerplate</p>
402
+ </div>
403
+ #{IEC_TITLE.sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "COMMISSION ELECTROTECHNIQUE INTERNATIONALE")}
404
+ <div id="D">
405
+ <h1>1&#160; Domaine d'application</h1>
406
+ <p id="E">Text</p>
407
+ </div>
408
+ <div>
409
+ <h1>2&#160; R&#233;f&#233;rences normatives</h1>
410
+ <p>Le pr&#233;sent document ne contient aucune r&#233;f&#233;rence normative.</p>
411
+ </div>
412
+ <div id="H"><h1>3&#160; Terms, d&#233;finitions, symboles et termes abr&#233;g&#233;s</h1><p>Pour les besoins du pr&#233;sent document, les termes et d&#233;finitions suivants s'appliquent.</p>
413
+ <p>L'ISO et l'IEC tiennent &#224; jour des bases de donn&#233;es terminologiques
414
+ destin&#233;es &#224; &#234;tre utilis&#233;es en normalisation, consultables aux adresses
415
+ suivantes:</p>
416
+ <ul>
417
+ <li> <p>ISO Online browsing platform: disponible &#224; l'adresse
418
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
419
+ <li> <p>IEC Electropedia: disponible &#224; l'adresse
420
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
421
+ </p> </li> </ul>
422
+ <div id="I"><h2>3.1 Normal Terms</h2>
423
+
424
+ <p class="TermNum" id="J">3.1.1</p>
425
+ <p class="Terms" style="text-align:left;">Term2</p>
426
+
427
+ </div><div id="K"><h2>3.2 Symboles et termes abr&#233;g&#233;s</h2>
428
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
429
+ </div></div>
430
+ <div id="L" class="Symbols">
431
+ <h1>4&#160; Symboles et termes abr&#233;g&#233;s</h1>
432
+ <dl>
433
+ <dt>
434
+ <p>Symbol</p>
435
+ </dt>
436
+ <dd>Definition</dd>
437
+ </dl>
438
+ </div>
439
+ <div id="M">
440
+ <h1>5&#160; Clause 4</h1>
441
+ <div id="N"><h2>5.1 Introduction</h2>
442
+
443
+ </div>
444
+ <div id="O"><h2>5.2 Clause 4.2</h2>
445
+
446
+ </div>
447
+ </div>
448
+ <br/>
449
+ <div id="P" class="Section3">
450
+ <h1 class="Annex"><b>Annexe A</b><br/><br/>(normative)<br/><br/><b>Annex</b></h1>
451
+ <div id="Q"><h2>A.1 Annex A.1</h2>
452
+
453
+ <div id="Q1"><h3>A.1.1 Annex A.1a</h3>
454
+
455
+ </div>
456
+ </div>
457
+ <div id="Q2"><h2>Appendice 1 An Appendix</h2>
458
+
459
+ </div>
460
+ </div>
461
+ <br/>
462
+ <div>
463
+ <h1 class="Section3">Bibliographie</h1>
464
+ <div>
465
+ <h2 class="Section3">Bibliography Subsection</h2>
466
+ </div>
467
+ </div>
468
+ </div>
469
+ </body>
470
+ </html>
471
+ OUTPUT
472
+ end
473
+
474
+ it "processes Simplified Chinese" do
475
+ expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
476
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
477
+ <bibdata>
478
+ <language>zh</language>
479
+ <script>Hans</script>
480
+ </bibdata>
481
+ <preface>
482
+ <foreword obligation="informative">
483
+ <title>Foreword</title>
484
+ <p id="A">This is a preamble</p>
485
+ </foreword>
486
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
487
+ <title>Introduction Subsection</title>
488
+ </clause>
489
+ <patent-notice>
490
+ <p>This is patent boilerplate</p>
491
+ </patent-notice>
492
+ </introduction></preface><sections>
493
+ <clause id="D" obligation="normative">
494
+ <title>Scope</title>
495
+ <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
496
+ </clause>
497
+
498
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
499
+ <title>Normal Terms</title>
500
+ <term id="J">
501
+ <preferred>Term2</preferred>
502
+ </term>
503
+ </terms>
504
+ <definitions id="K">
505
+ <dl>
506
+ <dt>Symbol</dt>
507
+ <dd>Definition</dd>
508
+ </dl>
509
+ </definitions>
510
+ </clause>
511
+ <definitions id="L">
512
+ <dl>
513
+ <dt>Symbol</dt>
514
+ <dd>Definition</dd>
515
+ </dl>
516
+ </definitions>
517
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
518
+ <title>Introduction</title>
519
+ </clause>
520
+ <clause id="O" inline-header="false" obligation="normative">
521
+ <title>Clause 4.2</title>
522
+ </clause></clause>
523
+
524
+ </sections><annex id="P" inline-header="false" obligation="normative">
525
+ <title>Annex</title>
526
+ <clause id="Q" inline-header="false" obligation="normative">
527
+ <title>Annex A.1</title>
528
+ <clause id="Q1" inline-header="false" obligation="normative">
529
+ <title>Annex A.1a</title>
530
+ </clause>
531
+ </clause>
532
+ <appendix id="Q2" inline-header="false" obligation="normative">
533
+ <title>An Appendix</title>
534
+ </appendix>
535
+ </annex><bibliography><references id="R" obligation="informative">
536
+ <title>Normative References</title>
537
+ <bibitem id="ISO712" type="standard">
538
+ <title format="text/plain">Cereals and cereal products</title>
539
+ <docidentifier>ISO 712</docidentifier>
540
+ <contributor>
541
+ <role type="publisher"/>
542
+ <organization>
543
+ <abbreviation>ISO</abbreviation>
544
+ </organization>
545
+ </contributor>
546
+ </bibitem>
547
+ </references><clause id="S" obligation="informative">
548
+ <title>Bibliography</title>
549
+ <references id="T" obligation="informative">
550
+ <title>Bibliography Subsection</title>
551
+ </references>
552
+ </clause>
553
+ </bibliography>
554
+ </iso-standard>
555
+ INPUT
556
+ #{HTML_HDR.sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "国际电工委员会")}
557
+ <div>
558
+ <h1 class="ForewordTitle">&#21069;&#35328;</h1>
559
+ <div class="boilerplate_legal"/>
560
+ <p id="A">This is a preamble</p>
561
+ </div>
562
+ <br/>
563
+ <div class="Section3" id="B">
564
+ <h1 class="IntroTitle">0&#160; &#24341;&#35328;</h1>
565
+ <div id="C"><h2>0.1 Introduction Subsection</h2>
566
+
567
+ </div>
568
+ <p>This is patent boilerplate</p>
569
+ </div>
570
+ #{IEC_TITLE.sub(/INTERNATIONAL ELECTROTECHNICAL COMMISSION/, "国际电工委员会")}
571
+ <div id="D">
572
+ <h1>1&#160; &#33539;&#22260;</h1>
573
+ <p id="E">
574
+ <a href="#ISO712">ISO 712&#12289;&#31532;1&#8211;<referenceto>1</referenceto>&#34920;</a>
575
+ </p>
576
+ </div>
577
+ <div>
578
+ <h1>2&#160; &#35268;&#33539;&#24615;&#24341;&#29992;&#25991;&#20214;</h1>
579
+ <p>&#19979;&#21015;&#25991;&#20214;&#23545;&#20110;&#26412;&#25991;&#20214;&#30340;&#24212;&#29992;&#26159;&#24517;&#19981;&#21487;&#23569;&#30340;&#12290; &#20961;&#26159;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20165;&#27880;&#26085;&#26399;&#30340;&#29256;&#26412;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290; &#20961;&#26159;&#19981;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20854;&#26368;&#26032;&#29256;&#26412;&#65288;&#21253;&#25324;&#25152;&#26377;&#30340;&#20462;&#25913;&#21333;&#65289;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
580
+ <p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
581
+ </div>
582
+ <div id="H"><h1>3&#160; &#26415;&#35821;&#12289;&#23450;&#20041;&#12289;&#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h1><p>&#19979;&#21015;&#26415;&#35821;&#21644;&#23450;&#20041;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
583
+ <p>ISO&#21644;IEC&#29992;&#20110;&#26631;&#20934;&#21270;&#30340;&#26415;&#35821;&#25968;&#25454;&#24211;&#22320;&#22336;&#22914;&#19979;&#65306;</p>
584
+ <ul>
585
+ <li> <p>ISO&#22312;&#32447;&#27983;&#35272;&#24179;&#21488;:
586
+ &#20301;&#20110;<a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
587
+ <li> <p>IEC Electropedia:
588
+ &#20301;&#20110;<a href="http://www.electropedia.org">http://www.electropedia.org</a>
589
+ </p> </li> </ul>
590
+ <div id="I"><h2>3.1 Normal Terms</h2>
591
+
592
+ <p class="TermNum" id="J">3.1.1</p>
593
+ <p class="Terms" style="text-align:left;">Term2</p>
594
+
595
+ </div><div id="K"><h2>3.2 &#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h2>
596
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
597
+ </div></div>
598
+ <div id="L" class="Symbols">
599
+ <h1>4&#160; &#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h1>
600
+ <dl>
601
+ <dt>
602
+ <p>Symbol</p>
603
+ </dt>
604
+ <dd>Definition</dd>
605
+ </dl>
606
+ </div>
607
+ <div id="M">
608
+ <h1>5&#160; Clause 4</h1>
609
+ <div id="N"><h2>5.1 Introduction</h2>
610
+
611
+ </div>
612
+ <div id="O"><h2>5.2 Clause 4.2</h2>
613
+
614
+ </div>
615
+ </div>
616
+ <br/>
617
+ <div id="P" class="Section3">
618
+ <h1 class="Annex">&#38468;&#20214;A<br/><br/>&#65288;&#35268;&#33539;&#24615;&#38468;&#24405;&#65289;<br/><br/><b>Annex</b></h1>
619
+ <div id="Q"><h2>A.1 Annex A.1</h2>
620
+
621
+ <div id="Q1"><h3>A.1.1 Annex A.1a</h3>
622
+
623
+ </div>
624
+ </div>
625
+ <div id="Q2"><h2>&#38468;&#24405;1 An Appendix</h2>
626
+
627
+ </div>
628
+ </div>
629
+ <br/>
630
+ <div>
631
+ <h1 class="Section3">&#21442;&#32771;&#25991;&#29486;</h1>
632
+ <div>
633
+ <h2 class="Section3">Bibliography Subsection</h2>
634
+ </div>
635
+ </div>
636
+ </div>
637
+ </body>
638
+ </html>
639
+ OUTPUT
640
+ end
641
+
642
+ end