metanorma-bsi 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.hound.yml +3 -0
  4. data/.rubocop.yml +14 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +7 -0
  7. data/LICENSE +25 -0
  8. data/README.adoc +199 -0
  9. data/Rakefile +8 -0
  10. data/bin/rspec +18 -0
  11. data/lib/asciidoctor/bsi/basicdoc.rng +1131 -0
  12. data/lib/asciidoctor/bsi/biblio.rng +1235 -0
  13. data/lib/asciidoctor/bsi/bsi.rng +120 -0
  14. data/lib/asciidoctor/bsi/bsi_intro_en.xml +105 -0
  15. data/lib/asciidoctor/bsi/cleanup.rb +78 -0
  16. data/lib/asciidoctor/bsi/cleanup_ref.rb +183 -0
  17. data/lib/asciidoctor/bsi/converter.rb +83 -0
  18. data/lib/asciidoctor/bsi/front.rb +67 -0
  19. data/lib/asciidoctor/bsi/isodoc.rng +1870 -0
  20. data/lib/asciidoctor/bsi/isostandard.rng +477 -0
  21. data/lib/asciidoctor/bsi/reqt.rng +194 -0
  22. data/lib/asciidoctor/bsi/validate.rb +224 -0
  23. data/lib/asciidoctor/bsi/validate_list.rb +72 -0
  24. data/lib/asciidoctor/bsi/validate_requirement.rb +163 -0
  25. data/lib/isodoc/bsi/base_convert.rb +91 -0
  26. data/lib/isodoc/bsi/bsi.international-standard.xsl +6540 -0
  27. data/lib/isodoc/bsi/html/html_bsi_intro.html +8 -0
  28. data/lib/isodoc/bsi/html/html_bsi_titlepage.html +50 -0
  29. data/lib/isodoc/bsi/html/htmlstyle.css +968 -0
  30. data/lib/isodoc/bsi/html/htmlstyle.scss +699 -0
  31. data/lib/isodoc/bsi/html_convert.rb +56 -0
  32. data/lib/isodoc/bsi/i18n-en.yaml +56 -0
  33. data/lib/isodoc/bsi/i18n.rb +15 -0
  34. data/lib/isodoc/bsi/init.rb +24 -0
  35. data/lib/isodoc/bsi/metadata.rb +33 -0
  36. data/lib/isodoc/bsi/pdf_convert.rb +17 -0
  37. data/lib/isodoc/bsi/presentation_xml_convert.rb +72 -0
  38. data/lib/isodoc/bsi/sts_convert.rb +30 -0
  39. data/lib/isodoc/bsi/xref.rb +134 -0
  40. data/lib/metanorma-bsi.rb +15 -0
  41. data/lib/metanorma/bsi.rb +6 -0
  42. data/lib/metanorma/bsi/processor.rb +51 -0
  43. data/lib/metanorma/bsi/version.rb +6 -0
  44. data/metanorma-bsi.gemspec +47 -0
  45. data/spec/asciidoctor/base_spec.rb +778 -0
  46. data/spec/asciidoctor/blocks_spec.rb +553 -0
  47. data/spec/asciidoctor/cleanup_spec.rb +547 -0
  48. data/spec/asciidoctor/inline_spec.rb +176 -0
  49. data/spec/asciidoctor/lists_spec.rb +194 -0
  50. data/spec/asciidoctor/refs_spec.rb +318 -0
  51. data/spec/asciidoctor/section_spec.rb +382 -0
  52. data/spec/asciidoctor/validate_spec.rb +858 -0
  53. data/spec/assets/header.html +7 -0
  54. data/spec/assets/html.css +2 -0
  55. data/spec/assets/iso.xml +71 -0
  56. data/spec/assets/rice_image1.png +0 -0
  57. data/spec/assets/word.css +2 -0
  58. data/spec/assets/wordintro.html +4 -0
  59. data/spec/assets/xref_error.adoc +7 -0
  60. data/spec/isodoc/blocks_spec.rb +259 -0
  61. data/spec/isodoc/i18n_spec.rb +442 -0
  62. data/spec/isodoc/inline_spec.rb +287 -0
  63. data/spec/isodoc/iso_spec.rb +116 -0
  64. data/spec/isodoc/metadata_spec.rb +262 -0
  65. data/spec/isodoc/postproc_spec.rb +137 -0
  66. data/spec/isodoc/ref_spec.rb +376 -0
  67. data/spec/isodoc/section_spec.rb +467 -0
  68. data/spec/isodoc/terms_spec.rb +246 -0
  69. data/spec/isodoc/xref_spec.rb +1730 -0
  70. data/spec/metanorma/processor_spec.rb +76 -0
  71. data/spec/spec_helper.rb +291 -0
  72. data/spec/vcr_cassettes/iso-639.yml +182 -0
  73. data/spec/vcr_cassettes/isobib_get_639_1967.yml +136 -0
  74. data/spec/vcr_cassettes/multistandard.yml +352 -0
  75. metadata +343 -0
@@ -0,0 +1,137 @@
1
+ require "spec_helper"
2
+ require "fileutils"
3
+
4
+ RSpec.describe IsoDoc do
5
+ it "generates file based on string input" do
6
+ FileUtils.rm_f "test.doc"
7
+ FileUtils.rm_f "test.html"
8
+ IsoDoc::BSI::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", filename: "test"}).convert("test", <<~"INPUT", false)
9
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
10
+ <bibdata>
11
+ <title>
12
+ <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
13
+ <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
14
+ <title type="title-part" language="en" format="text/plain">Rice</title>
15
+ </title>
16
+ </bibdata>
17
+ <preface><foreword>
18
+ <note>
19
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
20
+ </note>
21
+ </foreword></preface>
22
+ </iso-standard>
23
+ INPUT
24
+ expect(File.exist?("test.html")).to be true
25
+ html = File.read("test.html", encoding: "UTF-8")
26
+ expect(html).to match(%r{<title>Cereals and pulses\&#xA0;\&#x2014; Specifications and test methods\&#xA0;\&#x2014; Rice</title>})
27
+ expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
28
+ expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
29
+ end
30
+
31
+ it "generates HTML output docs with null configuration" do
32
+ FileUtils.rm_f "test.doc"
33
+ FileUtils.rm_f "test.html"
34
+ IsoDoc::BSI::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
35
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
36
+ <bibdata>
37
+ <title>
38
+ <title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
39
+ <title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
40
+ <title type="title-part" language="en" format="text/plain">Rice</title>
41
+ </title>
42
+ </bibdata>
43
+ <preface><foreword>
44
+ <note>
45
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
46
+ </note>
47
+ </foreword></preface>
48
+ </iso-standard>
49
+ INPUT
50
+ expect(File.exist?("test.html")).to be true
51
+ html = File.read("test.html", encoding: "UTF-8")
52
+ expect(html).to match(%r{<title>Cereals and pulses\&#xA0;\&#x2014; Specifications and test methods\&#xA0;\&#x2014; Rice</title>})
53
+ expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
54
+ expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
55
+ end
56
+
57
+ it "generates HTML output docs with null configuration from file" do
58
+ FileUtils.rm_f "spec/assets/iso.doc"
59
+ FileUtils.rm_f "spec/assets/iso.html"
60
+ IsoDoc::BSI::HtmlConvert.new({wordstylesheet: "word.css", htmlstylesheet: "html.css"}).convert("spec/assets/iso.xml", nil, false)
61
+ expect(File.exist?("spec/assets/iso.html")).to be true
62
+ html = File.read("spec/assets/iso.html", encoding: "UTF-8")
63
+ expect(html).to match(/<style>/)
64
+ expect(html).to match(%r{https://use.fontawesome.com})
65
+ expect(html).to match(%r{libs/jquery})
66
+ end
67
+
68
+ it "generates Pdf output docs with null configuration from file" do
69
+ FileUtils.rm_f "spec/assets/iso.pdf"
70
+ IsoDoc::BSI::PdfConvert.new({}).convert("spec/assets/iso.xml", nil, false)
71
+ expect(File.exist?("spec/assets/iso.pdf")).to be true
72
+ end
73
+
74
+ it "processes IsoXML terms for HTML" do
75
+ FileUtils.rm_f "test.html"
76
+ FileUtils.rm_f "test.doc"
77
+ IsoDoc::BSI::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
78
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
79
+ <sections>
80
+ <terms id="_terms_and_definitions" obligation="normative"><title>1<tab/>Terms and Definitions</title>
81
+
82
+ <term id="paddy1">
83
+ <name>1.1</name>
84
+ <preferred>paddy</preferred>
85
+ <domain>rice</domain>
86
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
87
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
88
+ <p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
89
+ <ul>
90
+ <li>A</li>
91
+ </ul>
92
+ </termexample>
93
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
94
+ <ul>
95
+ <li>A</li>
96
+ </ul>
97
+ </termexample>
98
+
99
+ <termsource status="modified">
100
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
101
+ <modification>
102
+ <p id="_e73a417d-ad39-417d-a4c8-20e4e2529489">The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here</p>
103
+ </modification>
104
+ </termsource></term>
105
+
106
+ <term id="paddy">
107
+ <name>1.2</name>
108
+ <preferred>paddy</preferred><admitted>paddy rice</admitted>
109
+ <admitted>rough rice</admitted>
110
+ <deprecates>cargo rice</deprecates>
111
+ <definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
112
+ <termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f893">
113
+ <ul>
114
+ <li>A</li>
115
+ </ul>
116
+ </termexample>
117
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74e">
118
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
119
+ </termnote>
120
+ <termnote id="_671a1994-4783-40d0-bc81-987d06ffb74f">
121
+ <ul><li>A</li></ul>
122
+ <p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
123
+ </termnote>
124
+ <termsource status="identical">
125
+ <origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
126
+ </termsource></term>
127
+ </terms>
128
+ </sections>
129
+ </iso-standard>
130
+ INPUT
131
+ expect(File.exist?("test.html")).to be true
132
+ html = File.read("test.html", encoding: "UTF-8")
133
+ expect(html).to match(%r{<h2 class="TermNum" id="paddy1">1\.1</h2>})
134
+ expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
135
+ end
136
+
137
+ end
@@ -0,0 +1,376 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe IsoDoc::BSI do
4
+ it "processes IsoXML bibliographies" do
5
+ input = <<~INPUT
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <bibdata>
8
+ <language>en</language>
9
+ </bibdata>
10
+ <preface><foreword>
11
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
12
+ <eref bibitemid="ISO712"/>
13
+ <eref bibitemid="ISBN"/>
14
+ <eref bibitemid="ISSN"/>
15
+ <eref bibitemid="ISO16634"/>
16
+ <eref bibitemid="ref1"/>
17
+ <eref bibitemid="ref10"/>
18
+ <eref bibitemid="ref12"/>
19
+ <eref bibitemid="zip_ffs"/>
20
+ </p>
21
+ </foreword></preface>
22
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
23
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
24
+ <bibitem id="ISO712" type="standard">
25
+ <title format="text/plain">Cereals or cereal products</title>
26
+ <title type="main" format="text/plain">Cereals and cereal products</title>
27
+ <docidentifier type="ISO">ISO 712</docidentifier>
28
+ <docidentifier type="metanorma">[110]</docidentifier>
29
+ <contributor>
30
+ <role type="publisher"/>
31
+ <organization>
32
+ <name>International Organization for Standardization</name>
33
+ </organization>
34
+ </contributor>
35
+ </bibitem>
36
+ <bibitem id="ISO16634" type="standard">
37
+ <title language="x" format="text/plain">Cereals, pulses, milled cereal products, xxxx, oilseeds and animal feeding stuffs</title>
38
+ <title language="en" format="text/plain">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
39
+ <docidentifier type="ISO">ISO 16634:-- (all parts)</docidentifier>
40
+ <date type="published"><on>--</on></date>
41
+ <contributor>
42
+ <role type="publisher"/>
43
+ <organization>
44
+ <abbreviation>ISO</abbreviation>
45
+ </organization>
46
+ </contributor>
47
+ <note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
48
+ <extent type="part">
49
+ <referenceFrom>all</referenceFrom>
50
+ </extent>
51
+
52
+ </bibitem>
53
+ <bibitem id="ISO20483" type="standard">
54
+ <title format="text/plain">Cereals and pulses</title>
55
+ <docidentifier type="ISO">ISO 20483:2013-2014</docidentifier>
56
+ <date type="published"><from>2013</from><to>2014</to></date>
57
+ <contributor>
58
+ <role type="publisher"/>
59
+ <organization>
60
+ <name>International Organization for Standardization</name>
61
+ </organization>
62
+ </contributor>
63
+ </bibitem>
64
+ <bibitem id="ref1">
65
+ <formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
66
+ <docidentifier type="ICC">167</docidentifier>
67
+ </bibitem>
68
+ <note><p>This is an annotation of ISO 20483:2013-2014</p></note>
69
+ <bibitem id="zip_ffs"><formattedref format="application/x-isodoc+xml">Title 5</formattedref><docidentifier type="metanorma">[5]</docidentifier></bibitem>
70
+
71
+
72
+ </references><references id="_bibliography" obligation="informative" normative="false">
73
+ <title>Bibliography</title>
74
+ <bibitem id="ISBN" type="ISBN">
75
+ <title format="text/plain">Chemicals for analytical laboratory use</title>
76
+ <docidentifier type="ISBN">ISBN</docidentifier>
77
+ <docidentifier type="metanorma">[1]</docidentifier>
78
+ <contributor>
79
+ <role type="publisher"/>
80
+ <organization>
81
+ <abbreviation>ISBN</abbreviation>
82
+ </organization>
83
+ </contributor>
84
+ </bibitem>
85
+ <bibitem id="ISSN" type="ISSN">
86
+ <title format="text/plain">Instruments for analytical laboratory use</title>
87
+ <docidentifier type="ISSN">ISSN</docidentifier>
88
+ <docidentifier type="metanorma">[2]</docidentifier>
89
+ <contributor>
90
+ <role type="publisher"/>
91
+ <organization>
92
+ <abbreviation>ISSN</abbreviation>
93
+ </organization>
94
+ </contributor>
95
+ </bibitem>
96
+ <note><p>This is an annotation of document ISSN.</p></note>
97
+ <note><p>This is another annotation of document ISSN.</p></note>
98
+ <bibitem id="ISO3696" type="standard">
99
+ <title format="text/plain">Water for analytical laboratory use</title>
100
+ <docidentifier type="ISO">ISO 3696</docidentifier>
101
+ <contributor>
102
+ <role type="publisher"/>
103
+ <organization>
104
+ <abbreviation>ISO</abbreviation>
105
+ </organization>
106
+ </contributor>
107
+ </bibitem>
108
+ <bibitem id="ref10">
109
+ <formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
110
+ <docidentifier type="metanorma">[10]</docidentifier>
111
+ </bibitem>
112
+ <bibitem id="ref11">
113
+ <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
114
+ <docidentifier type="IETF">RFC 10</docidentifier>
115
+ </bibitem>
116
+ <bibitem id="ref12">
117
+ <formattedref format="application/x-isodoc+xml">CitationWorks. 2019. <em>How to cite a reference</em>.</formattedref>
118
+ <docidentifier type="metanorma">[Citn]</docidentifier>
119
+ <docidentifier type="IETF">RFC 20</docidentifier>
120
+ </bibitem>
121
+
122
+
123
+ </references>
124
+ </bibliography>
125
+ </iso-standard>
126
+ INPUT
127
+
128
+ presxml = <<~OUTPUT
129
+ <iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
130
+ <bibdata>
131
+ <language current="true">en</language>
132
+ </bibdata>
133
+ <preface><foreword>
134
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
135
+ <eref bibitemid="ISO712">[110]</eref>
136
+ <eref bibitemid="ISBN">[1]</eref>
137
+ <eref bibitemid="ISSN">[2]</eref>
138
+ <eref bibitemid="ISO16634">ISO 16634:--</eref>
139
+ <eref bibitemid="ref1">ICC 167</eref>
140
+ <eref bibitemid="ref10">[10]</eref>
141
+ <eref bibitemid="ref12">Citn</eref>
142
+ <eref bibitemid="zip_ffs">[5]</eref>
143
+ </p>
144
+ </foreword></preface>
145
+ <bibliography><references id="_normative_references" obligation="informative" normative="true"><title depth="1">1<tab/>Normative References</title>
146
+ <p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
147
+ <bibitem id="ISO712" type="standard">
148
+ <title format="text/plain">Cereals or cereal products</title>
149
+ <title type="main" format="text/plain">Cereals and cereal products</title>
150
+ <docidentifier type="ISO">ISO 712</docidentifier>
151
+ <docidentifier type="metanorma">[110]</docidentifier>
152
+ <contributor>
153
+ <role type="publisher"/>
154
+ <organization>
155
+ <name>International Organization for Standardization</name>
156
+ </organization>
157
+ </contributor>
158
+ </bibitem>
159
+ <bibitem id="ISO16634" type="standard">
160
+ <title language="x" format="text/plain">Cereals, pulses, milled cereal products, xxxx, oilseeds and animal feeding stuffs</title>
161
+ <title language="en" format="text/plain">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
162
+ <docidentifier type="ISO">ISO 16634:-- (all parts)</docidentifier>
163
+ <date type="published"><on>--</on></date>
164
+ <contributor>
165
+ <role type="publisher"/>
166
+ <organization>
167
+ <abbreviation>ISO</abbreviation>
168
+ </organization>
169
+ </contributor>
170
+ <note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
171
+ <extent type="part">
172
+ <referenceFrom>all</referenceFrom>
173
+ </extent>
174
+
175
+ </bibitem>
176
+ <bibitem id="ISO20483" type="standard">
177
+ <title format="text/plain">Cereals and pulses</title>
178
+ <docidentifier type="ISO">ISO 20483:2013-2014</docidentifier>
179
+ <date type="published"><from>2013</from><to>2014</to></date>
180
+ <contributor>
181
+ <role type="publisher"/>
182
+ <organization>
183
+ <name>International Organization for Standardization</name>
184
+ </organization>
185
+ </contributor>
186
+ </bibitem>
187
+ <bibitem id="ref1">
188
+ <formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
189
+ <docidentifier type="ICC">167</docidentifier>
190
+ </bibitem>
191
+ <note><name>NOTE</name><p>This is an annotation of ISO 20483:2013-2014</p></note>
192
+ <bibitem id="zip_ffs"><formattedref format="application/x-isodoc+xml">Title 5</formattedref><docidentifier type="metanorma">[5]</docidentifier></bibitem>
193
+
194
+
195
+ </references><references id="_bibliography" obligation="informative" normative="false">
196
+ <title depth="1">Bibliography</title>
197
+ <bibitem id="ISBN" type="ISBN">
198
+ <title format="text/plain">Chemicals for analytical laboratory use</title>
199
+ <docidentifier type="ISBN">ISBN</docidentifier>
200
+ <docidentifier type="metanorma">[1]</docidentifier>
201
+ <contributor>
202
+ <role type="publisher"/>
203
+ <organization>
204
+ <abbreviation>ISBN</abbreviation>
205
+ </organization>
206
+ </contributor>
207
+ </bibitem>
208
+ <bibitem id="ISSN" type="ISSN">
209
+ <title format="text/plain">Instruments for analytical laboratory use</title>
210
+ <docidentifier type="ISSN">ISSN</docidentifier>
211
+ <docidentifier type="metanorma">[2]</docidentifier>
212
+ <contributor>
213
+ <role type="publisher"/>
214
+ <organization>
215
+ <abbreviation>ISSN</abbreviation>
216
+ </organization>
217
+ </contributor>
218
+ </bibitem>
219
+ <note><name>NOTE</name><p>This is an annotation of document ISSN.</p></note>
220
+ <note><name>NOTE</name><p>This is another annotation of document ISSN.</p></note>
221
+ <bibitem id="ISO3696" type="standard">
222
+ <title format="text/plain">Water for analytical laboratory use</title>
223
+ <docidentifier type="ISO">ISO 3696</docidentifier>
224
+ <contributor>
225
+ <role type="publisher"/>
226
+ <organization>
227
+ <abbreviation>ISO</abbreviation>
228
+ </organization>
229
+ </contributor>
230
+ </bibitem>
231
+ <bibitem id="ref10">
232
+ <formattedref format="application/x-isodoc+xml"><smallcap>Standard No I.C.C 167</smallcap>. <em>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</em> (see <link target="http://www.icc.or.at"/>)</formattedref>
233
+ <docidentifier type="metanorma">[10]</docidentifier>
234
+ </bibitem>
235
+ <bibitem id="ref11">
236
+ <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
237
+ <docidentifier type="IETF">RFC 10</docidentifier>
238
+ </bibitem>
239
+ <bibitem id="ref12">
240
+ <formattedref format="application/x-isodoc+xml">CitationWorks. 2019. <em>How to cite a reference</em>.</formattedref>
241
+ <docidentifier type="metanorma">[Citn]</docidentifier>
242
+ <docidentifier type="IETF">RFC 20</docidentifier>
243
+ </bibitem>
244
+
245
+
246
+ </references>
247
+ </bibliography>
248
+ </iso-standard>
249
+ OUTPUT
250
+
251
+ html = <<~OUTPUT
252
+ #{HTML_HDR}
253
+ <div>
254
+ <h1 class='ForewordTitle'>FOREWORD</h1>
255
+ <div class='boilerplate_legal'/>
256
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
257
+ <a href='#ISO712'>[110]</a>
258
+ <a href='#ISBN'>[1]</a>
259
+ <a href='#ISSN'>[2]</a>
260
+ <a href='#ISO16634'>ISO 16634:--</a>
261
+ <a href='#ref1'>ICC 167</a>
262
+ <a href='#ref10'>[10]</a>
263
+ <a href='#ref12'>Citn</a>
264
+ <a href='#zip_ffs'>[5]</a>
265
+ </p>
266
+ </div>
267
+ #{IEC_TITLE1}
268
+ <div>
269
+ <h1>1&#8195;Normative References</h1>
270
+ <p>
271
+ The following documents are referred to in the text in such a way that
272
+ some or all of their content constitutes requirements of this
273
+ document. For dated references, only the edition cited applies. For
274
+ undated references, the latest edition of the referenced document
275
+ (including any amendments) applies.
276
+ </p>
277
+ <p id='ISO712' class='NormRef'>
278
+ [110], ISO 712,
279
+ <i>Cereals and cereal products</i>
280
+ </p>
281
+ <p id='ISO16634' class='NormRef'>
282
+ ISO 16634:-- (all parts)
283
+ <a class='FootnoteRef' href='#fn:1'>
284
+ <sup>1</sup>
285
+ </a>
286
+ ,
287
+ <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
288
+ </p>
289
+ <p id='ISO20483' class='NormRef'>
290
+ ISO 20483:2013-2014,
291
+ <i>Cereals and pulses</i>
292
+ </p>
293
+ <p id='ref1' class='NormRef'>
294
+ ICC 167,
295
+ <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
296
+ .
297
+ <i>
298
+ Determination of the protein content in cereal and cereal products
299
+ for food and animal feeding stuffs according to the Dumas combustion
300
+ method
301
+ </i>
302
+ (see
303
+ <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
304
+ )
305
+ </p>
306
+ <div class='Note'>
307
+ <p>
308
+ <span class='note_label'>NOTE</span>
309
+ &#8195;This is an annotation of ISO 20483:2013-2014
310
+ </p>
311
+ </div>
312
+ <p id='zip_ffs' class='NormRef'>[5], Title 5</p>
313
+ </div>
314
+ <br/>
315
+ <div>
316
+ <h1 class='Section3'>Bibliography</h1>
317
+ <p id='ISBN' class='Biblio'>
318
+ [1]&#8195;
319
+ <i>Chemicals for analytical laboratory use</i>
320
+ </p>
321
+ <p id='ISSN' class='Biblio'>
322
+ [2]&#8195;
323
+ <i>Instruments for analytical laboratory use</i>
324
+ </p>
325
+ <div class='Note'>
326
+ <p>
327
+ <span class='note_label'>NOTE</span>
328
+ &#8195;This is an annotation of document ISSN.
329
+ </p>
330
+ </div>
331
+ <div class='Note'>
332
+ <p>
333
+ <span class='note_label'>NOTE</span>
334
+ &#8195;This is another annotation of document ISSN.
335
+ </p>
336
+ </div>
337
+ <p id='ISO3696' class='Biblio'>
338
+ [3]&#8195;ISO 3696,
339
+ <i>Water for analytical laboratory use</i>
340
+ </p>
341
+ <p id='ref10' class='Biblio'>
342
+ [10]&#8195;
343
+ <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
344
+ .
345
+ <i>
346
+ Determination of the protein content in cereal and cereal products
347
+ for food and animal feeding stuffs according to the Dumas combustion
348
+ method
349
+ </i>
350
+ (see
351
+ <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
352
+ )
353
+ </p>
354
+ <p id='ref11' class='Biblio'>
355
+ [5]&#8195;IETF RFC 10,
356
+ <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
357
+ </p>
358
+ <p id='ref12' class='Biblio'>
359
+ Citn&#8195;IETF RFC 20, CitationWorks. 2019.
360
+ <i>How to cite a reference</i>
361
+ .
362
+ </p>
363
+ </div>
364
+ <aside id='fn:1' class='footnote'>
365
+ <p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
366
+ </aside>
367
+ </div>
368
+ </body>
369
+ </html>
370
+
371
+ OUTPUT
372
+ expect(xmlpp(IsoDoc::BSI::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
373
+ expect(xmlpp(IsoDoc::BSI::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
374
+ end
375
+
376
+ end