metanorma-iso 1.6.1 → 1.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +11 -41
  3. data/.gitignore +2 -0
  4. data/.rubocop.yml +6 -2
  5. data/lib/asciidoctor/iso/base.rb +13 -13
  6. data/lib/asciidoctor/iso/basicdoc.rng +5 -3
  7. data/lib/asciidoctor/iso/biblio.rng +4 -6
  8. data/lib/asciidoctor/iso/cleanup.rb +1 -1
  9. data/lib/asciidoctor/iso/front.rb +6 -6
  10. data/lib/asciidoctor/iso/front_id.rb +30 -25
  11. data/lib/asciidoctor/iso/isodoc.rng +108 -2
  12. data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
  13. data/lib/asciidoctor/iso/isostandard.rng +17 -97
  14. data/lib/asciidoctor/iso/validate.rb +68 -1
  15. data/lib/asciidoctor/iso/validate_title.rb +21 -13
  16. data/lib/isodoc/iso/base_convert.rb +11 -0
  17. data/lib/isodoc/iso/html/header.html +12 -12
  18. data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
  19. data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
  20. data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
  21. data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
  22. data/lib/isodoc/iso/html_convert.rb +2 -2
  23. data/lib/isodoc/iso/i18n-en.yaml +6 -0
  24. data/lib/isodoc/iso/i18n-fr.yaml +4 -0
  25. data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
  26. data/lib/isodoc/iso/index.rb +140 -0
  27. data/lib/isodoc/iso/iso.amendment.xsl +1009 -321
  28. data/lib/isodoc/iso/iso.international-standard.xsl +1009 -321
  29. data/lib/isodoc/iso/presentation_xml_convert.rb +1 -4
  30. data/lib/isodoc/iso/word_convert.rb +2 -2
  31. data/lib/isodoc/iso/xref.rb +5 -0
  32. data/lib/metanorma/iso/version.rb +1 -1
  33. data/metanorma-iso.gemspec +4 -4
  34. data/spec/asciidoctor/amd_spec.rb +696 -0
  35. data/spec/asciidoctor/base_spec.rb +704 -0
  36. data/spec/asciidoctor/blocks_spec.rb +527 -0
  37. data/spec/asciidoctor/cleanup_spec.rb +1134 -0
  38. data/spec/asciidoctor/inline_spec.rb +195 -0
  39. data/spec/asciidoctor/lists_spec.rb +197 -0
  40. data/spec/asciidoctor/refs_spec.rb +375 -0
  41. data/spec/asciidoctor/section_spec.rb +393 -0
  42. data/spec/asciidoctor/table_spec.rb +329 -0
  43. data/spec/asciidoctor/validate_spec.rb +1572 -0
  44. data/spec/isodoc/amd_spec.rb +967 -946
  45. data/spec/isodoc/blocks_spec.rb +530 -507
  46. data/spec/isodoc/i18n_spec.rb +953 -911
  47. data/spec/isodoc/inline_spec.rb +355 -293
  48. data/spec/isodoc/iso_spec.rb +340 -316
  49. data/spec/isodoc/metadata_spec.rb +392 -382
  50. data/spec/isodoc/postproc_spec.rb +834 -656
  51. data/spec/isodoc/ref_spec.rb +374 -331
  52. data/spec/isodoc/section_spec.rb +821 -519
  53. data/spec/isodoc/table_spec.rb +472 -411
  54. data/spec/isodoc/terms_spec.rb +209 -185
  55. data/spec/isodoc/xref_spec.rb +1370 -1236
  56. data/spec/metanorma/processor_spec.rb +28 -26
  57. data/spec/spec_helper.rb +186 -189
  58. metadata +26 -27
  59. data/.rubocop.ribose.yml +0 -66
  60. data/spec/asciidoctor-iso/amd_spec.rb +0 -694
  61. data/spec/asciidoctor-iso/base_spec.rb +0 -713
  62. data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
  63. data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
  64. data/spec/asciidoctor-iso/inline_spec.rb +0 -170
  65. data/spec/asciidoctor-iso/lists_spec.rb +0 -190
  66. data/spec/asciidoctor-iso/refs_spec.rb +0 -317
  67. data/spec/asciidoctor-iso/section_spec.rb +0 -362
  68. data/spec/asciidoctor-iso/table_spec.rb +0 -313
  69. data/spec/asciidoctor-iso/validate_spec.rb +0 -1550
  70. data/spec/assets/xref_error.adoc +0 -7
@@ -2,330 +2,392 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "processes inline formatting" do
5
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <preface><foreword>
8
- <p>
9
- <em>A</em> <strong>B</strong> <sup>C</sup> <sub>D</sub> <tt>E</tt>
10
- <strike>F</strike> <smallcap>G</smallcap> <br/> <hr/>
11
- <bookmark id="H"/> <pagebreak/>
12
- </p>
13
- </foreword></preface>
14
- <sections>
15
- </iso-standard>
5
+ output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <preface>
8
+ <foreword>
9
+ <p>
10
+ <em>A</em>
11
+ <strong>B</strong>
12
+ <sup>C</sup>
13
+ <sub>D</sub>
14
+ <tt>E</tt>
15
+ <strike>F</strike>
16
+ <smallcap>G</smallcap>
17
+ <br/>
18
+ <hr/>
19
+ <bookmark id="H"/>
20
+ <pagebreak/>
21
+ </p>
22
+ </foreword>
23
+ </preface>
24
+ <sections>
25
+ </iso-standard>
16
26
  INPUT
17
- #{HTML_HDR}
18
- <br/>
19
- <div>
20
- <h1 class="ForewordTitle">Foreword</h1>
21
- <p>
22
- <i>A</i> <b>B</b> <sup>C</sup> <sub>D</sub> <tt>E</tt>
23
- <s>F</s> <span style="font-variant:small-caps;">G</span> <br/> <hr/>
24
- <a id="H"/> <br/>
25
- </p>
26
- </div>
27
- <p class="zzSTDTitle1"/>
28
- </div>
29
- </body>
30
- </html>
27
+ expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
28
+ #{HTML_HDR}
29
+ <br/>
30
+ <div>
31
+ <h1 class="ForewordTitle">Foreword</h1>
32
+ <p>
33
+ <i>A</i>
34
+ <b>B</b>
35
+ <sup>C</sup>
36
+ <sub>D</sub>
37
+ <tt>E</tt>
38
+ <s>F</s>
39
+ <span style="font-variant:small-caps;">G</span>
40
+ <br/>
41
+ <hr/>
42
+ <a id="H"/>
43
+ <br/>
44
+ </p>
45
+ </div>
46
+ <p class="zzSTDTitle1"/>
47
+ </div>
48
+ </body>
49
+ </html>
31
50
  OUTPUT
32
51
  end
33
52
 
34
53
  it "processes links" do
35
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
36
- <iso-standard xmlns="http://riboseinc.com/isoxml">
37
- <preface><foreword>
38
- <p>
39
- <link target="http://example.com"/>
40
- <link target="http://example.com">example</link>
41
- <link target="mailto:fred@example.com"/>
42
- <link target="mailto:fred@example.com">mailto:fred@example.com</link>
43
- </p>
44
- </foreword></preface>
45
- <sections>
46
- </iso-standard>
54
+ output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
55
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
56
+ <preface>
57
+ <foreword>
58
+ <p>
59
+ <link target="http://example.com"/>
60
+ <link target="http://example.com">example</link>
61
+ <link target="mailto:fred@example.com"/>
62
+ <link target="mailto:fred@example.com">mailto:fred@example.com</link>
63
+ </p>
64
+ </foreword>
65
+ </preface>
66
+ <sections>
67
+ </iso-standard>
47
68
  INPUT
48
- #{HTML_HDR}
49
- <br/>
50
- <div>
51
- <h1 class="ForewordTitle">Foreword</h1>
52
- <p>
53
- <a href="http://example.com">http://example.com</a>
54
- <a href="http://example.com">example</a>
55
- <a href="mailto:fred@example.com">fred@example.com</a>
56
- <a href="mailto:fred@example.com">mailto:fred@example.com</a>
57
- </p>
58
- </div>
59
- <p class="zzSTDTitle1"/>
60
- </div>
61
- </body>
62
- </html>
69
+ expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
70
+ #{HTML_HDR}
71
+ <br/>
72
+ <div>
73
+ <h1 class="ForewordTitle">Foreword</h1>
74
+ <p>
75
+ <a href="http://example.com">http://example.com</a>
76
+ <a href="http://example.com">example</a>
77
+ <a href="mailto:fred@example.com">fred@example.com</a>
78
+ <a href="mailto:fred@example.com">mailto:fred@example.com</a>
79
+ </p>
80
+ </div>
81
+ <p class="zzSTDTitle1"/>
82
+ </div>
83
+ </body>
84
+ </html>
63
85
  OUTPUT
64
86
  end
65
87
 
66
88
  it "processes unrecognised markup" do
67
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
68
- <iso-standard xmlns="http://riboseinc.com/isoxml">
69
- <preface><foreword>
70
- <p>
71
- <barry fred="http://example.com">example</barry>
72
- </p>
73
- </foreword></preface>
74
- <sections>
75
- </iso-standard>
89
+ output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
90
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
91
+ <preface>
92
+ <foreword>
93
+ <p>
94
+ <barry fred="http://example.com">example</barry>
95
+ </p>
96
+ </foreword>
97
+ </preface>
98
+ <sections>
99
+ </iso-standard>
76
100
  INPUT
77
- #{HTML_HDR}
78
- <br/>
79
- <div>
80
- <h1 class="ForewordTitle">Foreword</h1>
81
- <p>
82
- <para><b role="strong">&lt;barry fred="http://example.com"&gt;example&lt;/barry&gt;</b></para>
83
- </p>
84
- </div>
85
- <p class="zzSTDTitle1"/>
86
- </div>
87
- </body>
88
- </html>
101
+ expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
102
+ #{HTML_HDR}
103
+ <br/>
104
+ <div>
105
+ <h1 class="ForewordTitle">Foreword</h1>
106
+ <p>
107
+ <para>
108
+ <b role="strong">&lt;barry fred=&quot;http://example.com&quot;&gt;example&lt;/barry&gt;</b>
109
+ </para>
110
+ </p>
111
+ </div>
112
+ <p class="zzSTDTitle1"/>
113
+ </div>
114
+ </body>
115
+ </html>
89
116
  OUTPUT
90
117
  end
91
118
 
92
119
  it "processes AsciiMath and MathML" do
93
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true).sub(/<html/, "<html xmlns:m='m'"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
94
- <iso-standard xmlns="http://riboseinc.com/isoxml">
95
- <preface><foreword>
96
- <p>
97
- <stem type="AsciiMath">A</stem>
98
- <stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
99
- <stem type="None">Latex?</stem>
100
- </p>
101
- </foreword></preface>
102
- <sections>
103
- </iso-standard>
120
+ output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
121
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
122
+ <preface>
123
+ <foreword>
124
+ <p>
125
+ <stem type="AsciiMath">A</stem>
126
+ <stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
127
+ <stem type="None">Latex?</stem>
128
+ </p>
129
+ </foreword>
130
+ </preface>
131
+ <sections>
132
+ </iso-standard>
104
133
  INPUT
105
- #{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
106
- <br/>
107
- <div>
108
- <h1 class="ForewordTitle">Foreword</h1>
109
- <p>
110
- <span class="stem">(#(A)#)</span>
111
- <span class="stem"><m:math>
112
- <m:row>X</m:row>
113
- </m:math></span>
114
- <span class="stem">Latex?</span>
115
- </p>
116
- </div>
117
- <p class="zzSTDTitle1"/>
118
- </div>
119
- </body>
120
- </html>
134
+ expect(xmlpp(output.sub(/<html/, "<html xmlns:m='m'"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
135
+ #{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
136
+ <br/>
137
+ <div>
138
+ <h1 class="ForewordTitle">Foreword</h1>
139
+ <p>
140
+ <span class="stem">(#(A)#)</span>
141
+ <span class="stem">
142
+ <m:math>
143
+ <m:row>X</m:row>
144
+ </m:math>
145
+ </span>
146
+ <span class="stem">Latex?</span>
147
+ </p>
148
+ </div>
149
+ <p class="zzSTDTitle1"/>
150
+ </div>
151
+ </body>
152
+ </html>
121
153
  OUTPUT
122
154
  end
123
155
 
124
156
  it "overrides AsciiMath delimiters" do
125
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
126
- <iso-standard xmlns="http://riboseinc.com/isoxml">
127
- <preface><foreword>
128
- <p>
129
- <stem type="AsciiMath">A</stem>
130
- (#((Hello))#)
131
- </p>
132
- </foreword></preface>
133
- <sections>
134
- </iso-standard>
157
+ output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
158
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
159
+ <preface>
160
+ <foreword>
161
+ <p><stem type="AsciiMath">A</stem>(#((Hello))#)</p>
162
+ </foreword>
163
+ </preface>
164
+ <sections>
165
+ </iso-standard>
135
166
  INPUT
136
- #{HTML_HDR}
137
- <br/>
138
- <div>
139
- <h1 class="ForewordTitle">Foreword</h1>
140
- <p>
141
- <span class="stem">(#(((A)#)))</span>
142
- (#((Hello))#)
143
- </p>
144
- </div>
145
- <p class="zzSTDTitle1"/>
146
- </div>
147
- </body>
148
- </html>
167
+ expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
168
+ #{HTML_HDR}
169
+ <br/>
170
+ <div>
171
+ <h1 class="ForewordTitle">Foreword</h1>
172
+ <p>
173
+ <span class="stem">(#(((A)#)))</span>
174
+ (#((Hello))#)
175
+ </p>
176
+ </div>
177
+ <p class="zzSTDTitle1"/>
178
+ </div>
179
+ </body>
180
+ </html>
149
181
  OUTPUT
150
182
  end
151
183
 
152
184
  it "processes eref types" do
153
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
154
- <iso-standard xmlns="http://riboseinc.com/isoxml">
155
- <preface><foreword>
156
- <p>
157
- <eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
158
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
159
- </p>
160
- </foreword></preface>
161
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>1<tab/>Normative references</title>
162
- <bibitem id="ISO712" type="standard">
163
- <title format="text/plain">Cereals and cereal products</title>
164
- <docidentifier>ISO 712</docidentifier>
165
- <contributor>
166
- <role type="publisher"/>
167
- <organization>
168
- <abbreviation>ISO</abbreviation>
169
- </organization>
170
- </contributor>
171
- </bibitem>
172
- </references>
173
- </bibliography>
174
- </iso-standard>
185
+ output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
186
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
187
+ <preface>
188
+ <foreword>
189
+ <p>
190
+ <eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
191
+ <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
192
+ </p>
193
+ </foreword>
194
+ </preface>
195
+ <bibliography>
196
+ <references id="_normative_references" normative="true" obligation="informative">
197
+ <title>1<tab/>
198
+ Normative references</title>
199
+ <bibitem id="ISO712" type="standard">
200
+ <title format="text/plain">Cereals and cereal products</title>
201
+ <docidentifier>ISO 712</docidentifier>
202
+ <contributor>
203
+ <role type="publisher"/>
204
+ <organization>
205
+ <abbreviation>ISO</abbreviation>
206
+ </organization>
207
+ </contributor>
208
+ </bibitem>
209
+ </references>
210
+ </bibliography>
211
+ </iso-standard>
175
212
  INPUT
176
- #{HTML_HDR}
177
- <br/>
178
- <div>
179
- <h1 class="ForewordTitle">Foreword</h1>
180
- <p>
181
- <sup><a href="#ISO712">A</a></sup>
182
- <a href="#ISO712">A</a>
183
- </p>
184
- </div>
185
- <p class="zzSTDTitle1"/>
186
- <div>
187
- <h1>1&#160; Normative references</h1>
188
- <p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
189
- </div>
190
- </div>
191
- </body>
192
- </html>
213
+ expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
214
+ #{HTML_HDR}
215
+ <br/>
216
+ <div>
217
+ <h1 class="ForewordTitle">Foreword</h1>
218
+ <p>
219
+ <sup><a href="#ISO712">A</a></sup>
220
+ <a href="#ISO712">A</a>
221
+ </p>
222
+ </div>
223
+ <p class="zzSTDTitle1"/>
224
+ <div>
225
+ <h1>1&#160; Normative references</h1>
226
+ <p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
227
+ </div>
228
+ </div>
229
+ </body>
230
+ </html>
193
231
  OUTPUT
194
232
  end
195
233
 
196
234
  it "processes eref content" do
197
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)).sub(%r{<i18nyaml>.*</i18nyaml>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
198
- <iso-standard xmlns="http://riboseinc.com/isoxml">
199
- <preface><foreword>
200
- <p>
201
- <eref type="inline" bibitemid="IEV" citeas="IEV"><locality type="clause"><referenceFrom>1-2-3</referenceFrom></locality></eref>
202
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
203
- <eref type="inline" bibitemid="ISO712"/>
204
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
205
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
206
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
207
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="list"><referenceFrom>a</referenceFrom></locality></eref>
208
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
209
- <eref type="inline" bibitemid="ISO712"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
210
- <eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
211
- <eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
212
- <eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
213
- <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
214
- </p>
215
- </foreword></preface>
216
- <bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
217
- <bibitem id="ISO712" type="standard">
218
- <title format="text/plain">Cereals and cereal products</title>
219
- <docidentifier>ISO 712</docidentifier>
220
- <contributor>
221
- <role type="publisher"/>
222
- <organization>
223
- <abbreviation>ISO</abbreviation>
224
- </organization>
225
- </contributor>
226
- </bibitem>
227
- </references>
228
- </bibliography>
229
- </iso-standard>
235
+ output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
236
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
237
+ <preface>
238
+ <foreword>
239
+ <p>
240
+ <eref bibitemid="IEV" citeas="IEV" type="inline">
241
+ <locality type="clause">
242
+ <referenceFrom>1-2-3</referenceFrom>
243
+ </locality>
244
+ </eref>
245
+ <eref bibitemid="ISO712" citeas="ISO 712" type="inline"/>
246
+ <eref bibitemid="ISO712" type="inline"/>
247
+ <eref bibitemid="ISO712" type="inline">
248
+ <locality type="table">
249
+ <referenceFrom>1</referenceFrom>
250
+ </locality>
251
+ </eref>
252
+ <eref bibitemid="ISO712" type="inline">
253
+ <locality type="table">
254
+ <referenceFrom>1</referenceFrom>
255
+ <referenceTo>1</referenceTo>
256
+ </locality>
257
+ </eref>
258
+ <eref bibitemid="ISO712" type="inline">
259
+ <locality type="clause">
260
+ <referenceFrom>1</referenceFrom>
261
+ </locality>
262
+ <locality type="table">
263
+ <referenceFrom>1</referenceFrom>
264
+ </locality>
265
+ </eref>
266
+ <eref bibitemid="ISO712" type="inline">
267
+ <locality type="clause">
268
+ <referenceFrom>1</referenceFrom>
269
+ </locality>
270
+ <locality type="list">
271
+ <referenceFrom>a</referenceFrom>
272
+ </locality>
273
+ </eref>
274
+ <eref bibitemid="ISO712" type="inline">
275
+ <locality type="clause">
276
+ <referenceFrom>1</referenceFrom>
277
+ </locality>
278
+ </eref>
279
+ <eref bibitemid="ISO712" type="inline">
280
+ <locality type="clause">
281
+ <referenceFrom>1.5</referenceFrom>
282
+ </locality>
283
+ </eref>
284
+ <eref bibitemid="ISO712" type="inline">
285
+ <locality type="table">
286
+ <referenceFrom>1</referenceFrom>
287
+ </locality>A</eref>
288
+ <eref bibitemid="ISO712" type="inline">
289
+ <locality type="whole"/>
290
+ </eref>
291
+ <eref bibitemid="ISO712" type="inline">
292
+ <locality type="locality:prelude">
293
+ <referenceFrom>7</referenceFrom>
294
+ </locality>
295
+ </eref>
296
+ <eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
297
+ </p>
298
+ </foreword>
299
+ </preface>
300
+ <bibliography>
301
+ <references id="_normative_references" normative="true" obligation="informative">
302
+ <title>Normative References</title>
303
+ <bibitem id="ISO712" type="standard">
304
+ <title format="text/plain">Cereals and cereal products</title>
305
+ <docidentifier>ISO 712</docidentifier>
306
+ <contributor>
307
+ <role type="publisher"/>
308
+ <organization>
309
+ <abbreviation>ISO</abbreviation>
310
+ </organization>
311
+ </contributor>
312
+ </bibitem>
313
+ </references>
314
+ </bibliography>
315
+ </iso-standard>
230
316
  INPUT
231
- <?xml version='1.0'?>
232
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
233
- <preface>
234
- <foreword>
235
- <p>
236
- <eref type='inline' bibitemid='IEV' citeas='IEV'>
237
- <locality type='clause'>
238
- <referenceFrom>1-2-3</referenceFrom>
239
- </locality>
240
- IEV, 1-2-3
241
- </eref>
242
- <eref type='inline' bibitemid='ISO712' citeas='ISO 712'>ISO 712</eref>
243
- <eref type='inline' bibitemid='ISO712'>ISO 712</eref>
244
- <eref type='inline' bibitemid='ISO712'>
245
- <locality type='table'>
246
- <referenceFrom>1</referenceFrom>
247
- </locality>
248
- ISO 712, Table 1
249
- </eref>
250
- <eref type='inline' bibitemid='ISO712'>
251
- <locality type='table'>
252
- <referenceFrom>1</referenceFrom>
253
- <referenceTo>1</referenceTo>
254
- </locality>
255
- ISO 712, Table 1&#x2013;1
256
- </eref>
257
- <eref type='inline' bibitemid='ISO712'>
258
- <locality type='clause'>
259
- <referenceFrom>1</referenceFrom>
260
- </locality>
261
- <locality type='table'>
262
- <referenceFrom>1</referenceFrom>
263
- </locality>
264
- ISO 712, Clause 1, Table 1
265
- </eref>
266
- <eref type='inline' bibitemid='ISO712'>
267
- <locality type='clause'>
268
- <referenceFrom>1</referenceFrom>
269
- </locality>
270
- <locality type='list'>
271
- <referenceFrom>a</referenceFrom>
272
- </locality>
273
- ISO 712, Clause 1 a)
274
- </eref>
275
- <eref type='inline' bibitemid='ISO712'>
276
- <locality type='clause'>
277
- <referenceFrom>1</referenceFrom>
278
- </locality>
279
- ISO 712, Clause 1
280
- </eref>
281
- <eref type='inline' bibitemid='ISO712'>
282
- <locality type='clause'>
283
- <referenceFrom>1.5</referenceFrom>
284
- </locality>
285
- ISO 712, 1.5
286
- </eref>
287
- <eref type='inline' bibitemid='ISO712'>
288
- <locality type='table'>
289
- <referenceFrom>1</referenceFrom>
290
- </locality>
291
- A
292
- </eref>
293
- <eref type='inline' bibitemid='ISO712'>
294
- <locality type='whole'/>
295
- ISO 712, Whole of text
296
- </eref>
297
- <eref type='inline' bibitemid='ISO712'>
298
- <locality type='locality:prelude'>
299
- <referenceFrom>7</referenceFrom>
300
- </locality>
301
- ISO 712, Prelude 7
302
- </eref>
303
- <eref type='inline' bibitemid='ISO712' citeas='ISO 712'>A</eref>
304
- </p>
305
- </foreword>
306
- </preface>
307
- <bibliography>
308
- <references id='_normative_references' obligation='informative' normative='true'>
309
- <title depth='1'>
310
- 1
311
- <tab/>
312
- Normative References
313
- </title>
314
- <bibitem id='ISO712' type='standard'>
315
- <title format='text/plain'>Cereals and cereal products</title>
316
- <docidentifier>ISO 712</docidentifier>
317
- <contributor>
318
- <role type='publisher'/>
319
- <organization>
320
- <abbreviation>ISO</abbreviation>
321
- </organization>
322
- </contributor>
323
- </bibitem>
324
- </references>
325
- </bibliography>
326
- </iso-standard>
317
+ expect(xmlpp(output).sub(%r{<i18nyaml>.*</i18nyaml>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
318
+ <?xml version='1.0'?>
319
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
320
+ <preface>
321
+ <foreword>
322
+ <p>
323
+ <eref bibitemid="IEV" citeas="IEV" type="inline">
324
+ <locality type="clause">
325
+ <referenceFrom>1-2-3</referenceFrom>
326
+ </locality>IEV, 1-2-3</eref>
327
+ <eref bibitemid="ISO712" citeas="ISO 712" type="inline">ISO 712</eref>
328
+ <eref bibitemid="ISO712" type="inline">ISO 712</eref>
329
+ <eref bibitemid="ISO712" type="inline">
330
+ <locality type="table">
331
+ <referenceFrom>1</referenceFrom>
332
+ </locality>ISO 712, Table 1</eref>
333
+ <eref bibitemid="ISO712" type="inline">
334
+ <locality type="table">
335
+ <referenceFrom>1</referenceFrom>
336
+ <referenceTo>1</referenceTo>
337
+ </locality>ISO 712, Table 1–1</eref>
338
+ <eref bibitemid="ISO712" type="inline">
339
+ <locality type="clause">
340
+ <referenceFrom>1</referenceFrom>
341
+ </locality>
342
+ <locality type="table">
343
+ <referenceFrom>1</referenceFrom>
344
+ </locality>ISO 712, Clause 1, Table 1</eref>
345
+ <eref bibitemid="ISO712" type="inline">
346
+ <locality type="clause">
347
+ <referenceFrom>1</referenceFrom>
348
+ </locality>
349
+ <locality type="list">
350
+ <referenceFrom>a</referenceFrom>
351
+ </locality>ISO 712, Clause 1 a)</eref>
352
+ <eref bibitemid="ISO712" type="inline">
353
+ <locality type="clause">
354
+ <referenceFrom>1</referenceFrom>
355
+ </locality>ISO 712, Clause 1</eref>
356
+ <eref bibitemid="ISO712" type="inline">
357
+ <locality type="clause">
358
+ <referenceFrom>1.5</referenceFrom>
359
+ </locality>ISO 712, 1.5</eref>
360
+ <eref bibitemid="ISO712" type="inline">
361
+ <locality type="table">
362
+ <referenceFrom>1</referenceFrom>
363
+ </locality>A</eref>
364
+ <eref bibitemid="ISO712" type="inline">
365
+ <locality type="whole"/>ISO 712, Whole of text</eref>
366
+ <eref bibitemid="ISO712" type="inline">
367
+ <locality type="locality:prelude">
368
+ <referenceFrom>7</referenceFrom>
369
+ </locality>ISO 712, Prelude 7</eref>
370
+ <eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
371
+ </p>
372
+ </foreword>
373
+ </preface>
374
+ <bibliography>
375
+ <references id="_normative_references" normative="true" obligation="informative">
376
+ <title depth="1">1<tab/>
377
+ Normative References</title>
378
+ <bibitem id="ISO712" type="standard">
379
+ <title format="text/plain">Cereals and cereal products</title>
380
+ <docidentifier>ISO 712</docidentifier>
381
+ <contributor>
382
+ <role type="publisher"/>
383
+ <organization>
384
+ <abbreviation>ISO</abbreviation>
385
+ </organization>
386
+ </contributor>
387
+ </bibitem>
388
+ </references>
389
+ </bibliography>
390
+ </iso-standard>
327
391
  OUTPUT
328
392
  end
329
-
330
-
331
393
  end