isodoc 1.5.2 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +1 -1
  3. data/.rubocop.yml +6 -2
  4. data/Gemfile +2 -2
  5. data/bin/rspec +1 -2
  6. data/isodoc.gemspec +11 -11
  7. data/lib/isodoc/base_style/all.css +7 -0
  8. data/lib/isodoc/base_style/metanorma_word.css +7 -0
  9. data/lib/isodoc/base_style/metanorma_word.scss +8 -0
  10. data/lib/isodoc/base_style/reset.css +7 -0
  11. data/lib/isodoc/base_style/reset.scss +9 -0
  12. data/lib/isodoc/base_style/scripts.html +187 -0
  13. data/lib/isodoc/class_utils.rb +6 -5
  14. data/lib/isodoc/convert.rb +30 -17
  15. data/lib/isodoc/css.rb +42 -28
  16. data/lib/isodoc/function/blocks.rb +15 -4
  17. data/lib/isodoc/function/blocks_example_note.rb +2 -2
  18. data/lib/isodoc/function/cleanup.rb +1 -2
  19. data/lib/isodoc/function/inline.rb +31 -10
  20. data/lib/isodoc/function/references.rb +1 -1
  21. data/lib/isodoc/function/to_word_html.rb +19 -8
  22. data/lib/isodoc/function/utils.rb +41 -38
  23. data/lib/isodoc/gem_tasks.rb +30 -31
  24. data/lib/isodoc/html_convert.rb +4 -4
  25. data/lib/isodoc/html_function/postprocess.rb +35 -76
  26. data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
  27. data/lib/isodoc/i18n.rb +20 -20
  28. data/lib/isodoc/pdf_convert.rb +1 -3
  29. data/lib/isodoc/presentation_function/block.rb +26 -11
  30. data/lib/isodoc/presentation_function/inline.rb +44 -38
  31. data/lib/isodoc/presentation_xml_convert.rb +1 -1
  32. data/lib/isodoc/version.rb +1 -1
  33. data/lib/isodoc/word_function/footnotes.rb +22 -15
  34. data/lib/isodoc/word_function/inline.rb +6 -0
  35. data/lib/isodoc/word_function/postprocess.rb +16 -6
  36. data/lib/isodoc/xref.rb +10 -11
  37. data/lib/isodoc/xref/xref_counter.rb +31 -15
  38. data/lib/isodoc/xref/xref_gen.rb +28 -22
  39. data/lib/isodoc/xref/xref_sect_gen.rb +22 -20
  40. data/lib/isodoc/xslfo_convert.rb +36 -25
  41. data/spec/assets/html_override.css +1 -0
  42. data/spec/assets/word_override.css +1 -0
  43. data/spec/isodoc/blocks_spec.rb +2599 -2503
  44. data/spec/isodoc/cleanup_spec.rb +1107 -1109
  45. data/spec/isodoc/footnotes_spec.rb +1 -16
  46. data/spec/isodoc/i18n_spec.rb +984 -972
  47. data/spec/isodoc/inline_spec.rb +34 -0
  48. data/spec/isodoc/lists_spec.rb +316 -315
  49. data/spec/isodoc/postproc_spec.rb +1655 -1521
  50. data/spec/isodoc/presentation_xml_spec.rb +345 -338
  51. data/spec/isodoc/ref_spec.rb +718 -723
  52. data/spec/isodoc/section_spec.rb +910 -902
  53. data/spec/isodoc/table_spec.rb +566 -556
  54. data/spec/isodoc/terms_spec.rb +252 -256
  55. data/spec/isodoc/xref_spec.rb +3040 -2985
  56. data/spec/isodoc/xslfo_convert_spec.rb +39 -0
  57. data/spec/spec_helper.rb +30 -29
  58. metadata +72 -69
  59. data/.rubocop.ribose.yml +0 -65
  60. data/.rubocop.tb.yml +0 -650
@@ -1,745 +1,740 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
- it "processes Relaton 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" type="Unpublished-Status" reference="1">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">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
- presxml = <<~PRESXML
128
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
129
- <bibdata>
130
- <language current="true">en</language>
131
- </bibdata>
132
- <preface>
133
- <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:-- (all parts)</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>
145
- </preface>
146
- <bibliography>
147
- <references id='_normative_references' obligation='informative' normative='true'>
148
- <title depth='1'>1.<tab/>Normative References</title>
149
- <p>
150
- The following documents are referred to in the text in such a way that
151
- some or all of their content constitutes requirements of this document.
152
- For dated references, only the edition cited applies. For undated
153
- references, the latest edition of the referenced document (including any
154
- amendments) applies.
4
+ it "processes Relaton 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"/>
155
20
  </p>
156
- <bibitem id='ISO712' type='standard'>
157
- <title format='text/plain'>Cereals or cereal products</title>
158
- <title type='main' format='text/plain'>Cereals and cereal products</title>
159
- <docidentifier type='ISO'>ISO 712</docidentifier>
160
- <docidentifier type='metanorma'>[110]</docidentifier>
161
- <contributor>
162
- <role type='publisher'/>
163
- <organization>
164
- <name>International Organization for Standardization</name>
165
- </organization>
166
- </contributor>
167
- </bibitem>
168
- <bibitem id='ISO16634' type='standard'>
169
- <title language='x' format='text/plain'>
170
- Cereals, pulses, milled cereal products, xxxx, oilseeds and animal
171
- feeding stuffs
172
- </title>
173
- <title language='en' format='text/plain'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
174
- <docidentifier type='ISO'>ISO 16634:-- (all parts)</docidentifier>
175
- <date type='published'>
176
- <on>--</on>
177
- </date>
178
- <contributor>
179
- <role type='publisher'/>
180
- <organization>
181
- <abbreviation>ISO</abbreviation>
182
- </organization>
183
- </contributor>
184
- <note format='text/plain' type='Unpublished-Status' reference='1'>Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
185
- <extent type='part'>
186
- <referenceFrom>all</referenceFrom>
187
- </extent>
188
- </bibitem>
189
- <bibitem id='ISO20483' type='standard'>
190
- <title format='text/plain'>Cereals and pulses</title>
191
- <docidentifier type='ISO'>ISO 20483:2013-2014</docidentifier>
192
- <date type='published'>
193
- <from>2013</from>
194
- <to>2014</to>
195
- </date>
196
- <contributor>
197
- <role type='publisher'/>
198
- <organization>
199
- <name>International Organization for Standardization</name>
200
- </organization>
201
- </contributor>
202
- </bibitem>
203
- <bibitem id='ref1'>
204
- <formattedref format='application/x-isodoc+xml'>
205
- <smallcap>Standard No I.C.C 167</smallcap>
206
- .
207
- <em>
208
- Determination of the protein content in cereal and cereal products
209
- for food and animal feeding stuffs according to the Dumas combustion
210
- method
211
- </em>
212
- (see
213
- <link target='http://www.icc.or.at'/>
214
- )
215
- </formattedref>
216
- <docidentifier type='ICC'>ICC/167</docidentifier>
217
- </bibitem>
218
- <note>
219
- <name>NOTE</name>
220
- <p>This is an annotation of ISO 20483:2013-2014</p>
221
- </note>
222
- <bibitem id='zip_ffs'>
223
- <formattedref format='application/x-isodoc+xml'>Title 5</formattedref>
224
- <docidentifier type='metanorma'>[5]</docidentifier>
225
- </bibitem>
226
- </references>
227
- <references id='_bibliography' obligation='informative' normative='false'>
228
- <title depth="1">Bibliography</title>
229
- <bibitem id='ISBN' type='ISBN'>
230
- <title format='text/plain'>Chemicals for analytical laboratory use</title>
231
- <docidentifier type='ISBN'>ISBN</docidentifier>
232
- <docidentifier type='metanorma'>[1]</docidentifier>
233
- <contributor>
234
- <role type='publisher'/>
235
- <organization>
236
- <abbreviation>ISBN</abbreviation>
237
- </organization>
238
- </contributor>
239
- </bibitem>
240
- <bibitem id='ISSN' type='ISSN'>
241
- <title format='text/plain'>Instruments for analytical laboratory use</title>
242
- <docidentifier type='ISSN'>ISSN</docidentifier>
243
- <docidentifier type='metanorma'>[2]</docidentifier>
244
- <contributor>
245
- <role type='publisher'/>
246
- <organization>
247
- <abbreviation>ISSN</abbreviation>
248
- </organization>
249
- </contributor>
250
- </bibitem>
251
- <note>
252
- <name>NOTE</name>
253
- <p>This is an annotation of document ISSN.</p>
254
- </note>
255
- <note>
256
- <name>NOTE</name>
257
- <p>This is another annotation of document ISSN.</p>
258
- </note>
259
- <bibitem id='ISO3696' type='standard'>
260
- <title format='text/plain'>Water for analytical laboratory use</title>
261
- <docidentifier type='ISO'>ISO 3696</docidentifier>
262
- <contributor>
263
- <role type='publisher'/>
264
- <organization>
265
- <abbreviation>ISO</abbreviation>
266
- </organization>
267
- </contributor>
268
- </bibitem>
269
- <bibitem id='ref10'>
270
- <formattedref format='application/x-isodoc+xml'>
271
- <smallcap>Standard No I.C.C 167</smallcap>
272
- .
273
- <em>
274
- Determination of the protein content in cereal and cereal products
275
- for food and animal feeding stuffs according to the Dumas combustion
276
- method
277
- </em>
278
- (see
279
- <link target='http://www.icc.or.at'/>
280
- )
281
- </formattedref>
282
- <docidentifier type='metanorma'>[10]</docidentifier>
283
- </bibitem>
284
- <bibitem id='ref11'>
285
- <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
286
- <docidentifier type='IETF'>RFC 10</docidentifier>
287
- </bibitem>
288
- <bibitem id='ref12'>
289
- <formattedref format='application/x-isodoc+xml'>
290
- CitationWorks. 2019.
291
- <em>How to cite a reference</em>
292
- .
293
- </formattedref>
294
- <docidentifier type='metanorma'>[Citn]</docidentifier>
295
- <docidentifier type='IETF'>RFC 20</docidentifier>
296
- </bibitem>
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" type="Unpublished-Status" reference="1">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
48
+ <extent type="part">
49
+ <referenceFrom>all</referenceFrom>
50
+ </extent>
51
+ </bibitem>
52
+ <bibitem id="ISO20483" type="standard">
53
+ <title format="text/plain">Cereals and pulses</title>
54
+ <docidentifier type="ISO">ISO 20483:2013-2014</docidentifier>
55
+ <date type="published"><from>2013</from><to>2014</to></date>
56
+ <contributor>
57
+ <role type="publisher"/>
58
+ <organization>
59
+ <name>International Organization for Standardization</name>
60
+ </organization>
61
+ </contributor>
62
+ </bibitem>
63
+ <bibitem id="ref1">
64
+ <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>
65
+ <docidentifier type="ICC">ICC/167</docidentifier>
66
+ </bibitem>
67
+ <note><p>This is an annotation of ISO 20483:2013-2014</p></note>
68
+ <bibitem id="zip_ffs"><formattedref format="application/x-isodoc+xml">Title 5</formattedref><docidentifier type="metanorma">[5]</docidentifier></bibitem>
69
+ </references><references id="_bibliography" obligation="informative" normative="false">
70
+ <title>Bibliography</title>
71
+ <bibitem id="ISBN" type="ISBN">
72
+ <title format="text/plain">Chemicals for analytical laboratory use</title>
73
+ <docidentifier type="ISBN">ISBN</docidentifier>
74
+ <docidentifier type="metanorma">[1]</docidentifier>
75
+ <contributor>
76
+ <role type="publisher"/>
77
+ <organization>
78
+ <abbreviation>ISBN</abbreviation>
79
+ </organization>
80
+ </contributor>
81
+ </bibitem>
82
+ <bibitem id="ISSN" type="ISSN">
83
+ <title format="text/plain">Instruments for analytical laboratory use</title>
84
+ <docidentifier type="ISSN">ISSN</docidentifier>
85
+ <docidentifier type="metanorma">[2]</docidentifier>
86
+ <contributor>
87
+ <role type="publisher"/>
88
+ <organization>
89
+ <abbreviation>ISSN</abbreviation>
90
+ </organization>
91
+ </contributor>
92
+ </bibitem>
93
+ <note><p>This is an annotation of document ISSN.</p></note>
94
+ <note><p>This is another annotation of document ISSN.</p></note>
95
+ <bibitem id="ISO3696" type="standard">
96
+ <title format="text/plain">Water for analytical laboratory use</title>
97
+ <docidentifier type="ISO">ISO 3696</docidentifier>
98
+ <contributor>
99
+ <role type="publisher"/>
100
+ <organization>
101
+ <abbreviation>ISO</abbreviation>
102
+ </organization>
103
+ </contributor>
104
+ </bibitem>
105
+ <bibitem id="ref10">
106
+ <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>
107
+ <docidentifier type="metanorma">[10]</docidentifier>
108
+ </bibitem>
109
+ <bibitem id="ref11">
110
+ <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
111
+ <docidentifier type="IETF">RFC 10</docidentifier>
112
+ </bibitem>
113
+ <bibitem id="ref12">
114
+ <formattedref format="application/x-isodoc+xml">CitationWorks. 2019. <em>How to cite a reference</em>.</formattedref>
115
+ <docidentifier type="metanorma">[Citn]</docidentifier>
116
+ <docidentifier type="IETF">RFC 20</docidentifier>
117
+ </bibitem>
297
118
  </references>
298
- </bibliography>
299
- </iso-standard>
300
- PRESXML
301
-
302
- html = <<~OUTPUT
303
- #{HTML_HDR}
304
- <br/>
305
- <div>
306
- <h1 class='ForewordTitle'>Foreword</h1>
307
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
308
- <a href='#ISO712'>[110]</a>
309
- <a href='#ISBN'>[1]</a>
310
- <a href='#ISSN'>[2]</a>
311
- <a href='#ISO16634'>ISO 16634:-- (all parts)</a>
312
- <a href='#ref1'>ICC/167</a>
313
- <a href='#ref10'>[10]</a>
314
- <a href='#ref12'>Citn</a>
315
- <a href='#zip_ffs'>[5]</a>
316
- </p>
317
- </div>
318
- <p class='zzSTDTitle1'/>
319
- <div>
320
- <h1>1.&#160; Normative References</h1>
321
- <p>
322
- The following documents are referred to in the text in such a way that
323
- some or all of their content constitutes requirements of this
324
- document. For dated references, only the edition cited applies. For
325
- undated references, the latest edition of the referenced document
326
- (including any amendments) applies.
327
- </p>
328
- <p id='ISO712' class='NormRef'>
329
- [110], ISO 712,
330
- <i>Cereals and cereal products</i>
331
- </p>
332
- <p id='ISO16634' class='NormRef'>
333
- ISO 16634:-- (all parts)
334
- <a class='FootnoteRef' href='#fn:1'>
335
- <sup>1</sup>
336
- </a>
337
- ,
338
- <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
339
- </p>
340
- <p id='ISO20483' class='NormRef'>
341
- ISO 20483:2013-2014,
342
- <i>Cereals and pulses</i>
343
- </p>
344
- <p id='ref1' class='NormRef'>
345
- ICC/167,
346
- <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
347
- .
348
- <i>
349
- Determination of the protein content in cereal and cereal products
350
- for food and animal feeding stuffs according to the Dumas combustion
351
- method
352
- </i>
353
- (see
354
- <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
355
- )
356
- </p>
357
- <div class='Note'>
358
- <p>
359
- <span class='note_label'>NOTE</span>
360
- &#160; This is an annotation of ISO 20483:2013-2014
361
- </p>
362
- </div>
363
- <p id='zip_ffs' class='NormRef'>[5], Title 5</p>
364
- </div>
365
- <br/>
366
- <div>
367
- <h1 class='Section3'>Bibliography</h1>
368
- <p id='ISBN' class='Biblio'>
369
- [1]&#160;
370
- <i>Chemicals for analytical laboratory use</i>
371
- </p>
372
- <p id='ISSN' class='Biblio'>
373
- [2]&#160;
374
- <i>Instruments for analytical laboratory use</i>
375
- </p>
376
- <div class='Note'>
377
- <p>
378
- <span class='note_label'>NOTE</span>
379
- &#160; This is an annotation of document ISSN.
380
- </p>
381
- </div>
382
- <div class='Note'>
383
- <p>
384
- <span class='note_label'>NOTE</span>
385
- &#160; This is another annotation of document ISSN.
386
- </p>
387
- </div>
388
- <p id='ISO3696' class='Biblio'>
389
- [3]&#160; ISO 3696,
390
- <i>Water for analytical laboratory use</i>
391
- </p>
392
- <p id='ref10' class='Biblio'>
393
- [10]&#160;
394
- <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
395
- .
396
- <i>
397
- Determination of the protein content in cereal and cereal products
398
- for food and animal feeding stuffs according to the Dumas combustion
399
- method
400
- </i>
401
- (see
402
- <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
403
- )
404
- </p>
405
- <p id='ref11' class='Biblio'>
406
- [5]&#160; IETF RFC 10,
407
- <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
408
- </p>
409
- <p id='ref12' class='Biblio'>
410
- Citn&#160; IETF RFC 20, CitationWorks. 2019.
411
- <i>How to cite a reference</i>
412
- .
413
- </p>
414
- </div>
415
- <aside id='fn:1' class='footnote'>
416
- <p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
417
- </aside>
418
- </div>
419
- </body>
420
- </html>
119
+ </bibliography>
120
+ </iso-standard>
121
+ INPUT
122
+ presxml = <<~PRESXML
123
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
124
+ <bibdata>
125
+ <language current="true">en</language>
126
+ </bibdata>
127
+ <preface>
128
+ <foreword>
129
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
130
+ <eref bibitemid='ISO712'>[110]</eref>
131
+ <eref bibitemid='ISBN'>[1]</eref>
132
+ <eref bibitemid='ISSN'>[2]</eref>
133
+ <eref bibitemid='ISO16634'>ISO 16634:-- (all parts)</eref>
134
+ <eref bibitemid='ref1'>ICC/167</eref>
135
+ <eref bibitemid='ref10'>[10]</eref>
136
+ <eref bibitemid='ref12'>Citn</eref>
137
+ <eref bibitemid='zip_ffs'>[5]</eref>
138
+ </p>
139
+ </foreword>
140
+ </preface>
141
+ <bibliography>
142
+ <references id='_normative_references' obligation='informative' normative='true'>
143
+ <title depth='1'>1.<tab/>Normative References</title>
144
+ <p>
145
+ The following documents are referred to in the text in such a way that
146
+ some or all of their content constitutes requirements of this document.
147
+ For dated references, only the edition cited applies. For undated
148
+ references, the latest edition of the referenced document (including any
149
+ amendments) applies.
150
+ </p>
151
+ <bibitem id='ISO712' type='standard'>
152
+ <title format='text/plain'>Cereals or cereal products</title>
153
+ <title type='main' format='text/plain'>Cereals and cereal products</title>
154
+ <docidentifier type='ISO'>ISO 712</docidentifier>
155
+ <docidentifier type='metanorma'>[110]</docidentifier>
156
+ <contributor>
157
+ <role type='publisher'/>
158
+ <organization>
159
+ <name>International Organization for Standardization</name>
160
+ </organization>
161
+ </contributor>
162
+ </bibitem>
163
+ <bibitem id='ISO16634' type='standard'>
164
+ <title language='x' format='text/plain'>
165
+ Cereals, pulses, milled cereal products, xxxx, oilseeds and animal
166
+ feeding stuffs
167
+ </title>
168
+ <title language='en' format='text/plain'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
169
+ <docidentifier type='ISO'>ISO 16634:-- (all parts)</docidentifier>
170
+ <date type='published'>
171
+ <on>--</on>
172
+ </date>
173
+ <contributor>
174
+ <role type='publisher'/>
175
+ <organization>
176
+ <abbreviation>ISO</abbreviation>
177
+ </organization>
178
+ </contributor>
179
+ <note format='text/plain' type='Unpublished-Status' reference='1'>Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
180
+ <extent type='part'>
181
+ <referenceFrom>all</referenceFrom>
182
+ </extent>
183
+ </bibitem>
184
+ <bibitem id='ISO20483' type='standard'>
185
+ <title format='text/plain'>Cereals and pulses</title>
186
+ <docidentifier type='ISO'>ISO 20483:2013-2014</docidentifier>
187
+ <date type='published'>
188
+ <from>2013</from>
189
+ <to>2014</to>
190
+ </date>
191
+ <contributor>
192
+ <role type='publisher'/>
193
+ <organization>
194
+ <name>International Organization for Standardization</name>
195
+ </organization>
196
+ </contributor>
197
+ </bibitem>
198
+ <bibitem id='ref1'>
199
+ <formattedref format='application/x-isodoc+xml'>
200
+ <smallcap>Standard No I.C.C 167</smallcap>
201
+ .
202
+ <em>
203
+ Determination of the protein content in cereal and cereal products
204
+ for food and animal feeding stuffs according to the Dumas combustion
205
+ method
206
+ </em>
207
+ (see
208
+ <link target='http://www.icc.or.at'/>
209
+ )
210
+ </formattedref>
211
+ <docidentifier type='ICC'>ICC/167</docidentifier>
212
+ </bibitem>
213
+ <note>
214
+ <name>NOTE</name>
215
+ <p>This is an annotation of ISO 20483:2013-2014</p>
216
+ </note>
217
+ <bibitem id='zip_ffs'>
218
+ <formattedref format='application/x-isodoc+xml'>Title 5</formattedref>
219
+ <docidentifier type='metanorma'>[5]</docidentifier>
220
+ </bibitem>
221
+ </references>
222
+ <references id='_bibliography' obligation='informative' normative='false'>
223
+ <title depth="1">Bibliography</title>
224
+ <bibitem id='ISBN' type='ISBN'>
225
+ <title format='text/plain'>Chemicals for analytical laboratory use</title>
226
+ <docidentifier type='ISBN'>ISBN</docidentifier>
227
+ <docidentifier type='metanorma'>[1]</docidentifier>
228
+ <contributor>
229
+ <role type='publisher'/>
230
+ <organization>
231
+ <abbreviation>ISBN</abbreviation>
232
+ </organization>
233
+ </contributor>
234
+ </bibitem>
235
+ <bibitem id='ISSN' type='ISSN'>
236
+ <title format='text/plain'>Instruments for analytical laboratory use</title>
237
+ <docidentifier type='ISSN'>ISSN</docidentifier>
238
+ <docidentifier type='metanorma'>[2]</docidentifier>
239
+ <contributor>
240
+ <role type='publisher'/>
241
+ <organization>
242
+ <abbreviation>ISSN</abbreviation>
243
+ </organization>
244
+ </contributor>
245
+ </bibitem>
246
+ <note>
247
+ <name>NOTE</name>
248
+ <p>This is an annotation of document ISSN.</p>
249
+ </note>
250
+ <note>
251
+ <name>NOTE</name>
252
+ <p>This is another annotation of document ISSN.</p>
253
+ </note>
254
+ <bibitem id='ISO3696' type='standard'>
255
+ <title format='text/plain'>Water for analytical laboratory use</title>
256
+ <docidentifier type='ISO'>ISO 3696</docidentifier>
257
+ <contributor>
258
+ <role type='publisher'/>
259
+ <organization>
260
+ <abbreviation>ISO</abbreviation>
261
+ </organization>
262
+ </contributor>
263
+ </bibitem>
264
+ <bibitem id='ref10'>
265
+ <formattedref format='application/x-isodoc+xml'>
266
+ <smallcap>Standard No I.C.C 167</smallcap>
267
+ .
268
+ <em>
269
+ Determination of the protein content in cereal and cereal products
270
+ for food and animal feeding stuffs according to the Dumas combustion
271
+ method
272
+ </em>
273
+ (see
274
+ <link target='http://www.icc.or.at'/>
275
+ )
276
+ </formattedref>
277
+ <docidentifier type='metanorma'>[10]</docidentifier>
278
+ </bibitem>
279
+ <bibitem id='ref11'>
280
+ <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
281
+ <docidentifier type='IETF'>RFC 10</docidentifier>
282
+ </bibitem>
283
+ <bibitem id='ref12'>
284
+ <formattedref format='application/x-isodoc+xml'>
285
+ CitationWorks. 2019.
286
+ <em>How to cite a reference</em>
287
+ .
288
+ </formattedref>
289
+ <docidentifier type='metanorma'>[Citn]</docidentifier>
290
+ <docidentifier type='IETF'>RFC 20</docidentifier>
291
+ </bibitem>
292
+ </references>
293
+ </bibliography>
294
+ </iso-standard>
295
+ PRESXML
421
296
 
297
+ html = <<~OUTPUT
298
+ #{HTML_HDR}
299
+ <br/>
300
+ <div>
301
+ <h1 class='ForewordTitle'>Foreword</h1>
302
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
303
+ <a href='#ISO712'>[110]</a>
304
+ <a href='#ISBN'>[1]</a>
305
+ <a href='#ISSN'>[2]</a>
306
+ <a href='#ISO16634'>ISO 16634:-- (all parts)</a>
307
+ <a href='#ref1'>ICC/167</a>
308
+ <a href='#ref10'>[10]</a>
309
+ <a href='#ref12'>Citn</a>
310
+ <a href='#zip_ffs'>[5]</a>
311
+ </p>
312
+ </div>
313
+ <p class='zzSTDTitle1'/>
314
+ <div>
315
+ <h1>1.&#160; Normative References</h1>
316
+ <p>
317
+ The following documents are referred to in the text in such a way that
318
+ some or all of their content constitutes requirements of this
319
+ document. For dated references, only the edition cited applies. For
320
+ undated references, the latest edition of the referenced document
321
+ (including any amendments) applies.
322
+ </p>
323
+ <p id='ISO712' class='NormRef'>
324
+ [110], ISO 712,
325
+ <i>Cereals and cereal products</i>
326
+ </p>
327
+ <p id='ISO16634' class='NormRef'>
328
+ ISO 16634:-- (all parts)
329
+ <a class='FootnoteRef' href='#fn:1'>
330
+ <sup>1</sup>
331
+ </a>
332
+ ,
333
+ <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
334
+ </p>
335
+ <p id='ISO20483' class='NormRef'>
336
+ ISO 20483:2013-2014,
337
+ <i>Cereals and pulses</i>
338
+ </p>
339
+ <p id='ref1' class='NormRef'>
340
+ ICC/167,
341
+ <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
342
+ .
343
+ <i>
344
+ Determination of the protein content in cereal and cereal products
345
+ for food and animal feeding stuffs according to the Dumas combustion
346
+ method
347
+ </i>
348
+ (see
349
+ <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
350
+ )
351
+ </p>
352
+ <div class='Note'>
353
+ <p>
354
+ <span class='note_label'>NOTE</span>
355
+ &#160; This is an annotation of ISO 20483:2013-2014
356
+ </p>
357
+ </div>
358
+ <p id='zip_ffs' class='NormRef'>[5], Title 5</p>
359
+ </div>
360
+ <br/>
361
+ <div>
362
+ <h1 class='Section3'>Bibliography</h1>
363
+ <p id='ISBN' class='Biblio'>
364
+ [1]&#160;
365
+ <i>Chemicals for analytical laboratory use</i>
366
+ </p>
367
+ <p id='ISSN' class='Biblio'>
368
+ [2]&#160;
369
+ <i>Instruments for analytical laboratory use</i>
370
+ </p>
371
+ <div class='Note'>
372
+ <p>
373
+ <span class='note_label'>NOTE</span>
374
+ &#160; This is an annotation of document ISSN.
375
+ </p>
376
+ </div>
377
+ <div class='Note'>
378
+ <p>
379
+ <span class='note_label'>NOTE</span>
380
+ &#160; This is another annotation of document ISSN.
381
+ </p>
382
+ </div>
383
+ <p id='ISO3696' class='Biblio'>
384
+ [3]&#160; ISO 3696,
385
+ <i>Water for analytical laboratory use</i>
386
+ </p>
387
+ <p id='ref10' class='Biblio'>
388
+ [10]&#160;
389
+ <span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
390
+ .
391
+ <i>
392
+ Determination of the protein content in cereal and cereal products
393
+ for food and animal feeding stuffs according to the Dumas combustion
394
+ method
395
+ </i>
396
+ (see
397
+ <a href='http://www.icc.or.at'>http://www.icc.or.at</a>
398
+ )
399
+ </p>
400
+ <p id='ref11' class='Biblio'>
401
+ [5]&#160; IETF RFC 10,
402
+ <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
403
+ </p>
404
+ <p id='ref12' class='Biblio'>
405
+ Citn&#160; IETF RFC 20, CitationWorks. 2019.
406
+ <i>How to cite a reference</i>
407
+ .
408
+ </p>
409
+ </div>
410
+ <aside id='fn:1' class='footnote'>
411
+ <p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
412
+ </aside>
413
+ </div>
414
+ </body>
415
+ </html>
416
+ #{' '}
422
417
  OUTPUT
423
- expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
424
- expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
418
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
419
+ .convert("test", input, true)
420
+ .sub(%r{<localized-strings>.*</localized-strings>}m, "")))
421
+ .to be_equivalent_to xmlpp(presxml)
422
+ expect(xmlpp(IsoDoc::HtmlConvert.new({})
423
+ .convert("test", presxml, true)))
424
+ .to be_equivalent_to xmlpp(html)
425
425
  end
426
426
 
427
-
428
- it "processes hidden references sections in Relaton bibliographies" do
427
+ it "processes hidden references sections in Relaton bibliographies" do
429
428
  presxml = <<~PRESXML
430
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
431
- <bibdata>
432
- <language current="true">en</language>
433
- </bibdata>
434
- <preface>
435
- <foreword>
436
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
437
- <eref bibitemid='ISO712'>[110]</eref>
438
- <eref bibitemid='ISBN'>[1]</eref>
439
- <eref bibitemid='ISSN'>[2]</eref>
440
- <eref bibitemid='ISO16634'>ISO 16634:-- (all parts)</eref>
441
- <eref bibitemid='ref1'>ICC/167</eref>
442
- <eref bibitemid='ref10'>[10]</eref>
443
- <eref bibitemid='ref12'>Citn</eref>
444
- <eref bibitemid='zip_ffs'>[5]</eref>
445
- </p>
446
- </foreword>
447
- </preface>
448
- <bibliography>
449
- <references id='_normative_references' obligation='informative' normative='true' hidden="true">
450
- <title depth='1'>1.<tab/>Normative References</title>
451
- <p>
452
- The following documents are referred to in the text in such a way that
453
- some or all of their content constitutes requirements of this document.
454
- For dated references, only the edition cited applies. For undated
455
- references, the latest edition of the referenced document (including any
456
- amendments) applies.
457
- </p>
458
- <bibitem id='ISO712' type='standard'>
459
- <title format='text/plain'>Cereals or cereal products</title>
460
- <title type='main' format='text/plain'>Cereals and cereal products</title>
461
- <docidentifier type='ISO'>ISO 712</docidentifier>
462
- <docidentifier type='metanorma'>[110]</docidentifier>
463
- <contributor>
464
- <role type='publisher'/>
465
- <organization>
466
- <name>International Organization for Standardization</name>
467
- </organization>
468
- </contributor>
469
- </bibitem>
470
- <bibitem id='ISO16634' type='standard'>
471
- <title language='x' format='text/plain'>
472
- Cereals, pulses, milled cereal products, xxxx, oilseeds and animal
473
- feeding stuffs
474
- </title>
475
- <title language='en' format='text/plain'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
476
- <docidentifier type='ISO'>ISO 16634:-- (all parts)</docidentifier>
477
- <date type='published'>
478
- <on>--</on>
479
- </date>
480
- <contributor>
481
- <role type='publisher'/>
482
- <organization>
483
- <abbreviation>ISO</abbreviation>
484
- </organization>
485
- </contributor>
486
- <note format='text/plain' type='Unpublished-Status' reference='1'>Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
487
- <extent type='part'>
488
- <referenceFrom>all</referenceFrom>
489
- </extent>
490
- </bibitem>
491
- <bibitem id='ISO20483' type='standard'>
492
- <title format='text/plain'>Cereals and pulses</title>
493
- <docidentifier type='ISO'>ISO 20483:2013-2014</docidentifier>
494
- <date type='published'>
495
- <from>2013</from>
496
- <to>2014</to>
497
- </date>
498
- <contributor>
499
- <role type='publisher'/>
500
- <organization>
501
- <name>International Organization for Standardization</name>
502
- </organization>
503
- </contributor>
504
- </bibitem>
505
- <bibitem id='ref1'>
506
- <formattedref format='application/x-isodoc+xml'>
507
- <smallcap>Standard No I.C.C 167</smallcap>
508
- .
509
- <em>
510
- Determination of the protein content in cereal and cereal products
511
- for food and animal feeding stuffs according to the Dumas combustion
512
- method
513
- </em>
514
- (see
515
- <link target='http://www.icc.or.at'/>
516
- )
517
- </formattedref>
518
- <docidentifier type='ICC'>ICC/167</docidentifier>
519
- </bibitem>
520
- <note>
521
- <name>NOTE</name>
522
- <p>This is an annotation of ISO 20483:2013-2014</p>
523
- </note>
524
- <bibitem id='zip_ffs'>
525
- <formattedref format='application/x-isodoc+xml'>Title 5</formattedref>
526
- <docidentifier type='metanorma'>[5]</docidentifier>
527
- </bibitem>
528
- </references>
529
- <references id='_bibliography' obligation='informative' normative='false' hidden="true">
530
- <title depth="1">Bibliography</title>
531
- <bibitem id='ISBN' type='ISBN'>
532
- <title format='text/plain'>Chemicals for analytical laboratory use</title>
533
- <docidentifier type='ISBN'>ISBN</docidentifier>
534
- <docidentifier type='metanorma'>[1]</docidentifier>
535
- <contributor>
536
- <role type='publisher'/>
537
- <organization>
538
- <abbreviation>ISBN</abbreviation>
539
- </organization>
540
- </contributor>
541
- </bibitem>
542
- <bibitem id='ISSN' type='ISSN'>
543
- <title format='text/plain'>Instruments for analytical laboratory use</title>
544
- <docidentifier type='ISSN'>ISSN</docidentifier>
545
- <docidentifier type='metanorma'>[2]</docidentifier>
546
- <contributor>
547
- <role type='publisher'/>
548
- <organization>
549
- <abbreviation>ISSN</abbreviation>
550
- </organization>
551
- </contributor>
552
- </bibitem>
553
- <note>
554
- <name>NOTE</name>
555
- <p>This is an annotation of document ISSN.</p>
556
- </note>
557
- <note>
558
- <name>NOTE</name>
559
- <p>This is another annotation of document ISSN.</p>
560
- </note>
561
- <bibitem id='ISO3696' type='standard'>
562
- <title format='text/plain'>Water for analytical laboratory use</title>
563
- <docidentifier type='ISO'>ISO 3696</docidentifier>
564
- <contributor>
565
- <role type='publisher'/>
566
- <organization>
567
- <abbreviation>ISO</abbreviation>
568
- </organization>
569
- </contributor>
570
- </bibitem>
571
- <bibitem id='ref10'>
572
- <formattedref format='application/x-isodoc+xml'>
573
- <smallcap>Standard No I.C.C 167</smallcap>
574
- .
575
- <em>
576
- Determination of the protein content in cereal and cereal products
577
- for food and animal feeding stuffs according to the Dumas combustion
578
- method
579
- </em>
580
- (see
581
- <link target='http://www.icc.or.at'/>
582
- )
583
- </formattedref>
584
- <docidentifier type='metanorma'>[10]</docidentifier>
585
- </bibitem>
586
- <bibitem id='ref11'>
587
- <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
588
- <docidentifier type='IETF'>RFC 10</docidentifier>
589
- </bibitem>
590
- <bibitem id='ref12'>
591
- <formattedref format='application/x-isodoc+xml'>
592
- CitationWorks. 2019.
593
- <em>How to cite a reference</em>
594
- .
595
- </formattedref>
596
- <docidentifier type='metanorma'>[Citn]</docidentifier>
597
- <docidentifier type='IETF'>RFC 20</docidentifier>
598
- </bibitem>
599
- </references>
600
- </bibliography>
601
- </iso-standard>
602
- PRESXML
603
-
604
- html = <<~OUTPUT
605
- #{HTML_HDR}
606
- <br/>
607
- <div>
608
- <h1 class='ForewordTitle'>Foreword</h1>
609
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
610
- <a href='#ISO712'>[110]</a>
611
- <a href='#ISBN'>[1]</a>
612
- <a href='#ISSN'>[2]</a>
613
- <a href='#ISO16634'>ISO 16634:-- (all parts)</a>
614
- <a href='#ref1'>ICC/167</a>
615
- <a href='#ref10'>[10]</a>
616
- <a href='#ref12'>Citn</a>
617
- <a href='#zip_ffs'>[5]</a>
618
- </p>
619
- </div>
620
- <p class='zzSTDTitle1'/>
621
- </div>
622
- </body>
623
- </html>
429
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
430
+ <bibdata>
431
+ <language current="true">en</language>
432
+ </bibdata>
433
+ <preface>
434
+ <foreword>
435
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
436
+ <eref bibitemid='ISO712'>[110]</eref>
437
+ <eref bibitemid='ISBN'>[1]</eref>
438
+ <eref bibitemid='ISSN'>[2]</eref>
439
+ <eref bibitemid='ISO16634'>ISO 16634:-- (all parts)</eref>
440
+ <eref bibitemid='ref1'>ICC/167</eref>
441
+ <eref bibitemid='ref10'>[10]</eref>
442
+ <eref bibitemid='ref12'>Citn</eref>
443
+ <eref bibitemid='zip_ffs'>[5]</eref>
444
+ </p>
445
+ </foreword>
446
+ </preface>
447
+ <bibliography>
448
+ <references id='_normative_references' obligation='informative' normative='true' hidden="true">
449
+ <title depth='1'>1.<tab/>Normative References</title>
450
+ <p>
451
+ The following documents are referred to in the text in such a way that
452
+ some or all of their content constitutes requirements of this document.
453
+ For dated references, only the edition cited applies. For undated
454
+ references, the latest edition of the referenced document (including any
455
+ amendments) applies.
456
+ </p>
457
+ <bibitem id='ISO712' type='standard'>
458
+ <title format='text/plain'>Cereals or cereal products</title>
459
+ <title type='main' format='text/plain'>Cereals and cereal products</title>
460
+ <docidentifier type='ISO'>ISO 712</docidentifier>
461
+ <docidentifier type='metanorma'>[110]</docidentifier>
462
+ <contributor>
463
+ <role type='publisher'/>
464
+ <organization>
465
+ <name>International Organization for Standardization</name>
466
+ </organization>
467
+ </contributor>
468
+ </bibitem>
469
+ <bibitem id='ISO16634' type='standard'>
470
+ <title language='x' format='text/plain'>
471
+ Cereals, pulses, milled cereal products, xxxx, oilseeds and animal
472
+ feeding stuffs
473
+ </title>
474
+ <title language='en' format='text/plain'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
475
+ <docidentifier type='ISO'>ISO 16634:-- (all parts)</docidentifier>
476
+ <date type='published'>
477
+ <on>--</on>
478
+ </date>
479
+ <contributor>
480
+ <role type='publisher'/>
481
+ <organization>
482
+ <abbreviation>ISO</abbreviation>
483
+ </organization>
484
+ </contributor>
485
+ <note format='text/plain' type='Unpublished-Status' reference='1'>Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
486
+ <extent type='part'>
487
+ <referenceFrom>all</referenceFrom>
488
+ </extent>
489
+ </bibitem>
490
+ <bibitem id='ISO20483' type='standard'>
491
+ <title format='text/plain'>Cereals and pulses</title>
492
+ <docidentifier type='ISO'>ISO 20483:2013-2014</docidentifier>
493
+ <date type='published'>
494
+ <from>2013</from>
495
+ <to>2014</to>
496
+ </date>
497
+ <contributor>
498
+ <role type='publisher'/>
499
+ <organization>
500
+ <name>International Organization for Standardization</name>
501
+ </organization>
502
+ </contributor>
503
+ </bibitem>
504
+ <bibitem id='ref1'>
505
+ <formattedref format='application/x-isodoc+xml'>
506
+ <smallcap>Standard No I.C.C 167</smallcap>
507
+ .
508
+ <em>
509
+ Determination of the protein content in cereal and cereal products
510
+ for food and animal feeding stuffs according to the Dumas combustion
511
+ method
512
+ </em>
513
+ (see
514
+ <link target='http://www.icc.or.at'/>
515
+ )
516
+ </formattedref>
517
+ <docidentifier type='ICC'>ICC/167</docidentifier>
518
+ </bibitem>
519
+ <note>
520
+ <name>NOTE</name>
521
+ <p>This is an annotation of ISO 20483:2013-2014</p>
522
+ </note>
523
+ <bibitem id='zip_ffs'>
524
+ <formattedref format='application/x-isodoc+xml'>Title 5</formattedref>
525
+ <docidentifier type='metanorma'>[5]</docidentifier>
526
+ </bibitem>
527
+ </references>
528
+ <references id='_bibliography' obligation='informative' normative='false' hidden="true">
529
+ <title depth="1">Bibliography</title>
530
+ <bibitem id='ISBN' type='ISBN'>
531
+ <title format='text/plain'>Chemicals for analytical laboratory use</title>
532
+ <docidentifier type='ISBN'>ISBN</docidentifier>
533
+ <docidentifier type='metanorma'>[1]</docidentifier>
534
+ <contributor>
535
+ <role type='publisher'/>
536
+ <organization>
537
+ <abbreviation>ISBN</abbreviation>
538
+ </organization>
539
+ </contributor>
540
+ </bibitem>
541
+ <bibitem id='ISSN' type='ISSN'>
542
+ <title format='text/plain'>Instruments for analytical laboratory use</title>
543
+ <docidentifier type='ISSN'>ISSN</docidentifier>
544
+ <docidentifier type='metanorma'>[2]</docidentifier>
545
+ <contributor>
546
+ <role type='publisher'/>
547
+ <organization>
548
+ <abbreviation>ISSN</abbreviation>
549
+ </organization>
550
+ </contributor>
551
+ </bibitem>
552
+ <note>
553
+ <name>NOTE</name>
554
+ <p>This is an annotation of document ISSN.</p>
555
+ </note>
556
+ <note>
557
+ <name>NOTE</name>
558
+ <p>This is another annotation of document ISSN.</p>
559
+ </note>
560
+ <bibitem id='ISO3696' type='standard'>
561
+ <title format='text/plain'>Water for analytical laboratory use</title>
562
+ <docidentifier type='ISO'>ISO 3696</docidentifier>
563
+ <contributor>
564
+ <role type='publisher'/>
565
+ <organization>
566
+ <abbreviation>ISO</abbreviation>
567
+ </organization>
568
+ </contributor>
569
+ </bibitem>
570
+ <bibitem id='ref10'>
571
+ <formattedref format='application/x-isodoc+xml'>
572
+ <smallcap>Standard No I.C.C 167</smallcap>
573
+ .
574
+ <em>
575
+ Determination of the protein content in cereal and cereal products
576
+ for food and animal feeding stuffs according to the Dumas combustion
577
+ method
578
+ </em>
579
+ (see
580
+ <link target='http://www.icc.or.at'/>
581
+ )
582
+ </formattedref>
583
+ <docidentifier type='metanorma'>[10]</docidentifier>
584
+ </bibitem>
585
+ <bibitem id='ref11'>
586
+ <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
587
+ <docidentifier type='IETF'>RFC 10</docidentifier>
588
+ </bibitem>
589
+ <bibitem id='ref12'>
590
+ <formattedref format='application/x-isodoc+xml'>
591
+ CitationWorks. 2019.
592
+ <em>How to cite a reference</em>
593
+ .
594
+ </formattedref>
595
+ <docidentifier type='metanorma'>[Citn]</docidentifier>
596
+ <docidentifier type='IETF'>RFC 20</docidentifier>
597
+ </bibitem>
598
+ </references>
599
+ </bibliography>
600
+ </iso-standard>
601
+ PRESXML
624
602
 
603
+ html = <<~OUTPUT
604
+ #{HTML_HDR}
605
+ <br/>
606
+ <div>
607
+ <h1 class='ForewordTitle'>Foreword</h1>
608
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
609
+ <a href='#ISO712'>[110]</a>
610
+ <a href='#ISBN'>[1]</a>
611
+ <a href='#ISSN'>[2]</a>
612
+ <a href='#ISO16634'>ISO 16634:-- (all parts)</a>
613
+ <a href='#ref1'>ICC/167</a>
614
+ <a href='#ref10'>[10]</a>
615
+ <a href='#ref12'>Citn</a>
616
+ <a href='#zip_ffs'>[5]</a>
617
+ </p>
618
+ </div>
619
+ <p class='zzSTDTitle1'/>
620
+ </div>
621
+ </body>
622
+ </html>
623
+ #{' '}
625
624
  OUTPUT
626
625
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
627
626
  end
628
627
 
629
- it "processes hidden references sections in Relaton bibliographies" do
628
+ it "processes hidden references sections in Relaton bibliographies" do
630
629
  presxml = <<~PRESXML
631
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
632
- <bibdata>
633
- <language current="true">en</language>
634
- </bibdata>
635
- <preface>
636
- <foreword>
637
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
638
- <eref bibitemid='ISO712'>[110]</eref>
639
- <eref bibitemid='ISBN'>[1]</eref>
640
- <eref bibitemid='ISSN'>[2]</eref>
641
- <eref bibitemid='ISO16634'>ISO 16634:-- (all parts)</eref>
642
- <eref bibitemid='ref1'>ICC/167</eref>
643
- <eref bibitemid='ref10'>[10]</eref>
644
- <eref bibitemid='ref12'>Citn</eref>
645
- <eref bibitemid='zip_ffs'>[5]</eref>
646
- </p>
647
- </foreword>
648
- </preface>
649
- <bibliography>
650
- <references id='_normative_references' obligation='informative' normative='true'>
651
- <title depth='1'>1.<tab/>Normative References</title>
630
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
631
+ <bibdata>
632
+ <language current="true">en</language>
633
+ </bibdata>
634
+ <preface>
635
+ <foreword>
636
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
637
+ <eref bibitemid='ISO712'>[110]</eref>
638
+ <eref bibitemid='ISBN'>[1]</eref>
639
+ <eref bibitemid='ISSN'>[2]</eref>
640
+ <eref bibitemid='ISO16634'>ISO 16634:-- (all parts)</eref>
641
+ <eref bibitemid='ref1'>ICC/167</eref>
642
+ <eref bibitemid='ref10'>[10]</eref>
643
+ <eref bibitemid='ref12'>Citn</eref>
644
+ <eref bibitemid='zip_ffs'>[5]</eref>
645
+ </p>
646
+ </foreword>
647
+ </preface>
648
+ <bibliography>
649
+ <references id='_normative_references' obligation='informative' normative='true'>
650
+ <title depth='1'>1.<tab/>Normative References</title>
651
+ <p>
652
+ The following documents are referred to in the text in such a way that
653
+ some or all of their content constitutes requirements of this document.
654
+ For dated references, only the edition cited applies. For undated
655
+ references, the latest edition of the referenced document (including any
656
+ amendments) applies.
657
+ </p>
658
+ <bibitem id='ISO712' type='standard' hidden="true">
659
+ <title format='text/plain'>Cereals or cereal products</title>
660
+ <title type='main' format='text/plain'>Cereals and cereal products</title>
661
+ <docidentifier type='ISO'>ISO 712</docidentifier>
662
+ <docidentifier type='metanorma'>[110]</docidentifier>
663
+ <contributor>
664
+ <role type='publisher'/>
665
+ <organization>
666
+ <name>International Organization for Standardization</name>
667
+ </organization>
668
+ </contributor>
669
+ </bibitem>
670
+ <bibitem id='ISO16634' type='standard'>
671
+ <title language='x' format='text/plain'>
672
+ Cereals, pulses, milled cereal products, xxxx, oilseeds and animal
673
+ feeding stuffs
674
+ </title>
675
+ <title language='en' format='text/plain'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
676
+ <docidentifier type='ISO'>ISO 16634:-- (all parts)</docidentifier>
677
+ <date type='published'>
678
+ <on>--</on>
679
+ </date>
680
+ <contributor>
681
+ <role type='publisher'/>
682
+ <organization>
683
+ <abbreviation>ISO</abbreviation>
684
+ </organization>
685
+ </contributor>
686
+ <note format='text/plain' type='Unpublished-Status' reference='1'>Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
687
+ <extent type='part'>
688
+ <referenceFrom>all</referenceFrom>
689
+ </extent>
690
+ </bibitem>
691
+ </references></bibliography></iso-standard>
692
+ PRESXML
693
+
694
+ html = <<~OUTPUT
695
+ #{HTML_HDR}
696
+ <br/>
697
+ <div>
698
+ <h1 class='ForewordTitle'>Foreword</h1>
699
+ <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
700
+ <a href='#ISO712'>[110]</a>
701
+ <a href='#ISBN'>[1]</a>
702
+ <a href='#ISSN'>[2]</a>
703
+ <a href='#ISO16634'>ISO 16634:-- (all parts)</a>
704
+ <a href='#ref1'>ICC/167</a>
705
+ <a href='#ref10'>[10]</a>
706
+ <a href='#ref12'>Citn</a>
707
+ <a href='#zip_ffs'>[5]</a>
708
+ </p>
709
+ </div>
710
+ <p class='zzSTDTitle1'/>
711
+ <div>
712
+ <h1>1.&#160; Normative References</h1>
652
713
  <p>
653
- The following documents are referred to in the text in such a way that
654
- some or all of their content constitutes requirements of this document.
655
- For dated references, only the edition cited applies. For undated
656
- references, the latest edition of the referenced document (including any
657
- amendments) applies.
714
+ The following documents are referred to in the text in such a way
715
+ that some or all of their content constitutes requirements of this
716
+ document. For dated references, only the edition cited applies. For
717
+ undated references, the latest edition of the referenced document
718
+ (including any amendments) applies.
658
719
  </p>
659
- <bibitem id='ISO712' type='standard' hidden="true">
660
- <title format='text/plain'>Cereals or cereal products</title>
661
- <title type='main' format='text/plain'>Cereals and cereal products</title>
662
- <docidentifier type='ISO'>ISO 712</docidentifier>
663
- <docidentifier type='metanorma'>[110]</docidentifier>
664
- <contributor>
665
- <role type='publisher'/>
666
- <organization>
667
- <name>International Organization for Standardization</name>
668
- </organization>
669
- </contributor>
670
- </bibitem>
671
- <bibitem id='ISO16634' type='standard'>
672
- <title language='x' format='text/plain'>
673
- Cereals, pulses, milled cereal products, xxxx, oilseeds and animal
674
- feeding stuffs
675
- </title>
676
- <title language='en' format='text/plain'>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
677
- <docidentifier type='ISO'>ISO 16634:-- (all parts)</docidentifier>
678
- <date type='published'>
679
- <on>--</on>
680
- </date>
681
- <contributor>
682
- <role type='publisher'/>
683
- <organization>
684
- <abbreviation>ISO</abbreviation>
685
- </organization>
686
- </contributor>
687
- <note format='text/plain' type='Unpublished-Status' reference='1'>Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
688
- <extent type='part'>
689
- <referenceFrom>all</referenceFrom>
690
- </extent>
691
- </bibitem>
692
- </references></bibliography></iso-standard>
693
- PRESXML
694
-
695
- html = <<~OUTPUT
696
- #{HTML_HDR}
697
- <br/>
698
- <div>
699
- <h1 class='ForewordTitle'>Foreword</h1>
700
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
701
- <a href='#ISO712'>[110]</a>
702
- <a href='#ISBN'>[1]</a>
703
- <a href='#ISSN'>[2]</a>
704
- <a href='#ISO16634'>ISO 16634:-- (all parts)</a>
705
- <a href='#ref1'>ICC/167</a>
706
- <a href='#ref10'>[10]</a>
707
- <a href='#ref12'>Citn</a>
708
- <a href='#zip_ffs'>[5]</a>
709
- </p>
710
- </div>
711
- <p class='zzSTDTitle1'/>
712
- <div>
713
- <h1>1.&#160; Normative References</h1>
714
- <p>
715
- The following documents are referred to in the text in such a way
716
- that some or all of their content constitutes requirements of this
717
- document. For dated references, only the edition cited applies. For
718
- undated references, the latest edition of the referenced document
719
- (including any amendments) applies.
720
- </p>
721
- <p id='ISO16634' class='NormRef'>
722
- ISO 16634:-- (all parts)
723
- <a class='FootnoteRef' href='#fn:1'>
724
- <sup>1</sup>
725
- </a>
726
- ,
727
- <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
728
- </p>
729
- </div>
730
- <aside id='fn:1' class='footnote'>
731
- <p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
732
- </aside>
733
-
734
- </div>
735
- </body>
736
- </html>
737
-
720
+ <p id='ISO16634' class='NormRef'>
721
+ ISO 16634:-- (all parts)
722
+ <a class='FootnoteRef' href='#fn:1'>
723
+ <sup>1</sup>
724
+ </a>
725
+ ,
726
+ <i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
727
+ </p>
728
+ </div>
729
+ <aside id='fn:1' class='footnote'>
730
+ <p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
731
+ </aside>
732
+ #{' '}
733
+ </div>
734
+ </body>
735
+ </html>
736
+ #{' '}
738
737
  OUTPUT
739
738
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
740
739
  end
741
-
742
-
743
740
  end
744
-
745
-