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,981 +2,1002 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "cross-references notes in amendments" do
5
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
- <iso-standard xmlns="http://riboseinc.com/isoxml">
7
- <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
8
- <preface>
9
- <foreword>
10
- <p>
11
- <xref target="N"/>
12
- <xref target="note1"/>
13
- <xref target="note2"/>
14
- <xref target="AN"/>
15
- <xref target="Anote1"/>
16
- <xref target="Anote2"/>
17
- </p>
18
- </foreword>
19
- </preface>
20
- <sections>
21
- <clause id="scope"><title>Scope</title>
22
- <note id="N">
23
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
24
- </note>
25
- <p><xref target="N"/></p>
26
-
27
- </clause>
28
- <terms id="terms"/>
29
- <clause id="widgets"><title>Widgets</title>
30
- <clause id="widgets1">
31
- <note id="note1">
32
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
33
- </note>
34
- <note id="note2">
35
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
36
- </note>
37
- <p> <xref target="note1"/> <xref target="note2"/> </p>
38
-
39
- </clause>
40
- </clause>
41
- </sections>
42
- <annex id="annex1">
43
- <clause id="annex1a">
44
- <note id="AN">
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
- </clause>
48
- <clause id="annex1b">
49
- <note id="Anote1">
50
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
51
- </note>
52
- <note id="Anote2">
53
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
54
- </note>
55
- </clause>
56
- </annex>
57
- </iso-standard>
5
+ output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <bibdata>
8
+ <ext>
9
+ <doctype>amendment</doctype>
10
+ </ext>
11
+ </bibdata>
12
+ <preface>
13
+ <foreword>
14
+ <p>
15
+ <xref target="N"/>
16
+ <xref target="note1"/>
17
+ <xref target="note2"/>
18
+ <xref target="AN"/>
19
+ <xref target="Anote1"/>
20
+ <xref target="Anote2"/>
21
+ </p>
22
+ </foreword>
23
+ </preface>
24
+ <sections>
25
+ <clause id="scope">
26
+ <title>Scope</title>
27
+ <note id="N">
28
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
29
+ </note>
30
+ <p>
31
+ <xref target="N"/>
32
+ </p>
33
+ </clause>
34
+ <terms id="terms"/>
35
+ <clause id="widgets">
36
+ <title>Widgets</title>
37
+ <clause id="widgets1">
38
+ <note id="note1">
39
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
40
+ </note>
41
+ <note id="note2">
42
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
43
+ </note>
44
+ <p>
45
+ <xref target="note1"/>
46
+ <xref target="note2"/>
47
+ </p>
48
+ </clause>
49
+ </clause>
50
+ </sections>
51
+ <annex id="annex1">
52
+ <clause id="annex1a">
53
+ <note id="AN">
54
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
55
+ </note>
56
+ </clause>
57
+ <clause id="annex1b">
58
+ <note id="Anote1">
59
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
60
+ </note>
61
+ <note id="Anote2">
62
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
63
+ </note>
64
+ </clause>
65
+ </annex>
66
+ </iso-standard>
58
67
  INPUT
59
- <?xml version='1.0'?>
60
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
61
- <bibdata>
62
- <ext>
63
- <doctype language="">amendment</doctype>
64
- </ext>
65
- </bibdata>
66
- <preface>
67
- <foreword>
68
- <p>
69
- <xref target='N'>Scope, Note</xref>
70
- <xref target='note1'>Widgets, 1, Note 1</xref>
71
- <xref target='note2'>Widgets, 1, Note 2</xref>
72
- <xref target='AN'>A.1, Note</xref>
73
- <xref target='Anote1'>A.2, Note 1</xref>
74
- <xref target='Anote2'>A.2, Note 2</xref>
75
- </p>
76
- </foreword>
77
- </preface>
78
- <sections>
79
- <clause id='scope'>
80
- <title depth="1">Scope</title>
81
- <note id='N'>
82
- <name>NOTE</name>
83
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
84
- These results are based on a study carried out on three different
85
- types of kernel.
86
- </p>
87
- </note>
88
- <p>
89
- <xref target='N'>Note</xref>
90
- </p>
91
- </clause>
92
- <terms id='terms'/>
93
- <clause id='widgets'>
94
- <title depth="1">Widgets</title>
95
- <clause id='widgets1' inline-header="true">
96
- <note id='note1'>
97
- <name>NOTE 1</name>
98
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
99
- These results are based on a study carried out on three different
100
- types of kernel.
101
- </p>
102
- </note>
103
- <note id='note2'>
104
- <name>NOTE 2</name>
105
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
106
- These results are based on a study carried out on three different
107
- types of kernel.
108
- </p>
109
- </note>
110
- <p>
111
- <xref target='note1'>Note 1</xref>
112
- <xref target='note2'>Note 2</xref>
113
- </p>
114
- </clause>
115
- </clause>
116
- </sections>
117
- <annex id='annex1'>
118
- <title>
119
- <strong>Annex A</strong>
120
- <br/>
121
- (informative)
122
- </title>
123
- <clause id='annex1a' inline-header='true'>
124
- <title>A.1</title>
125
- <note id='AN'>
126
- <name>NOTE</name>
127
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
128
- These results are based on a study carried out on three different
129
- types of kernel.
130
- </p>
131
- </note>
132
- </clause>
133
- <clause id='annex1b' inline-header="true">
134
- <title>A.2</title>
135
- <note id='Anote1'>
136
- <name>NOTE 1</name>
137
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
138
- These results are based on a study carried out on three different
139
- types of kernel.
140
- </p>
141
- </note>
142
- <note id='Anote2'>
143
- <name>NOTE 2</name>
144
- <p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a'>
145
- These results are based on a study carried out on three different
146
- types of kernel.
147
- </p>
148
- </note>
149
- </clause>
150
- </annex>
151
- </iso-standard>
152
- OUTPUT
68
+ expect(xmlpp(output).sub(%r{<localized-strings>.*</localized-strings>}m, ""))
69
+ .to be_equivalent_to xmlpp(<<~"OUTPUT")
70
+ <?xml version='1.0'?>
71
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
72
+ <bibdata>
73
+ <ext>
74
+ <doctype language="">amendment</doctype>
75
+ </ext>
76
+ </bibdata>
77
+ <preface>
78
+ <foreword>
79
+ <p>
80
+ <xref target="N">Scope, Note</xref>
81
+ <xref target="note1">Widgets, 1, Note 1</xref>
82
+ <xref target="note2">Widgets, 1, Note 2</xref>
83
+ <xref target="AN">A.1, Note</xref>
84
+ <xref target="Anote1">A.2, Note 1</xref>
85
+ <xref target="Anote2">A.2, Note 2</xref>
86
+ </p>
87
+ </foreword>
88
+ </preface>
89
+ <sections>
90
+ <clause id="scope">
91
+ <title depth="1">Scope</title>
92
+ <note id="N">
93
+ <name>NOTE</name>
94
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
95
+ types of kernel.
96
+ </p>
97
+ </note>
98
+ <p>
99
+ <xref target="N">Note</xref>
100
+ </p>
101
+ </clause>
102
+ <terms id="terms"/>
103
+ <clause id="widgets">
104
+ <title depth="1">Widgets</title>
105
+ <clause id="widgets1" inline-header="true">
106
+ <note id="note1">
107
+ <name>NOTE 1</name>
108
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
109
+ types of kernel.
110
+ </p>
111
+ </note>
112
+ <note id="note2">
113
+ <name>NOTE 2</name>
114
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
115
+ types of kernel.
116
+ </p>
117
+ </note>
118
+ <p>
119
+ <xref target="note1">Note 1</xref>
120
+ <xref target="note2">Note 2</xref>
121
+ </p>
122
+ </clause>
123
+ </clause>
124
+ </sections>
125
+ <annex id="annex1">
126
+ <title>
127
+ <strong>Annex A</strong>
128
+ <br/>(informative)</title>
129
+ <clause id="annex1a" inline-header="true">
130
+ <title>A.1</title>
131
+ <note id="AN">
132
+ <name>NOTE</name>
133
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
134
+ types of kernel.
135
+ </p>
136
+ </note>
137
+ </clause>
138
+ <clause id="annex1b" inline-header="true">
139
+ <title>A.2</title>
140
+ <note id="Anote1">
141
+ <name>NOTE 1</name>
142
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
143
+ types of kernel.
144
+ </p>
145
+ </note>
146
+ <note id="Anote2">
147
+ <name>NOTE 2</name>
148
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
149
+ types of kernel.
150
+ </p>
151
+ </note>
152
+ </clause>
153
+ </annex>
154
+ </iso-standard>
155
+ OUTPUT
153
156
  end
154
157
 
155
158
  it "cross-references sections" do
156
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
159
+ output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
157
160
  <iso-standard xmlns="http://riboseinc.com/isoxml">
158
- <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
159
- <preface>
160
- <foreword obligation="informative">
161
- <title>Foreword</title>
162
- <p id="A">This is a preamble
163
- <xref target="C"/>
164
- <xref target="C1"/>
165
- <xref target="D"/>
166
- <xref target="H"/>
167
- <xref target="I"/>
168
- <xref target="J"/>
169
- <xref target="K"/>
170
- <xref target="L"/>
171
- <xref target="M"/>
172
- <xref target="N"/>
173
- <xref target="O"/>
174
- <xref target="P"/>
175
- <xref target="Q"/>
176
- <xref target="Q1"/>
177
- <xref target="Q2"/>
178
- <xref target="R"/>
179
- </p>
180
- </foreword>
181
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
182
- <title>Introduction Subsection</title>
183
- </clause>
184
- <clause id="C1" inline-header="false" obligation="informative">Text</clause>
185
- </introduction></preface><sections>
186
- <clause id="D" obligation="normative" type="scope">
187
- <title>Scope</title>
188
- <p id="E">Text</p>
189
- </clause>
161
+ <bibdata>
162
+ <ext>
163
+ <doctype>amendment</doctype>
164
+ </ext>
165
+ </bibdata>
166
+ <preface>
167
+ <foreword obligation="informative">
168
+ <title>Foreword</title>
169
+ <p id="A">This is a preamble
190
170
 
191
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
192
- <title>Introduction</title>
193
- </clause>
194
- <clause id="O" inline-header="false" obligation="normative">
195
- <title>Clause 4.2</title>
196
- </clause></clause>
197
-
198
- </sections><annex id="P" inline-header="false" obligation="normative">
199
- <title>Annex</title>
200
- <clause id="Q" inline-header="false" obligation="normative">
201
- <title>Annex A.1</title>
202
- <clause id="Q1" inline-header="false" obligation="normative">
203
- <title>Annex A.1a</title>
204
- </clause>
205
- </clause>
206
- <appendix id="Q2" inline-header="false" obligation="normative">
207
- <title>An Appendix</title>
208
- </appendix>
209
- </annex><bibliography><references id="R" obligation="informative" normative="true">
210
- <title>Normative References</title>
211
- </references><clause id="S" obligation="informative">
212
- <title>Bibliography</title>
213
- <references id="T" obligation="informative" normative="false">
214
- <title>Bibliography Subsection</title>
215
- </references>
216
- </clause>
217
- </bibliography>
218
- </iso-standard>
171
+ <xref target="C"/>
172
+ <xref target="C1"/>
173
+ <xref target="D"/>
174
+ <xref target="H"/>
175
+ <xref target="I"/>
176
+ <xref target="J"/>
177
+ <xref target="K"/>
178
+ <xref target="L"/>
179
+ <xref target="M"/>
180
+ <xref target="N"/>
181
+ <xref target="O"/>
182
+ <xref target="P"/>
183
+ <xref target="Q"/>
184
+ <xref target="Q1"/>
185
+ <xref target="Q2"/>
186
+ <xref target="R"/></p>
187
+ </foreword>
188
+ <introduction id="B" obligation="informative">
189
+ <title>Introduction</title>
190
+ <clause id="C" inline-header="false" obligation="informative">
191
+ <title>Introduction Subsection</title>
192
+ </clause>
193
+ <clause id="C1" inline-header="false" obligation="informative">Text</clause>
194
+ </introduction>
195
+ </preface>
196
+ <sections>
197
+ <clause id="D" obligation="normative" type="scope">
198
+ <title>Scope</title>
199
+ <p id="E">Text</p>
200
+ </clause>
201
+ <clause id="M" inline-header="false" obligation="normative">
202
+ <title>Clause 4</title>
203
+ <clause id="N" inline-header="false" obligation="normative">
204
+ <title>Introduction</title>
205
+ </clause>
206
+ <clause id="O" inline-header="false" obligation="normative">
207
+ <title>Clause 4.2</title>
208
+ </clause>
209
+ </clause>
210
+ </sections>
211
+ <annex id="P" inline-header="false" obligation="normative">
212
+ <title>Annex</title>
213
+ <clause id="Q" inline-header="false" obligation="normative">
214
+ <title>Annex A.1</title>
215
+ <clause id="Q1" inline-header="false" obligation="normative">
216
+ <title>Annex A.1a</title>
217
+ </clause>
218
+ </clause>
219
+ <appendix id="Q2" inline-header="false" obligation="normative">
220
+ <title>An Appendix</title>
221
+ </appendix>
222
+ </annex>
223
+ <bibliography>
224
+ <references id="R" normative="true" obligation="informative">
225
+ <title>Normative References</title>
226
+ </references>
227
+ <clause id="S" obligation="informative">
228
+ <title>Bibliography</title>
229
+ <references id="T" normative="false" obligation="informative">
230
+ <title>Bibliography Subsection</title>
231
+ </references>
232
+ </clause>
233
+ </bibliography>
234
+ </iso-standard>
219
235
  INPUT
220
- <?xml version='1.0'?>
221
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
222
- <bibdata>
223
- <ext>
224
- <doctype language="">amendment</doctype>
225
- </ext>
226
- </bibdata>
227
- <preface>
228
- <foreword obligation='informative'>
229
- <title>Foreword</title>
230
- <p id='A'>
231
- This is a preamble
232
- <xref target='C'>0.1</xref>
233
- <xref target='C1'>0.2</xref>
234
- <xref target='D'>Scope</xref>
235
- <xref target='H'>[H]</xref>
236
- <xref target='I'>[I]</xref>
237
- <xref target='J'>[J]</xref>
238
- <xref target='K'>[K]</xref>
239
- <xref target='L'>[L]</xref>
240
- <xref target='M'>Clause 4</xref>
241
- <xref target='N'>Introduction</xref>
242
- <xref target='O'>Clause 4.2</xref>
243
- <xref target='P'>Annex A</xref>
244
- <xref target='Q'>A.1</xref>
245
- <xref target='Q1'>A.1.1</xref>
246
- <xref target='Q2'>Annex A, Appendix 1</xref>
247
- <xref target='R'>[R]</xref>
248
- </p>
249
- </foreword>
250
- <introduction id='B' obligation='informative'>
251
- <title depth="1">Introduction</title>
252
- <clause id='C' inline-header='false' obligation='informative'>
253
- <title depth="2">Introduction Subsection</title>
254
- </clause>
255
- <clause id='C1' inline-header='true' obligation='informative'>Text</clause>
256
- </introduction>
257
- </preface>
258
- <sections>
259
- <clause id='D' obligation='normative' type="scope">
260
- <title depth="1">Scope</title>
261
- <p id='E'>Text</p>
262
- </clause>
263
- <clause id='M' inline-header='false' obligation='normative'>
264
- <title depth="1">Clause 4</title>
265
- <clause id='N' inline-header='false' obligation='normative'>
266
- <title depth="2">Introduction</title>
267
- </clause>
268
- <clause id='O' inline-header='false' obligation='normative'>
269
- <title depth="2">Clause 4.2</title>
270
- </clause>
271
- </clause>
272
- </sections>
273
- <annex id='P' inline-header='false' obligation='normative'>
274
- <title>
275
- <strong>Annex A</strong>
276
- <br/>
277
- (normative)
278
- <br/>
279
- <br/>
280
- <strong>Annex</strong>
281
- </title>
282
- <clause id='Q' inline-header='false' obligation='normative'>
283
- <title depth='2'>
284
- A.1
285
- <tab/>
286
- Annex A.1
287
- </title>
288
- <clause id='Q1' inline-header='false' obligation='normative'>
289
- <title depth='3'>
290
- A.1.1
291
- <tab/>
292
- Annex A.1a
293
- </title>
294
- </clause>
295
- </clause>
296
- <appendix id='Q2' inline-header='false' obligation='normative'>
297
- <title depth='2'>
298
- Appendix 1
299
- <tab/>
300
- An Appendix
301
- </title>
302
- </appendix>
303
- </annex>
304
- <bibliography>
305
- <references id='R' obligation='informative' normative='true'>
306
- <title depth="1">Normative References</title>
307
- </references>
308
- <clause id='S' obligation='informative'>
309
- <title depth="1">Bibliography</title>
310
- <references id='T' obligation='informative' normative='false'>
311
- <title depth="2">Bibliography Subsection</title>
312
- </references>
313
- </clause>
314
- </bibliography>
315
- </iso-standard>
316
- OUTPUT
236
+ expect(xmlpp(output).sub(%r{<localized-strings>.*</localized-strings>}m, ""))
237
+ .to be_equivalent_to xmlpp(<<~"OUTPUT")
238
+ <?xml version='1.0'?>
239
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
240
+ <bibdata>
241
+ <ext>
242
+ <doctype language="">amendment</doctype>
243
+ </ext>
244
+ </bibdata>
245
+ <preface>
246
+ <foreword obligation="informative">
247
+ <title>Foreword</title>
248
+ <p id="A">This is a preamble
249
+
250
+ <xref target="C">0.1</xref>
251
+ <xref target="C1">0.2</xref>
252
+ <xref target="D">Scope</xref>
253
+ <xref target="H">[H]</xref>
254
+ <xref target="I">[I]</xref>
255
+ <xref target="J">[J]</xref>
256
+ <xref target="K">[K]</xref>
257
+ <xref target="L">[L]</xref>
258
+ <xref target="M">Clause 4</xref>
259
+ <xref target="N">Introduction</xref>
260
+ <xref target="O">Clause 4.2</xref>
261
+ <xref target="P">Annex A</xref>
262
+ <xref target="Q">A.1</xref>
263
+ <xref target="Q1">A.1.1</xref>
264
+ <xref target="Q2">Annex A, Appendix 1</xref>
265
+ <xref target="R">[R]</xref></p>
266
+ </foreword>
267
+ <introduction id="B" obligation="informative">
268
+ <title depth="1">Introduction</title>
269
+ <clause id="C" inline-header="false" obligation="informative">
270
+ <title depth="2">Introduction Subsection</title>
271
+ </clause>
272
+ <clause id="C1" inline-header="true" obligation="informative">Text</clause>
273
+ </introduction>
274
+ </preface>
275
+ <sections>
276
+ <clause id="D" obligation="normative" type="scope">
277
+ <title depth="1">Scope</title>
278
+ <p id="E">Text</p>
279
+ </clause>
280
+ <clause id="M" inline-header="false" obligation="normative">
281
+ <title depth="1">Clause 4</title>
282
+ <clause id="N" inline-header="false" obligation="normative">
283
+ <title depth="2">Introduction</title>
284
+ </clause>
285
+ <clause id="O" inline-header="false" obligation="normative">
286
+ <title depth="2">Clause 4.2</title>
287
+ </clause>
288
+ </clause>
289
+ </sections>
290
+ <annex id="P" inline-header="false" obligation="normative">
291
+ <title>
292
+ <strong>Annex A</strong>
293
+ <br/>(normative)
294
+
295
+ <br/>
296
+ <br/>
297
+ <strong>Annex</strong></title>
298
+ <clause id="Q" inline-header="false" obligation="normative">
299
+ <title depth="2">A.1
300
+
301
+ <tab/>
302
+ Annex A.1</title>
303
+ <clause id="Q1" inline-header="false" obligation="normative">
304
+ <title depth="3">A.1.1
305
+
306
+ <tab/>
307
+ Annex A.1a</title>
308
+ </clause>
309
+ </clause>
310
+ <appendix id="Q2" inline-header="false" obligation="normative">
311
+ <title depth="2">Appendix 1
312
+
313
+ <tab/>
314
+ An Appendix</title>
315
+ </appendix>
316
+ </annex>
317
+ <bibliography>
318
+ <references id="R" normative="true" obligation="informative">
319
+ <title depth="1">Normative References</title>
320
+ </references>
321
+ <clause id="S" obligation="informative">
322
+ <title depth="1">Bibliography</title>
323
+ <references id="T" normative="false" obligation="informative">
324
+ <title depth="2">Bibliography Subsection</title>
325
+ </references>
326
+ </clause>
327
+ </bibliography>
328
+ </iso-standard>
329
+ OUTPUT
317
330
  end
318
331
 
319
- it "processes section names" do
320
- input = <<~INPUT
332
+ it "processes section names" do
333
+ input = <<~INPUT
321
334
  <iso-standard xmlns="http://riboseinc.com/isoxml">
322
- <bibdata> <ext> <doctype>amendment</doctype> </ext> </bibdata>
323
- <boilerplate>
324
- <copyright-statement>
325
- <clause>
326
- <title>Copyright</title>
327
- </clause>
328
- </copyright-statement>
329
- <license-statement>
330
- <clause>
331
- <title>License</title>
332
- </clause>
333
- </license-statement>
334
- <legal-statement>
335
- <clause>
336
- <title>Legal</title>
337
- </clause>
338
- </legal-statement>
339
- <feedback-statement>
340
- <clause>
341
- <title>Feedback</title>
342
- </clause>
343
- </feedback-statement>
344
- </boilerplate>
345
- <preface>
346
- <abstract obligation="informative">
347
- <title>Abstract</title>
348
- </abstract>
349
- <foreword obligation="informative">
350
- <title>Foreword</title>
351
- <p id="A">This is a preamble</p>
352
- </foreword>
353
- <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
354
- <title>Introduction Subsection</title>
355
- </clause>
356
- </introduction>
357
- <clause id="B1"><title>Dedication</title></clause>
358
- <clause id="B2"><title>Note to reader</title></clause>
359
- <acknowledgements obligation="informative">
360
- <title>Acknowledgements</title>
361
- </acknowledgements>
362
- </preface><sections>
363
- <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
364
- <title>Introduction</title>
365
- </clause>
366
- <clause id="O" inline-header="false" obligation="normative">
367
- <title>Clause 4.2</title>
368
- </clause>
369
- <clause id="O1" inline-header="false" obligation="normative">
370
- </clause>
371
- </clause>
372
- <clause id="D" obligation="normative">
373
- <title>Scope</title>
374
- <p id="E">Text</p>
375
- </clause>
376
- </sections><annex id="P" inline-header="false" obligation="normative">
377
- <title>Annex</title>
378
- <clause id="Q" inline-header="false" obligation="normative">
379
- <title>Annex A.1</title>
380
- <clause id="Q1" inline-header="false" obligation="normative">
381
- <title>Annex A.1a</title>
382
- </clause>
383
- </clause>
384
- </annex>
385
- <annex id="P1" inline-header="false" obligation="normative">
386
- </annex>
387
- <bibliography><references id="R" obligation="informative" normative="true">
388
- <title>Normative References</title>
389
- </references><clause id="S" obligation="informative">
390
- <title>Bibliography</title>
391
- <references id="T" obligation="informative" normative="false">
392
- <title>Bibliography Subsection</title>
393
- </references>
394
- </clause>
395
- </bibliography>
396
- </iso-standard>
335
+ <bibdata>
336
+ <ext>
337
+ <doctype>amendment</doctype>
338
+ </ext>
339
+ </bibdata>
340
+ <boilerplate>
341
+ <copyright-statement>
342
+ <clause>
343
+ <title>Copyright</title>
344
+ </clause>
345
+ </copyright-statement>
346
+ <license-statement>
347
+ <clause>
348
+ <title>License</title>
349
+ </clause>
350
+ </license-statement>
351
+ <legal-statement>
352
+ <clause>
353
+ <title>Legal</title>
354
+ </clause>
355
+ </legal-statement>
356
+ <feedback-statement>
357
+ <clause>
358
+ <title>Feedback</title>
359
+ </clause>
360
+ </feedback-statement>
361
+ </boilerplate>
362
+ <preface>
363
+ <abstract obligation="informative">
364
+ <title>Abstract</title>
365
+ </abstract>
366
+ <foreword obligation="informative">
367
+ <title>Foreword</title>
368
+ <p id="A">This is a preamble</p>
369
+ </foreword>
370
+ <introduction id="B" obligation="informative">
371
+ <title>Introduction</title>
372
+ <clause id="C" inline-header="false" obligation="informative">
373
+ <title>Introduction Subsection</title>
374
+ </clause>
375
+ </introduction>
376
+ <clause id="B1">
377
+ <title>Dedication</title>
378
+ </clause>
379
+ <clause id="B2">
380
+ <title>Note to reader</title>
381
+ </clause>
382
+ <acknowledgements obligation="informative">
383
+ <title>Acknowledgements</title>
384
+ </acknowledgements>
385
+ </preface>
386
+ <sections>
387
+ <clause id="M" inline-header="false" obligation="normative">
388
+ <title>Clause 4</title>
389
+ <clause id="N" inline-header="false" obligation="normative">
390
+ <title>Introduction</title>
391
+ </clause>
392
+ <clause id="O" inline-header="false" obligation="normative">
393
+ <title>Clause 4.2</title>
394
+ </clause>
395
+ <clause id="O1" inline-header="false" obligation="normative"/>
396
+ </clause>
397
+ <clause id="D" obligation="normative">
398
+ <title>Scope</title>
399
+ <p id="E">Text</p>
400
+ </clause>
401
+ </sections>
402
+ <annex id="P" inline-header="false" obligation="normative">
403
+ <title>Annex</title>
404
+ <clause id="Q" inline-header="false" obligation="normative">
405
+ <title>Annex A.1</title>
406
+ <clause id="Q1" inline-header="false" obligation="normative">
407
+ <title>Annex A.1a</title>
408
+ </clause>
409
+ </clause>
410
+ </annex>
411
+ <annex id="P1" inline-header="false" obligation="normative"/>
412
+ <bibliography>
413
+ <references id="R" normative="true" obligation="informative">
414
+ <title>Normative References</title>
415
+ </references>
416
+ <clause id="S" obligation="informative">
417
+ <title>Bibliography</title>
418
+ <references id="T" normative="false" obligation="informative">
419
+ <title>Bibliography Subsection</title>
420
+ </references>
421
+ </clause>
422
+ </bibliography>
423
+ </iso-standard>
397
424
  INPUT
398
425
  presxml = <<~OUTPUT
399
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
400
- <bibdata>
401
- <ext>
402
- <doctype language="">amendment</doctype>
403
- </ext>
404
- </bibdata>
405
- <boilerplate>
406
- <copyright-statement>
407
- <clause>
408
- <title depth="1">Copyright</title>
409
- </clause>
410
- </copyright-statement>
411
- <license-statement>
412
- <clause>
413
- <title depth="1">License</title>
414
- </clause>
415
- </license-statement>
416
- <legal-statement>
417
- <clause>
418
- <title depth="1">Legal</title>
419
- </clause>
420
- </legal-statement>
421
- <feedback-statement>
422
- <clause>
423
- <title depth="1">Feedback</title>
424
- </clause>
425
- </feedback-statement>
426
- </boilerplate>
427
- <preface>
428
- <abstract obligation='informative'>
429
- <title>Abstract</title>
430
- </abstract>
431
- <foreword obligation='informative'>
432
- <title>Foreword</title>
433
- <p id='A'>This is a preamble</p>
434
- </foreword>
435
- <introduction id='B' obligation='informative'>
436
- <title depth='1'>Introduction</title>
437
- <clause id='C' inline-header='false' obligation='informative'>
438
- <title depth='2'>Introduction Subsection</title>
439
- </clause>
440
- </introduction>
441
- <clause id='B1'>
442
- <title depth='1'>Dedication</title>
443
- </clause>
444
- <clause id='B2'>
445
- <title depth='1'>Note to reader</title>
446
- </clause>
447
- <acknowledgements obligation='informative'>
448
- <title>Acknowledgements</title>
449
- </acknowledgements>
450
- </preface>
451
- <sections>
452
- <clause id='M' inline-header='false' obligation='normative'>
453
- <title depth='1'>Clause 4</title>
454
- <clause id='N' inline-header='false' obligation='normative'>
455
- <title depth='2'>Introduction</title>
456
- </clause>
457
- <clause id='O' inline-header='false' obligation='normative'>
458
- <title depth='2'>Clause 4.2</title>
459
- </clause>
460
- <clause id='O1' inline-header='true' obligation='normative'> </clause>
461
- </clause>
462
- <clause id='D' obligation='normative'>
463
- <title depth='1'>Scope</title>
464
- <p id='E'>Text</p>
465
- </clause>
466
- </sections>
467
- <annex id='P' inline-header='false' obligation='normative'>
468
- <title>
469
- <strong>Annex A</strong>
470
- <br/>
471
- (normative)
472
- <br/>
473
- <br/>
474
- <strong>Annex</strong>
475
- </title>
476
- <clause id='Q' inline-header='false' obligation='normative'>
477
- <title depth='2'>A.1<tab/>Annex A.1</title>
478
- <clause id='Q1' inline-header='false' obligation='normative'>
479
- <title depth='3'>A.1.1<tab/>Annex A.1a</title>
480
- </clause>
481
- </clause>
482
- </annex>
483
- <annex id='P1' inline-header='false' obligation='normative'>
484
- <title>
485
- <strong>Annex B</strong>
486
- <br/>
487
- (normative)
488
- </title>
489
- </annex>
490
- <bibliography>
491
- <references id='R' obligation='informative' normative='true'>
492
- <title depth='1'>Normative References</title>
493
- </references>
494
- <clause id='S' obligation='informative'>
495
- <title depth='1'>Bibliography</title>
496
- <references id='T' obligation='informative' normative='false'>
497
- <title depth='2'>Bibliography Subsection</title>
498
- </references>
499
- </clause>
500
- </bibliography>
501
- </iso-standard>
502
- OUTPUT
426
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
427
+ <bibdata>
428
+ <ext>
429
+ <doctype language="">amendment</doctype>
430
+ </ext>
431
+ </bibdata>
432
+ <boilerplate>
433
+ <copyright-statement>
434
+ <clause>
435
+ <title depth="1">Copyright</title>
436
+ </clause>
437
+ </copyright-statement>
438
+ <license-statement>
439
+ <clause>
440
+ <title depth="1">License</title>
441
+ </clause>
442
+ </license-statement>
443
+ <legal-statement>
444
+ <clause>
445
+ <title depth="1">Legal</title>
446
+ </clause>
447
+ </legal-statement>
448
+ <feedback-statement>
449
+ <clause>
450
+ <title depth="1">Feedback</title>
451
+ </clause>
452
+ </feedback-statement>
453
+ </boilerplate>
454
+ <preface>
455
+ <abstract obligation="informative">
456
+ <title>Abstract</title>
457
+ </abstract>
458
+ <foreword obligation="informative">
459
+ <title>Foreword</title>
460
+ <p id="A">This is a preamble</p>
461
+ </foreword>
462
+ <introduction id="B" obligation="informative">
463
+ <title depth="1">Introduction</title>
464
+ <clause id="C" inline-header="false" obligation="informative">
465
+ <title depth="2">Introduction Subsection</title>
466
+ </clause>
467
+ </introduction>
468
+ <clause id="B1">
469
+ <title depth="1">Dedication</title>
470
+ </clause>
471
+ <clause id="B2">
472
+ <title depth="1">Note to reader</title>
473
+ </clause>
474
+ <acknowledgements obligation="informative">
475
+ <title>Acknowledgements</title>
476
+ </acknowledgements>
477
+ </preface>
478
+ <sections>
479
+ <clause id="M" inline-header="false" obligation="normative">
480
+ <title depth="1">Clause 4</title>
481
+ <clause id="N" inline-header="false" obligation="normative">
482
+ <title depth="2">Introduction</title>
483
+ </clause>
484
+ <clause id="O" inline-header="false" obligation="normative">
485
+ <title depth="2">Clause 4.2</title>
486
+ </clause>
487
+ <clause id="O1" inline-header="true" obligation="normative"/>
488
+ </clause>
489
+ <clause id="D" obligation="normative">
490
+ <title depth="1">Scope</title>
491
+ <p id="E">Text</p>
492
+ </clause>
493
+ </sections>
494
+ <annex id="P" inline-header="false" obligation="normative">
495
+ <title>
496
+ <strong>Annex A</strong>
497
+ <br/>(normative)
498
+ <br/>
499
+ <br/>
500
+ <strong>Annex</strong></title>
501
+ <clause id="Q" inline-header="false" obligation="normative">
502
+ <title depth="2">A.1
503
+ <tab/>
504
+ Annex A.1</title>
505
+ <clause id="Q1" inline-header="false" obligation="normative">
506
+ <title depth="3">A.1.1
507
+ <tab/>
508
+ Annex A.1a</title>
509
+ </clause>
510
+ </clause>
511
+ </annex>
512
+ <annex id="P1" inline-header="false" obligation="normative">
513
+ <title>
514
+ <strong>Annex B</strong>
515
+ <br/>(normative)</title>
516
+ </annex>
517
+ <bibliography>
518
+ <references id="R" normative="true" obligation="informative">
519
+ <title depth="1">Normative References</title>
520
+ </references>
521
+ <clause id="S" obligation="informative">
522
+ <title depth="1">Bibliography</title>
523
+ <references id="T" normative="false" obligation="informative">
524
+ <title depth="2">Bibliography Subsection</title>
525
+ </references>
526
+ </clause>
527
+ </bibliography>
528
+ </iso-standard>
529
+ OUTPUT
503
530
  html = <<~OUTPUT
504
- <html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
505
- <head/>
506
- <body lang='en'>
507
- <div class='title-section'>
508
- <p>&#160;</p>
509
- </div>
510
- <br/>
511
- <div class='prefatory-section'>
512
- <p>&#160;</p>
513
- </div>
514
- <br/>
515
- <div class='main-section'>
516
- <div class='authority'>
517
- <div class='boilerplate-copyright'>
518
- <div>
519
- <h1>Copyright</h1>
520
- </div>
521
- </div>
522
- <div class='boilerplate-license'>
523
- <div>
524
- <h1>License</h1>
525
- </div>
526
- </div>
527
- <div class='boilerplate-legal'>
528
- <div>
529
- <h1>Legal</h1>
530
- </div>
531
- </div>
532
- <div class='boilerplate-feedback'>
533
- <div>
534
- <h1>Feedback</h1>
531
+ <html lang="en" xmlns:epub="http://www.idpf.org/2007/ops">
532
+ <head/>
533
+ <body lang="en">
534
+ <div class="title-section">
535
+ <p> </p>
535
536
  </div>
536
- </div>
537
- </div>
538
- <br/>
539
- <div>
540
- <h1 class='AbstractTitle'>Abstract</h1>
541
- </div>
542
- <br/>
543
- <div>
544
- <h1 class='ForewordTitle'>Foreword</h1>
545
- <p id='A'>This is a preamble</p>
546
- </div>
547
- <br/>
548
- <div class='Section3' id='B'>
549
- <h1 class='IntroTitle'>Introduction</h1>
550
- <div id='C'>
551
- <h2>Introduction Subsection</h2>
552
- </div>
553
- </div>
554
- <br/>
555
- <div class='Section3' id='B1'>
556
- <h1 class='IntroTitle'>Dedication</h1>
557
- </div>
558
- <br/>
559
- <div class='Section3' id='B2'>
560
- <h1 class='IntroTitle'>Note to reader</h1>
561
- </div>
562
- <br/>
563
- <div class='Section3' id=''>
564
- <h1 class='IntroTitle'>Acknowledgements</h1>
565
- </div>
566
- <p class='zzSTDTitle1'/>
567
- <div>
568
- <h1>Normative References</h1>
569
- </div>
570
- <div id='M'>
571
- <h1>Clause 4</h1>
572
- <div id='N'>
573
- <h2>Introduction</h2>
574
- </div>
575
- <div id='O'>
576
- <h2>Clause 4.2</h2>
577
- </div>
578
- <div id='O1'>
579
- </div>
580
- </div>
581
- <div id='D'>
582
- <h1>Scope</h1>
583
- <p id='E'>Text</p>
584
- </div>
585
- <br/>
586
- <div id='P' class='Section3'>
587
- <h1 class='Annex'>
588
- <b>Annex A</b>
589
- <br/>
590
- (normative)
591
537
  <br/>
538
+ <div class="prefatory-section">
539
+ <p> </p>
540
+ </div>
592
541
  <br/>
593
- <b>Annex</b>
594
- </h1>
595
- <div id='Q'>
596
- <h2>A.1&#160; Annex A.1</h2>
597
- <div id='Q1'>
598
- <h3>A.1.1&#160; Annex A.1a</h3>
542
+ <div class="main-section">
543
+ <div class="authority">
544
+ <div class="boilerplate-copyright">
545
+ <div>
546
+ <h1>Copyright</h1>
547
+ </div>
548
+ </div>
549
+ <div class="boilerplate-license">
550
+ <div>
551
+ <h1>License</h1>
552
+ </div>
553
+ </div>
554
+ <div class="boilerplate-legal">
555
+ <div>
556
+ <h1>Legal</h1>
557
+ </div>
558
+ </div>
559
+ <div class="boilerplate-feedback">
560
+ <div>
561
+ <h1>Feedback</h1>
562
+ </div>
563
+ </div>
564
+ </div>
565
+ <br/>
566
+ <div>
567
+ <h1 class="AbstractTitle">Abstract</h1>
568
+ </div>
569
+ <br/>
570
+ <div>
571
+ <h1 class="ForewordTitle">Foreword</h1>
572
+ <p id="A">This is a preamble</p>
573
+ </div>
574
+ <br/>
575
+ <div class="Section3" id="B">
576
+ <h1 class="IntroTitle">Introduction</h1>
577
+ <div id="C">
578
+ <h2>Introduction Subsection</h2>
579
+ </div>
580
+ </div>
581
+ <br/>
582
+ <div class="Section3" id="B1">
583
+ <h1 class="IntroTitle">Dedication</h1>
584
+ </div>
585
+ <br/>
586
+ <div class="Section3" id="B2">
587
+ <h1 class="IntroTitle">Note to reader</h1>
588
+ </div>
589
+ <br/>
590
+ <div class="Section3" id="">
591
+ <h1 class="IntroTitle">Acknowledgements</h1>
592
+ </div>
593
+ <p class="zzSTDTitle1"/>
594
+ <div>
595
+ <h1>Normative References</h1>
596
+ </div>
597
+ <div id="M">
598
+ <h1>Clause 4</h1>
599
+ <div id="N">
600
+ <h2>Introduction</h2>
601
+ </div>
602
+ <div id="O">
603
+ <h2>Clause 4.2</h2>
604
+ </div>
605
+ <div id="O1"/>
606
+ </div>
607
+ <div id="D">
608
+ <h1>Scope</h1>
609
+ <p id="E">Text</p>
610
+ </div>
611
+ <br/>
612
+ <div class="Section3" id="P">
613
+ <h1 class="Annex">
614
+ <b>Annex A</b>
615
+ <br/>(normative)
616
+ <br/>
617
+ <br/>
618
+ <b>Annex</b></h1>
619
+ <div id="Q">
620
+ <h2>A.1 &#160; Annex A.1</h2>
621
+ <div id="Q1">
622
+ <h3>A.1.1 &#160; Annex A.1a</h3>
623
+ </div>
624
+ </div>
625
+ </div>
626
+ <br/>
627
+ <div class="Section3" id="P1">
628
+ <h1 class="Annex">
629
+ <b>Annex B</b>
630
+ <br/>(normative)</h1>
631
+ </div>
632
+ <br/>
633
+ <div>
634
+ <h1 class="Section3">Bibliography</h1>
635
+ <div>
636
+ <h2 class="Section3">Bibliography Subsection</h2>
637
+ </div>
638
+ </div>
599
639
  </div>
600
- </div>
601
- </div>
602
- <br/>
603
- <div id='P1' class='Section3'>
604
- <h1 class='Annex'>
605
- <b>Annex B</b>
606
- <br/>
607
- (normative)
608
- </h1>
609
- </div>
610
- <br/>
611
- <div>
612
- <h1 class='Section3'>Bibliography</h1>
613
- <div>
614
- <h2 class='Section3'>Bibliography Subsection</h2>
615
- </div>
616
- </div>
617
- </div>
618
- </body>
619
- </html>
620
- OUTPUT
621
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
640
+ </body>
641
+ </html>
642
+ OUTPUT
643
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))
644
+ .sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
622
645
  expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
623
- end
646
+ end
624
647
 
625
- it "processes IsoXML metadata" do
648
+ it "processes IsoXML metadata" do
626
649
  c = IsoDoc::Iso::HtmlConvert.new({})
627
- arr = c.convert_init(<<~"INPUT", "test", false)
628
- <iso-standard xmlns="http://riboseinc.com/isoxml">
650
+ _ = c.convert_init(<<~"INPUT", "test", false)
651
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
629
652
  INPUT
630
- expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
631
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
632
- <bibdata type='standard'>
633
- <title language='en' format='text/plain' type='main'>Introduction — Main Title — Title — Title Part  — Mass fraction of
634
- extraneous matter, milled rice (nonglutinous), sample dividers and
635
- recommendations relating to storage and transport conditions</title>
636
- <title language='en' format='text/plain' type='title-intro'>Introduction</title>
637
- <title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
638
- <title language='en' format='text/plain' type='title-part'>Title Part</title>
639
- <title language='en' format='text/plain' type='title-amd'>Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
640
- <title language='fr' format='text/plain' type='main'>
641
- Introduction Française — Titre Principal — Part du Titre — Fraction
642
- massique de matière étrangère, riz usiné (non gluant), diviseurs
643
- d’échantillon et recommandations relatives aux conditions d’entreposage et
644
- de transport
645
- </title>
646
- <title language='fr' format='text/plain' type='title-intro'>Introduction Française</title>
647
- <title language='fr' format='text/plain' type='title-main'>Titre Principal</title>
648
- <title language='fr' format='text/plain' type='title-part'>Part du Titre</title>
649
- <title language='fr' format='text/plain' type='title-amd'>Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
650
- <docidentifier type='ISO'>ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
651
- <docidentifier type='iso-with-lang'>ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
652
- <docidentifier type='iso-reference'>ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
653
- <docnumber>17301</docnumber>
654
- <date type='created'>
655
- <on>2016-05-01</on>
656
- </date>
657
- <contributor>
658
- <role type='author'/>
659
- <organization>
660
- <name>International Organization for Standardization</name>
661
- <abbreviation>ISO</abbreviation>
662
- </organization>
663
- </contributor>
664
- <contributor>
665
- <role type='publisher'/>
666
- <organization>
667
- <name>International Organization for Standardization</name>
668
- <abbreviation>ISO</abbreviation>
669
- </organization>
670
- </contributor>
671
- <edition>2</edition>
672
- <version>
673
- <revision-date>2000-01-01</revision-date>
674
- <draft>0.3.4</draft>
675
- </version>
676
- <language>en</language>
677
- <script>Latn</script>
678
- <status>
679
- <stage abbreviation='NWIP'>10</stage>
680
- <substage>20</substage>
681
- <iteration>3</iteration>
682
- </status>
683
- <copyright>
684
- <from>2017</from>
685
- <owner>
686
- <organization>
687
- <name>International Organization for Standardization</name>
688
- <abbreviation>ISO</abbreviation>
689
- </organization>
690
- </owner>
691
- </copyright>
692
- <ext>
693
- <doctype>amendment</doctype>
694
- <editorialgroup>
695
- <technical-committee number='1' type='A'>TC</technical-committee>
696
- <technical-committee number='11' type='A1'>TC1</technical-committee>
697
- <subcommittee number='2' type='B'>SC</subcommittee>
698
- <subcommittee number='21' type='B1'>SC1</subcommittee>
699
- <workgroup number='3' type='C'>WG</workgroup>
700
- <workgroup number='31' type='C1'>WG1</workgroup>
701
- <secretariat>SECRETARIAT</secretariat>
702
- </editorialgroup>
703
- <ics>
704
- <code>1</code>
705
- </ics>
706
- <ics>
707
- <code>2</code>
708
- </ics>
709
- <ics>
710
- <code>3</code>
711
- </ics>
712
- <structuredidentifier>
713
- <project-number part='1' amendment='1' corrigendum='2' origyr='2016-05-01'>17301</project-number>
714
- </structuredidentifier>
715
- <stagename>New work item proposal</stagename>
716
- <updates-document-type>international-standard</updates-document-type>
717
- </ext>
718
- </bibdata>
719
- <sections/>
720
- </iso-standard>
721
- INPUT
722
- {:accesseddate=>"XXX",
723
- :agency=>"ISO",
724
- :circulateddate=>"XXX",
725
- :confirmeddate=>"XXX",
726
- :copieddate=>"XXX",
727
- :createddate=>"2016-05-01",
728
- :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
729
- :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
730
- :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
731
- :docnumeric=>"17301",
732
- :docsubtitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
733
- :docsubtitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
734
- :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
735
- :docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
736
- :docsubtitleintro=>"Introduction Fran&#xe7;aise",
737
- :docsubtitlemain=>"Titre Principal",
738
- :docsubtitlepart=>"Part du Titre",
739
- :docsubtitlepartlabel=>"Partie&nbsp;1",
740
- :doctitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
741
- :doctitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
742
- :doctitleamdlabel=>"AMENDMENT&nbsp;1",
743
- :doctitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
744
- :doctitleintro=>"Introduction",
745
- :doctitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
746
- :doctitlepart=>"Title Part",
747
- :doctitlepartlabel=>"Part&nbsp;1",
748
- :doctype=>"Amendment",
749
- :doctype_display=>"Amendment",
750
- :docyear=>"2017",
751
- :draft=>"0.3.4",
752
- :draftinfo=>" (draft 0.3.4, 2000-01-01)",
753
- :edition=>"2",
754
- :editorialgroup=>["A 1", "B 2", "C 3"],
755
- :ics=>"1, 2, 3",
756
- :implementeddate=>"XXX",
757
- :issueddate=>"XXX",
758
- :lang=>"en",
759
- :obsoleteddate=>"XXX",
760
- :publisheddate=>"XXX",
761
- :publisher=>"International Organization for Standardization",
762
- :receiveddate=>"XXX",
763
- :revdate=>"2000-01-01",
764
- :revdate_monthyear=>"January 2000",
765
- :sc=>"B 2",
766
- :script=>"Latn",
767
- :secretariat=>"SECRETARIAT",
768
- :stage=>"10",
769
- :stage_int=>10,
770
- :stageabbr=>"NWIP",
771
- :statusabbr=>"PreNWIP3",
772
- :tc=>"A 1",
773
- :transmitteddate=>"XXX",
774
- :unchangeddate=>"XXX",
775
- :unpublished=>true,
776
- :updateddate=>"XXX",
777
- :vote_endeddate=>"XXX",
778
- :vote_starteddate=>"XXX",
779
- :wg=>"C 3"}
780
- OUTPUT
653
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
654
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso">
655
+ <bibdata type="standard">
656
+ <title format="text/plain" language="en" type="main">Introduction — Main Title — Title — Title Part  — Mass fraction of
657
+ extraneous matter, milled rice (nonglutinous), sample dividers and
658
+ recommendations relating to storage and transport conditions</title>
659
+ <title format="text/plain" language="en" type="title-intro">Introduction</title>
660
+ <title format="text/plain" language="en" type="title-main">Main Title — Title</title>
661
+ <title format="text/plain" language="en" type="title-part">Title Part</title>
662
+ <title format="text/plain" language="en" type="title-amd">Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
663
+ <title format="text/plain" language="fr" type="main">Introduction Française — Titre Principal — Part du Titre — Fraction
664
+ massique de matière étrangère, riz usiné (non gluant), diviseurs
665
+ d’échantillon et recommandations relatives aux conditions d’entreposage et
666
+ de transport
667
+ </title>
668
+ <title format="text/plain" language="fr" type="title-intro">Introduction Française</title>
669
+ <title format="text/plain" language="fr" type="title-main">Titre Principal</title>
670
+ <title format="text/plain" language="fr" type="title-part">Part du Titre</title>
671
+ <title format="text/plain" language="fr" type="title-amd">Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
672
+ <docidentifier type="ISO">ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
673
+ <docidentifier type="iso-with-lang">ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
674
+ <docidentifier type="iso-reference">ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
675
+ <docnumber>17301</docnumber>
676
+ <date type="created">
677
+ <on>2016-05-01</on>
678
+ </date>
679
+ <contributor>
680
+ <role type="author"/>
681
+ <organization>
682
+ <name>International Organization for Standardization</name>
683
+ <abbreviation>ISO</abbreviation>
684
+ </organization>
685
+ </contributor>
686
+ <contributor>
687
+ <role type="publisher"/>
688
+ <organization>
689
+ <name>International Organization for Standardization</name>
690
+ <abbreviation>ISO</abbreviation>
691
+ </organization>
692
+ </contributor>
693
+ <edition>2</edition>
694
+ <version>
695
+ <revision-date>2000-01-01</revision-date>
696
+ <draft>0.3.4</draft>
697
+ </version>
698
+ <language>en</language>
699
+ <script>Latn</script>
700
+ <status>
701
+ <stage abbreviation="NWIP">10</stage>
702
+ <substage>20</substage>
703
+ <iteration>3</iteration>
704
+ </status>
705
+ <copyright>
706
+ <from>2017</from>
707
+ <owner>
708
+ <organization>
709
+ <name>International Organization for Standardization</name>
710
+ <abbreviation>ISO</abbreviation>
711
+ </organization>
712
+ </owner>
713
+ </copyright>
714
+ <ext>
715
+ <doctype>amendment</doctype>
716
+ <editorialgroup>
717
+ <technical-committee number="1" type="A">TC</technical-committee>
718
+ <technical-committee number="11" type="A1">TC1</technical-committee>
719
+ <subcommittee number="2" type="B">SC</subcommittee>
720
+ <subcommittee number="21" type="B1">SC1</subcommittee>
721
+ <workgroup number="3" type="C">WG</workgroup>
722
+ <workgroup number="31" type="C1">WG1</workgroup>
723
+ <secretariat>SECRETARIAT</secretariat>
724
+ </editorialgroup>
725
+ <ics>
726
+ <code>1</code>
727
+ </ics>
728
+ <ics>
729
+ <code>2</code>
730
+ </ics>
731
+ <ics>
732
+ <code>3</code>
733
+ </ics>
734
+ <structuredidentifier>
735
+ <project-number amendment="1" corrigendum="2" origyr="2016-05-01" part="1">17301</project-number>
736
+ </structuredidentifier>
737
+ <stagename>New work item proposal</stagename>
738
+ <updates-document-type>international-standard</updates-document-type>
739
+ </ext>
740
+ </bibdata>
741
+ <sections/>
742
+ </iso-standard>
743
+ INPUT
744
+ {:accesseddate=>"XXX",
745
+ :agency=>"ISO",
746
+ :circulateddate=>"XXX",
747
+ :confirmeddate=>"XXX",
748
+ :copieddate=>"XXX",
749
+ :createddate=>"2016-05-01",
750
+ :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
751
+ :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
752
+ :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
753
+ :docnumeric=>"17301",
754
+ :docsubtitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
755
+ :docsubtitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
756
+ :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
757
+ :docsubtitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
758
+ :docsubtitleintro=>"Introduction Fran&#xe7;aise",
759
+ :docsubtitlemain=>"Titre Principal",
760
+ :docsubtitlepart=>"Part du Titre",
761
+ :docsubtitlepartlabel=>"Partie&nbsp;1",
762
+ :doctitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
763
+ :doctitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
764
+ :doctitleamdlabel=>"AMENDMENT&nbsp;1",
765
+ :doctitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
766
+ :doctitleintro=>"Introduction",
767
+ :doctitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
768
+ :doctitlepart=>"Title Part",
769
+ :doctitlepartlabel=>"Part&nbsp;1",
770
+ :doctype=>"Amendment",
771
+ :doctype_display=>"Amendment",
772
+ :docyear=>"2017",
773
+ :draft=>"0.3.4",
774
+ :draftinfo=>" (draft 0.3.4, 2000-01-01)",
775
+ :edition=>"2",
776
+ :editorialgroup=>["A 1", "B 2", "C 3"],
777
+ :ics=>"1, 2, 3",
778
+ :implementeddate=>"XXX",
779
+ :issueddate=>"XXX",
780
+ :lang=>"en",
781
+ :obsoleteddate=>"XXX",
782
+ :publisheddate=>"XXX",
783
+ :publisher=>"International Organization for Standardization",
784
+ :receiveddate=>"XXX",
785
+ :revdate=>"2000-01-01",
786
+ :revdate_monthyear=>"January 2000",
787
+ :sc=>"B 2",
788
+ :script=>"Latn",
789
+ :secretariat=>"SECRETARIAT",
790
+ :stage=>"10",
791
+ :stage_int=>10,
792
+ :stageabbr=>"NWIP",
793
+ :statusabbr=>"PreNWIP3",
794
+ :tc=>"A 1",
795
+ :transmitteddate=>"XXX",
796
+ :unchangeddate=>"XXX",
797
+ :unpublished=>true,
798
+ :updateddate=>"XXX",
799
+ :vote_endeddate=>"XXX",
800
+ :vote_starteddate=>"XXX",
801
+ :wg=>"C 3"}
802
+ OUTPUT
781
803
  end
782
804
 
783
- it "processes IsoXML metadata in French" do
805
+ it "processes IsoXML metadata in French" do
784
806
  c = IsoDoc::Iso::HtmlConvert.new({})
785
- arr = c.convert_init(<<~"INPUT", "test", false)
786
- <iso-standard xmlns="http://riboseinc.com/isoxml">
787
- <bibdata>
788
- <language>fr</language>
789
- </bibdata>
790
- </iso-standard>
807
+ _ = c.convert_init(<<~"INPUT", "test", false)
808
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
809
+ <bibdata>
810
+ <language>fr</language>
811
+ </bibdata>
812
+ </iso-standard>
791
813
  INPUT
792
- expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
793
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
794
- <bibdata type='standard'>
795
- <title language='en' format='text/plain' type='main'>Introduction — Main Title — Title — Title Part  — Mass fraction of
796
- extraneous matter, milled rice (nonglutinous), sample dividers and
797
- recommendations relating to storage and transport conditions</title>
798
- <title language='en' format='text/plain' type='title-intro'>Introduction</title>
799
- <title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
800
- <title language='en' format='text/plain' type='title-part'>Title Part</title>
801
- <title language='en' format='text/plain' type='title-amd'>Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
802
- <title language='fr' format='text/plain' type='main'>
803
- Introduction Française — Titre Principal — Part du Titre — Fraction
804
- massique de matière étrangère, riz usiné (non gluant), diviseurs
805
- d’échantillon et recommandations relatives aux conditions d’entreposage et
806
- de transport
807
- </title>
808
- <title language='fr' format='text/plain' type='title-intro'>Introduction Française</title>
809
- <title language='fr' format='text/plain' type='title-main'>Titre Principal</title>
810
- <title language='fr' format='text/plain' type='title-part'>Part du Titre</title>
811
- <title language='fr' format='text/plain' type='title-amd'>Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
812
- <docidentifier type='ISO'>ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
813
- <docidentifier type='iso-with-lang'>ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
814
- <docidentifier type='iso-reference'>ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
815
- <docnumber>17301</docnumber>
816
- <date type='created'>
817
- <on>2016-05-01</on>
818
- </date>
819
- <contributor>
820
- <role type='author'/>
821
- <organization>
822
- <name>International Organization for Standardization</name>
823
- <abbreviation>ISO</abbreviation>
824
- </organization>
825
- </contributor>
826
- <contributor>
827
- <role type='publisher'/>
828
- <organization>
829
- <name>International Organization for Standardization</name>
830
- <abbreviation>ISO</abbreviation>
831
- </organization>
832
- </contributor>
833
- <edition>2</edition>
834
- <version>
835
- <revision-date>2000-01-01</revision-date>
836
- <draft>0.3.4</draft>
837
- </version>
838
- <language>fr</language>
839
- <script>Latn</script>
840
- <status>
841
- <stage abbreviation='NWIP'>10</stage>
842
- <substage>20</substage>
843
- <iteration>3</iteration>
844
- </status>
845
- <copyright>
846
- <from>2017</from>
847
- <owner>
848
- <organization>
849
- <name>International Organization for Standardization</name>
850
- <abbreviation>ISO</abbreviation>
851
- </organization>
852
- </owner>
853
- </copyright>
854
- <ext>
855
- <doctype language="">amendment</doctype>
856
- <doctype language="fr">Amendment</doctype>
857
- <editorialgroup>
858
- <technical-committee number='1' type='A'>TC</technical-committee>
859
- <technical-committee number='11' type='A1'>TC1</technical-committee>
860
- <subcommittee number='2' type='B'>SC</subcommittee>
861
- <subcommittee number='21' type='B1'>SC1</subcommittee>
862
- <workgroup number='3' type='C'>WG</workgroup>
863
- <workgroup number='31' type='C1'>WG1</workgroup>
864
- <secretariat>SECRETARIAT</secretariat>
865
- </editorialgroup>
866
- <ics>
867
- <code>1</code>
868
- </ics>
869
- <ics>
870
- <code>2</code>
871
- </ics>
872
- <ics>
873
- <code>3</code>
874
- </ics>
875
- <structuredidentifier>
876
- <project-number part='1' amendment='1' corrigendum='2' origyr='2016-05-01'>17301</project-number>
877
- </structuredidentifier>
878
- <stagename>New work item proposal</stagename>
879
- <updates-document-type>international-standard</updates-document-type>
880
- </ext>
881
- </bibdata>
882
- <sections/>
883
- </iso-standard>
884
- INPUT
885
- {:accesseddate=>"XXX",
886
- :agency=>"ISO",
887
- :circulateddate=>"XXX",
888
- :confirmeddate=>"XXX",
889
- :copieddate=>"XXX",
890
- :createddate=>"2016-05-01",
891
- :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
892
- :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
893
- :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
894
- :docnumeric=>"17301",
895
- :docsubtitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
896
- :docsubtitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
897
- :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
898
- :docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
899
- :docsubtitleintro=>"Introduction",
900
- :docsubtitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
901
- :docsubtitlepart=>"Title Part",
902
- :docsubtitlepartlabel=>"Part&nbsp;1",
903
- :doctitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
904
- :doctitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
905
- :doctitleamdlabel=>"AMENDMENT&nbsp;1",
906
- :doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
907
- :doctitleintro=>"Introduction Fran&#xe7;aise",
908
- :doctitlemain=>"Titre Principal",
909
- :doctitlepart=>"Part du Titre",
910
- :doctitlepartlabel=>"Partie&nbsp;1",
911
- :doctype=>"Amendment",
912
- :doctype_display=>"Amendment",
913
- :docyear=>"2017",
914
- :draft=>"0.3.4",
915
- :draftinfo=>" (brouillon 0.3.4, 2000-01-01)",
916
- :edition=>"2",
917
- :editorialgroup=>["A 1", "B 2", "C 3"],
918
- :ics=>"1, 2, 3",
919
- :implementeddate=>"XXX",
920
- :issueddate=>"XXX",
921
- :lang=>"fr",
922
- :obsoleteddate=>"XXX",
923
- :publisheddate=>"XXX",
924
- :publisher=>"International Organization for Standardization",
925
- :receiveddate=>"XXX",
926
- :revdate=>"2000-01-01",
927
- :revdate_monthyear=>"Janvier 2000",
928
- :sc=>"B 2",
929
- :script=>"Latn",
930
- :secretariat=>"SECRETARIAT",
931
- :stage=>"10",
932
- :stage_int=>10,
933
- :stageabbr=>"NWIP",
934
- :statusabbr=>"PreNWIP3",
935
- :tc=>"A 1",
936
- :transmitteddate=>"XXX",
937
- :unchangeddate=>"XXX",
938
- :unpublished=>true,
939
- :updateddate=>"XXX",
940
- :vote_endeddate=>"XXX",
941
- :vote_starteddate=>"XXX",
942
- :wg=>"C 3"}
943
- OUTPUT
944
- end
814
+ expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
815
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso">
816
+ <bibdata type="standard">
817
+ <title format="text/plain" language="en" type="main">Introduction — Main Title — Title — Title Part  — Mass fraction of
818
+ extraneous matter, milled rice (nonglutinous), sample dividers and
819
+ recommendations relating to storage and transport conditions</title>
820
+ <title format="text/plain" language="en" type="title-intro">Introduction</title>
821
+ <title format="text/plain" language="en" type="title-main">Main Title — Title</title>
822
+ <title format="text/plain" language="en" type="title-part">Title Part</title>
823
+ <title format="text/plain" language="en" type="title-amd">Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
824
+ <title format="text/plain" language="fr" type="main">Introduction Française — Titre Principal — Part du Titre — Fraction
825
+ massique de matière étrangère, riz usiné (non gluant), diviseurs
826
+ d’échantillon et recommandations relatives aux conditions d’entreposage et
827
+ de transport
828
+ </title>
829
+ <title format="text/plain" language="fr" type="title-intro">Introduction Française</title>
830
+ <title format="text/plain" language="fr" type="title-main">Titre Principal</title>
831
+ <title format="text/plain" language="fr" type="title-part">Part du Titre</title>
832
+ <title format="text/plain" language="fr" type="title-amd">Fraction massique de matière étrangère, riz usiné (non gluant), diviseurs d’échantillon et recommandations relatives aux conditions d’entreposage et de transport</title>
833
+ <docidentifier type="ISO">ISO/PreNWIP3 17301-1:2016/Amd.1</docidentifier>
834
+ <docidentifier type="iso-with-lang">ISO/PreNWIP3 17301-1:2016/Amd.1(E)</docidentifier>
835
+ <docidentifier type="iso-reference">ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)</docidentifier>
836
+ <docnumber>17301</docnumber>
837
+ <date type="created">
838
+ <on>2016-05-01</on>
839
+ </date>
840
+ <contributor>
841
+ <role type="author"/>
842
+ <organization>
843
+ <name>International Organization for Standardization</name>
844
+ <abbreviation>ISO</abbreviation>
845
+ </organization>
846
+ </contributor>
847
+ <contributor>
848
+ <role type="publisher"/>
849
+ <organization>
850
+ <name>International Organization for Standardization</name>
851
+ <abbreviation>ISO</abbreviation>
852
+ </organization>
853
+ </contributor>
854
+ <edition>2</edition>
855
+ <version>
856
+ <revision-date>2000-01-01</revision-date>
857
+ <draft>0.3.4</draft>
858
+ </version>
859
+ <language>fr</language>
860
+ <script>Latn</script>
861
+ <status>
862
+ <stage abbreviation="NWIP">10</stage>
863
+ <substage>20</substage>
864
+ <iteration>3</iteration>
865
+ </status>
866
+ <copyright>
867
+ <from>2017</from>
868
+ <owner>
869
+ <organization>
870
+ <name>International Organization for Standardization</name>
871
+ <abbreviation>ISO</abbreviation>
872
+ </organization>
873
+ </owner>
874
+ </copyright>
875
+ <ext>
876
+ <doctype language="">amendment</doctype>
877
+ <doctype language="fr">Amendment</doctype>
878
+ <editorialgroup>
879
+ <technical-committee number="1" type="A">TC</technical-committee>
880
+ <technical-committee number="11" type="A1">TC1</technical-committee>
881
+ <subcommittee number="2" type="B">SC</subcommittee>
882
+ <subcommittee number="21" type="B1">SC1</subcommittee>
883
+ <workgroup number="3" type="C">WG</workgroup>
884
+ <workgroup number="31" type="C1">WG1</workgroup>
885
+ <secretariat>SECRETARIAT</secretariat>
886
+ </editorialgroup>
887
+ <ics>
888
+ <code>1</code>
889
+ </ics>
890
+ <ics>
891
+ <code>2</code>
892
+ </ics>
893
+ <ics>
894
+ <code>3</code>
895
+ </ics>
896
+ <structuredidentifier>
897
+ <project-number amendment="1" corrigendum="2" origyr="2016-05-01" part="1">17301</project-number>
898
+ </structuredidentifier>
899
+ <stagename>New work item proposal</stagename>
900
+ <updates-document-type>international-standard</updates-document-type>
901
+ </ext>
902
+ </bibdata>
903
+ <sections/>
904
+ </iso-standard>
905
+ INPUT
906
+ {:accesseddate=>"XXX",
907
+ :agency=>"ISO",
908
+ :circulateddate=>"XXX",
909
+ :confirmeddate=>"XXX",
910
+ :copieddate=>"XXX",
911
+ :createddate=>"2016-05-01",
912
+ :docnumber=>"ISO/PreNWIP3 17301-1:2016/Amd.1",
913
+ :docnumber_lang=>"ISO/PreNWIP3 17301-1:2016/Amd.1(E)",
914
+ :docnumber_reference=>"ISO/PreNWIP3 17301-1:2016/Amd.1:2017(E)",
915
+ :docnumeric=>"17301",
916
+ :docsubtitle=>"Introduction&nbsp;&mdash; Main Title&#x2009;&#x2014;&#x2009;Title&nbsp;&mdash; Part&nbsp;1: Title Part",
917
+ :docsubtitleamd=>"Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions",
918
+ :docsubtitleamdlabel=>"AMENDMENT&nbsp;1",
919
+ :docsubtitlecorrlabel=>"TECHNICAL CORRIGENDUM&nbsp;2",
920
+ :docsubtitleintro=>"Introduction",
921
+ :docsubtitlemain=>"Main Title&#x2009;&#x2014;&#x2009;Title",
922
+ :docsubtitlepart=>"Title Part",
923
+ :docsubtitlepartlabel=>"Part&nbsp;1",
924
+ :doctitle=>"Introduction Fran&#xe7;aise&nbsp;&mdash; Titre Principal&nbsp;&mdash; Partie&nbsp;1: Part du Titre",
925
+ :doctitleamd=>"Fraction massique de mati&#xe8;re &#xe9;trang&#xe8;re, riz usin&#xe9; (non gluant), diviseurs d&#x2019;&#xe9;chantillon et recommandations relatives aux conditions d&#x2019;entreposage et de transport",
926
+ :doctitleamdlabel=>"AMENDMENT&nbsp;1",
927
+ :doctitlecorrlabel=>"RECTIFICATIF TECHNIQUE&nbsp;2",
928
+ :doctitleintro=>"Introduction Fran&#xe7;aise",
929
+ :doctitlemain=>"Titre Principal",
930
+ :doctitlepart=>"Part du Titre",
931
+ :doctitlepartlabel=>"Partie&nbsp;1",
932
+ :doctype=>"Amendment",
933
+ :doctype_display=>"Amendment",
934
+ :docyear=>"2017",
935
+ :draft=>"0.3.4",
936
+ :draftinfo=>" (brouillon 0.3.4, 2000-01-01)",
937
+ :edition=>"2",
938
+ :editorialgroup=>["A 1", "B 2", "C 3"],
939
+ :ics=>"1, 2, 3",
940
+ :implementeddate=>"XXX",
941
+ :issueddate=>"XXX",
942
+ :lang=>"fr",
943
+ :obsoleteddate=>"XXX",
944
+ :publisheddate=>"XXX",
945
+ :publisher=>"International Organization for Standardization",
946
+ :receiveddate=>"XXX",
947
+ :revdate=>"2000-01-01",
948
+ :revdate_monthyear=>"Janvier 2000",
949
+ :sc=>"B 2",
950
+ :script=>"Latn",
951
+ :secretariat=>"SECRETARIAT",
952
+ :stage=>"10",
953
+ :stage_int=>10,
954
+ :stageabbr=>"NWIP",
955
+ :statusabbr=>"PreNWIP3",
956
+ :tc=>"A 1",
957
+ :transmitteddate=>"XXX",
958
+ :unchangeddate=>"XXX",
959
+ :unpublished=>true,
960
+ :updateddate=>"XXX",
961
+ :vote_endeddate=>"XXX",
962
+ :vote_starteddate=>"XXX",
963
+ :wg=>"C 3"}
964
+ OUTPUT
965
+ end
945
966
 
946
967
  it "processes middle title" do
947
- expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
968
+ output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
948
969
  <iso-standard xmlns="http://riboseinc.com/isoxml">
949
- <bibdata>
950
- <title language='en' format='text/plain' type='title-intro'>Introduction</title>
951
- <title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
952
- <title language='en' format='text/plain' type='title-part'>Title Part</title>
953
- <title language='en' format='text/plain' type='title-amd'>Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
954
- <ext>
955
- <structuredidentifier>
956
- <project-number part='1' amendment='1' corrigendum='2' origyr='2016-05-01'>17301</project-number>
957
- </structuredidentifier>
958
- </ext>
959
- </bibdata>
960
- <sections/>
970
+ <bibdata>
971
+ <title format="text/plain" language="en" type="title-intro">Introduction</title>
972
+ <title format="text/plain" language="en" type="title-main">Main Title — Title</title>
973
+ <title format="text/plain" language="en" type="title-part">Title Part</title>
974
+ <title format="text/plain" language="en" type="title-amd">Mass fraction of extraneous matter, milled rice (nonglutinous), sample dividers and recommendations relating to storage and transport conditions</title>
975
+ <ext>
976
+ <structuredidentifier>
977
+ <project-number amendment="1" corrigendum="2" origyr="2016-05-01" part="1">17301</project-number>
978
+ </structuredidentifier>
979
+ </ext>
980
+ </bibdata>
981
+ <sections/>
961
982
  </iso-standard>
962
983
  INPUT
963
- #{HTML_HDR}
964
- <p class='zzSTDTitle1'>Introduction &#8212; Main Title&#8201;&#8212;&#8201;Title &#8212; </p>
965
- <p class='zzSTDTitle2'>
966
- Part&#160;1:
967
- <br/><b>Title Part</b>
968
- </p>
969
- <p class='zzSTDTitle2'>
970
- AMENDMENT&#160;1: Mass fraction of extraneous matter, milled rice
971
- (nonglutinous), sample dividers and recommendations relating to storage
972
- and transport conditions
973
- </p>
974
- <p class='zzSTDTitle2'>TECHNICAL CORRIGENDUM&#160;2</p>
975
- </div>
976
- </body>
977
- </html>
978
- OUTPUT
979
- end
980
-
984
+ expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
981
985
 
986
+ #{HTML_HDR}
987
+ <p class='zzSTDTitle1'>Introduction &#8212; Main Title&#8201;&#8212;&#8201;Title &#8212; </p>
988
+ <p class='zzSTDTitle2'>
989
+ Part&#160;1:
990
+ <br/><b>Title Part</b>
991
+ </p>
992
+ <p class='zzSTDTitle2'>
993
+ AMENDMENT&#160;1: Mass fraction of extraneous matter, milled rice
994
+ (nonglutinous), sample dividers and recommendations relating to storage
995
+ and transport conditions
996
+ </p>
997
+ <p class='zzSTDTitle2'>TECHNICAL CORRIGENDUM&#160;2</p>
998
+ </div>
999
+ </body>
1000
+ </html>
1001
+ OUTPUT
1002
+ end
982
1003
  end