metanorma-iso 2.2.2 → 2.2.3

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