metanorma-iec 1.2.1 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +44 -0
  3. data/lib/asciidoctor/iec/basicdoc.rng +23 -0
  4. data/lib/asciidoctor/iec/converter.rb +1 -0
  5. data/lib/asciidoctor/iec/front.rb +9 -7
  6. data/lib/asciidoctor/iec/iec.rng +7 -0
  7. data/lib/asciidoctor/iec/isodoc.rng +125 -58
  8. data/lib/asciidoctor/iec/isostandard.rng +8 -1
  9. data/lib/isodoc/iec/base_convert.rb +0 -20
  10. data/lib/isodoc/iec/html/htmlstyle.css +5 -1
  11. data/lib/isodoc/iec/html/isodoc.css +16 -4
  12. data/lib/isodoc/iec/html/isodoc.scss +19 -4
  13. data/lib/isodoc/iec/html/wordstyle.css +10 -10
  14. data/lib/isodoc/iec/html/wordstyle.scss +15 -10
  15. data/lib/isodoc/iec/iec.international-standard.xsl +1279 -391
  16. data/lib/metanorma/iec/version.rb +1 -1
  17. data/metanorma-iec.gemspec +1 -1
  18. data/spec/asciidoctor-iec/base_spec.rb +14 -5
  19. data/spec/asciidoctor-iec/cleanup_spec.rb +30 -6
  20. data/spec/asciidoctor-iec/iev_spec.rb +3 -3
  21. data/spec/asciidoctor-iec/inline_spec.rb +7 -1
  22. data/spec/asciidoctor-iec/validate_spec.rb +21 -1
  23. data/spec/assets/xref_error.adoc +7 -0
  24. data/spec/isodoc/blocks_spec.rb +1 -1
  25. data/spec/isodoc/i18n_spec.rb +9 -9
  26. data/spec/isodoc/iev_spec.rb +13 -17
  27. data/spec/isodoc/inline_spec.rb +1 -1
  28. data/spec/isodoc/metadata_spec.rb +36 -23
  29. data/spec/isodoc/ref_spec.rb +15 -15
  30. data/spec/isodoc/section_spec.rb +2 -2
  31. data/spec/isodoc/terms_spec.rb +1 -1
  32. data/spec/spec_helper.rb +5 -1
  33. metadata +6 -7
  34. data/.github/workflows/macos.yml +0 -38
  35. data/.github/workflows/ubuntu.yml +0 -56
  36. data/.github/workflows/windows.yml +0 -40
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.7"
4
4
  end
5
5
  end
6
6
 
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.add_dependency "ruby-jing"
31
31
  spec.add_dependency "isodoc", "~> 1.2.0"
32
- spec.add_dependency "metanorma-iso", "~> 1.5.0"
32
+ spec.add_dependency "metanorma-iso", "~> 1.5.10"
33
33
 
34
34
  spec.add_development_dependency "byebug"
35
35
  spec.add_development_dependency "sassc", "2.4.0"
@@ -29,6 +29,8 @@ RSpec.describe Asciidoctor::Iec do
29
29
 
30
30
  it "converts a blank document" do
31
31
  FileUtils.rm_f "test.doc"
32
+ FileUtils.rm_f "test.html"
33
+ FileUtils.rm_f "test.pdf"
32
34
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
33
35
  = Document title
34
36
  Author
@@ -40,6 +42,8 @@ RSpec.describe Asciidoctor::Iec do
40
42
  <sections/>
41
43
  </iec-standard>
42
44
  OUTPUT
45
+ expect(File.exist?("test.pdf")).to be true
46
+ expect(File.exist?("test.html")).to be true
43
47
  expect(File.exist?("test.doc")).to be true
44
48
  expect(File.exist?("htmlstyle.css")).to be false
45
49
  end
@@ -89,7 +93,7 @@ RSpec.describe Asciidoctor::Iec do
89
93
  :library-ics: 1,2,3
90
94
  INPUT
91
95
  <?xml version="1.0" encoding="UTF-8"?>
92
- <iec-standard xmlns="https://www.metanorma.org/ns/iec">
96
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
93
97
  <bibdata type="standard">
94
98
  <title language="en" format="text/plain" type="main">Introduction — Main Title — Title — Title Part</title>
95
99
  <title language="en" format="text/plain" type="title-intro">Introduction</title>
@@ -188,7 +192,7 @@ RSpec.describe Asciidoctor::Iec do
188
192
  :doctype: technical-specification
189
193
  INPUT
190
194
  <?xml version="1.0" encoding="UTF-8"?>
191
- <iec-standard xmlns="https://www.metanorma.org/ns/iec">
195
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
192
196
  <bibdata type="standard">
193
197
  <docidentifier type="ISO">ISO/IEC/IETF/2CDTS 1000-1-1 ED 1</docidentifier>
194
198
  <docidentifier type="iso-tc">2000</docidentifier>
@@ -336,7 +340,7 @@ RSpec.describe Asciidoctor::Iec do
336
340
  :docnumber: 1000
337
341
  :docstage: 50
338
342
  INPUT
339
- <iec-standard xmlns="https://www.metanorma.org/ns/iec">
343
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
340
344
  <bibdata type="standard">
341
345
  <docidentifier type="ISO">IEC/FDIS 1000 ED 1</docidentifier>
342
346
  <docnumber>1000</docnumber>
@@ -400,7 +404,7 @@ OUTPUT
400
404
  :docnumber: 1000
401
405
  :docstage: 60
402
406
  INPUT
403
- <iec-standard xmlns="https://www.metanorma.org/ns/iec">
407
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
404
408
  <bibdata type="standard">
405
409
  <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
406
410
  <docnumber>1000</docnumber>
@@ -465,7 +469,7 @@ OUTPUT
465
469
  :docstage: 60
466
470
  :docsubstage: 00
467
471
  INPUT
468
- <iec-standard xmlns="https://www.metanorma.org/ns/iec">
472
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
469
473
  <bibdata type="standard">
470
474
  <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
471
475
  <docnumber>1000</docnumber>
@@ -527,6 +531,7 @@ OUTPUT
527
531
  :docfile: test.adoc
528
532
  :novalid:
529
533
  :no-isobib:
534
+ :no-pdf:
530
535
  INPUT
531
536
  html = File.read("test.html", encoding: "utf-8")
532
537
  expect(html).to match(%r{<script>})
@@ -540,6 +545,7 @@ OUTPUT
540
545
  :docfile: test.adoc
541
546
  :novalid:
542
547
  :no-isobib:
548
+ :no-pdf:
543
549
  INPUT
544
550
  html = File.read("test.html", encoding: "utf-8")
545
551
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
@@ -556,6 +562,7 @@ OUTPUT
556
562
  :novalid:
557
563
  :no-isobib:
558
564
  :script: Hans
565
+ :no-pdf:
559
566
  INPUT
560
567
  html = File.read("test.html", encoding: "utf-8")
561
568
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
@@ -575,6 +582,7 @@ OUTPUT
575
582
  :body-font: Zapf Chancery
576
583
  :header-font: Comic Sans
577
584
  :monospace-font: Andale Mono
585
+ :no-pdf:
578
586
  INPUT
579
587
  html = File.read("test.html", encoding: "utf-8")
580
588
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
@@ -591,6 +599,7 @@ OUTPUT
591
599
  :docfile: test.adoc
592
600
  :novalid:
593
601
  :no-isobib:
602
+ :no-pdf:
594
603
  INPUT
595
604
  word = File.read("test.doc", encoding: "utf-8")
596
605
  html = File.read("test.html", encoding: "utf-8")
@@ -34,7 +34,19 @@ RSpec.describe Asciidoctor::Iec do
34
34
  <p id="_">For the purposes of this document,
35
35
  the following terms and definitions apply.</p>
36
36
  #{TERMS_BOILERPLATE}
37
- <term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>91</mn></msub></math></stem></admitted>
37
+ <term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
38
+ <mi>t</mi>
39
+ </mrow>
40
+ <mrow>
41
+ <mn>90</mn>
42
+ </mrow>
43
+ </msub></math></stem></preferred><admitted><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
44
+ <mi>t</mi>
45
+ </mrow>
46
+ <mrow>
47
+ <mn>91</mn>
48
+ </mrow>
49
+ </msub></math></stem></admitted>
38
50
  <definition><p id="_">Time</p></definition></term>
39
51
  </terms>
40
52
  </sections>
@@ -70,8 +82,20 @@ RSpec.describe Asciidoctor::Iec do
70
82
  <p id="_">For the purposes of this document,
71
83
  the following terms and definitions apply.</p>
72
84
  #{TERMS_BOILERPLATE}
73
- <term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>90</mn></msub></math></stem></preferred><definition><formula id="_">
74
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>A</mi></msub></math></stem>
85
+ <term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
86
+ <mi>t</mi>
87
+ </mrow>
88
+ <mrow>
89
+ <mn>90</mn>
90
+ </mrow>
91
+ </msub></math></stem></preferred><definition><formula id="_">
92
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
93
+ <mi>t</mi>
94
+ </mrow>
95
+ <mrow>
96
+ <mi>A</mi>
97
+ </mrow>
98
+ </msub></math></stem>
75
99
  </formula><p id="_">This paragraph is extraneous</p></definition>
76
100
  </term>
77
101
  </terms>
@@ -257,9 +281,9 @@ RSpec.describe Asciidoctor::Iec do
257
281
  <sections><table id="_">
258
282
  <tbody>
259
283
  <tr>
260
- <td align="left">a</td>
261
- <td align="left">b</td>
262
- <td align="left">c</td>
284
+ <td valign="top" align="left">a</td>
285
+ <td valign="top" align="left">b</td>
286
+ <td valign="top" align="left">c</td>
263
287
  </tr>
264
288
  </tbody>
265
289
  <dl id="_">
@@ -18,7 +18,7 @@ RSpec.describe Asciidoctor::Iec do
18
18
  * [[[A,B]]], _TITLE_
19
19
  INPUT
20
20
  <?xml version='1.0' encoding='UTF-8'?>
21
- <iec-standard xmlns='https://www.metanorma.org/ns/iec'>
21
+ <iec-standard xmlns='https://www.metanorma.org/ns/iec' type="semantic" version="#{Metanorma::Iec::VERSION}">
22
22
  <bibdata type='standard'>
23
23
  <docidentifier type='ISO'>IEC 60050 ED 1</docidentifier>
24
24
  <docnumber>60050</docnumber>
@@ -96,7 +96,7 @@ RSpec.describe Asciidoctor::Iec do
96
96
  === General
97
97
  ==== Term 1
98
98
  INPUT
99
- <iec-standard xmlns='https://www.metanorma.org/ns/iec'>
99
+ <iec-standard xmlns='https://www.metanorma.org/ns/iec' type="semantic" version="#{Metanorma::Iec::VERSION}">
100
100
  <bibdata type='standard'>
101
101
  <docidentifier type='ISO'>IEC 60050 ED 1</docidentifier>
102
102
  <docnumber>60050</docnumber>
@@ -174,7 +174,7 @@ OUTPUT
174
174
  Text
175
175
  INPUT
176
176
  <?xml version='1.0' encoding='UTF-8'?>
177
- <iec-standard xmlns='https://www.metanorma.org/ns/iec'>
177
+ <iec-standard xmlns='https://www.metanorma.org/ns/iec' type="semantic" version="#{Metanorma::Iec::VERSION}">
178
178
  <bibdata type='standard'>
179
179
  <docidentifier type='ISO'>IEC 60050 ED 1</docidentifier>
180
180
  <docnumber>60050</docnumber>
@@ -28,7 +28,13 @@ RSpec.describe Asciidoctor::Iec do
28
28
  ‘single quote’
29
29
  super<sup>script</sup>
30
30
  sub<sub>script</sub>
31
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>a</mi><mn>90</mn></msub></math></stem>
31
+ <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
32
+ <mi>a</mi>
33
+ </mrow>
34
+ <mrow>
35
+ <mn>90</mn>
36
+ </mrow>
37
+ </msub></math></stem>
32
38
  <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
33
39
  <admitted>alt</admitted>
34
40
  <deprecates>deprecated</deprecates>
@@ -2,10 +2,30 @@ require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
4
  RSpec.describe Asciidoctor::Iec do
5
+ context "when xref_error.adoc compilation" do
6
+ around do |example|
7
+ FileUtils.rm_f "spec/assets/xref_error.err"
8
+ example.run
9
+ Dir["spec/assets/xref_error*"].each do |file|
10
+ next if file.match?(/adoc$/)
11
+
12
+ FileUtils.rm_f(file)
13
+ end
14
+ end
15
+
16
+ it "generates error file" do
17
+ expect do
18
+ Metanorma::Compile
19
+ .new
20
+ .compile("spec/assets/xref_error.adoc", type: "iec")
21
+ end.to(change { File.exist?("spec/assets/xref_error.err") }
22
+ .from(false).to(true))
23
+ end
24
+ end
5
25
 
6
26
  it "Warns of illegal doctype" do
7
27
  FileUtils.rm_f "test.err"
8
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
28
+ Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
9
29
  = Document title
10
30
  Author
11
31
  :docfile: test.adoc
@@ -0,0 +1,7 @@
1
+ = X
2
+ A
3
+
4
+ == Clause
5
+
6
+ <<a,b>>
7
+
@@ -177,7 +177,7 @@ RSpec.describe IsoDoc::Iec do
177
177
  </sections>
178
178
  </iso-standard>
179
179
  INPUT
180
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
180
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
181
181
  <preface>
182
182
  <foreword>
183
183
  <p>
@@ -73,10 +73,10 @@ RSpec.describe IsoDoc do
73
73
  INPUT
74
74
 
75
75
  presxml = <<~OUTPUT
76
- <iso-standard xmlns="http://riboseinc.com/isoxml">
76
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
77
77
  <bibdata>
78
78
  <docnumber>1</docnumber>
79
- <language>en</language>
79
+ <language current="true">en</language>
80
80
  </bibdata>
81
81
  <preface>
82
82
  <foreword obligation="informative">
@@ -216,12 +216,12 @@ RSpec.describe IsoDoc do
216
216
  </body>
217
217
  </html>
218
218
  OUTPUT
219
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
219
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
220
220
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
221
221
  end
222
222
 
223
223
  it "defaults to English" do
224
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
224
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
225
225
  <iso-standard xmlns="http://riboseinc.com/isoxml">
226
226
  <bibdata>
227
227
  <language>tlh</language>
@@ -289,9 +289,9 @@ RSpec.describe IsoDoc do
289
289
  </bibliography>
290
290
  </iso-standard>
291
291
  INPUT
292
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
292
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
293
293
  <bibdata>
294
- <language>tlh</language>
294
+ <language current="true">tlh</language>
295
295
  </bibdata>
296
296
  <preface>
297
297
  <foreword obligation='informative'>
@@ -498,9 +498,9 @@ RSpec.describe IsoDoc do
498
498
  INPUT
499
499
 
500
500
  presxml = <<~OUTPUT
501
- <iso-standard xmlns="http://riboseinc.com/isoxml">
501
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
502
502
  <bibdata>
503
- <language>fr</language>
503
+ <language current="true">fr</language>
504
504
  </bibdata>
505
505
  <preface>
506
506
  <foreword obligation="informative">
@@ -641,7 +641,7 @@ RSpec.describe IsoDoc do
641
641
  </body>
642
642
  </html>
643
643
  OUTPUT
644
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
644
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
645
645
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
646
646
  end
647
647
 
@@ -22,7 +22,7 @@ RSpec.describe IsoDoc do
22
22
  INPUT
23
23
 
24
24
  presxml = <<~OUTPUT
25
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
25
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
26
26
  <bibdata>
27
27
  <docidentifier type='iso'>IEC/PWI 60050-871 ED 2</docidentifier>
28
28
  <docnumber>60050</docnumber>
@@ -64,7 +64,7 @@ OUTPUT
64
64
  </body>
65
65
  </html>
66
66
  OUTPUT
67
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
67
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
68
68
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
69
69
  end
70
70
 
@@ -142,7 +142,7 @@ OUTPUT
142
142
  </iec-standard>
143
143
  INPUT
144
144
  presxml = <<~OUTPUT
145
- <iec-standard xmlns='https://www.metanorma.org/ns/iec'>
145
+ <iec-standard xmlns='https://www.metanorma.org/ns/iec' type="presentation">
146
146
  <bibdata type='standard'>
147
147
  <docidentifier type='iso'>IEC 60050 ED 1</docidentifier>
148
148
  <docnumber>60050</docnumber>
@@ -160,11 +160,11 @@ OUTPUT
160
160
  <abbreviation>IEC</abbreviation>
161
161
  </organization>
162
162
  </contributor>
163
- <language>en</language>
164
- <script>Latn</script>
163
+ <language current="true">en</language>
164
+ <script current="true">Latn</script>
165
165
  <status>
166
- <stage>60</stage>
167
- <substage>60</substage>
166
+ <stage language="">60</stage>
167
+ <substage language="">60</substage>
168
168
  </status>
169
169
  <copyright>
170
170
  <from>2020</from>
@@ -176,7 +176,7 @@ OUTPUT
176
176
  </owner>
177
177
  </copyright>
178
178
  <ext>
179
- <doctype>article</doctype>
179
+ <doctype language="">article</doctype>
180
180
  <editorialgroup>
181
181
  <technical-committee/>
182
182
  <subcommittee/>
@@ -222,16 +222,12 @@ OUTPUT
222
222
  <div>
223
223
  <h1>1&#160; Normative References</h1>
224
224
  <p id='_'>There are no normative references in this document.</p>
225
- <p id='A' class='NormRef'>
226
- B,
227
- <i>TITLE</i>
228
- </p>
229
225
  </div>
230
226
  </div>
231
227
  </body>
232
228
  </html>
233
229
  OUTPUT
234
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
230
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
235
231
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
236
232
  end
237
233
 
@@ -294,7 +290,7 @@ OUTPUT
294
290
  INPUT
295
291
 
296
292
  presxml = <<~INPUT
297
- <iso-standard xmlns="http://riboseinc.com/isoxml">
293
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
298
294
  <bibdata type='standard'>
299
295
  <docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
300
296
  <docnumber>60050</docnumber>
@@ -445,7 +441,7 @@ html = <<~OUTPUT
445
441
  </body>
446
442
  </html>
447
443
  OUTPUT
448
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
444
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
449
445
  expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
450
446
  end
451
447
 
@@ -477,7 +473,7 @@ end
477
473
  </iso-standard>
478
474
  INPUT
479
475
  presxml = <<~OUTPUT
480
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
476
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
481
477
  <bibdata type='standard'>
482
478
  <docidentifier type='ISO'>IEC 60050-192 ED 1</docidentifier>
483
479
  <docnumber>60050</docnumber>
@@ -513,7 +509,7 @@ end
513
509
  </sections>
514
510
  </iso-standard>
515
511
  OUTPUT
516
- expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
512
+ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
517
513
  IsoDoc::Iec::WordConvert.new({}).convert("test", presxml, false)
518
514
  word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
519
515
  sub(%r{<br clear="all" style="page-break-before:left;mso-break-type:section-break"/>.*$}m, "")
@@ -185,7 +185,7 @@ expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({}).convert("test", <<~"INP
185
185
  </iso-standard>
186
186
  INPUT
187
187
  <?xml version='1.0'?>
188
- <iso-standard xmlns='http://riboseinc.com/isoxml'>
188
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
189
189
  <preface>
190
190
  <foreword>
191
191
  <p>
@@ -7,7 +7,7 @@ RSpec.describe IsoDoc::Iec::Metadata do
7
7
  arr = c.convert_init(<<~"INPUT", "test", false)
8
8
  <iec-standard xmlns="http://riboseinc.com/isoxml">
9
9
  INPUT
10
- expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort].to_s.gsub(/, :/, ",\n:")).to be_equivalent_to <<~"OUTPUT"
10
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil)).to_s.gsub(/, :/, ",\n:")).to be_equivalent_to <<~"OUTPUT"
11
11
  <iso-standard xmlns="http://riboseinc.com/isoxml">
12
12
  <bibdata type="standard">
13
13
  <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
@@ -76,12 +76,11 @@ INPUT
76
76
  {:accesseddate=>"2012",
77
77
  :activateddate=>"2013",
78
78
  :agency=>"ISO",
79
- :authors=>[],
80
- :authors_affiliations=>{},
79
+ :circulateddate=>"XXX",
80
+ :confirmeddate=>"XXX",
81
+ :copieddate=>"XXX",
81
82
  :createddate=>"2010&ndash;2011",
82
83
  :docnumber=>"ISO/PreCD3 17301-1",
83
- :docnumber_lang=>nil,
84
- :docnumber_reference=>nil,
85
84
  :docnumeric=>"1730",
86
85
  :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1: Riz",
87
86
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
@@ -94,21 +93,23 @@ INPUT
94
93
  :doctitlepart=>"Rice",
95
94
  :doctitlepartlabel=>"Part&nbsp;1",
96
95
  :doctype=>"International Standard",
96
+ :doctype_display=>"International Standard",
97
97
  :docyear=>"2016",
98
98
  :draft=>"0.4",
99
99
  :draftinfo=>" (draft 0.4, 2016-05-01)",
100
100
  :edition=>"2",
101
101
  :editorialgroup=>["TC 34", "SC 4", "WG 3"],
102
- :ics=>nil,
103
- :keywords=>[],
102
+ :implementeddate=>"XXX",
103
+ :issueddate=>"XXX",
104
+ :lang=>"en",
104
105
  :obsoleteddate=>"2014",
105
- :obsoletes=>nil,
106
- :obsoletes_part=>nil,
107
106
  :publisheddate=>"2011",
108
107
  :publisher=>"International Organization for Standardization",
108
+ :receiveddate=>"XXX",
109
109
  :revdate=>"2016-05-01",
110
110
  :revdate_monthyear=>"May 2016",
111
111
  :sc=>"SC 4",
112
+ :script=>"Latn",
112
113
  :secretariat=>"GB",
113
114
  :stage=>"35",
114
115
  :stage_int=>35,
@@ -116,7 +117,12 @@ INPUT
116
117
  :statusabbr=>"3CD",
117
118
  :tc=>"TC 34",
118
119
  :tc_docnumber=>["17301"],
120
+ :transmitteddate=>"XXX",
121
+ :unchangeddate=>"XXX",
119
122
  :unpublished=>true,
123
+ :updateddate=>"XXX",
124
+ :vote_endeddate=>"XXX",
125
+ :vote_starteddate=>"XXX",
120
126
  :wg=>"WG 3"}
121
127
  OUTPUT
122
128
  end
@@ -126,7 +132,7 @@ OUTPUT
126
132
  arr = c.convert_init(<<~"INPUT", "test", false)
127
133
  <iso-standard xmlns="http://riboseinc.com/isoxml">
128
134
  INPUT
129
- expect(Hash[c.info(Nokogiri::XML(<<~"INPUT"), nil).sort].to_s.gsub(/, :/, ",\n:")).to be_equivalent_to <<~"OUTPUT"
135
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil)).to_s.gsub(/, :/, ",\n:")).to be_equivalent_to <<~"OUTPUT"
130
136
  <iso-standard xmlns="http://riboseinc.com/isoxml">
131
137
  <bibdata type="standard">
132
138
  <title>
@@ -196,13 +202,13 @@ OUTPUT
196
202
  </bibdata>
197
203
  </iso-standard>
198
204
  INPUT
199
- {:agency=>"ISO/IEC",
200
- :authors=>[],
201
- :authors_affiliations=>{},
205
+ {:accesseddate=>"XXX",
206
+ :agency=>"ISO/IEC",
207
+ :circulateddate=>"XXX",
208
+ :confirmeddate=>"XXX",
209
+ :copieddate=>"XXX",
210
+ :createddate=>"XXX",
202
211
  :docnumber=>"ISO/IEC/CD 17301-1-3",
203
- :docnumber_lang=>nil,
204
- :docnumber_reference=>nil,
205
- :docnumeric=>nil,
206
212
  :docsubtitle=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses&nbsp;&mdash; Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai&nbsp;&mdash; Partie&nbsp;1&ndash;3: Riz",
207
213
  :docsubtitleintro=>"C&#xe9;r&#xe9;ales et l&#xe9;gumineuses",
208
214
  :docsubtitlemain=>"Sp&#xe9;cification et m&#xe9;thodes d&#x27;essai",
@@ -214,27 +220,34 @@ INPUT
214
220
  :doctitlepart=>"Rice",
215
221
  :doctitlepartlabel=>"Part&nbsp;1&ndash;3",
216
222
  :doctype=>"Technical Report",
223
+ :doctype_display=>"Technical Report",
217
224
  :docyear=>"2016",
218
- :draft=>nil,
219
- :draftinfo=>"",
220
- :edition=>nil,
221
225
  :editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
222
226
  :ics=>"1.2.3, 1.2.3",
223
- :keywords=>[],
227
+ :implementeddate=>"XXX",
228
+ :issueddate=>"XXX",
229
+ :lang=>"en",
230
+ :obsoleteddate=>"XXX",
224
231
  :obsoletes=>"IEC 8121",
225
232
  :obsoletes_part=>"3.1",
233
+ :publisheddate=>"XXX",
226
234
  :publisher=>"International Organization for Standardization and International Electrotechnical Commission",
227
- :revdate=>nil,
228
- :revdate_monthyear=>nil,
235
+ :receiveddate=>"XXX",
229
236
  :sc=>"DEF 4",
230
- :secretariat=>"XXXX",
237
+ :script=>"Latn",
238
+ :secretariat=>"XXX",
231
239
  :stage=>"50",
232
240
  :stage_int=>50,
233
241
  :stageabbr=>"FDIS",
234
242
  :statusabbr=>"CFDIS",
235
243
  :tc=>"ABC 34",
236
244
  :tc_docnumber=>["17301"],
245
+ :transmitteddate=>"XXX",
246
+ :unchangeddate=>"XXX",
237
247
  :unpublished=>true,
248
+ :updateddate=>"XXX",
249
+ :vote_endeddate=>"XXX",
250
+ :vote_starteddate=>"XXX",
238
251
  :wg=>"GHI 3"}
239
252
  OUTPUT
240
253
  end