metanorma-iso 2.2.2 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/iso/html/header-dis.html +111 -29
  3. data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
  4. data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
  5. data/lib/isodoc/iso/html/style-human.css +7 -2
  6. data/lib/isodoc/iso/html/style-human.scss +0 -1
  7. data/lib/isodoc/iso/html/style-iso.css +7 -2
  8. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +160 -4
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +154 -4
  11. data/lib/isodoc/iso/html/wordstyle.css +150 -0
  12. data/lib/isodoc/iso/html/wordstyle.scss +144 -0
  13. data/lib/isodoc/iso/i18n-en.yaml +4 -4
  14. data/lib/isodoc/iso/iso.amendment.xsl +1649 -1199
  15. data/lib/isodoc/iso/iso.international-standard.xsl +1649 -1199
  16. data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
  17. data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
  18. data/lib/isodoc/iso/word_convert.rb +6 -4
  19. data/lib/isodoc/iso/word_dis_cleanup.rb +30 -8
  20. data/lib/isodoc/iso/word_dis_convert.rb +5 -2
  21. data/lib/metanorma/iso/base.rb +2 -1
  22. data/lib/metanorma/iso/biblio.rng +5 -0
  23. data/lib/metanorma/iso/isodoc.rng +47 -13
  24. data/lib/metanorma/iso/validate.rb +2 -2
  25. data/lib/metanorma/iso/version.rb +1 -1
  26. data/metanorma-iso.gemspec +5 -2
  27. metadata +4 -87
  28. data/.github/workflows/automerge.yml +0 -31
  29. data/.github/workflows/rake.yml +0 -15
  30. data/.github/workflows/release.yml +0 -24
  31. data/.github/workflows/ubuntu.yml +0 -41
  32. data/Rakefile +0 -8
  33. data/bin/rspec +0 -17
  34. data/spec/assets/header.html +0 -7
  35. data/spec/assets/html.css +0 -2
  36. data/spec/assets/htmlcover.html +0 -4
  37. data/spec/assets/htmlintro.html +0 -5
  38. data/spec/assets/i18n.yaml +0 -2
  39. data/spec/assets/iso.adoc +0 -10
  40. data/spec/assets/iso.headless.html +0 -33
  41. data/spec/assets/iso.xml +0 -71
  42. data/spec/assets/rice_image1.png +0 -0
  43. data/spec/assets/scripts.html +0 -3
  44. data/spec/assets/std.css +0 -2
  45. data/spec/assets/word.css +0 -2
  46. data/spec/assets/wordcover.html +0 -3
  47. data/spec/assets/wordintro.html +0 -4
  48. data/spec/examples/103_01_02.html +0 -247
  49. data/spec/examples/english.yaml +0 -69
  50. data/spec/examples/iso_123_.xml +0 -45
  51. data/spec/examples/iso_123_all_parts.xml +0 -45
  52. data/spec/examples/iso_123_no_year_note.xml +0 -46
  53. data/spec/examples/iso_124_.xml +0 -41
  54. data/spec/examples/iso_216_.xml +0 -47
  55. data/spec/examples/iso_iec_12382_.xml +0 -48
  56. data/spec/examples/rice.adoc +0 -714
  57. data/spec/examples/rice.preview.html +0 -1870
  58. data/spec/examples/rice.sh +0 -4
  59. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  60. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  61. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  62. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  63. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  64. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  65. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  66. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  67. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  68. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  69. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  70. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  71. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  72. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  73. data/spec/examples/rice_img/rice_image1.png +0 -0
  74. data/spec/examples/rice_img/rice_image2.png +0 -0
  75. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  76. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  77. data/spec/examples/rice_img/rice_image3_3.png +0 -0
  78. data/spec/isodoc/amd_spec.rb +0 -986
  79. data/spec/isodoc/blocks_spec.rb +0 -1174
  80. data/spec/isodoc/i18n_spec.rb +0 -1579
  81. data/spec/isodoc/inline_spec.rb +0 -1060
  82. data/spec/isodoc/iso_spec.rb +0 -255
  83. data/spec/isodoc/metadata_spec.rb +0 -701
  84. data/spec/isodoc/postproc_spec.rb +0 -1089
  85. data/spec/isodoc/ref_spec.rb +0 -439
  86. data/spec/isodoc/section_spec.rb +0 -998
  87. data/spec/isodoc/table_spec.rb +0 -420
  88. data/spec/isodoc/terms_spec.rb +0 -314
  89. data/spec/isodoc/word_dis_spec.rb +0 -2064
  90. data/spec/isodoc/xref_spec.rb +0 -1747
  91. data/spec/metanorma/amd_spec.rb +0 -724
  92. data/spec/metanorma/base_spec.rb +0 -1384
  93. data/spec/metanorma/blank_spec.rb +0 -38
  94. data/spec/metanorma/blocks_spec.rb +0 -624
  95. data/spec/metanorma/cleanup_spec.rb +0 -1645
  96. data/spec/metanorma/inline_spec.rb +0 -203
  97. data/spec/metanorma/lists_spec.rb +0 -197
  98. data/spec/metanorma/macros_spec.rb +0 -99
  99. data/spec/metanorma/processor_spec.rb +0 -161
  100. data/spec/metanorma/refs_spec.rb +0 -672
  101. data/spec/metanorma/section_spec.rb +0 -492
  102. data/spec/metanorma/table_spec.rb +0 -329
  103. data/spec/metanorma/validate_spec.rb +0 -2153
  104. data/spec/relaton/render_spec.rb +0 -568
  105. data/spec/requirements/requirement_components_spec.rb +0 -610
  106. data/spec/requirements/requirements_spec.rb +0 -1596
  107. data/spec/requirements/xref_spec.rb +0 -1211
  108. data/spec/spec_helper.rb +0 -313
  109. data/spec/vcr_cassettes/docrels.yml +0 -385
  110. data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
@@ -1,1579 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe IsoDoc do
4
- it "processes English" do
5
- input = <<~INPUT
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <bibdata>
8
- <status>
9
- <stage abbreviation='IS' language=''>60</stage>
10
- </status>
11
- <language>en</language>
12
- <ext>
13
- <doctype language=''>international-standard</doctype>
14
- </ext>
15
- </bibdata>
16
- <preface>
17
- <foreword obligation="informative">
18
- <title>Foreword</title>
19
- <p id="A">This is a preamble</p>
20
- </foreword>
21
- <introduction id="B" obligation="informative">
22
- <title>Introduction</title>
23
- <clause id="C" inline-header="false" obligation="informative">
24
- <title>Introduction Subsection</title>
25
- </clause>
26
- <p>This is patent boilerplate</p>
27
- </introduction>
28
- </preface>
29
- <sections>
30
- <clause id="D" obligation="normative" type="scope">
31
- <title>Scope</title>
32
- <p id="E">Text</p>
33
- </clause>
34
- <clause id="H" obligation="normative">
35
- <title>Terms, definitions, symbols and abbreviated terms</title>
36
- <terms id="I" obligation="normative">
37
- <title>Normal Terms</title>
38
- <term id="J">
39
- <preferred><expression><name>Term2</name></expression></preferred>
40
- </term>
41
- </terms>
42
- <definitions id="K">
43
- <dl>
44
- <dt>Symbol</dt>
45
- <dd>Definition</dd>
46
- </dl>
47
- </definitions>
48
- </clause>
49
- <definitions id="L">
50
- <dl>
51
- <dt>Symbol</dt>
52
- <dd>Definition</dd>
53
- </dl>
54
- </definitions>
55
- <clause id="M" inline-header="false" obligation="normative">
56
- <title>Clause 4</title>
57
- <clause id="N" inline-header="false" obligation="normative">
58
- <title>Introduction</title>
59
- </clause>
60
- <clause id="O" inline-header="false" obligation="normative">
61
- <title>Clause 4.2</title>
62
- </clause>
63
- </clause>
64
- </sections>
65
- <annex id="P" inline-header="false" obligation="normative">
66
- <title>Annex</title>
67
- <clause id="Q" inline-header="false" obligation="normative">
68
- <title>Annex A.1</title>
69
- <clause id="Q1" inline-header="false" obligation="normative">
70
- <title>Annex A.1a</title>
71
- </clause>
72
- </clause>
73
- <appendix id="Q2" inline-header="false" obligation="normative">
74
- <title>An Appendix</title>
75
- </appendix>
76
- </annex>
77
- <bibliography>
78
- <references id="R" normative="true" obligation="informative">
79
- <title>Normative References</title>
80
- </references>
81
- <clause id="S" obligation="informative">
82
- <title>Bibliography</title>
83
- <references id="T" normative="false" obligation="informative">
84
- <title>Bibliography Subsection</title>
85
- </references>
86
- </clause>
87
- </bibliography>
88
- </iso-standard>
89
- INPUT
90
-
91
- presxml = <<~OUTPUT
92
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
93
- <bibdata>
94
- <status>
95
- <stage abbreviation='IS' language=''>60</stage>
96
- <stage abbreviation='IS' language='en'>International Standard</stage>
97
- </status>
98
- <language current='true'>en</language>
99
- <ext>
100
- <doctype language=''>international-standard</doctype>
101
- <doctype language='en'>International Standard</doctype>
102
- </ext>
103
- </bibdata>
104
- <preface>
105
- <foreword obligation="informative" displayorder='1'>
106
- <title>Foreword</title>
107
- <p id="A">This is a preamble</p>
108
- </foreword>
109
- <introduction id="B" obligation="informative" displayorder='2'>
110
- <title depth="1">0<tab/>Introduction</title>
111
- <clause id="C" inline-header="false" obligation="informative">
112
- <title depth="2">0.1<tab/>Introduction Subsection</title>
113
- </clause>
114
- <p>This is patent boilerplate</p>
115
- </introduction>
116
- </preface>
117
- <sections>
118
- <clause id="D" obligation="normative" type="scope" displayorder='3'>
119
- <title depth="1">1<tab/>Scope</title>
120
- <p id="E">Text</p>
121
- </clause>
122
- <clause id="H" obligation="normative" displayorder='5'>
123
- <title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title>
124
- <terms id="I" obligation="normative">
125
- <title depth="2">3.1<tab/>Normal Terms</title>
126
- <term id="J">
127
- <name>3.1.1</name>
128
- <preferred><strong>Term2</strong></preferred>
129
- </term>
130
- </terms>
131
- <definitions id="K" inline-header="true">
132
- <title>3.2</title>
133
- <dl>
134
- <dt>Symbol</dt>
135
- <dd>Definition</dd>
136
- </dl>
137
- </definitions>
138
- </clause>
139
- <definitions id="L" displayorder='6'>
140
- <title>4</title>
141
- <dl>
142
- <dt>Symbol</dt>
143
- <dd>Definition</dd>
144
- </dl>
145
- </definitions>
146
- <clause id="M" inline-header="false" obligation="normative" displayorder='7'>
147
- <title depth="1">5<tab/>Clause 4</title>
148
- <clause id="N" inline-header="false" obligation="normative">
149
- <title depth="2">5.1<tab/>Introduction</title>
150
- </clause>
151
- <clause id="O" inline-header="false" obligation="normative">
152
- <title depth="2">5.2<tab/>Clause 4.2</title>
153
- </clause>
154
- </clause>
155
- </sections>
156
- <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
157
- <title>
158
- <strong>Annex A</strong>
159
- <br/><span class='obligation'>(normative)</span>
160
- <br/>
161
- <br/>
162
- <strong>Annex</strong></title>
163
- <clause id="Q" inline-header="false" obligation="normative">
164
- <title depth="2">A.1<tab/>Annex A.1</title>
165
- <clause id="Q1" inline-header="false" obligation="normative">
166
- <title depth="3">A.1.1<tab/>Annex A.1a</title>
167
- </clause>
168
- </clause>
169
- <appendix id="Q2" inline-header="false" obligation="normative">
170
- <title depth="2">Appendix 1<tab/>An Appendix</title>
171
- </appendix>
172
- </annex>
173
- <bibliography>
174
- <references id="R" normative="true" obligation="informative" displayorder='4'>
175
- <title depth="1">2<tab/>Normative References</title>
176
- </references>
177
- <clause id="S" obligation="informative" displayorder='9'>
178
- <title depth="1">Bibliography</title>
179
- <references id="T" normative="false" obligation="informative">
180
- <title depth="2">Bibliography Subsection</title>
181
- </references>
182
- </clause>
183
- </bibliography>
184
- </iso-standard>
185
- OUTPUT
186
-
187
- html = <<~OUTPUT
188
- #{HTML_HDR}
189
- <br/>
190
- <div>
191
- <h1 class="ForewordTitle">Foreword</h1>
192
- <p id="A">This is a preamble</p>
193
- </div>
194
- <br/>
195
- <div class="Section3" id="B">
196
- <h1 class="IntroTitle">0&#160; Introduction</h1>
197
- <div id="C">
198
- <h2>0.1&#160; Introduction Subsection</h2>
199
- </div>
200
- <p>This is patent boilerplate</p>
201
- </div>
202
- <p class="zzSTDTitle1"/>
203
- <div id="D">
204
- <h1>1&#160; Scope</h1>
205
- <p id="E">Text</p>
206
- </div>
207
- <div>
208
- <h1>2&#160; Normative References</h1>
209
- </div>
210
- <div id="H">
211
- <h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1>
212
- <div id="I">
213
- <h2>3.1&#160; Normal Terms</h2>
214
-
215
- <p class="TermNum" id="J">3.1.1</p>
216
- <p class="Terms" style="text-align:left;"><b>Term2</b></p>
217
- </div>
218
- <div id="K">
219
- <span class="zzMoveToFollowing">
220
- <b>3.2&#160; </b>
221
- </span>
222
- <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
223
- </div>
224
- </div>
225
- <div id="L" class="Symbols">
226
- <h1>4</h1>
227
- <dl>
228
- <dt>
229
- <p>Symbol</p>
230
- </dt>
231
- <dd>Definition</dd>
232
- </dl>
233
- </div>
234
- <div id="M">
235
- <h1>5&#160; Clause 4</h1>
236
- <div id="N">
237
- <h2>5.1&#160; Introduction</h2>
238
- </div>
239
- <div id="O">
240
- <h2>5.2&#160; Clause 4.2</h2>
241
- </div>
242
- </div>
243
- <br/>
244
- <div id="P" class="Section3">
245
- <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
246
- <div id="Q"><h2>A.1&#160; Annex A.1</h2>
247
- <div id="Q1">
248
- <h3>A.1.1&#160; Annex A.1a</h3>
249
- </div>
250
- </div>
251
- <div id="Q2">
252
- <h2>Appendix 1&#160; An Appendix</h2>
253
- </div>
254
- </div>
255
- <br/>
256
- <div>
257
- <h1 class="Section3">Bibliography</h1>
258
- <div>
259
- <h2 class="Section3">Bibliography Subsection</h2>
260
- </div>
261
- </div>
262
- </div>
263
- </body>
264
- </html>
265
- OUTPUT
266
- word = <<~WORD
267
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
268
- <head>
269
- <style></style>
270
- <style></style>
271
- </head>
272
- <body lang='EN-US' link='blue' vlink='#954F72'>
273
- <div class='WordSection1'>
274
- <p> </p>
275
- </div>
276
- <p>
277
- <br clear='all' class='section'/>
278
- </p>
279
- <div class='WordSection2'>
280
- <p>
281
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
282
- </p>
283
- <div>
284
- <h1 class='ForewordTitle'>Foreword</h1>
285
- <p class='ForewordText' id='A'>This is a preamble</p>
286
- </div>
287
- <p>
288
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
289
- </p>
290
- <div class='Section3' id='B'>
291
- <h1 class='IntroTitle'>
292
- 0
293
- <span style='mso-tab-count:1'>  </span>
294
- Introduction
295
- </h1>
296
- <div id='C'>
297
- <h2>
298
- 0.1
299
- <span style='mso-tab-count:1'>  </span>
300
- Introduction Subsection
301
- </h2>
302
- </div>
303
- <p>This is patent boilerplate</p>
304
- </div>
305
- <p> </p>
306
- </div>
307
- <p>
308
- <br clear='all' class='section'/>
309
- </p>
310
- <div class='WordSection3'>
311
- <p class='zzSTDTitle'/>
312
- <div id='D'>
313
- <h1>
314
- 1
315
- <span style='mso-tab-count:1'>  </span>
316
- Scope
317
- </h1>
318
- <p id='E'>Text</p>
319
- </div>
320
- <div>
321
- <h1>
322
- 2
323
- <span style='mso-tab-count:1'>  </span>
324
- Normative References
325
- </h1>
326
- </div>
327
- <div id='H'>
328
- <h1>
329
- 3
330
- <span style='mso-tab-count:1'>  </span>
331
- Terms, definitions, symbols and abbreviated terms
332
- </h1>
333
- <div id='I'>
334
- <h2>
335
- 3.1
336
- <span style='mso-tab-count:1'>  </span>
337
- Normal Terms
338
- </h2>
339
- <p class='TermNum' id='J'>3.1.1</p>
340
- <p class='Terms' style='text-align:left;'>
341
- <b>Term2</b>
342
- </p>
343
- </div>
344
- <div id='K'>
345
- <span class='zzMoveToFollowing'>
346
- <b>
347
- 3.2
348
- <span style='mso-tab-count:1'>  </span>
349
- </b>
350
- </span>
351
- <table class='dl'>
352
- <tr>
353
- <td valign='top' align='left'>
354
- <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
355
- </td>
356
- <td valign='top'>Definition</td>
357
- </tr>
358
- </table>
359
- </div>
360
- </div>
361
- <div id='L' class='Symbols'>
362
- <h1>4</h1>
363
- <table class='dl'>
364
- <tr>
365
- <td valign='top' align='left'>
366
- <p align='left' style='margin-left:0pt;text-align:left;'>Symbol</p>
367
- </td>
368
- <td valign='top'>Definition</td>
369
- </tr>
370
- </table>
371
- </div>
372
- <div id='M'>
373
- <h1>
374
- 5
375
- <span style='mso-tab-count:1'>  </span>
376
- Clause 4
377
- </h1>
378
- <div id='N'>
379
- <h2>
380
- 5.1
381
- <span style='mso-tab-count:1'>  </span>
382
- Introduction
383
- </h2>
384
- </div>
385
- <div id='O'>
386
- <h2>
387
- 5.2
388
- <span style='mso-tab-count:1'>  </span>
389
- Clause 4.2
390
- </h2>
391
- </div>
392
- </div>
393
- <p>
394
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
395
- </p>
396
- <div id='P' class='Section3'>
397
- <h1 class='Annex'>
398
- <br/>
399
- <span style='font-weight:normal;'>(normative)</span>
400
- <br/>
401
- <br/>
402
- <b>Annex</b>
403
- </h1>
404
- <div id='Q'>
405
- <h2>
406
- A.1
407
- <span style='mso-tab-count:1'>  </span>
408
- Annex A.1
409
- </h2>
410
- <div id='Q1'>
411
- <h3>
412
- A.1.1
413
- <span style='mso-tab-count:1'>  </span>
414
- Annex A.1a
415
- </h3>
416
- </div>
417
- </div>
418
- <div id='Q2'>
419
- <h2>
420
- Appendix 1
421
- <span style='mso-tab-count:1'>  </span>
422
- An Appendix
423
- </h2>
424
- </div>
425
- </div>
426
- <p>
427
- <br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
428
- </p>
429
- <div>
430
- <h1 class='BiblioTitle'>Bibliography</h1>
431
- <div>
432
- <h2 class='BiblioTitle'>Bibliography Subsection</h2>
433
- </div>
434
- </div>
435
- </div>
436
- <br clear='all' style='page-break-before:left;mso-break-type:section-break'/>
437
- <div class='colophon'/>
438
- </body>
439
- </html>
440
- WORD
441
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
442
- .convert("test", input, true))
443
- .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
444
- .to be_equivalent_to xmlpp(presxml)
445
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
446
- .convert("test", presxml, true)))
447
- .to be_equivalent_to xmlpp(html)
448
- expect(xmlpp(IsoDoc::Iso::WordConvert.new({})
449
- .convert("test", presxml, true)))
450
- .to be_equivalent_to xmlpp(word)
451
- end
452
-
453
- it "defaults to English" do
454
- output = IsoDoc::Iso::PresentationXMLConvert.new({})
455
- .convert("test", <<~"INPUT", true)
456
- <iso-standard xmlns="http://riboseinc.com/isoxml">
457
- <bibdata>
458
- <status>
459
- <stage abbreviation='IS' language=''>60</stage>
460
- </status>
461
- <language>tlh</language>
462
- <ext>
463
- <doctype language=''>international-standard</doctype>
464
- </ext>
465
- </bibdata>
466
- <preface>
467
- <foreword obligation="informative">
468
- <title>Foreword</title>
469
- <p id="A">This is a preamble</p>
470
- </foreword>
471
- <introduction id="B" obligation="informative">
472
- <title>Introduction</title>
473
- <clause id="C" inline-header="false" obligation="informative">
474
- <title>Introduction Subsection</title>
475
- </clause>
476
- <p>This is patent boilerplate</p>
477
- </introduction>
478
- </preface>
479
- <sections>
480
- <clause id="D" obligation="normative" type="scope">
481
- <title>Scope</title>
482
- <p id="E">Text</p>
483
- </clause>
484
- <clause id="H" obligation="normative">
485
- <title>Terms, definitions, symbols and abbreviated terms</title>
486
- <terms id="I" obligation="normative">
487
- <title>Normal Terms</title>
488
- <term id="J">
489
- <preferred><expression><name>Term2</name></expression></preferred>
490
- </term>
491
- </terms>
492
- <definitions id="K">
493
- <dl>
494
- <dt>Symbol</dt>
495
- <dd>Definition</dd>
496
- </dl>
497
- </definitions>
498
- </clause>
499
- <definitions id="L">
500
- <dl>
501
- <dt>Symbol</dt>
502
- <dd>Definition</dd>
503
- </dl>
504
- </definitions>
505
- <clause id="M" inline-header="false" obligation="normative">
506
- <title>Clause 4</title>
507
- <clause id="N" inline-header="false" obligation="normative">
508
- <title>Introduction</title>
509
- </clause>
510
- <clause id="O" inline-header="false" obligation="normative">
511
- <title>Clause 4.2</title>
512
- </clause>
513
- </clause>
514
- </sections>
515
- <annex id="P" inline-header="false" obligation="normative">
516
- <title>Annex</title>
517
- <clause id="Q" inline-header="false" obligation="normative">
518
- <title>Annex A.1</title>
519
- <clause id="Q1" inline-header="false" obligation="normative">
520
- <title>Annex A.1a</title>
521
- </clause>
522
- </clause>
523
- <appendix id="Q2" inline-header="false" obligation="normative">
524
- <title>An Appendix</title>
525
- </appendix>
526
- </annex>
527
- <bibliography>
528
- <references id="R" normative="true" obligation="informative">
529
- <title>Normative References</title>
530
- </references>
531
- <clause id="S" obligation="informative">
532
- <title>Bibliography</title>
533
- <references id="T" normative="false" obligation="informative">
534
- <title>Bibliography Subsection</title>
535
- </references>
536
- </clause>
537
- </bibliography>
538
- </iso-standard>
539
- INPUT
540
- expect(xmlpp(output)
541
- .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
542
- .to be_equivalent_to xmlpp(<<~"OUTPUT")
543
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
544
- <bibdata>
545
- <status>
546
- <stage abbreviation='IS' language=''>60</stage>
547
- <stage abbreviation='IS' language='tlh'>International Standard</stage>
548
- </status>
549
- <language current='true'>tlh</language>
550
- <ext>
551
- <doctype language=''>international-standard</doctype>
552
- <doctype language='tlh'>International Standard</doctype>
553
- </ext>
554
- </bibdata>
555
- <preface>
556
- <foreword obligation="informative" displayorder='1'>
557
- <title>Foreword</title>
558
- <p id="A">This is a preamble</p>
559
- </foreword>
560
- <introduction id="B" obligation="informative" displayorder='2'>
561
- <title depth="1">0<tab/>Introduction</title>
562
- <clause id="C" inline-header="false" obligation="informative">
563
- <title depth="2">0.1<tab/>Introduction Subsection</title>
564
- </clause>
565
- <p>This is patent boilerplate</p>
566
- </introduction>
567
- </preface>
568
- <sections>
569
- <clause id="D" obligation="normative" type="scope" displayorder='3'>
570
- <title depth="1">1<tab/>Scope</title>
571
- <p id="E">Text</p>
572
- </clause>
573
- <clause id="H" obligation="normative" displayorder='5'>
574
- <title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title>
575
- <terms id="I" obligation="normative">
576
- <title depth="2">3.1<tab/>Normal Terms</title>
577
- <term id="J">
578
- <name>3.1.1</name>
579
- <preferred><strong>Term2</strong></preferred>
580
- </term>
581
- </terms>
582
- <definitions id="K" inline-header="true">
583
- <title>3.2</title>
584
- <dl>
585
- <dt>Symbol</dt>
586
- <dd>Definition</dd>
587
- </dl>
588
- </definitions>
589
- </clause>
590
- <definitions id="L" displayorder='6'>
591
- <title>4</title>
592
- <dl>
593
- <dt>Symbol</dt>
594
- <dd>Definition</dd>
595
- </dl>
596
- </definitions>
597
- <clause id="M" inline-header="false" obligation="normative" displayorder='7'>
598
- <title depth="1">5<tab/>Clause 4</title>
599
- <clause id="N" inline-header="false" obligation="normative">
600
- <title depth="2">5.1<tab/>Introduction</title>
601
- </clause>
602
- <clause id="O" inline-header="false" obligation="normative">
603
- <title depth="2">5.2<tab/>Clause 4.2</title>
604
- </clause>
605
- </clause>
606
- </sections>
607
- <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
608
- <title>
609
- <strong>Annex A</strong>
610
- <br/><span class='obligation'>(normative)</span>
611
- <br/>
612
- <br/>
613
- <strong>Annex</strong></title>
614
- <clause id="Q" inline-header="false" obligation="normative">
615
- <title depth="2">A.1<tab/>Annex A.1</title>
616
- <clause id="Q1" inline-header="false" obligation="normative">
617
- <title depth="3">A.1.1<tab/>Annex A.1a</title>
618
- </clause>
619
- </clause>
620
- <appendix id="Q2" inline-header="false" obligation="normative">
621
- <title depth="2">Appendix 1<tab/>An Appendix</title>
622
- </appendix>
623
- </annex>
624
- <bibliography>
625
- <references id="R" normative="true" obligation="informative" displayorder='4'>
626
- <title depth="1">2<tab/>Normative References</title>
627
- </references>
628
- <clause id="S" obligation="informative" displayorder='9'>
629
- <title depth="1">Bibliography</title>
630
- <references id="T" normative="false" obligation="informative">
631
- <title depth="2">Bibliography Subsection</title>
632
- </references>
633
- </clause>
634
- </bibliography>
635
- </iso-standard>
636
- OUTPUT
637
- end
638
-
639
- it "processes French" do
640
- input = <<~INPUT
641
- <iso-standard xmlns="http://riboseinc.com/isoxml">
642
- <bibdata>
643
- <status>
644
- <stage abbreviation='IS' language=''>60</stage>
645
- </status>
646
- <language>fr</language>
647
- <ext>
648
- <doctype language=''>international-standard</doctype>
649
- </ext>
650
- </bibdata>
651
- <preface>
652
- <foreword obligation="informative">
653
- <title>Foreword</title>
654
- <p id="A">This is a preamble</p>
655
- </foreword>
656
- <introduction id="B" obligation="informative">
657
- <title>Introduction</title>
658
- <clause id="C" inline-header="false" obligation="informative">
659
- <title>Introduction Subsection</title>
660
- </clause>
661
- <p>This is patent boilerplate</p>
662
- </introduction>
663
- </preface>
664
- <sections>
665
- <clause id="D" obligation="normative" type="scope">
666
- <title>Scope</title>
667
- <p id="E">Text</p>
668
- </clause>
669
- <clause id="H" obligation="normative">
670
- <title>Terms, definitions, symbols and abbreviated terms</title>
671
- <terms id="I" obligation="normative">
672
- <title>Normal Terms</title>
673
- <term id="J">
674
- <preferred><expression><name>Term2</name></expression></preferred>
675
- </term>
676
- </terms>
677
- <definitions id="K">
678
- <dl>
679
- <dt>Symbol</dt>
680
- <dd>Definition</dd>
681
- </dl>
682
- </definitions>
683
- </clause>
684
- <definitions id="L">
685
- <dl>
686
- <dt>Symbol</dt>
687
- <dd>Definition</dd>
688
- </dl>
689
- </definitions>
690
- <clause id="M" inline-header="false" obligation="normative">
691
- <title>Clause 4</title>
692
- <clause id="N" inline-header="false" obligation="normative">
693
- <title>Introduction</title>
694
- </clause>
695
- <clause id="O" inline-header="false" obligation="normative">
696
- <title>Clause 4.2</title>
697
- </clause>
698
- </clause>
699
- </sections>
700
- <annex id="P" inline-header="false" obligation="normative">
701
- <title>Annex</title>
702
- <clause id="Q" inline-header="false" obligation="normative">
703
- <title>Annex A.1</title>
704
- <clause id="Q1" inline-header="false" obligation="normative">
705
- <title>Annex A.1a</title>
706
- </clause>
707
- </clause>
708
- <appendix id="Q2" inline-header="false" obligation="normative">
709
- <title>An Appendix</title>
710
- </appendix>
711
- </annex>
712
- <bibliography>
713
- <references id="R" normative="true" obligation="informative">
714
- <title>Normative References</title>
715
- </references>
716
- <clause id="S" obligation="informative">
717
- <title>Bibliography</title>
718
- <references id="T" normative="false" obligation="informative">
719
- <title>Bibliography Subsection</title>
720
- </references>
721
- </clause>
722
- </bibliography>
723
- </iso-standard>
724
- INPUT
725
-
726
- presxml = <<~OUTPUT
727
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
728
- <bibdata>
729
- <status>
730
- <stage abbreviation='IS' language=''>60</stage>
731
- <stage abbreviation='IS' language='fr'>Norme internationale</stage>
732
- </status>
733
- <language current='true'>fr</language>
734
- <ext>
735
- <doctype language=''>international-standard</doctype>
736
- <doctype language='fr'>Norme internationale</doctype>
737
- </ext>
738
- </bibdata>
739
- <preface>
740
- <foreword obligation="informative" displayorder='1'>
741
- <title>Foreword</title>
742
- <p id="A">This is a preamble</p>
743
- </foreword>
744
- <introduction id="B" obligation="informative" displayorder='2'>
745
- <title depth="1">0<tab/>Introduction</title>
746
- <clause id="C" inline-header="false" obligation="informative">
747
- <title depth="2">0.1<tab/>Introduction Subsection</title>
748
- </clause>
749
- <p>This is patent boilerplate</p>
750
- </introduction>
751
- </preface>
752
- <sections>
753
- <clause id="D" obligation="normative" type="scope" displayorder='3'>
754
- <title depth="1">1<tab/>Scope</title>
755
- <p id="E">Text</p>
756
- </clause>
757
- <clause id="H" obligation="normative" displayorder='5'>
758
- <title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title>
759
- <terms id="I" obligation="normative">
760
- <title depth="2">3.1<tab/>Normal Terms</title>
761
- <term id="J">
762
- <name>3.1.1</name>
763
- <preferred><strong>Term2</strong></preferred>
764
- </term>
765
- </terms>
766
- <definitions id="K" inline-header="true">
767
- <title>3.2</title>
768
- <dl>
769
- <dt>Symbol</dt>
770
- <dd>Definition</dd>
771
- </dl>
772
- </definitions>
773
- </clause>
774
- <definitions id="L" displayorder='6'>
775
- <title>4</title>
776
- <dl>
777
- <dt>Symbol</dt>
778
- <dd>Definition</dd>
779
- </dl>
780
- </definitions>
781
- <clause id="M" inline-header="false" obligation="normative" displayorder='7'>
782
- <title depth="1">5<tab/>Clause 4</title>
783
- <clause id="N" inline-header="false" obligation="normative">
784
- <title depth="2">5.1<tab/>Introduction</title>
785
- </clause>
786
- <clause id="O" inline-header="false" obligation="normative">
787
- <title depth="2">5.2<tab/>Clause 4.2</title>
788
- </clause>
789
- </clause>
790
- </sections>
791
- <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
792
- <title>
793
- <strong>Annexe A</strong>
794
- <br/><span class='obligation'>(normative)</span>
795
- <br/>
796
- <br/>
797
- <strong>Annex</strong></title>
798
- <clause id="Q" inline-header="false" obligation="normative">
799
- <title depth="2">A.1<tab/>Annex A.1</title>
800
- <clause id="Q1" inline-header="false" obligation="normative">
801
- <title depth="3">A.1.1<tab/>Annex A.1a</title>
802
- </clause>
803
- </clause>
804
- <appendix id="Q2" inline-header="false" obligation="normative">
805
- <title depth="2">Appendice 1<tab/>An Appendix</title>
806
- </appendix>
807
- </annex>
808
- <bibliography>
809
- <references id="R" normative="true" obligation="informative" displayorder='4'>
810
- <title depth="1">2<tab/>Normative References</title>
811
- </references>
812
- <clause id="S" obligation="informative" displayorder='9'>
813
- <title depth="1">Bibliography</title>
814
- <references id="T" normative="false" obligation="informative">
815
- <title depth="2">Bibliography Subsection</title>
816
- </references>
817
- </clause>
818
- </bibliography>
819
- </iso-standard>
820
- OUTPUT
821
-
822
- html = <<~OUTPUT
823
- #{HTML_HDR.gsub(/"en"/, '"fr"')}
824
- <br/>
825
- <div>
826
- <h1 class="ForewordTitle">Foreword</h1>
827
- <p id="A">This is a preamble</p>
828
- </div>
829
- <br/>
830
- <div class="Section3" id="B">
831
- <h1 class="IntroTitle">0&#160; Introduction</h1>
832
- <div id="C">
833
- <h2>0.1&#160; Introduction Subsection</h2>
834
- </div>
835
- <p>This is patent boilerplate</p>
836
- </div>
837
- <p class="zzSTDTitle1"/>
838
- <div id="D">
839
- <h1>1&#160; Scope</h1>
840
- <p id="E">Text</p>
841
- </div>
842
- <div>
843
- <h1>2&#160; Normative References</h1>
844
- </div>
845
- <div id="H">
846
- <h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1>
847
- <div id="I">
848
- <h2>3.1&#160; Normal Terms</h2>
849
- <p class="TermNum" id="J">3.1.1</p>
850
- <p class="Terms" style="text-align:left;"><b>Term2</b></p>
851
- </div>
852
- <div id="K">
853
- <span class="zzMoveToFollowing">
854
- <b>3.2&#160; </b>
855
- </span>
856
- <dl>
857
- <dt>
858
- <p>Symbol</p>
859
- </dt>
860
- <dd>Definition</dd>
861
- </dl>
862
- </div>
863
- </div>
864
- <div class="Symbols" id="L">
865
- <h1>4</h1>
866
- <dl>
867
- <dt>
868
- <p>Symbol</p>
869
- </dt>
870
- <dd>Definition</dd>
871
- </dl>
872
- </div>
873
- <div id="M">
874
- <h1>5&#160; Clause 4</h1>
875
- <div id="N">
876
- <h2>5.1&#160; Introduction</h2>
877
- </div>
878
- <div id="O">
879
- <h2>5.2&#160; Clause 4.2</h2>
880
- </div>
881
- </div>
882
- <br/>
883
- <div class="Section3" id="P">
884
- <h1 class="Annex">
885
- <b>Annexe A</b>
886
- <br/>(normative)
887
- <br/>
888
- <br/>
889
- <b>Annex</b></h1>
890
- <div id="Q">
891
- <h2>A.1&#160; Annex A.1</h2>
892
- <div id="Q1">
893
- <h3>A.1.1&#160; Annex A.1a</h3>
894
- </div>
895
- </div>
896
- <div id="Q2">
897
- <h2>Appendice 1&#160; An Appendix</h2>
898
- </div>
899
- </div>
900
- <br/>
901
- <div>
902
- <h1 class="Section3">Bibliography</h1>
903
- <div>
904
- <h2 class="Section3">Bibliography Subsection</h2>
905
- </div>
906
- </div>
907
- </div>
908
- </body>
909
- </html>
910
- OUTPUT
911
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
912
- .convert("test", input, true))
913
- .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
914
- .to be_equivalent_to xmlpp(presxml)
915
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
916
- .convert("test", presxml, true)))
917
- .to be_equivalent_to xmlpp(html)
918
- end
919
-
920
- it "processes Russian" do
921
- input = <<~INPUT
922
- <iso-standard xmlns="http://riboseinc.com/isoxml">
923
- <bibdata>
924
- <status>
925
- <stage abbreviation='IS' language=''>60</stage>
926
- </status>
927
- <language>ru</language>
928
- <ext>
929
- <doctype language=''>international-standard</doctype>
930
- </ext>
931
- </bibdata>
932
- <preface>
933
- <foreword obligation="informative">
934
- <title>Foreword</title>
935
- <p id="A">This is a preamble</p>
936
- </foreword>
937
- <introduction id="B" obligation="informative">
938
- <title>Introduction</title>
939
- <clause id="C" inline-header="false" obligation="informative">
940
- <title>Introduction Subsection</title>
941
- </clause>
942
- <p>This is patent boilerplate</p>
943
- </introduction>
944
- </preface>
945
- <sections>
946
- <clause id="D" obligation="normative" type="scope">
947
- <title>Scope</title>
948
- <p id="E">Text</p>
949
- </clause>
950
- <clause id="H" obligation="normative">
951
- <title>Terms, definitions, symbols and abbreviated terms</title>
952
- <terms id="I" obligation="normative">
953
- <title>Normal Terms</title>
954
- <term id="J">
955
- <preferred><expression><name>Term2</name></expression></preferred>
956
- </term>
957
- </terms>
958
- <definitions id="K">
959
- <dl>
960
- <dt>Symbol</dt>
961
- <dd>Definition</dd>
962
- </dl>
963
- </definitions>
964
- </clause>
965
- <definitions id="L">
966
- <dl>
967
- <dt>Symbol</dt>
968
- <dd>Definition</dd>
969
- </dl>
970
- </definitions>
971
- <clause id="M" inline-header="false" obligation="normative">
972
- <title>Clause 4</title>
973
- <clause id="N" inline-header="false" obligation="normative">
974
- <title>Introduction</title>
975
- </clause>
976
- <clause id="O" inline-header="false" obligation="normative">
977
- <title>Clause 4.2</title>
978
- </clause>
979
- </clause>
980
- </sections>
981
- <annex id="P" inline-header="false" obligation="normative">
982
- <title>Annex</title>
983
- <clause id="Q" inline-header="false" obligation="normative">
984
- <title>Annex A.1</title>
985
- <clause id="Q1" inline-header="false" obligation="normative">
986
- <title>Annex A.1a</title>
987
- </clause>
988
- </clause>
989
- <appendix id="Q2" inline-header="false" obligation="normative">
990
- <title>An Appendix</title>
991
- </appendix>
992
- </annex>
993
- <bibliography>
994
- <references id="R" normative="true" obligation="informative">
995
- <title>Normative References</title>
996
- </references>
997
- <clause id="S" obligation="informative">
998
- <title>Bibliography</title>
999
- <references id="T" normative="false" obligation="informative">
1000
- <title>Bibliography Subsection</title>
1001
- </references>
1002
- </clause>
1003
- </bibliography>
1004
- </iso-standard>
1005
- INPUT
1006
-
1007
- presxml = <<~OUTPUT
1008
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
1009
- <bibdata>
1010
- <status>
1011
- <stage abbreviation='IS' language=''>60</stage>
1012
- <stage abbreviation='IS' language='ru'>
1013
- Международный Стандарт
1014
- </stage>
1015
- </status>
1016
- <language current='true'>ru</language>
1017
- <ext>
1018
- <doctype language=''>international-standard</doctype>
1019
- <doctype language='ru'>
1020
- Международный Стандарт
1021
- </doctype>
1022
- </ext>
1023
- </bibdata>
1024
- <preface>
1025
- <foreword obligation="informative" displayorder='1'>
1026
- <title>Foreword</title>
1027
- <p id="A">This is a preamble</p>
1028
- </foreword>
1029
- <introduction id="B" obligation="informative" displayorder='2'>
1030
- <title depth="1">0<tab/>Introduction</title>
1031
- <clause id="C" inline-header="false" obligation="informative">
1032
- <title depth="2">0.1<tab/>Introduction Subsection</title>
1033
- </clause>
1034
- <p>This is patent boilerplate</p>
1035
- </introduction>
1036
- </preface>
1037
- <sections>
1038
- <clause id="D" obligation="normative" type="scope" displayorder='3'>
1039
- <title depth="1">1<tab/>Scope</title>
1040
- <p id="E">Text</p>
1041
- </clause>
1042
- <clause id="H" obligation="normative" displayorder='5'>
1043
- <title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title>
1044
- <terms id="I" obligation="normative">
1045
- <title depth="2">3.1<tab/>Normal Terms</title>
1046
- <term id="J">
1047
- <name>3.1.1</name>
1048
- <preferred><strong>Term2</strong></preferred>
1049
- </term>
1050
- </terms>
1051
- <definitions id="K" inline-header="true">
1052
- <title>3.2</title>
1053
- <dl>
1054
- <dt>Symbol</dt>
1055
- <dd>Definition</dd>
1056
- </dl>
1057
- </definitions>
1058
- </clause>
1059
- <definitions id="L" displayorder='6'>
1060
- <title>4</title>
1061
- <dl>
1062
- <dt>Symbol</dt>
1063
- <dd>Definition</dd>
1064
- </dl>
1065
- </definitions>
1066
- <clause id="M" inline-header="false" obligation="normative" displayorder='7'>
1067
- <title depth="1">5<tab/>Clause 4</title>
1068
- <clause id="N" inline-header="false" obligation="normative">
1069
- <title depth="2">5.1<tab/>Introduction</title>
1070
- </clause>
1071
- <clause id="O" inline-header="false" obligation="normative">
1072
- <title depth="2">5.2<tab/>Clause 4.2</title>
1073
- </clause>
1074
- </clause>
1075
- </sections>
1076
- <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
1077
- <title>
1078
- <strong>&#x414;&#x43E;&#x43F;&#x43E;&#x43B;&#x43D;&#x435;&#x43D;&#x438;&#x435; A</strong>
1079
- <br/><span class='obligation'>(&#x43D;&#x43E;&#x440;&#x43C;&#x430;&#x442;&#x438;&#x432;&#x43D;&#x43E;&#x435;)</span>
1080
- <br/>
1081
- <br/>
1082
- <strong>Annex</strong></title>
1083
- <clause id="Q" inline-header="false" obligation="normative">
1084
- <title depth="2">A.1<tab/>Annex A.1</title>
1085
- <clause id="Q1" inline-header="false" obligation="normative">
1086
- <title depth="3">A.1.1<tab/>Annex A.1a</title>
1087
- </clause>
1088
- </clause>
1089
- <appendix id="Q2" inline-header="false" obligation="normative">
1090
- <title depth="2"> &#x41F;&#x440;&#x438;&#x43B;&#x43E;&#x436;&#x435;&#x43D;&#x438;&#x435; 1<tab/>An Appendix</title>
1091
- </appendix>
1092
- </annex>
1093
- <bibliography>
1094
- <references id="R" normative="true" obligation="informative" displayorder='4'>
1095
- <title depth="1">2<tab/>Normative References</title>
1096
- </references>
1097
- <clause id="S" obligation="informative" displayorder='9'>
1098
- <title depth="1">Bibliography</title>
1099
- <references id="T" normative="false" obligation="informative">
1100
- <title depth="2">Bibliography Subsection</title>
1101
- </references>
1102
- </clause>
1103
- </bibliography>
1104
- </iso-standard>
1105
- OUTPUT
1106
-
1107
- html = <<~OUTPUT
1108
- #{HTML_HDR.gsub(/"en"/, '"ru"')}
1109
- <br/>
1110
- <div>
1111
- <h1 class="ForewordTitle">Foreword</h1>
1112
- <p id="A">This is a preamble</p>
1113
- </div>
1114
- <br/>
1115
- <div class="Section3" id="B">
1116
- <h1 class="IntroTitle">0&#160; Introduction</h1>
1117
- <div id="C">
1118
- <h2>0.1&#160; Introduction Subsection</h2>
1119
- </div>
1120
- <p>This is patent boilerplate</p>
1121
- </div>
1122
- <p class="zzSTDTitle1"/>
1123
- <div id="D">
1124
- <h1>1&#160; Scope</h1>
1125
- <p id="E">Text</p>
1126
- </div>
1127
- <div>
1128
- <h1>2&#160; Normative References</h1>
1129
- </div>
1130
- <div id="H">
1131
- <h1>3&#160; Terms, definitions, symbols and abbreviated terms</h1>
1132
- <div id="I">
1133
- <h2>3.1&#160; Normal Terms</h2>
1134
- <p class="TermNum" id="J">3.1.1</p>
1135
- <p class="Terms" style="text-align:left;"><b>Term2</b></p>
1136
- </div>
1137
- <div id="K">
1138
- <span class="zzMoveToFollowing">
1139
- <b>3.2&#160; </b>
1140
- </span>
1141
- <dl>
1142
- <dt>
1143
- <p>Symbol</p>
1144
- </dt>
1145
- <dd>Definition</dd>
1146
- </dl>
1147
- </div>
1148
- </div>
1149
- <div class="Symbols" id="L">
1150
- <h1>4</h1>
1151
- <dl>
1152
- <dt>
1153
- <p>Symbol</p>
1154
- </dt>
1155
- <dd>Definition</dd>
1156
- </dl>
1157
- </div>
1158
- <div id="M">
1159
- <h1>5&#160; Clause 4</h1>
1160
- <div id="N">
1161
- <h2>5.1&#160; Introduction</h2>
1162
- </div>
1163
- <div id="O">
1164
- <h2>5.2&#160; Clause 4.2</h2>
1165
- </div>
1166
- </div>
1167
- <br/>
1168
- <div class="Section3" id="P">
1169
- <h1 class="Annex">
1170
- <b>&#1044;&#1086;&#1087;&#1086;&#1083;&#1085;&#1077;&#1085;&#1080;&#1077; A</b>
1171
- <br/>(&#1085;&#1086;&#1088;&#1084;&#1072;&#1090;&#1080;&#1074;&#1085;&#1086;&#1077;)
1172
- <br/>
1173
- <br/>
1174
- <b>Annex</b></h1>
1175
- <div id="Q">
1176
- <h2>A.1&#160; Annex A.1</h2>
1177
- <div id="Q1">
1178
- <h3>A.1.1&#160; Annex A.1a</h3>
1179
- </div>
1180
- </div>
1181
- <div id="Q2">
1182
- <h2>&#1055;&#1088;&#1080;&#1083;&#1086;&#1078;&#1077;&#1085;&#1080;&#1077; 1&#160; An Appendix</h2>
1183
- </div>
1184
- </div>
1185
- <br/>
1186
- <div>
1187
- <h1 class="Section3">Bibliography</h1>
1188
- <div>
1189
- <h2 class="Section3">Bibliography Subsection</h2>
1190
- </div>
1191
- </div>
1192
- </div>
1193
- </body>
1194
- </html>
1195
- OUTPUT
1196
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1197
- .convert("test", input, true))
1198
- .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
1199
- .to be_equivalent_to xmlpp(presxml)
1200
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
1201
- .convert("test", presxml, true)))
1202
- .to be_equivalent_to xmlpp(html)
1203
- end
1204
-
1205
- it "processes Simplified Chinese" do
1206
- input = <<~INPUT
1207
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1208
- <bibdata>
1209
- <status>
1210
- <stage abbreviation='IS' language=''>60</stage>
1211
- </status>
1212
- <language>zh</language>
1213
- <script>Hans</script>
1214
- <ext>
1215
- <doctype language=''>international-standard</doctype>
1216
- </ext>
1217
- </bibdata>
1218
- <preface>
1219
- <foreword obligation="informative">
1220
- <title>Foreword</title>
1221
- <p id="A">This is a preamble</p>
1222
- </foreword>
1223
- <introduction id="B" obligation="informative">
1224
- <title>Introduction</title>
1225
- <clause id="C" inline-header="false" obligation="informative">
1226
- <title>Introduction Subsection</title>
1227
- </clause>
1228
- <p>This is patent boilerplate</p>
1229
- </introduction>
1230
- </preface>
1231
- <sections>
1232
- <clause id="D" obligation="normative" type="scope">
1233
- <title>Scope</title>
1234
- <p id="E">
1235
- <eref bibitemid="ISO712" type="inline">
1236
- <locality type="table">
1237
- <referenceFrom>1</referenceFrom>
1238
- <referenceTo>1</referenceTo>
1239
- </locality>
1240
- </eref>
1241
- </p>
1242
- </clause>
1243
- <clause id="H" obligation="normative">
1244
- <title>Terms, definitions, symbols and abbreviated terms</title>
1245
- <terms id="I" obligation="normative">
1246
- <title>Normal Terms</title>
1247
- <term id="J">
1248
- <preferred><expression><name>Term2</name></expression></preferred>
1249
- </term>
1250
- </terms>
1251
- <definitions id="K">
1252
- <dl>
1253
- <dt>Symbol</dt>
1254
- <dd>Definition</dd>
1255
- </dl>
1256
- </definitions>
1257
- </clause>
1258
- <definitions id="L">
1259
- <dl>
1260
- <dt>Symbol</dt>
1261
- <dd>Definition</dd>
1262
- </dl>
1263
- </definitions>
1264
- <clause id="M" inline-header="false" obligation="normative">
1265
- <title>Clause 4</title>
1266
- <clause id="N" inline-header="false" obligation="normative">
1267
- <title>Introduction</title>
1268
- </clause>
1269
- <clause id="O" inline-header="false" obligation="normative">
1270
- <title>Clause 4.2</title>
1271
- </clause>
1272
- </clause>
1273
- </sections>
1274
- <annex id="P" inline-header="false" obligation="normative">
1275
- <title>Annex</title>
1276
- <clause id="Q" inline-header="false" obligation="normative">
1277
- <title>Annex A.1</title>
1278
- <clause id="Q1" inline-header="false" obligation="normative">
1279
- <title>Annex A.1a</title>
1280
- </clause>
1281
- </clause>
1282
- <appendix id="Q2" inline-header="false" obligation="normative">
1283
- <title>An Appendix</title>
1284
- </appendix>
1285
- </annex>
1286
- <bibliography>
1287
- <references id="R" normative="true" obligation="informative">
1288
- <title>Normative References</title>
1289
- <bibitem id="ISO712" type="standard">
1290
- <formattedref><em>Cereals and cereal products</em>.</formattedref>
1291
- <docidentifier>ISO 712</docidentifier>
1292
- </bibitem>
1293
- </references>
1294
- <clause id="S" obligation="informative">
1295
- <title>Bibliography</title>
1296
- <references id="T" normative="false" obligation="informative">
1297
- <title>Bibliography Subsection</title>
1298
- </references>
1299
- </clause>
1300
- </bibliography>
1301
- </iso-standard>
1302
- INPUT
1303
- presxml = <<~OUTPUT
1304
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
1305
- <bibdata>
1306
- <status>
1307
- <stage abbreviation='IS' language=''>60</stage>
1308
- <stage abbreviation='IS' language='zh'>&#x56FD;&#x9645;&#x6807;&#x51C6;</stage>
1309
- </status>
1310
- <language current='true'>zh</language>
1311
- <script current='true'>Hans</script>
1312
- <ext>
1313
- <doctype language=''>international-standard</doctype>
1314
- <doctype language='zh'>&#x56FD;&#x9645;&#x6807;&#x51C6;</doctype>
1315
- </ext>
1316
- </bibdata>
1317
-
1318
- <preface>
1319
- <foreword obligation="informative" displayorder='1'>
1320
- <title>Foreword</title>
1321
- <p id="A">This is a preamble</p>
1322
- </foreword>
1323
- <introduction id="B" obligation="informative" displayorder='2'>
1324
- <title depth="1">0<tab/>Introduction</title>
1325
- <clause id="C" inline-header="false" obligation="informative">
1326
- <title depth="2">0.1<tab/>Introduction Subsection</title>
1327
- </clause>
1328
- <p>This is patent boilerplate</p>
1329
- </introduction>
1330
- </preface>
1331
- <sections>
1332
- <clause id="D" obligation="normative" type="scope" displayorder='3'>
1333
- <title depth="1">1<tab/>Scope</title>
1334
- <p id="E">
1335
- <eref bibitemid="ISO712" type="inline"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, <span class='citetbl'>第1–1表</span></eref>
1336
- </p>
1337
- </clause>
1338
- <clause id="H" obligation="normative" displayorder='5'>
1339
- <title depth="1">3<tab/>Terms, definitions, symbols and abbreviated terms</title>
1340
- <terms id="I" obligation="normative">
1341
- <title depth="2">3.1<tab/>Normal Terms</title>
1342
- <term id="J">
1343
- <name>3.1.1</name>
1344
- <preferred><strong>Term2</strong></preferred>
1345
- </term>
1346
- </terms>
1347
- <definitions id="K" inline-header="true">
1348
- <title>3.2</title>
1349
- <dl>
1350
- <dt>Symbol</dt>
1351
- <dd>Definition</dd>
1352
- </dl>
1353
- </definitions>
1354
- </clause>
1355
- <definitions id="L" displayorder='6'>
1356
- <title>4</title>
1357
- <dl>
1358
- <dt>Symbol</dt>
1359
- <dd>Definition</dd>
1360
- </dl>
1361
- </definitions>
1362
- <clause id="M" inline-header="false" obligation="normative" displayorder='7'>
1363
- <title depth="1">5<tab/>Clause 4</title>
1364
- <clause id="N" inline-header="false" obligation="normative">
1365
- <title depth="2">5.1<tab/>Introduction</title>
1366
- </clause>
1367
- <clause id="O" inline-header="false" obligation="normative">
1368
- <title depth="2">5.2<tab/>Clause 4.2</title>
1369
- </clause>
1370
- </clause>
1371
- </sections>
1372
- <annex id="P" inline-header="false" obligation="normative" displayorder='8'>
1373
- <title>
1374
- <strong>附件A</strong>
1375
- <br/><span class='obligation'>(规范性附录)</span>
1376
- <br/>
1377
- <br/>
1378
- <strong>Annex</strong></title>
1379
- <clause id="Q" inline-header="false" obligation="normative">
1380
- <title depth="2">A.1<tab/>Annex A.1</title>
1381
- <clause id="Q1" inline-header="false" obligation="normative">
1382
- <title depth="3">A.1.1<tab/>Annex A.1a</title>
1383
- </clause>
1384
- </clause>
1385
- <appendix id="Q2" inline-header="false" obligation="normative">
1386
- <title depth="2">附录1<tab/>An Appendix</title>
1387
- </appendix>
1388
- </annex>
1389
- <bibliography>
1390
- <references id="R" normative="true" obligation="informative" displayorder='4'>
1391
- <title depth="1">2<tab/>Normative References</title>
1392
- <bibitem id="ISO712" type="standard">
1393
- <formattedref><em>Cereals and cereal products</em>.</formattedref>
1394
- <docidentifier>ISO 712</docidentifier>
1395
- </bibitem>
1396
- </references>
1397
- <clause id="S" obligation="informative" displayorder='9'>
1398
- <title depth="1">Bibliography</title>
1399
- <references id="T" normative="false" obligation="informative">
1400
- <title depth="2">Bibliography Subsection</title>
1401
- </references>
1402
- </clause>
1403
- </bibliography>
1404
- </iso-standard>
1405
- OUTPUT
1406
-
1407
- html = <<~OUTPUT
1408
- #{HTML_HDR.gsub(/"en"/, '"zh"')}
1409
- <br/>
1410
- <div>
1411
- <h1 class='ForewordTitle'>Foreword</h1>
1412
- <p id='A'>This is a preamble</p>
1413
- </div>
1414
- <br/>
1415
- <div class='Section3' id='B'>
1416
- <h1 class='IntroTitle'>0 Introduction</h1>
1417
- <div id='C'>
1418
- <h2>0.1 Introduction Subsection</h2>
1419
- </div>
1420
- <p>This is patent boilerplate</p>
1421
- </div>
1422
- <p class='zzSTDTitle1'/>
1423
- <div id='D'>
1424
- <h1>1 Scope</h1>
1425
- <p id='E'>
1426
- <a href='#ISO712'>ISO 712, 第1–1表</a>
1427
- </p>
1428
- </div>
1429
- <div>
1430
- <h1>2 Normative References</h1>
1431
- <p id='ISO712' class='NormRef'>
1432
- ISO 712,
1433
- <i>Cereals and cereal products</i>.
1434
- </p>
1435
- </div>
1436
- <div id='H'>
1437
- <h1>3 Terms, definitions, symbols and abbreviated terms</h1>
1438
- <div id='I'>
1439
- <h2>3.1 Normal Terms</h2>
1440
- <p class='TermNum' id='J'>3.1.1</p>
1441
- <p class='Terms' style='text-align:left;'>
1442
- <b>Term2</b>
1443
- </p>
1444
- </div>
1445
- <div id='K'>
1446
- <span class='zzMoveToFollowing'>
1447
- <b>3.2 </b>
1448
- </span>
1449
- <dl>
1450
- <dt>
1451
- <p>Symbol</p>
1452
- </dt>
1453
- <dd>Definition</dd>
1454
- </dl>
1455
- </div>
1456
- </div>
1457
- <div id='L' class='Symbols'>
1458
- <h1>4</h1>
1459
- <dl>
1460
- <dt>
1461
- <p>Symbol</p>
1462
- </dt>
1463
- <dd>Definition</dd>
1464
- </dl>
1465
- </div>
1466
- <div id='M'>
1467
- <h1>5 Clause 4</h1>
1468
- <div id='N'>
1469
- <h2>5.1 Introduction</h2>
1470
- </div>
1471
- <div id='O'>
1472
- <h2>5.2 Clause 4.2</h2>
1473
- </div>
1474
- </div>
1475
- <br/>
1476
- <div id='P' class='Section3'>
1477
- <h1 class='Annex'>
1478
- <b>附件A</b>
1479
- <br/>
1480
- (规范性附录)
1481
- <br/>
1482
- <br/>
1483
- <b>Annex</b>
1484
- </h1>
1485
- <div id='Q'>
1486
- <h2>A.1 Annex A.1</h2>
1487
- <div id='Q1'>
1488
- <h3>A.1.1 Annex A.1a</h3>
1489
- </div>
1490
- </div>
1491
- <div id='Q2'>
1492
- <h2>附录1 An Appendix</h2>
1493
- </div>
1494
- </div>
1495
- <br/>
1496
- <div>
1497
- <h1 class='Section3'>Bibliography</h1>
1498
- <div>
1499
- <h2 class='Section3'>Bibliography Subsection</h2>
1500
- </div>
1501
- </div>
1502
- </div>
1503
- </body>
1504
- </html>
1505
- OUTPUT
1506
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1507
- .convert("test", input, true))
1508
- .sub(%r{<localized-strings>.*</localized-strings>}m, ""))
1509
- .to be_equivalent_to xmlpp(presxml)
1510
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({})
1511
- .convert("test", presxml, true)))
1512
- .to be_equivalent_to xmlpp(html)
1513
- end
1514
-
1515
- it "internationalises locality" do
1516
- input = <<~"INPUT"
1517
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1518
- <bibdata>
1519
- <language>fr</language>
1520
- <script>Latn</script>
1521
- <status>
1522
- <stage>published</stage>
1523
- <substage>withdrawn</substage>
1524
- </status>
1525
- <edition>2</edition>
1526
- <ext>
1527
- <doctype>brochure</doctype>
1528
- </ext>
1529
- </bibdata>
1530
- <preface>
1531
- <foreword obligation="informative">
1532
- <title>Foreword</title>
1533
- <p id="A"><eref type="inline" bibitemid="ISO712"><locality type="locality:appendix"><referenceFrom>7</referenceFrom></locality></eref></p>
1534
- <p id="B"><eref type="inline" bibitemid="ISO712"><locality type="annex"><referenceFrom>7</referenceFrom></locality></eref></p>
1535
- </foreword>
1536
- </preface>
1537
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
1538
- <bibitem id="ISO712" type="standard">
1539
- <title format="text/plain">Cereals and cereal products</title>
1540
- <docidentifier>ISO 712</docidentifier>
1541
- <contributor>
1542
- <role type="publisher"/>
1543
- <organization>
1544
- <abbreviation>ISO</abbreviation>
1545
- </organization>
1546
- </contributor>
1547
- </bibitem>
1548
- </references>
1549
- </bibliography>
1550
- </iso-standard>
1551
- INPUT
1552
- presxml = <<~OUTPUT
1553
- <foreword obligation='informative' displayorder='1'>
1554
- <title>Foreword</title>
1555
- <p id='A'>
1556
- <eref type='inline' bibitemid='ISO712'>
1557
- <locality type='locality:appendix'>
1558
- <referenceFrom>7</referenceFrom>
1559
- </locality>
1560
- ISO 712, Appendice 7
1561
- </eref>
1562
- </p>
1563
- <p id='B'>
1564
- <eref type='inline' bibitemid='ISO712'>
1565
- <locality type='annex'>
1566
- <referenceFrom>7</referenceFrom>
1567
- </locality>
1568
- ISO 712,
1569
- <span class='citeapp'>Annexe 7</span>
1570
- </eref>
1571
- </p>
1572
- </foreword>
1573
- OUTPUT
1574
- expect(xmlpp(Nokogiri::XML(IsoDoc::Iso::PresentationXMLConvert
1575
- .new({}).convert("test", input, true))
1576
- .at("//xmlns:foreword").to_xml))
1577
- .to be_equivalent_to xmlpp(presxml)
1578
- end
1579
- end