metanorma-iso 2.0.7 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/iso/base.rb +0 -1
  3. data/lib/asciidoctor/iso/cleanup.rb +0 -1
  4. data/lib/asciidoctor/iso/converter.rb +0 -1
  5. data/lib/asciidoctor/iso/deprecated.rb +4 -2
  6. data/lib/asciidoctor/iso/front.rb +0 -1
  7. data/lib/asciidoctor/iso/front_id.rb +0 -1
  8. data/lib/asciidoctor/iso/section.rb +0 -1
  9. data/lib/asciidoctor/iso/validate.rb +0 -1
  10. data/lib/asciidoctor/iso/validate_image.rb +0 -1
  11. data/lib/asciidoctor/iso/validate_requirements.rb +0 -1
  12. data/lib/asciidoctor/iso/validate_section.rb +0 -1
  13. data/lib/asciidoctor/iso/validate_style.rb +0 -1
  14. data/lib/asciidoctor/iso/validate_title.rb +0 -1
  15. data/lib/html2doc/lists.rb +37 -0
  16. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -2
  17. data/lib/isodoc/iso/html/isodoc-dis.css +196 -156
  18. data/lib/isodoc/iso/html/isodoc-dis.scss +193 -156
  19. data/lib/isodoc/iso/html/word_iso_intro-dis.html +7 -0
  20. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +3 -2
  21. data/lib/isodoc/iso/html/word_iso_titlepage.html +8 -2
  22. data/lib/isodoc/iso/html/wordstyle-dis.css +204 -34
  23. data/lib/isodoc/iso/html/wordstyle-dis.scss +198 -34
  24. data/lib/isodoc/iso/i18n-en.yaml +2 -1
  25. data/lib/isodoc/iso/i18n-fr.yaml +1 -0
  26. data/lib/isodoc/iso/i18n-ru.yaml +1 -0
  27. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
  28. data/lib/isodoc/iso/index.rb +1 -1
  29. data/lib/isodoc/iso/init.rb +17 -1
  30. data/lib/isodoc/iso/iso.amendment.xsl +726 -299
  31. data/lib/isodoc/iso/iso.international-standard.xsl +726 -299
  32. data/lib/isodoc/iso/metadata.rb +75 -63
  33. data/lib/isodoc/iso/presentation_inline.rb +90 -0
  34. data/lib/isodoc/iso/presentation_xml_convert.rb +39 -100
  35. data/lib/isodoc/iso/presentation_xref.rb +126 -0
  36. data/lib/isodoc/iso/word_cleanup.rb +16 -2
  37. data/lib/isodoc/iso/word_convert.rb +27 -10
  38. data/lib/isodoc/iso/word_dis_convert.rb +174 -0
  39. data/lib/isodoc/iso/xref.rb +50 -30
  40. data/lib/metanorma/iso/biblio.rng +62 -10
  41. data/lib/metanorma/iso/boilerplate-fr.xml +1 -1
  42. data/lib/metanorma/iso/boilerplate-ru.xml +1 -3
  43. data/lib/metanorma/iso/boilerplate.xml +1 -3
  44. data/lib/metanorma/iso/cleanup.rb +7 -6
  45. data/lib/metanorma/iso/front_id.rb +28 -11
  46. data/lib/metanorma/iso/isodoc.rng +56 -0
  47. data/lib/metanorma/iso/version.rb +1 -1
  48. data/lib/metanorma-iso.rb +1 -0
  49. data/lib/relaton/render/config.yml +4 -0
  50. data/lib/relaton/render/general.rb +13 -0
  51. data/metanorma-iso.gemspec +1 -1
  52. data/spec/isodoc/amd_spec.rb +15 -14
  53. data/spec/isodoc/blocks_spec.rb +286 -179
  54. data/spec/isodoc/i18n_spec.rb +296 -133
  55. data/spec/isodoc/inline_spec.rb +35 -42
  56. data/spec/isodoc/iso_spec.rb +43 -27
  57. data/spec/isodoc/postproc_spec.rb +25 -0
  58. data/spec/isodoc/ref_spec.rb +66 -69
  59. data/spec/isodoc/section_spec.rb +78 -76
  60. data/spec/isodoc/table_spec.rb +2 -2
  61. data/spec/isodoc/terms_spec.rb +2 -2
  62. data/spec/isodoc/word_dis_spec.rb +760 -0
  63. data/spec/isodoc/xref_spec.rb +51 -51
  64. data/spec/metanorma/amd_spec.rb +39 -16
  65. data/spec/metanorma/base_spec.rb +17 -9
  66. data/spec/metanorma/blocks_spec.rb +4 -4
  67. data/spec/metanorma/cleanup_spec.rb +11 -11
  68. data/spec/metanorma/section_spec.rb +3 -3
  69. data/spec/spec_helper.rb +5 -2
  70. data/spec/vcr_cassettes/withdrawn_iso.yml +26 -26
  71. metadata +11 -5
  72. data/spec/vcr_cassettes/docrels.yml +0 -385
@@ -121,7 +121,7 @@ RSpec.describe IsoDoc do
121
121
  <annex id="annex1" displayorder='5'>
122
122
  <title>
123
123
  <strong>Annex A</strong>
124
- <br/>(informative)</title>
124
+ <br/><span class="obligation">(informative)</span></title>
125
125
  <clause id="annex1a" inline-header="true">
126
126
  <title>A.1</title>
127
127
  <note id="AN">
@@ -224,12 +224,12 @@ RSpec.describe IsoDoc do
224
224
  <preface>
225
225
  <foreword id="fwd" displayorder='1'>
226
226
  <p>
227
- <xref target="N">Figure 1</xref>
228
- <xref target="note1">Figure 2</xref>
229
- <xref target="note2">Figure 3</xref>
230
- <xref target="AN">Figure A.1</xref>
231
- <xref target="Anote1">Figure A.2</xref>
232
- <xref target="Anote2">Figure A.3</xref>
227
+ <xref target="N"><span class='citefig'>Figure 1</span></xref>
228
+ <xref target="note1"><span class='citefig'>Figure 2</span></xref>
229
+ <xref target="note2"><span class='citefig'>Figure 3</span></xref>
230
+ <xref target="AN"><span class='citefig'>Figure A.1</span></xref>
231
+ <xref target="Anote1"><span class='citefig'>Figure A.2</span></xref>
232
+ <xref target="Anote2"><span class='citefig'>Figure A.3</span></xref>
233
233
  </p>
234
234
  </foreword>
235
235
  </preface>
@@ -243,7 +243,7 @@ RSpec.describe IsoDoc do
243
243
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
244
244
  </figure>
245
245
  <p>
246
- <xref target="N">Figure 1</xref>
246
+ <xref target="N"><span class='citefig'>Figure 1</span></xref>
247
247
  </p>
248
248
  </clause>
249
249
  <terms id="terms" displayorder='3'>
@@ -264,8 +264,8 @@ RSpec.describe IsoDoc do
264
264
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
265
265
  </figure>
266
266
  <p>
267
- <xref target="note1">Figure 2</xref>
268
- <xref target="note2">Figure 3</xref>
267
+ <xref target="note1"><span class='citefig'>Figure 2</span></xref>
268
+ <xref target="note2"><span class='citefig'>Figure 3</span></xref>
269
269
  </p>
270
270
  </clause>
271
271
  </clause>
@@ -273,7 +273,7 @@ RSpec.describe IsoDoc do
273
273
  <annex id="annex1" displayorder='5'>
274
274
  <title>
275
275
  <strong>Annex A</strong>
276
- <br/>(informative)</title>
276
+ <br/><span class="obligation">(informative)</span></title>
277
277
  <clause id="annex1a" inline-header="true">
278
278
  <title>A.1</title>
279
279
  <figure id="AN">
@@ -362,12 +362,12 @@ RSpec.describe IsoDoc do
362
362
  <preface>
363
363
  <foreword id="fwd" displayorder='1'>
364
364
  <p>
365
- <xref target="N">Figure 1</xref>
366
- <xref target="note1">Figure 1 a)</xref>
367
- <xref target="note2">Figure 1 b)</xref>
368
- <xref target="AN">Figure A.1</xref>
369
- <xref target="Anote1">Figure A.1 a)</xref>
370
- <xref target="Anote2">Figure A.1 b)</xref>
365
+ <xref target="N"><span class='citefig'>Figure 1</span></xref>
366
+ <xref target="note1"><span class='citefig'>Figure 1 a)</span></xref>
367
+ <xref target="note2"><span class='citefig'>Figure 1 b)</span></xref>
368
+ <xref target="AN"><span class='citefig'>Figure A.1</span></xref>
369
+ <xref target="Anote1"><span class='citefig'>Figure A.1 a)</span></xref>
370
+ <xref target="Anote2"><span class='citefig'>Figure A.1 b)</span></xref>
371
371
  </p>
372
372
  </foreword>
373
373
  </preface>
@@ -398,8 +398,8 @@ RSpec.describe IsoDoc do
398
398
  </figure>
399
399
  </figure>
400
400
  <p>
401
- <xref target="note1">Figure 1 a)</xref>
402
- <xref target="note2">Figure 1 b)</xref>
401
+ <xref target="note1"><span class='citefig'>Figure 1 a)</span></xref>
402
+ <xref target="note2"><span class='citefig'>Figure 1 b)</span></xref>
403
403
  </p>
404
404
  </clause>
405
405
  </clause>
@@ -407,7 +407,7 @@ RSpec.describe IsoDoc do
407
407
  <annex id="annex1" displayorder='5'>
408
408
  <title>
409
409
  <strong>Annex A</strong>
410
- <br/>(informative)</title>
410
+ <br/><span class="obligation">(informative)</span></title>
411
411
  <clause id="annex1a" inline-header="true">
412
412
  <title>A.1</title>
413
413
  </clause>
@@ -546,7 +546,7 @@ RSpec.describe IsoDoc do
546
546
  <annex id="annex1" displayorder='5'>
547
547
  <title>
548
548
  <strong>Annex A</strong>
549
- <br/>(informative)</title>
549
+ <br/><span class="obligation">(informative)</span></title>
550
550
  <clause id="annex1a" inline-header="true">
551
551
  <title>A.1</title>
552
552
  <example id="AN">
@@ -700,7 +700,7 @@ RSpec.describe IsoDoc do
700
700
  <annex id="annex1" displayorder='5'>
701
701
  <title>
702
702
  <strong>Annex A</strong>
703
- <br/>(informative)</title>
703
+ <br/><span class="obligation">(informative)</span></title>
704
704
  <clause id="annex1a" inline-header="true">
705
705
  <title>A.1</title>
706
706
  <formula id="AN">
@@ -833,12 +833,12 @@ RSpec.describe IsoDoc do
833
833
  <preface>
834
834
  <foreword displayorder='1'>
835
835
  <p>
836
- <xref target="N">Table 1</xref>
837
- <xref target="note1">Table 2</xref>
838
- <xref target="note2">Table 3</xref>
839
- <xref target="AN">Table A.1</xref>
840
- <xref target="Anote1">Table A.2</xref>
841
- <xref target="Anote2">Table A.3</xref>
836
+ <xref target="N"><span class='citetbl'>Table 1</span></xref>
837
+ <xref target="note1"><span class='citetbl'>Table 2</span></xref>
838
+ <xref target="note2"><span class='citetbl'>Table 3</span></xref>
839
+ <xref target="AN"><span class='citetbl'>Table A.1</span></xref>
840
+ <xref target="Anote1"><span class='citetbl'>Table A.2</span></xref>
841
+ <xref target="Anote2"><span class='citetbl'>Table A.3</span></xref>
842
842
  </p>
843
843
  </foreword>
844
844
  </preface>
@@ -858,7 +858,7 @@ RSpec.describe IsoDoc do
858
858
  </tbody>
859
859
  </table>
860
860
  <p>
861
- <xref target="N">Table 1</xref>
861
+ <xref target="N"><span class='citetbl'>Table 1</span></xref>
862
862
  </p>
863
863
  </clause>
864
864
  <terms id="terms" displayorder='3'>
@@ -891,8 +891,8 @@ RSpec.describe IsoDoc do
891
891
  </tbody>
892
892
  </table>
893
893
  <p>
894
- <xref target="note1">Table 2</xref>
895
- <xref target="note2">Table 3</xref>
894
+ <xref target="note1"><span class='citetbl'>Table 2</span></xref>
895
+ <xref target="note2"><span class='citetbl'>Table 3</span></xref>
896
896
  </p>
897
897
  </clause>
898
898
  </clause>
@@ -900,7 +900,7 @@ RSpec.describe IsoDoc do
900
900
  <annex id="annex1" displayorder='5'>
901
901
  <title>
902
902
  <strong>Annex A</strong>
903
- <br/>(informative)</title>
903
+ <br/><span class="obligation">(informative)</span></title>
904
904
  <clause id="annex1a" inline-header="true">
905
905
  <title>A.1</title>
906
906
  <table id="AN">
@@ -1138,23 +1138,23 @@ RSpec.describe IsoDoc do
1138
1138
  <title>Foreword</title>
1139
1139
  <p id='A'>
1140
1140
  This is a preamble
1141
- <xref target='C'>0.1</xref>
1142
- <xref target='C1'>0.2</xref>
1143
- <xref target='D'>Clause 1</xref>
1144
- <xref target='H'>Clause 3</xref>
1145
- <xref target='I'>3.1</xref>
1146
- <xref target='J'>3.1.1</xref>
1147
- <xref target='K'>3.2</xref>
1148
- <xref target='L'>Clause 4</xref>
1149
- <xref target='M'>Clause 5</xref>
1150
- <xref target='N'>5.1</xref>
1151
- <xref target='O'>5.2</xref>
1152
- <xref target='P'>Annex A</xref>
1153
- <xref target='Q'>A.1</xref>
1154
- <xref target='Q1'>A.1.1</xref>
1155
- <xref target='Q2'>Annex A, Appendix 1</xref>
1141
+ <xref target='C'><span class='citesec'>0.1</span></xref>
1142
+ <xref target='C1'><span class='citesec'>0.2</span></xref>
1143
+ <xref target='D'><span class='citesec'>Clause 1</span></xref>
1144
+ <xref target='H'><span class='citesec'>Clause 3</span></xref>
1145
+ <xref target='I'><span class='citesec'>3.1</span></xref>
1146
+ <xref target='J'><span class='citesec'>3.1.1</span></xref>
1147
+ <xref target='K'><span class='citesec'>3.2</span></xref>
1148
+ <xref target='L'><span class='citesec'>Clause 4</span></xref>
1149
+ <xref target='M'><span class='citesec'>Clause 5</span></xref>
1150
+ <xref target='N'><span class='citesec'>5.1</span></xref>
1151
+ <xref target='O'><span class='citesec'>5.2</span></xref>
1152
+ <xref target='P'><span class='citeapp'>Annex A</span></xref>
1153
+ <xref target='Q'><span class='citeapp'>A.1</span></xref>
1154
+ <xref target='Q1'><span class='citeapp'>A.1.1</span></xref>
1155
+ <xref target='Q2'><span class='citeapp'>Annex A, Appendix 1</span></xref>
1156
1156
  <xref target='Q3'>Annex A, Appendix 1.1</xref>
1157
- <xref target='R'>Clause 2</xref>
1157
+ <xref target='R'><span class='citesec'>Clause 2</span></xref>
1158
1158
  </p>
1159
1159
  </foreword>
1160
1160
  <introduction id='B' obligation='informative' displayorder='2'>
@@ -1243,7 +1243,7 @@ RSpec.describe IsoDoc do
1243
1243
  <title>
1244
1244
  <strong>Annex A</strong>
1245
1245
  <br/>
1246
- (normative)
1246
+ <span class="obligation">(normative)</span>
1247
1247
  <br/>
1248
1248
  <br/>
1249
1249
  <strong>Annex</strong>
@@ -1404,7 +1404,7 @@ RSpec.describe IsoDoc do
1404
1404
  <annex id="annex1" displayorder='5'>
1405
1405
  <title>
1406
1406
  <strong>Annex A</strong>
1407
- <br/>(informative)</title>
1407
+ <br/><span class="obligation">(informative)</span></title>
1408
1408
  <clause id="annex1a" inline-header="true">
1409
1409
  <title>A.1</title>
1410
1410
  <ol id="AN" type="alphabet">
@@ -1536,7 +1536,7 @@ RSpec.describe IsoDoc do
1536
1536
  </clause>
1537
1537
  </clause>
1538
1538
  </sections>
1539
- <annex id='annex1' displayorder='5'><title><strong>Annex A</strong><br/>(informative)</title>
1539
+ <annex id='annex1' displayorder='5'><title><strong>Annex A</strong><br/><span class="obligation">(informative)</span></title>
1540
1540
  <clause inline-header="true" id='annex1a'><title>A.1</title>
1541
1541
  <ol id='ANl' type="alphabet">
1542
1542
  <li id='AN'>
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Metanorma::ISO do
4
4
  it "processes amendment sections" do
5
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ input = <<~INPUT
6
6
  #{AMD_BLANK_HDR}
7
7
  == Foreword
8
8
 
@@ -54,6 +54,7 @@ RSpec.describe Metanorma::ISO do
54
54
 
55
55
  === Bibliography Subsection
56
56
  INPUT
57
+ output = <<~OUTPUT
57
58
  #{BLANK_HDR.sub(%r{<doctype>article</doctype>}, '<doctype>amendment</doctype>')}
58
59
  <sections>
59
60
  <clause id="_" obligation="normative">
@@ -127,10 +128,12 @@ RSpec.describe Metanorma::ISO do
127
128
  </annex>
128
129
  </iso-standard>
129
130
  OUTPUT
131
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
132
+ .to be_equivalent_to xmlpp(output)
130
133
  end
131
134
 
132
135
  it "processes default metadata, amendment" do
133
- output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
136
+ input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
134
137
  = Document title
135
138
  Author
136
139
  :docfile: test.adoc
@@ -182,7 +185,7 @@ RSpec.describe Metanorma::ISO do
182
185
  :updates-document-type: international-standard
183
186
  INPUT
184
187
 
185
- expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
188
+ output = <<~OUTPUT
186
189
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
187
190
  <bibdata type="standard">
188
191
  <title format="text/plain" language="en" type="main">Introduction — Main Title — Title — Title Part — Mass fraction of
@@ -207,6 +210,7 @@ RSpec.describe Metanorma::ISO do
207
210
  de transport
208
211
  </title>
209
212
  <docidentifier type="ISO">ISO 17301-1:2016/PreNP Amd 1</docidentifier>
213
+ <docidentifier type='iso-undated'>ISO 17301-1/PreNP Amd 1</docidentifier>
210
214
  <docidentifier type="iso-with-lang">ISO 17301-1:2016/PreNP Amd 1(E)</docidentifier>
211
215
  <docidentifier type="iso-reference">ISO 17301-1:2016/PreNP Amd 1:2017(E)</docidentifier>
212
216
  <docnumber>17301</docnumber>
@@ -278,10 +282,12 @@ RSpec.describe Metanorma::ISO do
278
282
  <sections/>
279
283
  </iso-standard>
280
284
  OUTPUT
285
+ expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
286
+ .to be_equivalent_to xmlpp(output)
281
287
  end
282
288
 
283
289
  it "processes metadata, amendment, stage 30" do
284
- output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
290
+ input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
285
291
  = Document title
286
292
  Author
287
293
  :docfile: test.adoc
@@ -295,11 +301,11 @@ RSpec.describe Metanorma::ISO do
295
301
  :updates: ISO 17301-1:2030
296
302
  :amendment-number: 1
297
303
  INPUT
298
- expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
299
-
304
+ output = <<~OUTPUT
300
305
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
301
306
  <bibdata type="standard">
302
307
  <docidentifier type="ISO">ISO 17301-1:2030/CD Amd 1</docidentifier>
308
+ <docidentifier type='iso-undated'>ISO 17301-1/CD Amd 1</docidentifier>
303
309
  <docidentifier type="iso-with-lang">ISO 17301-1:2030/CD Amd 1(E)</docidentifier>
304
310
  <docidentifier type="iso-reference">ISO 17301-1:2030/CD Amd 1(E)</docidentifier>
305
311
  <docnumber>17301</docnumber>
@@ -348,10 +354,12 @@ RSpec.describe Metanorma::ISO do
348
354
  <sections/>
349
355
  </iso-standard>
350
356
  OUTPUT
357
+ expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
358
+ .to be_equivalent_to xmlpp(output)
351
359
  end
352
360
 
353
361
  it "processes metadata, amendment, stage 40" do
354
- output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
362
+ input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
355
363
  = Document title
356
364
  Author
357
365
  :docfile: test.adoc
@@ -365,10 +373,11 @@ RSpec.describe Metanorma::ISO do
365
373
  :updates: ISO 17301-1:2030
366
374
  :amendment-number: 1
367
375
  INPUT
368
- expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
376
+ output = <<~OUTPUT
369
377
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
370
378
  <bibdata type="standard">
371
379
  <docidentifier type="ISO">ISO 17301-1:2030/DAmd 1</docidentifier>
380
+ <docidentifier type='iso-undated'>ISO 17301-1/DAmd 1</docidentifier>
372
381
  <docidentifier type="iso-with-lang">ISO 17301-1:2030/DAmd 1(E)</docidentifier>
373
382
  <docidentifier type="iso-reference">ISO 17301-1:2030/DAmd 1(E)</docidentifier>
374
383
  <docnumber>17301</docnumber>
@@ -417,10 +426,12 @@ RSpec.describe Metanorma::ISO do
417
426
  <sections/>
418
427
  </iso-standard>
419
428
  OUTPUT
429
+ expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
430
+ .to be_equivalent_to xmlpp(output)
420
431
  end
421
432
 
422
433
  it "processes metadata, amendment, published" do
423
- output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
434
+ input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
424
435
  = Document title
425
436
  Author
426
437
  :docfile: test.adoc
@@ -433,10 +444,11 @@ RSpec.describe Metanorma::ISO do
433
444
  :updates: ISO 17301-1:2030
434
445
  :amendment-number: 1
435
446
  INPUT
436
- expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
447
+ output = <<~OUTPUT
437
448
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
438
449
  <bibdata type="standard">
439
450
  <docidentifier type="ISO">ISO 17301-1:2030/Amd 1</docidentifier>
451
+ <docidentifier type='iso-undated'>ISO 17301-1/Amd 1</docidentifier>
440
452
  <docidentifier type="iso-with-lang">ISO 17301-1:2030/Amd 1(E)</docidentifier>
441
453
  <docidentifier type="iso-reference">ISO 17301-1:2030/Amd 1(E)</docidentifier>
442
454
  <docnumber>17301</docnumber>
@@ -485,10 +497,12 @@ RSpec.describe Metanorma::ISO do
485
497
  <sections/>
486
498
  </iso-standard>
487
499
  OUTPUT
500
+ expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
501
+ .to be_equivalent_to xmlpp(output)
488
502
  end
489
503
 
490
504
  it "processes metadata, corrigendum, stage 30" do
491
- output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
505
+ input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
492
506
  = Document title
493
507
  Author
494
508
  :docfile: test.adoc
@@ -502,10 +516,11 @@ RSpec.describe Metanorma::ISO do
502
516
  :updates: ISO 17301-1:2030
503
517
  :corrigendum-number: 3
504
518
  INPUT
505
- expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
519
+ output = <<~OUTPUT
506
520
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
507
521
  <bibdata type="standard">
508
522
  <docidentifier type="ISO">ISO 17301-1:2030/CD Cor.3</docidentifier>
523
+ <docidentifier type='iso-undated'>ISO 17301-1/CD Cor.3</docidentifier>
509
524
  <docidentifier type="iso-with-lang">ISO 17301-1:2030/CD Cor.3(E)</docidentifier>
510
525
  <docidentifier type="iso-reference">ISO 17301-1:2030/CD Cor.3(E)</docidentifier>
511
526
  <docnumber>17301</docnumber>
@@ -554,10 +569,12 @@ RSpec.describe Metanorma::ISO do
554
569
  <sections/>
555
570
  </iso-standard>
556
571
  OUTPUT
572
+ expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
573
+ .to be_equivalent_to xmlpp(output)
557
574
  end
558
575
 
559
576
  it "processes metadata, corrigendum, stage 50" do
560
- output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
577
+ input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
561
578
  = Document title
562
579
  Author
563
580
  :docfile: test.adoc
@@ -571,10 +588,11 @@ RSpec.describe Metanorma::ISO do
571
588
  :updates: ISO 17301-1:2030
572
589
  :corrigendum-number: 3
573
590
  INPUT
574
- expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
591
+ output = <<~OUTPUT
575
592
  <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
576
593
  <bibdata type='standard'>
577
594
  <docidentifier type='ISO'>ISO 17301-1:2030/FDCor.3</docidentifier>
595
+ <docidentifier type='iso-undated'>ISO 17301-1/FDCor.3</docidentifier>
578
596
  <docidentifier type='iso-with-lang'>ISO 17301-1:2030/FDCor.3(E)</docidentifier>
579
597
  <docidentifier type='iso-reference'>ISO 17301-1:2030/FDCor.3(E)</docidentifier>
580
598
  <docnumber>17301</docnumber>
@@ -623,10 +641,12 @@ RSpec.describe Metanorma::ISO do
623
641
  <sections/>
624
642
  </iso-standard>
625
643
  OUTPUT
644
+ expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
645
+ .to be_equivalent_to xmlpp(output)
626
646
  end
627
647
 
628
648
  it "processes metadata, corrigendum, published" do
629
- output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
649
+ input = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
630
650
  = Document title
631
651
  Author
632
652
  :docfile: test.adoc
@@ -639,10 +659,11 @@ RSpec.describe Metanorma::ISO do
639
659
  :updates: ISO 17301-1:2030
640
660
  :corrigendum-number: 3
641
661
  INPUT
642
- expect(xmlpp(output.sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
662
+ output = <<~OUTPUT
643
663
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
644
664
  <bibdata type="standard">
645
665
  <docidentifier type="ISO">ISO 17301-1:2030/Cor.3</docidentifier>
666
+ <docidentifier type='iso-undated'>ISO 17301-1/Cor.3</docidentifier>
646
667
  <docidentifier type="iso-with-lang">ISO 17301-1:2030/Cor.3(E)</docidentifier>
647
668
  <docidentifier type="iso-reference">ISO 17301-1:2030/Cor.3(E)</docidentifier>
648
669
  <docnumber>17301</docnumber>
@@ -691,5 +712,7 @@ RSpec.describe Metanorma::ISO do
691
712
  <sections/>
692
713
  </iso-standard>
693
714
  OUTPUT
715
+ expect(xmlpp(input.sub(%r{<boilerplate>.*</boilerplate>}m, "")))
716
+ .to be_equivalent_to xmlpp(output)
694
717
  end
695
718
  end
@@ -65,6 +65,7 @@ RSpec.describe Metanorma::ISO do
65
65
  <title format="text/plain" language="fr" type="title-main">Titre Principal</title>
66
66
  <title format="text/plain" language="fr" type="title-part">Part du Titre</title>
67
67
  <docidentifier type="ISO">ISO/PreWD3 1000-1</docidentifier>
68
+ <docidentifier type='iso-undated'>ISO/PreWD3 1000-1</docidentifier>
68
69
  <docidentifier type="iso-with-lang">ISO/PreWD3 1000-1(E)</docidentifier>
69
70
  <docidentifier type="iso-reference">ISO/PreWD3 1000-1:2000(E)</docidentifier>
70
71
  <docnumber>1000</docnumber>
@@ -149,7 +150,7 @@ RSpec.describe Metanorma::ISO do
149
150
  :language: el
150
151
  :script: Grek
151
152
  :publisher: IEC;IETF;ISO
152
- :copyright-holder: ISO;IETF
153
+ :copyright-holder: IETF;ISO
153
154
  :copyright-year: 2001
154
155
  :doctype: technical-report
155
156
  :pub-address: 1 Infinity Loop + \
@@ -166,9 +167,10 @@ RSpec.describe Metanorma::ISO do
166
167
  <?xml version="1.0" encoding="UTF-8"?>
167
168
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
168
169
  <bibdata type="standard">
169
- <docidentifier type="ISO">ISO/IEC/IETF/TR 1000-1-1:2001</docidentifier>
170
- <docidentifier type="iso-with-lang">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
171
- <docidentifier type="iso-reference">ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
170
+ <docidentifier type='ISO'>IEC/IETF/ISO/TR 1000-1-1:2001</docidentifier>
171
+ <docidentifier type='iso-undated'>IEC/IETF/ISO/TR 1000-1-1</docidentifier>
172
+ <docidentifier type='iso-with-lang'>IEC/IETF/ISO/TR 1000-1-1:2001(X)</docidentifier>
173
+ <docidentifier type='iso-reference'>IEC/IETF/ISO/TR 1000-1-1:2001(X)</docidentifier>
172
174
  <docidentifier type="iso-tc">2000</docidentifier>
173
175
  <docidentifier type="iso-tc">2003</docidentifier>
174
176
  <docnumber>1000</docnumber>
@@ -243,8 +245,7 @@ RSpec.describe Metanorma::ISO do
243
245
  <from>2001</from>
244
246
  <owner>
245
247
  <organization>
246
- <name>International Organization for Standardization</name>
247
- <abbreviation>ISO</abbreviation>
248
+ <name>IETF</name>
248
249
  <address>
249
250
  <formattedAddress>1 Infinity Loop + California</formattedAddress>
250
251
  </address>
@@ -255,11 +256,12 @@ RSpec.describe Metanorma::ISO do
255
256
  </organization>
256
257
  </owner>
257
258
  </copyright>
258
- <copyright>
259
+ <copyright>
259
260
  <from>2001</from>
260
261
  <owner>
261
262
  <organization>
262
- <name>IETF</name>
263
+ <name>International Organization for Standardization</name>
264
+ <abbreviation>ISO</abbreviation>
263
265
  <address>
264
266
  <formattedAddress>1 Infinity Loop + California</formattedAddress>
265
267
  </address>
@@ -278,7 +280,7 @@ RSpec.describe Metanorma::ISO do
278
280
  <workgroup/>
279
281
  </editorialgroup>
280
282
  <structuredidentifier>
281
- <project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
283
+ <project-number part="1" subpart="1">IEC/IETF/ISO 1000</project-number>
282
284
  </structuredidentifier>
283
285
  <stagename>International standard</stagename>
284
286
  </ext>
@@ -340,6 +342,7 @@ RSpec.describe Metanorma::ISO do
340
342
  <title language='fr' format='text/plain' type='title-main'>Titre Principal</title>
341
343
  <title language='fr' format='text/plain' type='title-part'>Part du Titre</title>
342
344
  <docidentifier type='ISO'>ISO 1000-1:2000</docidentifier>
345
+ <docidentifier type='iso-undated'>ISO 1000-1</docidentifier>
343
346
  <docidentifier type='iso-with-lang'>ISO 1000-1:2000(R)</docidentifier>
344
347
  <docidentifier type='iso-reference'>ISO 1000-1:2000(R)</docidentifier>
345
348
  <docnumber>1000</docnumber>
@@ -426,6 +429,7 @@ RSpec.describe Metanorma::ISO do
426
429
  <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
427
430
  <bibdata type='standard'>
428
431
  <docidentifier type='ISO'>SD 1000-1-1</docidentifier>
432
+ <docidentifier type='iso-undated'>SD 1000-1-1</docidentifier>
429
433
  <docidentifier type='iso-with-lang'>SD 1000-1-1(X)</docidentifier>
430
434
  <docidentifier type='iso-reference'>SD 1000-1-1(X)</docidentifier>
431
435
  <docidentifier type='iso-tc'>2000</docidentifier>
@@ -521,6 +525,7 @@ RSpec.describe Metanorma::ISO do
521
525
  <iso-standard type="semantic" version="#{Metanorma::ISO::VERSION}" xmlns="https://www.metanorma.org/ns/iso">
522
526
  <bibdata type="standard">
523
527
  <docidentifier type='ISO'>ISO/FDIS 1000.2</docidentifier>
528
+ <docidentifier type='iso-undated'>ISO/FDIS 1000.2</docidentifier>
524
529
  <docidentifier type='iso-with-lang'>ISO/FDIS 1000.2(F)</docidentifier>
525
530
  <docidentifier type='iso-reference'>ISO/FDIS 1000.2(F)</docidentifier>
526
531
  <docnumber>1000</docnumber>
@@ -589,6 +594,7 @@ RSpec.describe Metanorma::ISO do
589
594
  <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
590
595
  <bibdata type="standard">
591
596
  <docidentifier type="ISO">ISO 1000</docidentifier>
597
+ <docidentifier type='iso-undated'>ISO 1000</docidentifier>
592
598
  <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
593
599
  <docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
594
600
  <docnumber>1000</docnumber>
@@ -657,6 +663,7 @@ RSpec.describe Metanorma::ISO do
657
663
  <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
658
664
  <bibdata type="standard">
659
665
  <docidentifier type="ISO">ISO 1000</docidentifier>
666
+ <docidentifier type='iso-undated'>ISO 1000</docidentifier>
660
667
  <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
661
668
  <docidentifier type='iso-reference'>ISO 1000(E)</docidentifier>
662
669
  <docnumber>1000</docnumber>
@@ -725,6 +732,7 @@ RSpec.describe Metanorma::ISO do
725
732
  <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
726
733
  <bibdata type='standard'>
727
734
  <docidentifier type='ISO'>ISO DIR 1000</docidentifier>
735
+ <docidentifier type='iso-undated'>ISO DIR 1000</docidentifier>
728
736
  <docidentifier type='iso-with-lang'>ISO DIR 1000(E)</docidentifier>
729
737
  <docidentifier type='iso-reference'>ISO DIR 1000(E)</docidentifier>
730
738
  <docnumber>1000</docnumber>
@@ -159,7 +159,7 @@ RSpec.describe Metanorma::ISO do
159
159
  <terms id="_" obligation="normative">
160
160
  <title>Terms and definitions</title>
161
161
  #{TERM_BOILERPLATE}
162
- <term id="term-term1">
162
+ <term id="term-Term1">
163
163
  <preferred><expression><name>Term1</name></expression></preferred>
164
164
  <termnote id="_">
165
165
  <p id="_">This is a note</p></termnote>
@@ -282,7 +282,7 @@ RSpec.describe Metanorma::ISO do
282
282
  <terms id="_" obligation="normative">
283
283
  <title>Terms and definitions</title>
284
284
  #{TERM_BOILERPLATE}
285
- <term id="term-term1">
285
+ <term id="term-Term1">
286
286
  <preferred><expression><name>Term1</name></expression></preferred>
287
287
  <termexample id="_">
288
288
  <p id="_">This is an example</p></termexample>
@@ -532,7 +532,7 @@ RSpec.describe Metanorma::ISO do
532
532
  <terms id="_" obligation="normative">
533
533
  <title>Terms and definitions</title>
534
534
  #{TERM_BOILERPLATE}
535
- <term id="term-term1">
535
+ <term id="term-Term1">
536
536
  <preferred><expression><name>Term1</name></expression></preferred>
537
537
  <definition>
538
538
  <verbal-definition>
@@ -574,7 +574,7 @@ RSpec.describe Metanorma::ISO do
574
574
  <terms id="_" obligation="normative">
575
575
  <title>Terms and definitions</title>
576
576
  #{TERM_BOILERPLATE}
577
- <term id="term-term1">
577
+ <term id="term-Term1">
578
578
  <preferred><expression><name>Term1</name></expression></preferred>
579
579
  <definition>
580
580
  <verbal-definition>