metanorma-iso 1.9.3 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,799 +2,767 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "cross-references notes" do
5
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
6
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
7
- <iso-standard xmlns="http://riboseinc.com/isoxml">
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" type="scope">
22
- <title>Scope</title>
23
- <note id="N">
24
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
25
- </note>
26
- <p>
27
- <xref target="N"/>
28
- </p>
29
- </clause>
30
- <terms id="terms"/>
31
- <clause id="widgets">
32
- <title>Widgets</title>
33
- <clause id="widgets1">
34
- <note id="note1">
35
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
36
- </note>
37
- <note id="note2">
38
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
39
- </note>
40
- <p>
41
- <xref target="note1"/>
42
- <xref target="note2"/>
43
- </p>
44
- </clause>
45
- </clause>
46
- </sections>
47
- <annex id="annex1">
48
- <clause id="annex1a">
49
- <note id="AN">
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
- </clause>
53
- <clause id="annex1b">
54
- <note id="Anote1">
5
+ input = <<~INPUT
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <preface>
8
+ <foreword>
9
+ <p>
10
+ <xref target="N"/>
11
+ <xref target="note1"/>
12
+ <xref target="note2"/>
13
+ <xref target="AN"/>
14
+ <xref target="Anote1"/>
15
+ <xref target="Anote2"/>
16
+ </p>
17
+ </foreword>
18
+ </preface>
19
+ <sections>
20
+ <clause id="scope" type="scope">
21
+ <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>
26
+ <xref target="N"/>
27
+ </p>
28
+ </clause>
29
+ <terms id="terms"/>
30
+ <clause id="widgets">
31
+ <title>Widgets</title>
32
+ <clause id="widgets1">
33
+ <note id="note1">
55
34
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
56
35
  </note>
57
- <note id="Anote2">
36
+ <note id="note2">
58
37
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
59
38
  </note>
60
- </clause>
61
- </annex>
62
- </iso-standard>
63
- INPUT
64
- <?xml version='1.0'?>
65
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
66
- <preface>
67
- <foreword displayorder='1'>
68
- <p>
69
- <xref target="N">Clause 1, Note</xref>
70
- <xref target="note1">3.1, Note 1</xref>
71
- <xref target="note2">3.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" type="scope" displayorder='2'>
80
- <title depth="1">1
81
- <tab/>
82
- Scope</title>
83
- <note id="N">
84
- <name>NOTE</name>
85
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
86
- types of kernel.
87
- </p>
88
- </note>
89
39
  <p>
90
- <xref target="N">Note</xref>
40
+ <xref target="note1"/>
41
+ <xref target="note2"/>
91
42
  </p>
92
43
  </clause>
93
- <terms id="terms" displayorder='3'>
94
- <title>2</title>
95
- </terms>
96
- <clause id="widgets" displayorder='4'>
97
- <title depth="1">3
98
- <tab/>
99
- Widgets</title>
100
- <clause id="widgets1" inline-header="true">
101
- <title>3.1</title>
102
- <note id="note1">
103
- <name>NOTE 1</name>
104
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
105
- types of kernel.
106
- </p>
107
- </note>
108
- <note id="note2">
109
- <name>NOTE 2</name>
110
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
111
- types of kernel.
112
- </p>
113
- </note>
114
- <p>
115
- <xref target="note1">Note 1</xref>
116
- <xref target="note2">Note 2</xref>
117
- </p>
118
- </clause>
119
- </clause>
120
- </sections>
121
- <annex id="annex1" displayorder='5'>
122
- <title>
123
- <strong>Annex A</strong>
124
- <br/>(informative)</title>
125
- <clause id="annex1a" inline-header="true">
126
- <title>A.1</title>
127
- <note id="AN">
128
- <name>NOTE</name>
129
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
130
- types of kernel.
131
- </p>
132
- </note>
133
- </clause>
134
- <clause id="annex1b" inline-header="true">
135
- <title>A.2</title>
136
- <note id="Anote1">
44
+ </clause>
45
+ </sections>
46
+ <annex id="annex1">
47
+ <clause id="annex1a">
48
+ <note id="AN">
49
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
50
+ </note>
51
+ </clause>
52
+ <clause id="annex1b">
53
+ <note id="Anote1">
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
+ <note id="Anote2">
57
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
58
+ </note>
59
+ </clause>
60
+ </annex>
61
+ </iso-standard>
62
+ INPUT
63
+ output = <<~OUTPUT
64
+ <?xml version='1.0'?>
65
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
66
+ <preface>
67
+ <foreword displayorder='1'>
68
+ <p>
69
+ <xref target="N">Clause 1, Note</xref>
70
+ <xref target="note1">3.1, Note 1</xref>
71
+ <xref target="note2">3.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" type="scope" displayorder='2'>
80
+ <title depth="1">1
81
+ <tab/>
82
+ Scope</title>
83
+ <note id="N">
84
+ <name>NOTE</name>
85
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
86
+ types of kernel.
87
+ </p>
88
+ </note>
89
+ <p>
90
+ <xref target="N">Note</xref>
91
+ </p>
92
+ </clause>
93
+ <terms id="terms" displayorder='3'>
94
+ <title>2</title>
95
+ </terms>
96
+ <clause id="widgets" displayorder='4'>
97
+ <title depth="1">3
98
+ <tab/>
99
+ Widgets</title>
100
+ <clause id="widgets1" inline-header="true">
101
+ <title>3.1</title>
102
+ <note id="note1">
137
103
  <name>NOTE 1</name>
138
104
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
139
105
  types of kernel.
140
106
  </p>
141
107
  </note>
142
- <note id="Anote2">
108
+ <note id="note2">
143
109
  <name>NOTE 2</name>
144
110
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different
145
111
  types of kernel.
146
112
  </p>
147
113
  </note>
114
+ <p>
115
+ <xref target="note1">Note 1</xref>
116
+ <xref target="note2">Note 2</xref>
117
+ </p>
148
118
  </clause>
149
- </annex>
150
- </iso-standard>
151
- OUTPUT
119
+ </clause>
120
+ </sections>
121
+ <annex id="annex1" displayorder='5'>
122
+ <title>
123
+ <strong>Annex A</strong>
124
+ <br/>(informative)</title>
125
+ <clause id="annex1a" inline-header="true">
126
+ <title>A.1</title>
127
+ <note id="AN">
128
+ <name>NOTE</name>
129
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different
130
+ types of kernel.
131
+ </p>
132
+ </note>
133
+ </clause>
134
+ <clause id="annex1b" inline-header="true">
135
+ <title>A.2</title>
136
+ <note id="Anote1">
137
+ <name>NOTE 1</name>
138
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">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">These results are based on a study carried out on three different
145
+ types of kernel.
146
+ </p>
147
+ </note>
148
+ </clause>
149
+ </annex>
150
+ </iso-standard>
151
+ OUTPUT
152
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
153
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
152
154
  end
153
155
 
154
156
  it "cross-references figures (Presentation XML)" do
155
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
156
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
157
- <iso-standard xmlns="http://riboseinc.com/isoxml">
158
- <preface>
159
- <foreword id="fwd">
160
- <p>
161
- <xref target="N"/>
162
- <xref target="note1"/>
163
- <xref target="note2"/>
164
- <xref target="AN"/>
165
- <xref target="Anote1"/>
166
- <xref target="Anote2"/>
167
- </p>
168
- </foreword>
169
- </preface>
170
- <sections>
171
- <clause id="scope" type="scope">
172
- <title>Scope</title>
173
- <figure id="N">
174
- <name>Split-it-right sample divider</name>
175
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
176
- </figure>
177
- <p>
178
- <xref target="N"/>
179
- </p>
180
- </clause>
181
- <terms id="terms"/>
182
- <clause id="widgets">
183
- <title>Widgets</title>
184
- <clause id="widgets1">
185
- <figure id="note1">
186
- <name>Split-it-right sample divider</name>
187
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
188
- </figure>
189
- <figure id="note2">
190
- <name>Split-it-right sample divider</name>
191
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
192
- </figure>
193
- <p>
194
- <xref target="note1"/>
195
- <xref target="note2"/>
196
- </p>
197
- </clause>
198
- </clause>
199
- </sections>
200
- <annex id="annex1">
201
- <clause id="annex1a">
202
- <figure id="AN">
203
- <name>Split-it-right sample divider</name>
204
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
205
- </figure>
206
- </clause>
207
- <clause id="annex1b">
208
- <figure id="Anote1">
157
+ input = <<~INPUT
158
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
159
+ <preface>
160
+ <foreword id="fwd">
161
+ <p>
162
+ <xref target="N"/>
163
+ <xref target="note1"/>
164
+ <xref target="note2"/>
165
+ <xref target="AN"/>
166
+ <xref target="Anote1"/>
167
+ <xref target="Anote2"/>
168
+ </p>
169
+ </foreword>
170
+ </preface>
171
+ <sections>
172
+ <clause id="scope" type="scope">
173
+ <title>Scope</title>
174
+ <figure id="N">
175
+ <name>Split-it-right sample divider</name>
176
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
177
+ </figure>
178
+ <p>
179
+ <xref target="N"/>
180
+ </p>
181
+ </clause>
182
+ <terms id="terms"/>
183
+ <clause id="widgets">
184
+ <title>Widgets</title>
185
+ <clause id="widgets1">
186
+ <figure id="note1">
209
187
  <name>Split-it-right sample divider</name>
210
188
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
211
189
  </figure>
212
- <figure id="Anote2">
190
+ <figure id="note2">
213
191
  <name>Split-it-right sample divider</name>
214
192
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
215
193
  </figure>
216
- </clause>
217
- </annex>
218
- </iso-standard>
219
- INPUT
220
- <?xml version='1.0'?>
221
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
222
- <preface>
223
- <foreword id="fwd" displayorder='1'>
224
- <p>
225
- <xref target="N">Figure 1</xref>
226
- <xref target="note1">Figure 2</xref>
227
- <xref target="note2">Figure 3</xref>
228
- <xref target="AN">Figure A.1</xref>
229
- <xref target="Anote1">Figure A.2</xref>
230
- <xref target="Anote2">Figure A.3</xref>
231
- </p>
232
- </foreword>
233
- </preface>
234
- <sections>
235
- <clause id="scope" type="scope" displayorder='2'>
236
- <title depth="1">1
237
- <tab/>
238
- Scope</title>
239
- <figure id="N">
240
- <name>Figure 1 — Split-it-right sample divider</name>
241
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
242
- </figure>
243
194
  <p>
244
- <xref target="N">Figure 1</xref>
195
+ <xref target="note1"/>
196
+ <xref target="note2"/>
245
197
  </p>
246
198
  </clause>
247
- <terms id="terms" displayorder='3'>
248
- <title>2</title>
249
- </terms>
250
- <clause id="widgets" displayorder='4'>
251
- <title depth="1">3
252
- <tab/>
253
- Widgets</title>
254
- <clause id="widgets1" inline-header="true">
255
- <title>3.1</title>
256
- <figure id="note1">
257
- <name>Figure 2 — Split-it-right sample divider</name>
258
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
259
- </figure>
260
- <figure id="note2">
261
- <name>Figure 3 — Split-it-right sample divider</name>
262
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
263
- </figure>
264
- <p>
265
- <xref target="note1">Figure 2</xref>
266
- <xref target="note2">Figure 3</xref>
267
- </p>
268
- </clause>
269
- </clause>
270
- </sections>
271
- <annex id="annex1" displayorder='5'>
272
- <title>
273
- <strong>Annex A</strong>
274
- <br/>(informative)</title>
275
- <clause id="annex1a" inline-header="true">
276
- <title>A.1</title>
277
- <figure id="AN">
278
- <name>Figure A.1 — Split-it-right sample divider</name>
279
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
280
- </figure>
281
- </clause>
282
- <clause id="annex1b" inline-header="true">
283
- <title>A.2</title>
284
- <figure id="Anote1">
285
- <name>Figure A.2 — Split-it-right sample divider</name>
199
+ </clause>
200
+ </sections>
201
+ <annex id="annex1">
202
+ <clause id="annex1a">
203
+ <figure id="AN">
204
+ <name>Split-it-right sample divider</name>
205
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
206
+ </figure>
207
+ </clause>
208
+ <clause id="annex1b">
209
+ <figure id="Anote1">
210
+ <name>Split-it-right sample divider</name>
211
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
212
+ </figure>
213
+ <figure id="Anote2">
214
+ <name>Split-it-right sample divider</name>
215
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
216
+ </figure>
217
+ </clause>
218
+ </annex>
219
+ </iso-standard>
220
+ INPUT
221
+ output = <<~OUTPUT
222
+ <?xml version='1.0'?>
223
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
224
+ <preface>
225
+ <foreword id="fwd" displayorder='1'>
226
+ <p>
227
+ <xref target="N">Figure 1</xref>
228
+ <xref target="note1">Figure 2</xref>
229
+ <xref target="note2">Figure 3</xref>
230
+ <xref target="AN">Figure A.1</xref>
231
+ <xref target="Anote1">Figure A.2</xref>
232
+ <xref target="Anote2">Figure A.3</xref>
233
+ </p>
234
+ </foreword>
235
+ </preface>
236
+ <sections>
237
+ <clause id="scope" type="scope" displayorder='2'>
238
+ <title depth="1">1
239
+ <tab/>
240
+ Scope</title>
241
+ <figure id="N">
242
+ <name>Figure 1 — Split-it-right sample divider</name>
243
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
244
+ </figure>
245
+ <p>
246
+ <xref target="N">Figure 1</xref>
247
+ </p>
248
+ </clause>
249
+ <terms id="terms" displayorder='3'>
250
+ <title>2</title>
251
+ </terms>
252
+ <clause id="widgets" displayorder='4'>
253
+ <title depth="1">3
254
+ <tab/>
255
+ Widgets</title>
256
+ <clause id="widgets1" inline-header="true">
257
+ <title>3.1</title>
258
+ <figure id="note1">
259
+ <name>Figure 2 — Split-it-right sample divider</name>
286
260
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
287
261
  </figure>
288
- <figure id="Anote2">
289
- <name>Figure A.3 — Split-it-right sample divider</name>
262
+ <figure id="note2">
263
+ <name>Figure 3 — Split-it-right sample divider</name>
290
264
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
291
265
  </figure>
266
+ <p>
267
+ <xref target="note1">Figure 2</xref>
268
+ <xref target="note2">Figure 3</xref>
269
+ </p>
292
270
  </clause>
293
- </annex>
294
- </iso-standard>
295
- OUTPUT
271
+ </clause>
272
+ </sections>
273
+ <annex id="annex1" displayorder='5'>
274
+ <title>
275
+ <strong>Annex A</strong>
276
+ <br/>(informative)</title>
277
+ <clause id="annex1a" inline-header="true">
278
+ <title>A.1</title>
279
+ <figure id="AN">
280
+ <name>Figure A.1 — Split-it-right sample divider</name>
281
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
282
+ </figure>
283
+ </clause>
284
+ <clause id="annex1b" inline-header="true">
285
+ <title>A.2</title>
286
+ <figure id="Anote1">
287
+ <name>Figure A.2 — Split-it-right sample divider</name>
288
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
289
+ </figure>
290
+ <figure id="Anote2">
291
+ <name>Figure A.3 — Split-it-right sample divider</name>
292
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
293
+ </figure>
294
+ </clause>
295
+ </annex>
296
+ </iso-standard>
297
+ OUTPUT
298
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
299
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
296
300
  end
297
301
 
298
302
  it "cross-references subfigures (Presentation XML)" do
299
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
300
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
301
- <iso-standard xmlns="http://riboseinc.com/isoxml">
302
- <preface>
303
- <foreword id="fwd">
304
- <p>
305
- <xref target="N"/>
306
- <xref target="note1"/>
307
- <xref target="note2"/>
308
- <xref target="AN"/>
309
- <xref target="Anote1"/>
310
- <xref target="Anote2"/>
311
- </p>
312
- </foreword>
313
- </preface>
314
- <sections>
315
- <clause id="scope" type="scope">
316
- <title>Scope</title>
317
- </clause>
318
- <terms id="terms"/>
319
- <clause id="widgets">
320
- <title>Widgets</title>
321
- <clause id="widgets1">
322
- <figure id="N">
323
- <figure id="note1">
324
- <name>Split-it-right sample divider</name>
325
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
326
- </figure>
327
- <figure id="note2">
328
- <name>Split-it-right sample divider</name>
329
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
330
- </figure>
331
- </figure>
332
- <p>
333
- <xref target="note1"/>
334
- <xref target="note2"/>
335
- </p>
336
- </clause>
337
- </clause>
338
- </sections>
339
- <annex id="annex1">
340
- <clause id="annex1a"/>
341
- <clause id="annex1b">
342
- <figure id="AN">
343
- <figure id="Anote1">
303
+ input = <<~INPUT
304
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
305
+ <preface>
306
+ <foreword id="fwd">
307
+ <p>
308
+ <xref target="N"/>
309
+ <xref target="note1"/>
310
+ <xref target="note2"/>
311
+ <xref target="AN"/>
312
+ <xref target="Anote1"/>
313
+ <xref target="Anote2"/>
314
+ </p>
315
+ </foreword>
316
+ </preface>
317
+ <sections>
318
+ <clause id="scope" type="scope">
319
+ <title>Scope</title>
320
+ </clause>
321
+ <terms id="terms"/>
322
+ <clause id="widgets">
323
+ <title>Widgets</title>
324
+ <clause id="widgets1">
325
+ <figure id="N">
326
+ <figure id="note1">
344
327
  <name>Split-it-right sample divider</name>
345
328
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
346
329
  </figure>
347
- <figure id="Anote2">
330
+ <figure id="note2">
348
331
  <name>Split-it-right sample divider</name>
349
332
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
350
333
  </figure>
351
334
  </figure>
352
- </clause>
353
- </annex>
354
- </iso-standard>
355
- INPUT
356
- <?xml version='1.0'?>
357
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
358
- <preface>
359
- <foreword id="fwd" displayorder='1'>
360
335
  <p>
361
- <xref target="N">Figure 1</xref>
362
- <xref target="note1">Figure 1 a)</xref>
363
- <xref target="note2">Figure 1 b)</xref>
364
- <xref target="AN">Figure A.1</xref>
365
- <xref target="Anote1">Figure A.1 a)</xref>
366
- <xref target="Anote2">Figure A.1 b)</xref>
336
+ <xref target="note1"/>
337
+ <xref target="note2"/>
367
338
  </p>
368
- </foreword>
369
- </preface>
370
- <sections>
371
- <clause id="scope" type="scope" displayorder='2'>
372
- <title depth="1">1
373
- <tab/>
374
- Scope</title>
375
- </clause>
376
- <terms id="terms" displayorder='3'>
377
- <title>2</title>
378
- </terms>
379
- <clause id="widgets" displayorder='4'>
380
- <title depth="1">3
381
- <tab/>
382
- Widgets</title>
383
- <clause id="widgets1" inline-header="true">
384
- <title>3.1</title>
385
- <figure id="N">
386
- <name>Figure 1</name>
387
- <figure id="note1">
388
- <name>a)  Split-it-right sample divider</name>
389
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
390
- </figure>
391
- <figure id="note2">
392
- <name>b)  Split-it-right sample divider</name>
393
- <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
394
- </figure>
395
- </figure>
396
- <p>
397
- <xref target="note1">Figure 1 a)</xref>
398
- <xref target="note2">Figure 1 b)</xref>
399
- </p>
400
- </clause>
401
- </clause>
402
- </sections>
403
- <annex id="annex1" displayorder='5'>
404
- <title>
405
- <strong>Annex A</strong>
406
- <br/>(informative)</title>
407
- <clause id="annex1a" inline-header="true">
408
- <title>A.1</title>
409
339
  </clause>
410
- <clause id="annex1b" inline-header="true">
411
- <title>A.2</title>
412
- <figure id="AN">
413
- <name>Figure A.1</name>
414
- <figure id="Anote1">
340
+ </clause>
341
+ </sections>
342
+ <annex id="annex1">
343
+ <clause id="annex1a"/>
344
+ <clause id="annex1b">
345
+ <figure id="AN">
346
+ <figure id="Anote1">
347
+ <name>Split-it-right sample divider</name>
348
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
349
+ </figure>
350
+ <figure id="Anote2">
351
+ <name>Split-it-right sample divider</name>
352
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
353
+ </figure>
354
+ </figure>
355
+ </clause>
356
+ </annex>
357
+ </iso-standard>
358
+ INPUT
359
+ output = <<~OUTPUT
360
+ <?xml version='1.0'?>
361
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
362
+ <preface>
363
+ <foreword id="fwd" displayorder='1'>
364
+ <p>
365
+ <xref target="N">Figure 1</xref>
366
+ <xref target="note1">Figure 1 a)</xref>
367
+ <xref target="note2">Figure 1 b)</xref>
368
+ <xref target="AN">Figure A.1</xref>
369
+ <xref target="Anote1">Figure A.1 a)</xref>
370
+ <xref target="Anote2">Figure A.1 b)</xref>
371
+ </p>
372
+ </foreword>
373
+ </preface>
374
+ <sections>
375
+ <clause id="scope" type="scope" displayorder='2'>
376
+ <title depth="1">1
377
+ <tab/>
378
+ Scope</title>
379
+ </clause>
380
+ <terms id="terms" displayorder='3'>
381
+ <title>2</title>
382
+ </terms>
383
+ <clause id="widgets" displayorder='4'>
384
+ <title depth="1">3
385
+ <tab/>
386
+ Widgets</title>
387
+ <clause id="widgets1" inline-header="true">
388
+ <title>3.1</title>
389
+ <figure id="N">
390
+ <name>Figure 1</name>
391
+ <figure id="note1">
415
392
  <name>a)  Split-it-right sample divider</name>
416
393
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
417
394
  </figure>
418
- <figure id="Anote2">
395
+ <figure id="note2">
419
396
  <name>b)  Split-it-right sample divider</name>
420
397
  <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
421
398
  </figure>
422
399
  </figure>
400
+ <p>
401
+ <xref target="note1">Figure 1 a)</xref>
402
+ <xref target="note2">Figure 1 b)</xref>
403
+ </p>
423
404
  </clause>
424
- </annex>
425
- </iso-standard>
426
- OUTPUT
405
+ </clause>
406
+ </sections>
407
+ <annex id="annex1" displayorder='5'>
408
+ <title>
409
+ <strong>Annex A</strong>
410
+ <br/>(informative)</title>
411
+ <clause id="annex1a" inline-header="true">
412
+ <title>A.1</title>
413
+ </clause>
414
+ <clause id="annex1b" inline-header="true">
415
+ <title>A.2</title>
416
+ <figure id="AN">
417
+ <name>Figure A.1</name>
418
+ <figure id="Anote1">
419
+ <name>a)  Split-it-right sample divider</name>
420
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
421
+ </figure>
422
+ <figure id="Anote2">
423
+ <name>b)  Split-it-right sample divider</name>
424
+ <image id="_8357ede4-6d44-4672-bac4-9a85e82ab7f0" mimetype="image/png" src="rice_images/rice_image1.png"/>
425
+ </figure>
426
+ </figure>
427
+ </clause>
428
+ </annex>
429
+ </iso-standard>
430
+ OUTPUT
431
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
432
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
427
433
  end
428
434
 
429
435
  it "cross-references examples" do
430
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
431
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
432
- <iso-standard xmlns="http://riboseinc.com/isoxml">
433
- <preface>
434
- <foreword>
435
- <p>
436
- <xref target="N"/>
437
- <xref target="note1"/>
438
- <xref target="note2"/>
439
- <xref target="AN"/>
440
- <xref target="Anote1"/>
441
- <xref target="Anote2"/>
442
- </p>
443
- </foreword>
444
- </preface>
445
- <sections>
446
- <clause id="scope" type="scope">
447
- <title>Scope</title>
448
- <example id="N">
449
- <p>Hello</p>
450
- </example>
451
- <p>
452
- <xref target="N"/>
453
- </p>
454
- </clause>
455
- <terms id="terms"/>
456
- <clause id="widgets">
457
- <title>Widgets</title>
458
- <clause id="widgets1">
459
- <example id="note1">
460
- <p>Hello</p>
461
- </example>
462
- <example id="note2">
463
- <p>Hello</p>
464
- </example>
465
- <p>
466
- <xref target="note1"/>
467
- <xref target="note2"/>
468
- </p>
469
- </clause>
470
- </clause>
471
- </sections>
472
- <annex id="annex1">
473
- <clause id="annex1a">
474
- <example id="AN">
475
- <p>Hello</p>
476
- </example>
477
- </clause>
478
- <clause id="annex1b">
479
- <example id="Anote1">
480
- <p>Hello</p>
481
- </example>
482
- <example id="Anote2">
483
- <p>Hello</p>
484
- </example>
485
- </clause>
486
- </annex>
487
- </iso-standard>
488
- INPUT
489
- <?xml version='1.0'?>
490
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
491
- <preface>
492
- <foreword displayorder='1'>
493
- <p>
494
- <xref target="N">Clause 1, Example</xref>
495
- <xref target="note1">3.1, Example 1</xref>
496
- <xref target="note2">3.1, Example 2</xref>
497
- <xref target="AN">A.1, Example</xref>
498
- <xref target="Anote1">A.2, Example 1</xref>
499
- <xref target="Anote2">A.2, Example 2</xref>
500
- </p>
501
- </foreword>
502
- </preface>
503
- <sections>
504
- <clause id="scope" type="scope" displayorder='2'>
505
- <title depth="1">1
506
- <tab/>
507
- Scope</title>
508
- <example id="N">
509
- <name>EXAMPLE</name>
510
- <p>Hello</p>
511
- </example>
512
- <p>
513
- <xref target="N">Example</xref>
514
- </p>
515
- </clause>
516
- <terms id="terms" displayorder='3'>
517
- <title>2</title>
518
- </terms>
519
- <clause id="widgets" displayorder='4'>
520
- <title depth="1">3
521
- <tab/>
522
- Widgets</title>
523
- <clause id="widgets1" inline-header="true">
524
- <title>3.1</title>
525
- <example id="note1">
526
- <name>EXAMPLE 1</name>
527
- <p>Hello</p>
528
- </example>
529
- <example id="note2">
530
- <name>EXAMPLE 2</name>
531
- <p>Hello</p>
532
- </example>
533
- <p>
534
- <xref target="note1">Example 1</xref>
535
- <xref target="note2">Example 2</xref>
536
- </p>
537
- </clause>
538
- </clause>
539
- </sections>
540
- <annex id="annex1" displayorder='5'>
541
- <title>
542
- <strong>Annex A</strong>
543
- <br/>(informative)</title>
544
- <clause id="annex1a" inline-header="true">
545
- <title>A.1</title>
546
- <example id="AN">
547
- <name>EXAMPLE</name>
548
- <p>Hello</p>
549
- </example>
550
- </clause>
551
- <clause id="annex1b" inline-header="true">
552
- <title>A.2</title>
553
- <example id="Anote1">
554
- <name>EXAMPLE 1</name>
436
+ input = <<~INPUT
437
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
438
+ <preface>
439
+ <foreword>
440
+ <p>
441
+ <xref target="N"/>
442
+ <xref target="note1"/>
443
+ <xref target="note2"/>
444
+ <xref target="AN"/>
445
+ <xref target="Anote1"/>
446
+ <xref target="Anote2"/>
447
+ </p>
448
+ </foreword>
449
+ </preface>
450
+ <sections>
451
+ <clause id="scope" type="scope">
452
+ <title>Scope</title>
453
+ <example id="N">
454
+ <p>Hello</p>
455
+ </example>
456
+ <p>
457
+ <xref target="N"/>
458
+ </p>
459
+ </clause>
460
+ <terms id="terms"/>
461
+ <clause id="widgets">
462
+ <title>Widgets</title>
463
+ <clause id="widgets1">
464
+ <example id="note1">
555
465
  <p>Hello</p>
556
466
  </example>
557
- <example id="Anote2">
558
- <name>EXAMPLE 2</name>
467
+ <example id="note2">
559
468
  <p>Hello</p>
560
469
  </example>
561
- </clause>
562
- </annex>
563
- </iso-standard>
564
- OUTPUT
565
- end
566
-
567
- it "cross-references formulae" do
568
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
569
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
570
- <iso-standard xmlns="http://riboseinc.com/isoxml">
571
- <preface>
572
- <foreword>
573
470
  <p>
574
- <xref target="N"/>
575
471
  <xref target="note1"/>
576
472
  <xref target="note2"/>
577
- <xref target="AN"/>
578
- <xref target="Anote1"/>
579
- <xref target="Anote2"/>
580
473
  </p>
581
- </foreword>
582
- </preface>
583
- <sections>
584
- <clause id="scope" type="scope">
585
- <title>Scope</title>
586
- <formula id="N">
587
- <stem type="AsciiMath">r = 1 %</stem>
588
- </formula>
589
- <p>
590
- <xref target="N"/>
591
- </p>
592
- </clause>
593
- <terms id="terms"/>
594
- <clause id="widgets">
595
- <title>Widgets</title>
596
- <clause id="widgets1">
597
- <formula id="note1">
598
- <stem type="AsciiMath">r = 1 %</stem>
599
- </formula>
600
- <formula id="note2">
601
- <stem type="AsciiMath">r = 1 %</stem>
602
- </formula>
603
- <p>
604
- <xref target="note1"/>
605
- <xref target="note2"/>
606
- </p>
607
- </clause>
608
- </clause>
609
- </sections>
610
- <annex id="annex1">
611
- <clause id="annex1a">
612
- <formula id="AN">
613
- <stem type="AsciiMath">r = 1 %</stem>
614
- </formula>
615
- </clause>
616
- <clause id="annex1b">
617
- <formula id="Anote1">
618
- <stem type="AsciiMath">r = 1 %</stem>
619
- </formula>
620
- <formula id="Anote2">
621
- <stem type="AsciiMath">r = 1 %</stem>
622
- </formula>
623
474
  </clause>
624
- </annex>
625
- </iso-standard>
626
- <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934">
627
- <stem type="AsciiMath">r = 1 %</stem>
628
- <dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
629
- <dt>
630
- <stem type="AsciiMath">r</stem>
631
- </dt>
632
- <dd>
633
- <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
634
- </dd>
635
- </dl>
636
- </formula>
637
- </foreword>
638
- </preface>
639
- </iso-standard>
640
- INPUT
641
- <?xml version='1.0'?>
642
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
643
- <preface>
644
- <foreword displayorder='1'>
475
+ </clause>
476
+ </sections>
477
+ <annex id="annex1">
478
+ <clause id="annex1a">
479
+ <example id="AN">
480
+ <p>Hello</p>
481
+ </example>
482
+ </clause>
483
+ <clause id="annex1b">
484
+ <example id="Anote1">
485
+ <p>Hello</p>
486
+ </example>
487
+ <example id="Anote2">
488
+ <p>Hello</p>
489
+ </example>
490
+ </clause>
491
+ </annex>
492
+ </iso-standard>
493
+ INPUT
494
+ output = <<~OUTPUT
495
+ <?xml version='1.0'?>
496
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
497
+ <preface>
498
+ <foreword displayorder='1'>
499
+ <p>
500
+ <xref target="N">Clause 1, Example</xref>
501
+ <xref target="note1">3.1, Example 1</xref>
502
+ <xref target="note2">3.1, Example 2</xref>
503
+ <xref target="AN">A.1, Example</xref>
504
+ <xref target="Anote1">A.2, Example 1</xref>
505
+ <xref target="Anote2">A.2, Example 2</xref>
506
+ </p>
507
+ </foreword>
508
+ </preface>
509
+ <sections>
510
+ <clause id="scope" type="scope" displayorder='2'>
511
+ <title depth="1">1
512
+ <tab/>
513
+ Scope</title>
514
+ <example id="N">
515
+ <name>EXAMPLE</name>
516
+ <p>Hello</p>
517
+ </example>
518
+ <p>
519
+ <xref target="N">Example</xref>
520
+ </p>
521
+ </clause>
522
+ <terms id="terms" displayorder='3'>
523
+ <title>2</title>
524
+ </terms>
525
+ <clause id="widgets" displayorder='4'>
526
+ <title depth="1">3
527
+ <tab/>
528
+ Widgets</title>
529
+ <clause id="widgets1" inline-header="true">
530
+ <title>3.1</title>
531
+ <example id="note1">
532
+ <name>EXAMPLE 1</name>
533
+ <p>Hello</p>
534
+ </example>
535
+ <example id="note2">
536
+ <name>EXAMPLE 2</name>
537
+ <p>Hello</p>
538
+ </example>
645
539
  <p>
646
- <xref target="N">Clause 1, Formula (1)</xref>
647
- <xref target="note1">3.1, Formula (2)</xref>
648
- <xref target="note2">3.1, Formula (3)</xref>
649
- <xref target="AN">A.1, Formula (A.1)</xref>
650
- <xref target="Anote1">A.2, Formula (A.2)</xref>
651
- <xref target="Anote2">A.2, Formula (A.3)</xref>
540
+ <xref target="note1">Example 1</xref>
541
+ <xref target="note2">Example 2</xref>
652
542
  </p>
653
- </foreword>
654
- </preface>
655
- <sections>
656
- <clause id="scope" type="scope" displayorder='2'>
657
- <title depth="1">1
658
- <tab/>
659
- Scope</title>
660
- <formula id="N">
661
- <name>1</name>
543
+ </clause>
544
+ </clause>
545
+ </sections>
546
+ <annex id="annex1" displayorder='5'>
547
+ <title>
548
+ <strong>Annex A</strong>
549
+ <br/>(informative)</title>
550
+ <clause id="annex1a" inline-header="true">
551
+ <title>A.1</title>
552
+ <example id="AN">
553
+ <name>EXAMPLE</name>
554
+ <p>Hello</p>
555
+ </example>
556
+ </clause>
557
+ <clause id="annex1b" inline-header="true">
558
+ <title>A.2</title>
559
+ <example id="Anote1">
560
+ <name>EXAMPLE 1</name>
561
+ <p>Hello</p>
562
+ </example>
563
+ <example id="Anote2">
564
+ <name>EXAMPLE 2</name>
565
+ <p>Hello</p>
566
+ </example>
567
+ </clause>
568
+ </annex>
569
+ </iso-standard>
570
+ OUTPUT
571
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
572
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
573
+ end
574
+
575
+ it "cross-references formulae" do
576
+ input = <<~INPUT
577
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
578
+ <preface>
579
+ <foreword>
580
+ <p>
581
+ <xref target="N"/>
582
+ <xref target="note1"/>
583
+ <xref target="note2"/>
584
+ <xref target="AN"/>
585
+ <xref target="Anote1"/>
586
+ <xref target="Anote2"/>
587
+ </p>
588
+ </foreword>
589
+ </preface>
590
+ <sections>
591
+ <clause id="scope" type="scope">
592
+ <title>Scope</title>
593
+ <formula id="N">
594
+ <stem type="AsciiMath">r = 1 %</stem>
595
+ </formula>
596
+ <p>
597
+ <xref target="N"/>
598
+ </p>
599
+ </clause>
600
+ <terms id="terms"/>
601
+ <clause id="widgets">
602
+ <title>Widgets</title>
603
+ <clause id="widgets1">
604
+ <formula id="note1">
662
605
  <stem type="AsciiMath">r = 1 %</stem>
663
606
  </formula>
664
- <p>
665
- <xref target="N">Formula (1)</xref>
666
- </p>
667
- </clause>
668
- <terms id="terms" displayorder='3'>
669
- <title>2</title>
670
- </terms>
671
- <clause id="widgets" displayorder='4'>
672
- <title depth="1">3
673
- <tab/>
674
- Widgets</title>
675
- <clause id="widgets1" inline-header="true">
676
- <title>3.1</title>
677
- <formula id="note1">
678
- <name>2</name>
679
- <stem type="AsciiMath">r = 1 %</stem>
680
- </formula>
681
- <formula id="note2">
682
- <name>3</name>
683
- <stem type="AsciiMath">r = 1 %</stem>
684
- </formula>
685
- <p>
686
- <xref target="note1">Formula (2)</xref>
687
- <xref target="note2">Formula (3)</xref>
688
- </p>
689
- </clause>
690
- </clause>
691
- </sections>
692
- <annex id="annex1" displayorder='5'>
693
- <title>
694
- <strong>Annex A</strong>
695
- <br/>(informative)</title>
696
- <clause id="annex1a" inline-header="true">
697
- <title>A.1</title>
698
- <formula id="AN">
699
- <name>A.1</name>
607
+ <formula id="note2">
700
608
  <stem type="AsciiMath">r = 1 %</stem>
701
609
  </formula>
610
+ <p>
611
+ <xref target="note1"/>
612
+ <xref target="note2"/>
613
+ </p>
702
614
  </clause>
703
- <clause id="annex1b" inline-header="true">
704
- <title>A.2</title>
705
- <formula id="Anote1">
706
- <name>A.2</name>
615
+ </clause>
616
+ </sections>
617
+ <annex id="annex1">
618
+ <clause id="annex1a">
619
+ <formula id="AN">
620
+ <stem type="AsciiMath">r = 1 %</stem>
621
+ </formula>
622
+ </clause>
623
+ <clause id="annex1b">
624
+ <formula id="Anote1">
625
+ <stem type="AsciiMath">r = 1 %</stem>
626
+ </formula>
627
+ <formula id="Anote2">
628
+ <stem type="AsciiMath">r = 1 %</stem>
629
+ </formula>
630
+ </clause>
631
+ </annex>
632
+ </iso-standard>
633
+ <formula id="_be9158af-7e93-4ee2-90c5-26d31c181934">
634
+ <stem type="AsciiMath">r = 1 %</stem>
635
+ <dl id="_e4fe94fe-1cde-49d9-b1ad-743293b7e21d">
636
+ <dt>
637
+ <stem type="AsciiMath">r</stem>
638
+ </dt>
639
+ <dd>
640
+ <p id="_1b99995d-ff03-40f5-8f2e-ab9665a69b77">is the repeatability limit.</p>
641
+ </dd>
642
+ </dl>
643
+ </formula>
644
+ </foreword>
645
+ </preface>
646
+ </iso-standard>
647
+ INPUT
648
+ output = <<~OUTPUT
649
+ <?xml version='1.0'?>
650
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
651
+ <preface>
652
+ <foreword displayorder='1'>
653
+ <p>
654
+ <xref target="N">Clause 1, Formula (1)</xref>
655
+ <xref target="note1">3.1, Formula (2)</xref>
656
+ <xref target="note2">3.1, Formula (3)</xref>
657
+ <xref target="AN">A.1, Formula (A.1)</xref>
658
+ <xref target="Anote1">A.2, Formula (A.2)</xref>
659
+ <xref target="Anote2">A.2, Formula (A.3)</xref>
660
+ </p>
661
+ </foreword>
662
+ </preface>
663
+ <sections>
664
+ <clause id="scope" type="scope" displayorder='2'>
665
+ <title depth="1">1
666
+ <tab/>
667
+ Scope</title>
668
+ <formula id="N">
669
+ <name>1</name>
670
+ <stem type="AsciiMath">r = 1 %</stem>
671
+ </formula>
672
+ <p>
673
+ <xref target="N">Formula (1)</xref>
674
+ </p>
675
+ </clause>
676
+ <terms id="terms" displayorder='3'>
677
+ <title>2</title>
678
+ </terms>
679
+ <clause id="widgets" displayorder='4'>
680
+ <title depth="1">3
681
+ <tab/>
682
+ Widgets</title>
683
+ <clause id="widgets1" inline-header="true">
684
+ <title>3.1</title>
685
+ <formula id="note1">
686
+ <name>2</name>
707
687
  <stem type="AsciiMath">r = 1 %</stem>
708
688
  </formula>
709
- <formula id="Anote2">
710
- <name>A.3</name>
689
+ <formula id="note2">
690
+ <name>3</name>
711
691
  <stem type="AsciiMath">r = 1 %</stem>
712
692
  </formula>
693
+ <p>
694
+ <xref target="note1">Formula (2)</xref>
695
+ <xref target="note2">Formula (3)</xref>
696
+ </p>
713
697
  </clause>
714
- </annex>
715
- </iso-standard>
716
- OUTPUT
698
+ </clause>
699
+ </sections>
700
+ <annex id="annex1" displayorder='5'>
701
+ <title>
702
+ <strong>Annex A</strong>
703
+ <br/>(informative)</title>
704
+ <clause id="annex1a" inline-header="true">
705
+ <title>A.1</title>
706
+ <formula id="AN">
707
+ <name>A.1</name>
708
+ <stem type="AsciiMath">r = 1 %</stem>
709
+ </formula>
710
+ </clause>
711
+ <clause id="annex1b" inline-header="true">
712
+ <title>A.2</title>
713
+ <formula id="Anote1">
714
+ <name>A.2</name>
715
+ <stem type="AsciiMath">r = 1 %</stem>
716
+ </formula>
717
+ <formula id="Anote2">
718
+ <name>A.3</name>
719
+ <stem type="AsciiMath">r = 1 %</stem>
720
+ </formula>
721
+ </clause>
722
+ </annex>
723
+ </iso-standard>
724
+ OUTPUT
725
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
726
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
717
727
  end
718
728
 
719
729
  it "cross-references tables" do
720
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
721
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
722
- <iso-standard xmlns="http://riboseinc.com/isoxml">
723
- <preface>
724
- <foreword>
725
- <p>
726
- <xref target="N"/>
727
- <xref target="note1"/>
728
- <xref target="note2"/>
729
- <xref target="AN"/>
730
- <xref target="Anote1"/>
731
- <xref target="Anote2"/>
732
- </p>
733
- </foreword>
734
- </preface>
735
- <sections>
736
- <clause id="scope" type="scope">
737
- <title>Scope</title>
738
- <table id="N">
739
- <name>Repeatability and reproducibility of husked rice yield</name>
740
- <tbody>
741
- <tr>
742
- <td align="left">Number of laboratories retained after eliminating outliers</td>
743
- <td align="center">13</td>
744
- <td align="center">11</td>
745
- </tr>
746
- </tbody>
747
- </table>
748
- <p>
749
- <xref target="N"/>
750
- </p>
751
- </clause>
752
- <terms id="terms"/>
753
- <clause id="widgets">
754
- <title>Widgets</title>
755
- <clause id="widgets1">
756
- <table id="note1">
757
- <name>Repeatability and reproducibility of husked rice yield</name>
758
- <tbody>
759
- <tr>
760
- <td align="left">Number of laboratories retained after eliminating outliers</td>
761
- <td align="center">13</td>
762
- <td align="center">11</td>
763
- </tr>
764
- </tbody>
765
- </table>
766
- <table id="note2">
767
- <name>Repeatability and reproducibility of husked rice yield</name>
768
- <tbody>
769
- <tr>
770
- <td align="left">Number of laboratories retained after eliminating outliers</td>
771
- <td align="center">13</td>
772
- <td align="center">11</td>
773
- </tr>
774
- </tbody>
775
- </table>
776
- <p>
777
- <xref target="note1"/>
778
- <xref target="note2"/>
779
- </p>
780
- </clause>
781
- </clause>
782
- </sections>
783
- <annex id="annex1">
784
- <clause id="annex1a">
785
- <table id="AN">
786
- <name>Repeatability and reproducibility of husked rice yield</name>
787
- <tbody>
788
- <tr>
789
- <td align="left">Number of laboratories retained after eliminating outliers</td>
790
- <td align="center">13</td>
791
- <td align="center">11</td>
792
- </tr>
793
- </tbody>
794
- </table>
795
- </clause>
796
- <clause id="annex1b">
797
- <table id="Anote1">
730
+ input = <<~INPUT
731
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
732
+ <preface>
733
+ <foreword>
734
+ <p>
735
+ <xref target="N"/>
736
+ <xref target="note1"/>
737
+ <xref target="note2"/>
738
+ <xref target="AN"/>
739
+ <xref target="Anote1"/>
740
+ <xref target="Anote2"/>
741
+ </p>
742
+ </foreword>
743
+ </preface>
744
+ <sections>
745
+ <clause id="scope" type="scope">
746
+ <title>Scope</title>
747
+ <table id="N">
748
+ <name>Repeatability and reproducibility of husked rice yield</name>
749
+ <tbody>
750
+ <tr>
751
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
752
+ <td align="center">13</td>
753
+ <td align="center">11</td>
754
+ </tr>
755
+ </tbody>
756
+ </table>
757
+ <p>
758
+ <xref target="N"/>
759
+ </p>
760
+ </clause>
761
+ <terms id="terms"/>
762
+ <clause id="widgets">
763
+ <title>Widgets</title>
764
+ <clause id="widgets1">
765
+ <table id="note1">
798
766
  <name>Repeatability and reproducibility of husked rice yield</name>
799
767
  <tbody>
800
768
  <tr>
@@ -804,7 +772,7 @@ RSpec.describe IsoDoc do
804
772
  </tr>
805
773
  </tbody>
806
774
  </table>
807
- <table id="Anote2">
775
+ <table id="note2">
808
776
  <name>Repeatability and reproducibility of husked rice yield</name>
809
777
  <tbody>
810
778
  <tr>
@@ -814,100 +782,96 @@ RSpec.describe IsoDoc do
814
782
  </tr>
815
783
  </tbody>
816
784
  </table>
817
- </clause>
818
- </annex>
819
- </iso-standard>
820
- INPUT
821
- <?xml version='1.0'?>
822
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
823
- <preface>
824
- <foreword displayorder='1'>
825
- <p>
826
- <xref target="N">Table 1</xref>
827
- <xref target="note1">Table 2</xref>
828
- <xref target="note2">Table 3</xref>
829
- <xref target="AN">Table A.1</xref>
830
- <xref target="Anote1">Table A.2</xref>
831
- <xref target="Anote2">Table A.3</xref>
832
- </p>
833
- </foreword>
834
- </preface>
835
- <sections>
836
- <clause id="scope" type="scope" displayorder='2'>
837
- <title depth="1">1
838
- <tab/>
839
- Scope</title>
840
- <table id="N">
841
- <name>Table 1 — Repeatability and reproducibility of husked rice yield</name>
842
- <tbody>
843
- <tr>
844
- <td align="left">Number of laboratories retained after eliminating outliers</td>
845
- <td align="center">13</td>
846
- <td align="center">11</td>
847
- </tr>
848
- </tbody>
849
- </table>
850
785
  <p>
851
- <xref target="N">Table 1</xref>
786
+ <xref target="note1"/>
787
+ <xref target="note2"/>
852
788
  </p>
853
789
  </clause>
854
- <terms id="terms" displayorder='3'>
855
- <title>2</title>
856
- </terms>
857
- <clause id="widgets" displayorder='4'>
858
- <title depth="1">3
859
- <tab/>
860
- Widgets</title>
861
- <clause id="widgets1" inline-header="true">
862
- <title>3.1</title>
863
- <table id="note1">
864
- <name>Table 2 — Repeatability and reproducibility of husked rice yield</name>
865
- <tbody>
866
- <tr>
867
- <td align="left">Number of laboratories retained after eliminating outliers</td>
868
- <td align="center">13</td>
869
- <td align="center">11</td>
870
- </tr>
871
- </tbody>
872
- </table>
873
- <table id="note2">
874
- <name>Table 3 — Repeatability and reproducibility of husked rice yield</name>
875
- <tbody>
876
- <tr>
877
- <td align="left">Number of laboratories retained after eliminating outliers</td>
878
- <td align="center">13</td>
879
- <td align="center">11</td>
880
- </tr>
881
- </tbody>
882
- </table>
883
- <p>
884
- <xref target="note1">Table 2</xref>
885
- <xref target="note2">Table 3</xref>
886
- </p>
887
- </clause>
888
- </clause>
889
- </sections>
890
- <annex id="annex1" displayorder='5'>
891
- <title>
892
- <strong>Annex A</strong>
893
- <br/>(informative)</title>
894
- <clause id="annex1a" inline-header="true">
895
- <title>A.1</title>
896
- <table id="AN">
897
- <name>Table A.1 — Repeatability and reproducibility of husked rice yield</name>
898
- <tbody>
899
- <tr>
900
- <td align="left">Number of laboratories retained after eliminating outliers</td>
901
- <td align="center">13</td>
902
- <td align="center">11</td>
903
- </tr>
904
- </tbody>
905
- </table>
906
- </clause>
907
- <clause id="annex1b" inline-header="true">
908
- <title>A.2</title>
909
- <table id="Anote1">
910
- <name>Table A.2 — Repeatability and reproducibility of husked rice yield</name>
790
+ </clause>
791
+ </sections>
792
+ <annex id="annex1">
793
+ <clause id="annex1a">
794
+ <table id="AN">
795
+ <name>Repeatability and reproducibility of husked rice yield</name>
796
+ <tbody>
797
+ <tr>
798
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
799
+ <td align="center">13</td>
800
+ <td align="center">11</td>
801
+ </tr>
802
+ </tbody>
803
+ </table>
804
+ </clause>
805
+ <clause id="annex1b">
806
+ <table id="Anote1">
807
+ <name>Repeatability and reproducibility of husked rice yield</name>
808
+ <tbody>
809
+ <tr>
810
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
811
+ <td align="center">13</td>
812
+ <td align="center">11</td>
813
+ </tr>
814
+ </tbody>
815
+ </table>
816
+ <table id="Anote2">
817
+ <name>Repeatability and reproducibility of husked rice yield</name>
818
+ <tbody>
819
+ <tr>
820
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
821
+ <td align="center">13</td>
822
+ <td align="center">11</td>
823
+ </tr>
824
+ </tbody>
825
+ </table>
826
+ </clause>
827
+ </annex>
828
+ </iso-standard>
829
+ INPUT
830
+ output = <<~OUTPUT
831
+ <?xml version='1.0'?>
832
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
833
+ <preface>
834
+ <foreword displayorder='1'>
835
+ <p>
836
+ <xref target="N">Table 1</xref>
837
+ <xref target="note1">Table 2</xref>
838
+ <xref target="note2">Table 3</xref>
839
+ <xref target="AN">Table A.1</xref>
840
+ <xref target="Anote1">Table A.2</xref>
841
+ <xref target="Anote2">Table A.3</xref>
842
+ </p>
843
+ </foreword>
844
+ </preface>
845
+ <sections>
846
+ <clause id="scope" type="scope" displayorder='2'>
847
+ <title depth="1">1
848
+ <tab/>
849
+ Scope</title>
850
+ <table id="N">
851
+ <name>Table 1 — Repeatability and reproducibility of husked rice yield</name>
852
+ <tbody>
853
+ <tr>
854
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
855
+ <td align="center">13</td>
856
+ <td align="center">11</td>
857
+ </tr>
858
+ </tbody>
859
+ </table>
860
+ <p>
861
+ <xref target="N">Table 1</xref>
862
+ </p>
863
+ </clause>
864
+ <terms id="terms" displayorder='3'>
865
+ <title>2</title>
866
+ </terms>
867
+ <clause id="widgets" displayorder='4'>
868
+ <title depth="1">3
869
+ <tab/>
870
+ Widgets</title>
871
+ <clause id="widgets1" inline-header="true">
872
+ <title>3.1</title>
873
+ <table id="note1">
874
+ <name>Table 2 — Repeatability and reproducibility of husked rice yield</name>
911
875
  <tbody>
912
876
  <tr>
913
877
  <td align="left">Number of laboratories retained after eliminating outliers</td>
@@ -916,8 +880,8 @@ RSpec.describe IsoDoc do
916
880
  </tr>
917
881
  </tbody>
918
882
  </table>
919
- <table id="Anote2">
920
- <name>Table A.3 — Repeatability and reproducibility of husked rice yield</name>
883
+ <table id="note2">
884
+ <name>Table 3 — Repeatability and reproducibility of husked rice yield</name>
921
885
  <tbody>
922
886
  <tr>
923
887
  <td align="left">Number of laboratories retained after eliminating outliers</td>
@@ -926,416 +890,469 @@ RSpec.describe IsoDoc do
926
890
  </tr>
927
891
  </tbody>
928
892
  </table>
893
+ <p>
894
+ <xref target="note1">Table 2</xref>
895
+ <xref target="note2">Table 3</xref>
896
+ </p>
929
897
  </clause>
930
- </annex>
931
- </iso-standard>
898
+ </clause>
899
+ </sections>
900
+ <annex id="annex1" displayorder='5'>
901
+ <title>
902
+ <strong>Annex A</strong>
903
+ <br/>(informative)</title>
904
+ <clause id="annex1a" inline-header="true">
905
+ <title>A.1</title>
906
+ <table id="AN">
907
+ <name>Table A.1 — Repeatability and reproducibility of husked rice yield</name>
908
+ <tbody>
909
+ <tr>
910
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
911
+ <td align="center">13</td>
912
+ <td align="center">11</td>
913
+ </tr>
914
+ </tbody>
915
+ </table>
916
+ </clause>
917
+ <clause id="annex1b" inline-header="true">
918
+ <title>A.2</title>
919
+ <table id="Anote1">
920
+ <name>Table A.2 — Repeatability and reproducibility of husked rice yield</name>
921
+ <tbody>
922
+ <tr>
923
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
924
+ <td align="center">13</td>
925
+ <td align="center">11</td>
926
+ </tr>
927
+ </tbody>
928
+ </table>
929
+ <table id="Anote2">
930
+ <name>Table A.3 — Repeatability and reproducibility of husked rice yield</name>
931
+ <tbody>
932
+ <tr>
933
+ <td align="left">Number of laboratories retained after eliminating outliers</td>
934
+ <td align="center">13</td>
935
+ <td align="center">11</td>
936
+ </tr>
937
+ </tbody>
938
+ </table>
939
+ </clause>
940
+ </annex>
941
+ </iso-standard>
932
942
  OUTPUT
943
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
944
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
933
945
  end
934
946
 
935
947
  it "cross-references term notes" do
936
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
937
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
938
- <iso-standard xmlns="http://riboseinc.com/isoxml">
939
- <preface>
940
- <foreword>
941
- <p>
942
- <xref target="note1"/>
943
- <xref target="note2"/>
944
- <xref target="note3"/>
945
- </p>
946
- </foreword>
947
- </preface>
948
- <sections>
949
- <clause id="scope" type="scope">
950
- <title>Scope</title>
951
- </clause>
952
- <terms id="terms">
953
- <term id="_waxy_rice">
954
- <preferred>waxy rice</preferred>
955
- <termnote id="note1">
956
- <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
957
- </termnote>
958
- </term>
959
- <term id="_nonwaxy_rice">
960
- <preferred>nonwaxy rice</preferred>
961
- <termnote id="note2">
962
- <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
963
- </termnote>
964
- <termnote id="note3">
965
- <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
966
- </termnote>
967
- </term>
968
- </terms>
948
+ input = <<~INPUT
949
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
950
+ <preface>
951
+ <foreword>
952
+ <p>
953
+ <xref target="note1"/>
954
+ <xref target="note2"/>
955
+ <xref target="note3"/>
956
+ </p>
957
+ </foreword>
958
+ </preface>
959
+ <sections>
960
+ <clause id="scope" type="scope">
961
+ <title>Scope</title>
962
+ </clause>
963
+ <terms id="terms">
964
+ <term id="_waxy_rice">
965
+ <preferred><expression><name>waxy rice</name></expression></preferred>
966
+ <termnote id="note1">
967
+ <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
968
+ </termnote>
969
+ </term>
970
+ <term id="_nonwaxy_rice">
971
+ <preferred><expression><name>nonwaxy rice</name></expression></preferred>
972
+ <termnote id="note2">
973
+ <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
974
+ </termnote>
975
+ <termnote id="note3">
976
+ <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p>
977
+ </termnote>
978
+ </term>
979
+ </terms>
969
980
 
970
- </iso-standard>
971
- INPUT
972
- <?xml version='1.0'?>
973
- <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
974
- <preface>
975
- <foreword displayorder='1'>
976
- <p>
977
- <xref target="note1">2.1, Note 1</xref>
978
- <xref target="note2">2.2, Note 1</xref>
979
- <xref target="note3">2.2, Note 2</xref>
980
- </p>
981
- </foreword>
982
- </preface>
983
- <sections>
984
- <clause id="scope" type="scope" displayorder='2'>
985
- <title depth="1">1
986
- <tab/>
987
- Scope</title>
988
- </clause>
989
- <terms id="terms" displayorder='3'>
990
- <title>2</title>
991
- <term id="_waxy_rice">
992
- <name>2.1</name>
993
- <preferred>waxy rice</preferred>
994
- <termnote id="note1">
995
- <name>Note 1 to entry</name>
996
- <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
997
- kernels have a tendency to stick together after cooking.
998
- </p>
999
- </termnote>
1000
- </term>
1001
- <term id="_nonwaxy_rice">
1002
- <name>2.2</name>
1003
- <preferred>nonwaxy rice</preferred>
1004
- <termnote id="note2">
1005
- <name>Note 1 to entry</name>
1006
- <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
1007
- kernels have a tendency to stick together after cooking.
1008
- </p>
1009
- </termnote>
1010
- <termnote id="note3">
1011
- <name>Note 2 to entry</name>
1012
- <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
1013
- kernels have a tendency to stick together after cooking.
1014
- </p>
1015
- </termnote>
1016
- </term>
1017
- </terms>
1018
- </sections>
1019
- </iso-standard>
1020
- OUTPUT
981
+ </iso-standard>
982
+ INPUT
983
+ output = <<~OUTPUT
984
+ <?xml version='1.0'?>
985
+ <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
986
+ <preface>
987
+ <foreword displayorder='1'>
988
+ <p>
989
+ <xref target="note1">2.1, Note 1</xref>
990
+ <xref target="note2">2.2, Note 1</xref>
991
+ <xref target="note3">2.2, Note 2</xref>
992
+ </p>
993
+ </foreword>
994
+ </preface>
995
+ <sections>
996
+ <clause id="scope" type="scope" displayorder='2'>
997
+ <title depth="1">1
998
+ <tab/>
999
+ Scope</title>
1000
+ </clause>
1001
+ <terms id="terms" displayorder='3'>
1002
+ <title>2</title>
1003
+ <term id="_waxy_rice">
1004
+ <name>2.1</name>
1005
+ <preferred>waxy rice</preferred>
1006
+ <termnote id="note1">
1007
+ <name>Note 1 to entry</name>
1008
+ <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
1009
+ kernels have a tendency to stick together after cooking.
1010
+ </p>
1011
+ </termnote>
1012
+ </term>
1013
+ <term id="_nonwaxy_rice">
1014
+ <name>2.2</name>
1015
+ <preferred>nonwaxy rice</preferred>
1016
+ <termnote id="note2">
1017
+ <name>Note 1 to entry</name>
1018
+ <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
1019
+ kernels have a tendency to stick together after cooking.
1020
+ </p>
1021
+ </termnote>
1022
+ <termnote id="note3">
1023
+ <name>Note 2 to entry</name>
1024
+ <p id="_b0cb3dfd-78fc-47dd-a339-84070d947463">The starch of waxy rice consists almost entirely of amylopectin. The
1025
+ kernels have a tendency to stick together after cooking.
1026
+ </p>
1027
+ </termnote>
1028
+ </term>
1029
+ </terms>
1030
+ </sections>
1031
+ </iso-standard>
1032
+ OUTPUT
1033
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1034
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1021
1035
  end
1022
1036
 
1023
1037
  it "cross-references sections" do
1024
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1025
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1026
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1027
- <preface>
1028
- <foreword obligation="informative">
1029
- <title>Foreword</title>
1030
- <p id="A">This is a preamble
1031
- <xref target="C"/>
1032
- <xref target="C1"/>
1033
- <xref target="D"/>
1034
- <xref target="H"/>
1035
- <xref target="I"/>
1036
- <xref target="J"/>
1037
- <xref target="K"/>
1038
- <xref target="L"/>
1039
- <xref target="M"/>
1040
- <xref target="N"/>
1041
- <xref target="O"/>
1042
- <xref target="P"/>
1043
- <xref target="Q"/>
1044
- <xref target="Q1"/>
1045
- <xref target="Q2"/>
1046
- <xref target="Q3"/>
1047
- <xref target="R"/></p>
1048
- </foreword>
1049
- <introduction id="B" obligation="informative">
1050
- <title>Introduction</title>
1051
- <clause id="C" inline-header="false" obligation="informative">
1052
- <title>Introduction Subsection</title>
1053
- </clause>
1054
- <clause id="C1" inline-header="false" obligation="informative">Text</clause>
1055
- </introduction>
1056
- </preface>
1057
- <sections>
1058
- <clause id="D" obligation="normative" type="scope">
1059
- <title>Scope</title>
1060
- <p id="E">Text</p>
1038
+ input = <<~INPUT
1039
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1040
+ <preface>
1041
+ <foreword obligation="informative">
1042
+ <title>Foreword</title>
1043
+ <p id="A">This is a preamble
1044
+ <xref target="C"/>
1045
+ <xref target="C1"/>
1046
+ <xref target="D"/>
1047
+ <xref target="H"/>
1048
+ <xref target="I"/>
1049
+ <xref target="J"/>
1050
+ <xref target="K"/>
1051
+ <xref target="L"/>
1052
+ <xref target="M"/>
1053
+ <xref target="N"/>
1054
+ <xref target="O"/>
1055
+ <xref target="P"/>
1056
+ <xref target="Q"/>
1057
+ <xref target="Q1"/>
1058
+ <xref target="Q2"/>
1059
+ <xref target="Q3"/>
1060
+ <xref target="R"/></p>
1061
+ </foreword>
1062
+ <introduction id="B" obligation="informative">
1063
+ <title>Introduction</title>
1064
+ <clause id="C" inline-header="false" obligation="informative">
1065
+ <title>Introduction Subsection</title>
1061
1066
  </clause>
1062
- <terms id="H" obligation="normative">
1063
- <title>Terms, definitions, symbols and abbreviated terms</title>
1064
- <terms id="I" obligation="normative">
1065
- <title>Normal Terms</title>
1066
- <term id="J">
1067
- <preferred>Term2</preferred>
1068
- </term>
1069
- </terms>
1070
- <definitions id="K">
1071
- <dl>
1072
- <dt>Symbol</dt>
1073
- <dd>Definition</dd>
1074
- </dl>
1075
- </definitions>
1067
+ <clause id="C1" inline-header="false" obligation="informative">Text</clause>
1068
+ </introduction>
1069
+ </preface>
1070
+ <sections>
1071
+ <clause id="D" obligation="normative" type="scope">
1072
+ <title>Scope</title>
1073
+ <p id="E">Text</p>
1074
+ </clause>
1075
+ <terms id="H" obligation="normative">
1076
+ <title>Terms, definitions, symbols and abbreviated terms</title>
1077
+ <terms id="I" obligation="normative">
1078
+ <title>Normal Terms</title>
1079
+ <term id="J">
1080
+ <preferred><expression><name>Term2</name></expression></preferred>
1081
+ </term>
1076
1082
  </terms>
1077
- <definitions id="L">
1083
+ <definitions id="K">
1078
1084
  <dl>
1079
1085
  <dt>Symbol</dt>
1080
1086
  <dd>Definition</dd>
1081
1087
  </dl>
1082
1088
  </definitions>
1083
- <clause id="M" inline-header="false" obligation="normative">
1084
- <title>Clause 4</title>
1085
- <clause id="N" inline-header="false" obligation="normative">
1086
- <title>Introduction</title>
1087
- </clause>
1088
- <clause id="O" inline-header="false" obligation="normative">
1089
- <title>Clause 4.2</title>
1090
- </clause>
1089
+ </terms>
1090
+ <definitions id="L">
1091
+ <dl>
1092
+ <dt>Symbol</dt>
1093
+ <dd>Definition</dd>
1094
+ </dl>
1095
+ </definitions>
1096
+ <clause id="M" inline-header="false" obligation="normative">
1097
+ <title>Clause 4</title>
1098
+ <clause id="N" inline-header="false" obligation="normative">
1099
+ <title>Introduction</title>
1091
1100
  </clause>
1092
- </sections>
1093
- <annex id="P" inline-header="false" obligation="normative">
1094
- <title>Annex</title>
1095
- <clause id="Q" inline-header="false" obligation="normative">
1096
- <title>Annex A.1</title>
1097
- <clause id="Q1" inline-header="false" obligation="normative">
1098
- <title>Annex A.1a</title>
1099
- </clause>
1101
+ <clause id="O" inline-header="false" obligation="normative">
1102
+ <title>Clause 4.2</title>
1100
1103
  </clause>
1101
- <appendix id="Q2" inline-header="false" obligation="normative">
1102
- <title>An Appendix</title>
1103
- <clause id="Q3" inline-header="false" obligation="normative">
1104
- <title>Appendix subclause</title>
1105
- </clause>
1106
- </appendix>
1107
- </annex>
1108
- <bibliography>
1109
- <references id="R" normative="true" obligation="informative">
1110
- <title>Normative References</title>
1111
- </references>
1112
- <clause id="S" obligation="informative">
1113
- <title>Bibliography</title>
1114
- <references id="T" normative="false" obligation="informative">
1115
- <title>Bibliography Subsection</title>
1116
- </references>
1104
+ </clause>
1105
+ </sections>
1106
+ <annex id="P" inline-header="false" obligation="normative">
1107
+ <title>Annex</title>
1108
+ <clause id="Q" inline-header="false" obligation="normative">
1109
+ <title>Annex A.1</title>
1110
+ <clause id="Q1" inline-header="false" obligation="normative">
1111
+ <title>Annex A.1a</title>
1117
1112
  </clause>
1118
- </bibliography>
1119
- </iso-standard>
1120
- INPUT
1121
- <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1122
- <preface>
1123
- <foreword obligation='informative' displayorder='1'>
1124
- <title>Foreword</title>
1125
- <p id='A'>
1126
- This is a preamble
1127
- <xref target='C'>0.1</xref>
1128
- <xref target='C1'>0.2</xref>
1129
- <xref target='D'>Clause 1</xref>
1130
- <xref target='H'>Clause 3</xref>
1131
- <xref target='I'>3.1</xref>
1132
- <xref target='J'>3.1.1</xref>
1133
- <xref target='K'>3.2</xref>
1134
- <xref target='L'>Clause 4</xref>
1135
- <xref target='M'>Clause 5</xref>
1136
- <xref target='N'>5.1</xref>
1137
- <xref target='O'>5.2</xref>
1138
- <xref target='P'>Annex A</xref>
1139
- <xref target='Q'>A.1</xref>
1140
- <xref target='Q1'>A.1.1</xref>
1141
- <xref target='Q2'>Annex A, Appendix 1</xref>
1142
- <xref target='Q3'>Annex A, Appendix 1.1</xref>
1143
- <xref target='R'>Clause 2</xref>
1144
- </p>
1145
- </foreword>
1146
- <introduction id='B' obligation='informative' displayorder='2'>
1147
- <title depth='1'>
1148
- 0
1149
- <tab/>
1150
- Introduction
1151
- </title>
1152
- <clause id='C' inline-header='false' obligation='informative'>
1153
- <title depth='2'>
1154
- 0.1
1155
- <tab/>
1156
- Introduction Subsection
1157
- </title>
1158
- </clause>
1159
- <clause id='C1' inline-header='true' obligation='informative'>
1160
- <title>0.2</title>
1161
- Text
1162
- </clause>
1163
- </introduction>
1164
- </preface>
1165
- <sections>
1166
- <clause id='D' obligation='normative' type='scope' displayorder='3'>
1167
- <title depth='1'>
1168
- 1
1113
+ </clause>
1114
+ <appendix id="Q2" inline-header="false" obligation="normative">
1115
+ <title>An Appendix</title>
1116
+ <clause id="Q3" inline-header="false" obligation="normative">
1117
+ <title>Appendix subclause</title>
1118
+ </clause>
1119
+ </appendix>
1120
+ </annex>
1121
+ <bibliography>
1122
+ <references id="R" normative="true" obligation="informative">
1123
+ <title>Normative References</title>
1124
+ </references>
1125
+ <clause id="S" obligation="informative">
1126
+ <title>Bibliography</title>
1127
+ <references id="T" normative="false" obligation="informative">
1128
+ <title>Bibliography Subsection</title>
1129
+ </references>
1130
+ </clause>
1131
+ </bibliography>
1132
+ </iso-standard>
1133
+ INPUT
1134
+ output = <<~OUTPUT
1135
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
1136
+ <preface>
1137
+ <foreword obligation='informative' displayorder='1'>
1138
+ <title>Foreword</title>
1139
+ <p id='A'>
1140
+ This is a preamble
1141
+ <xref target='C'>0.1</xref>
1142
+ <xref target='C1'>0.2</xref>
1143
+ <xref target='D'>Clause 1</xref>
1144
+ <xref target='H'>Clause 3</xref>
1145
+ <xref target='I'>3.1</xref>
1146
+ <xref target='J'>3.1.1</xref>
1147
+ <xref target='K'>3.2</xref>
1148
+ <xref target='L'>Clause 4</xref>
1149
+ <xref target='M'>Clause 5</xref>
1150
+ <xref target='N'>5.1</xref>
1151
+ <xref target='O'>5.2</xref>
1152
+ <xref target='P'>Annex A</xref>
1153
+ <xref target='Q'>A.1</xref>
1154
+ <xref target='Q1'>A.1.1</xref>
1155
+ <xref target='Q2'>Annex A, Appendix 1</xref>
1156
+ <xref target='Q3'>Annex A, Appendix 1.1</xref>
1157
+ <xref target='R'>Clause 2</xref>
1158
+ </p>
1159
+ </foreword>
1160
+ <introduction id='B' obligation='informative' displayorder='2'>
1161
+ <title depth='1'>
1162
+ 0
1163
+ <tab/>
1164
+ Introduction
1165
+ </title>
1166
+ <clause id='C' inline-header='false' obligation='informative'>
1167
+ <title depth='2'>
1168
+ 0.1
1169
1169
  <tab/>
1170
- Scope
1170
+ Introduction Subsection
1171
1171
  </title>
1172
- <p id='E'>Text</p>
1173
1172
  </clause>
1174
- <terms id='H' obligation='normative' displayorder='5'>
1175
- <title depth='1'>
1176
- 3
1173
+ <clause id='C1' inline-header='true' obligation='informative'>
1174
+ <title>0.2</title>
1175
+ Text
1176
+ </clause>
1177
+ </introduction>
1178
+ </preface>
1179
+ <sections>
1180
+ <clause id='D' obligation='normative' type='scope' displayorder='3'>
1181
+ <title depth='1'>
1182
+ 1
1183
+ <tab/>
1184
+ Scope
1185
+ </title>
1186
+ <p id='E'>Text</p>
1187
+ </clause>
1188
+ <terms id='H' obligation='normative' displayorder='5'>
1189
+ <title depth='1'>
1190
+ 3
1191
+ <tab/>
1192
+ Terms, definitions, symbols and abbreviated terms
1193
+ </title>
1194
+ <terms id='I' obligation='normative'>
1195
+ <title depth='2'>
1196
+ 3.1
1177
1197
  <tab/>
1178
- Terms, definitions, symbols and abbreviated terms
1198
+ Normal Terms
1179
1199
  </title>
1180
- <terms id='I' obligation='normative'>
1181
- <title depth='2'>
1182
- 3.1
1183
- <tab/>
1184
- Normal Terms
1185
- </title>
1186
- <term id='J'>
1187
- <name>3.1.1</name>
1188
- <preferred>Term2</preferred>
1189
- </term>
1190
- </terms>
1191
- <definitions id='K' inline-header='true'>
1192
- <title>3.2</title>
1193
- <dl>
1194
- <dt>Symbol</dt>
1195
- <dd>Definition</dd>
1196
- </dl>
1197
- </definitions>
1200
+ <term id='J'>
1201
+ <name>3.1.1</name>
1202
+ <preferred>Term2</preferred>
1203
+ </term>
1198
1204
  </terms>
1199
- <definitions id='L' displayorder='6'>
1200
- <title>4</title>
1205
+ <definitions id='K' inline-header='true'>
1206
+ <title>3.2</title>
1201
1207
  <dl>
1202
1208
  <dt>Symbol</dt>
1203
1209
  <dd>Definition</dd>
1204
1210
  </dl>
1205
1211
  </definitions>
1206
- <clause id='M' inline-header='false' obligation='normative' displayorder='7'>
1207
- <title depth='1'>
1208
- 5
1212
+ </terms>
1213
+ <definitions id='L' displayorder='6'>
1214
+ <title>4</title>
1215
+ <dl>
1216
+ <dt>Symbol</dt>
1217
+ <dd>Definition</dd>
1218
+ </dl>
1219
+ </definitions>
1220
+ <clause id='M' inline-header='false' obligation='normative' displayorder='7'>
1221
+ <title depth='1'>
1222
+ 5
1223
+ <tab/>
1224
+ Clause 4
1225
+ </title>
1226
+ <clause id='N' inline-header='false' obligation='normative'>
1227
+ <title depth='2'>
1228
+ 5.1
1209
1229
  <tab/>
1210
- Clause 4
1230
+ Introduction
1211
1231
  </title>
1212
- <clause id='N' inline-header='false' obligation='normative'>
1213
- <title depth='2'>
1214
- 5.1
1215
- <tab/>
1216
- Introduction
1217
- </title>
1218
- </clause>
1219
- <clause id='O' inline-header='false' obligation='normative'>
1220
- <title depth='2'>
1221
- 5.2
1222
- <tab/>
1223
- Clause 4.2
1224
- </title>
1225
- </clause>
1226
1232
  </clause>
1227
- </sections>
1228
- <annex id='P' inline-header='false' obligation='normative' displayorder='8'>
1229
- <title>
1230
- <strong>Annex A</strong>
1231
- <br/>
1232
- (normative)
1233
- <br/>
1234
- <br/>
1235
- <strong>Annex</strong>
1236
- </title>
1237
- <clause id='Q' inline-header='false' obligation='normative'>
1233
+ <clause id='O' inline-header='false' obligation='normative'>
1238
1234
  <title depth='2'>
1239
- A.1
1235
+ 5.2
1240
1236
  <tab/>
1241
- Annex A.1
1237
+ Clause 4.2
1242
1238
  </title>
1243
- <clause id='Q1' inline-header='false' obligation='normative'>
1244
- <title depth='3'>
1245
- A.1.1
1246
- <tab/>
1247
- Annex A.1a
1248
- </title>
1249
- </clause>
1250
1239
  </clause>
1251
- <appendix id='Q2' inline-header='false' obligation='normative'>
1252
- <title depth='2'>
1253
- Appendix 1
1240
+ </clause>
1241
+ </sections>
1242
+ <annex id='P' inline-header='false' obligation='normative' displayorder='8'>
1243
+ <title>
1244
+ <strong>Annex A</strong>
1245
+ <br/>
1246
+ (normative)
1247
+ <br/>
1248
+ <br/>
1249
+ <strong>Annex</strong>
1250
+ </title>
1251
+ <clause id='Q' inline-header='false' obligation='normative'>
1252
+ <title depth='2'>
1253
+ A.1
1254
+ <tab/>
1255
+ Annex A.1
1256
+ </title>
1257
+ <clause id='Q1' inline-header='false' obligation='normative'>
1258
+ <title depth='3'>
1259
+ A.1.1
1254
1260
  <tab/>
1255
- An Appendix
1261
+ Annex A.1a
1256
1262
  </title>
1257
- <clause id='Q3' inline-header='false' obligation='normative'>
1258
- <title depth='3'>
1259
- Appendix 1.1
1260
- <tab/>
1261
- Appendix subclause
1262
- </title>
1263
- </clause>
1264
- </appendix>
1265
- </annex>
1266
- <bibliography>
1267
- <references id='R' normative='true' obligation='informative' displayorder='4'>
1268
- <title depth='1'>
1269
- 2
1263
+ </clause>
1264
+ </clause>
1265
+ <appendix id='Q2' inline-header='false' obligation='normative'>
1266
+ <title depth='2'>
1267
+ Appendix 1
1268
+ <tab/>
1269
+ An Appendix
1270
+ </title>
1271
+ <clause id='Q3' inline-header='false' obligation='normative'>
1272
+ <title depth='3'>
1273
+ Appendix 1.1
1270
1274
  <tab/>
1271
- Normative References
1275
+ Appendix subclause
1272
1276
  </title>
1273
- </references>
1274
- <clause id='S' obligation='informative' displayorder='9'>
1275
- <title depth='1'>Bibliography</title>
1276
- <references id='T' normative='false' obligation='informative'>
1277
- <title depth='2'>Bibliography Subsection</title>
1278
- </references>
1279
1277
  </clause>
1280
- </bibliography>
1281
- </iso-standard>
1282
- OUTPUT
1278
+ </appendix>
1279
+ </annex>
1280
+ <bibliography>
1281
+ <references id='R' normative='true' obligation='informative' displayorder='4'>
1282
+ <title depth='1'>
1283
+ 2
1284
+ <tab/>
1285
+ Normative References
1286
+ </title>
1287
+ </references>
1288
+ <clause id='S' obligation='informative' displayorder='9'>
1289
+ <title depth='1'>Bibliography</title>
1290
+ <references id='T' normative='false' obligation='informative'>
1291
+ <title depth='2'>Bibliography Subsection</title>
1292
+ </references>
1293
+ </clause>
1294
+ </bibliography>
1295
+ </iso-standard>
1296
+ OUTPUT
1297
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1298
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1283
1299
  end
1284
1300
 
1285
1301
  it "cross-references lists" do
1286
- output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
1287
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1288
- <preface>
1289
- <foreword>
1290
- <p>
1291
- <xref target="N"/>
1292
- <xref target="note1"/>
1293
- <xref target="note2"/>
1294
- <xref target="AN"/>
1295
- <xref target="Anote1"/>
1296
- <xref target="Anote2"/>
1297
- </p>
1298
- </foreword>
1299
- </preface>
1300
- <sections>
1301
- <clause id="scope" type="scope">
1302
- <title>Scope</title>
1303
- <ol id="N">
1304
- <li>
1305
- <p>A</p>
1306
- </li>
1307
- </ol>
1308
- </clause>
1309
- <terms id="terms"/>
1310
- <clause id="widgets">
1311
- <title>Widgets</title>
1312
- <clause id="widgets1">
1313
- <ol id="note1">
1302
+ output = IsoDoc::Iso::PresentationXMLConvert.new({})
1303
+ .convert("test", <<~"INPUT", true)
1304
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1305
+ <preface>
1306
+ <foreword>
1307
+ <p>
1308
+ <xref target="N"/>
1309
+ <xref target="note1"/>
1310
+ <xref target="note2"/>
1311
+ <xref target="AN"/>
1312
+ <xref target="Anote1"/>
1313
+ <xref target="Anote2"/>
1314
+ </p>
1315
+ </foreword>
1316
+ </preface>
1317
+ <sections>
1318
+ <clause id="scope" type="scope">
1319
+ <title>Scope</title>
1320
+ <ol id="N">
1321
+ <li>
1322
+ <p>A</p>
1323
+ </li>
1324
+ </ol>
1325
+ </clause>
1326
+ <terms id="terms"/>
1327
+ <clause id="widgets">
1328
+ <title>Widgets</title>
1329
+ <clause id="widgets1">
1330
+ <ol id="note1">
1331
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1332
+ </ol>
1333
+ <ol id="note2">
1334
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
1335
+ </ol>
1336
+ </clause>
1337
+ </clause>
1338
+ </sections>
1339
+ <annex id="annex1">
1340
+ <clause id="annex1a">
1341
+ <ol id="AN">
1314
1342
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1315
1343
  </ol>
1316
- <ol id="note2">
1344
+ </clause>
1345
+ <clause id="annex1b">
1346
+ <ol id="Anote1">
1347
+ <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1348
+ </ol>
1349
+ <ol id="Anote2">
1317
1350
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
1318
1351
  </ol>
1319
1352
  </clause>
1320
- </clause>
1321
- </sections>
1322
- <annex id="annex1">
1323
- <clause id="annex1a">
1324
- <ol id="AN">
1325
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1326
- </ol>
1327
- </clause>
1328
- <clause id="annex1b">
1329
- <ol id="Anote1">
1330
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
1331
- </ol>
1332
- <ol id="Anote2">
1333
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83a">These results are based on a study carried out on three different types of kernel.</p>
1334
- </ol>
1335
- </clause>
1336
- </annex>
1337
- </iso-standard>
1338
- INPUT
1353
+ </annex>
1354
+ </iso-standard>
1355
+ INPUT
1339
1356
  expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
1340
1357
  <?xml version='1.0'?>
1341
1358
  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
@@ -1415,238 +1432,242 @@ RSpec.describe IsoDoc do
1415
1432
  end
1416
1433
 
1417
1434
  it "cross-references list items" do
1418
- expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1419
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1420
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1421
- <preface>
1422
- <foreword>
1423
- <p>
1424
- <xref target="N"/>
1425
- <xref target="note1"/>
1426
- <xref target="note2"/>
1427
- <xref target="AN"/>
1428
- <xref target="Anote1"/>
1429
- <xref target="Anote2"/>
1430
- </p>
1431
- </foreword>
1432
- </preface>
1433
- <sections>
1434
- <clause id="scope" type="scope">
1435
- <title>Scope</title>
1436
- <ol id="N1">
1437
- <li id="N">
1435
+ input = <<~INPUT
1436
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1437
+ <preface>
1438
+ <foreword>
1439
+ <p>
1440
+ <xref target="N"/>
1441
+ <xref target="note1"/>
1442
+ <xref target="note2"/>
1443
+ <xref target="AN"/>
1444
+ <xref target="Anote1"/>
1445
+ <xref target="Anote2"/>
1446
+ </p>
1447
+ </foreword>
1448
+ </preface>
1449
+ <sections>
1450
+ <clause id="scope" type="scope">
1451
+ <title>Scope</title>
1452
+ <ol id="N1">
1453
+ <li id="N">
1454
+ <p>A</p>
1455
+ </li>
1456
+ </ol>
1457
+ </clause>
1458
+ <terms id="terms"/>
1459
+ <clause id="widgets">
1460
+ <title>Widgets</title>
1461
+ <clause id="widgets1">
1462
+ <ol id="note1l">
1463
+ <li id="note1">
1438
1464
  <p>A</p>
1439
1465
  </li>
1440
1466
  </ol>
1441
- </clause>
1442
- <terms id="terms"/>
1443
- <clause id="widgets">
1444
- <title>Widgets</title>
1445
- <clause id="widgets1">
1446
- <ol id="note1l">
1447
- <li id="note1">
1448
- <p>A</p>
1449
- </li>
1450
- </ol>
1451
- <ol id="note2l">
1452
- <li id="note2">
1453
- <p>A</p>
1454
- </li>
1455
- </ol>
1456
- </clause>
1457
- </clause>
1458
- </sections>
1459
- <annex id="annex1">
1460
- <clause id="annex1a">
1461
- <ol id="ANl">
1462
- <li id="AN">
1467
+ <ol id="note2l">
1468
+ <li id="note2">
1463
1469
  <p>A</p>
1464
1470
  </li>
1465
1471
  </ol>
1466
1472
  </clause>
1467
- <clause id="annex1b">
1468
- <ol id="Anote1l">
1469
- <li id="Anote1">
1470
- <p>A</p>
1471
- </li>
1472
- </ol>
1473
- <ol id="Anote2l">
1474
- <li id="Anote2">
1473
+ </clause>
1474
+ </sections>
1475
+ <annex id="annex1">
1476
+ <clause id="annex1a">
1477
+ <ol id="ANl">
1478
+ <li id="AN">
1479
+ <p>A</p>
1480
+ </li>
1481
+ </ol>
1482
+ </clause>
1483
+ <clause id="annex1b">
1484
+ <ol id="Anote1l">
1485
+ <li id="Anote1">
1486
+ <p>A</p>
1487
+ </li>
1488
+ </ol>
1489
+ <ol id="Anote2l">
1490
+ <li id="Anote2">
1491
+ <p>A</p>
1492
+ </li>
1493
+ </ol>
1494
+ </clause>
1495
+ </annex>
1496
+ </iso-standard>
1497
+ INPUT
1498
+ output = <<~OUTPUT
1499
+ <?xml version='1.0'?>
1500
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1501
+ <preface>
1502
+ <foreword displayorder='1'>
1503
+ <p>
1504
+ <xref target='N'>Clause 1 a)</xref>
1505
+ <xref target='note1'>3.1 List 1 a)</xref>
1506
+ <xref target='note2'>3.1 List 2 a)</xref>
1507
+ <xref target='AN'>A.1 a)</xref>
1508
+ <xref target='Anote1'>A.2 List 1 a)</xref>
1509
+ <xref target='Anote2'>A.2 List 2 a)</xref>
1510
+ </p>
1511
+ </foreword>
1512
+ </preface>
1513
+ <sections>
1514
+ <clause id='scope' type='scope' displayorder='2'>
1515
+ <title depth='1'>1<tab/>Scope</title>
1516
+ <ol id='N1'>
1517
+ <li id='N'>
1518
+ <p>A</p>
1519
+ </li>
1520
+ </ol>
1521
+ </clause>
1522
+ <terms id='terms' displayorder='3'><title>2</title></terms>
1523
+ <clause id='widgets' displayorder='4'>
1524
+ <title depth='1'>3<tab/>Widgets</title>
1525
+ <clause inline-header="true" id='widgets1'><title>3.1</title>
1526
+ <ol id='note1l'>
1527
+ <li id='note1'>
1475
1528
  <p>A</p>
1476
1529
  </li>
1477
1530
  </ol>
1478
- </clause>
1479
- </annex>
1480
- </iso-standard>
1481
- INPUT
1482
- <?xml version='1.0'?>
1483
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1484
- <preface>
1485
- <foreword displayorder='1'>
1486
- <p>
1487
- <xref target='N'>Clause 1 a)</xref>
1488
- <xref target='note1'>3.1 List 1 a)</xref>
1489
- <xref target='note2'>3.1 List 2 a)</xref>
1490
- <xref target='AN'>A.1 a)</xref>
1491
- <xref target='Anote1'>A.2 List 1 a)</xref>
1492
- <xref target='Anote2'>A.2 List 2 a)</xref>
1493
- </p>
1494
- </foreword>
1495
- </preface>
1496
- <sections>
1497
- <clause id='scope' type='scope' displayorder='2'>
1498
- <title depth='1'>1<tab/>Scope</title>
1499
- <ol id='N1'>
1500
- <li id='N'>
1531
+ <ol id='note2l'>
1532
+ <li id='note2'>
1501
1533
  <p>A</p>
1502
1534
  </li>
1503
1535
  </ol>
1504
1536
  </clause>
1505
- <terms id='terms' displayorder='3'><title>2</title></terms>
1506
- <clause id='widgets' displayorder='4'>
1507
- <title depth='1'>3<tab/>Widgets</title>
1508
- <clause inline-header="true" id='widgets1'><title>3.1</title>
1509
- <ol id='note1l'>
1510
- <li id='note1'>
1537
+ </clause>
1538
+ </sections>
1539
+ <annex id='annex1' displayorder='5'><title><strong>Annex A</strong><br/>(informative)</title>
1540
+ <clause inline-header="true" id='annex1a'><title>A.1</title>
1541
+ <ol id='ANl'>
1542
+ <li id='AN'>
1543
+ <p>A</p>
1544
+ </li>
1545
+ </ol>
1546
+ </clause>
1547
+ <clause inline-header="true" id='annex1b'><title>A.2</title>
1548
+ <ol id='Anote1l'>
1549
+ <li id='Anote1'>
1550
+ <p>A</p>
1551
+ </li>
1552
+ </ol>
1553
+ <ol id='Anote2l'>
1554
+ <li id='Anote2'>
1555
+ <p>A</p>
1556
+ </li>
1557
+ </ol>
1558
+ </clause>
1559
+ </annex>
1560
+ </iso-standard>
1561
+ OUTPUT
1562
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1563
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1564
+ end
1565
+
1566
+ it "cross-references nested list items" do
1567
+ input = <<~INPUT
1568
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
1569
+ <preface>
1570
+ <foreword>
1571
+ <p>
1572
+ <xref target="N"/>
1573
+ <xref target="note1"/>
1574
+ <xref target="note2"/>
1575
+ <xref target="AN"/>
1576
+ <xref target="Anote1"/>
1577
+ <xref target="Anote2"/>
1578
+ </p>
1579
+ </foreword>
1580
+ </preface>
1581
+ <sections>
1582
+ <clause id="scope" type="scope">
1583
+ <title>Scope</title>
1584
+ <ol id="N1">
1585
+ <li id="N">
1586
+ <p>A</p>
1587
+ <ol>
1588
+ <li id="note1">
1511
1589
  <p>A</p>
1590
+ <ol>
1591
+ <li id="note2">
1592
+ <p>A</p>
1593
+ <ol>
1594
+ <li id="AN">
1595
+ <p>A</p>
1596
+ <ol>
1597
+ <li id="Anote1">
1598
+ <p>A</p>
1599
+ <ol>
1600
+ <li id="Anote2">
1601
+ <p>A</p>
1602
+ </li>
1603
+ </ol>
1604
+ </li>
1605
+ </ol>
1606
+ </li>
1607
+ </ol>
1608
+ </li>
1609
+ </ol>
1512
1610
  </li>
1513
1611
  </ol>
1514
- <ol id='note2l'>
1515
- <li id='note2'>
1612
+ </li>
1613
+ </ol>
1614
+ </clause>
1615
+ </sections>
1616
+ </iso-standard>
1617
+ INPUT
1618
+ output = <<~OUTPUT
1619
+ <?xml version='1.0'?>
1620
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1621
+ <preface>
1622
+ <foreword displayorder='1'>
1623
+ <p>
1624
+ <xref target='N'>Clause 1 a)</xref>
1625
+ <xref target='note1'>Clause 1 a.1)</xref>
1626
+ <xref target='note2'>Clause 1 a.1.i)</xref>
1627
+ <xref target='AN'>Clause 1 a.1.i.A)</xref>
1628
+ <xref target='Anote1'>Clause 1 a.1.i.A.I)</xref>
1629
+ <xref target='Anote2'>Clause 1 a.1.i.A.I.a)</xref>
1630
+ </p>
1631
+ </foreword>
1632
+ </preface>
1633
+ <sections>
1634
+ <clause id='scope' type='scope' displayorder='2'>
1635
+ <title depth='1'>1<tab/>Scope</title>
1636
+ <ol id='N1'>
1637
+ <li id='N'>
1638
+ <p>A</p>
1639
+ <ol>
1640
+ <li id='note1'>
1516
1641
  <p>A</p>
1642
+ <ol>
1643
+ <li id='note2'>
1644
+ <p>A</p>
1645
+ <ol>
1646
+ <li id='AN'>
1647
+ <p>A</p>
1648
+ <ol>
1649
+ <li id='Anote1'>
1650
+ <p>A</p>
1651
+ <ol>
1652
+ <li id='Anote2'>
1653
+ <p>A</p>
1654
+ </li>
1655
+ </ol>
1656
+ </li>
1657
+ </ol>
1658
+ </li>
1659
+ </ol>
1660
+ </li>
1661
+ </ol>
1517
1662
  </li>
1518
1663
  </ol>
1519
- </clause>
1520
- </clause>
1521
- </sections>
1522
- <annex id='annex1' displayorder='5'><title><strong>Annex A</strong><br/>(informative)</title>
1523
- <clause inline-header="true" id='annex1a'><title>A.1</title>
1524
- <ol id='ANl'>
1525
- <li id='AN'>
1526
- <p>A</p>
1527
- </li>
1528
- </ol>
1529
- </clause>
1530
- <clause inline-header="true" id='annex1b'><title>A.2</title>
1531
- <ol id='Anote1l'>
1532
- <li id='Anote1'>
1533
- <p>A</p>
1534
- </li>
1535
- </ol>
1536
- <ol id='Anote2l'>
1537
- <li id='Anote2'>
1538
- <p>A</p>
1539
- </li>
1540
- </ol>
1541
- </clause>
1542
- </annex>
1543
- </iso-standard>
1544
- OUTPUT
1545
- end
1546
-
1547
- it "cross-references nested list items" do
1664
+ </li>
1665
+ </ol>
1666
+ </clause>
1667
+ </sections>
1668
+ </iso-standard>
1669
+ OUTPUT
1548
1670
  expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1549
- .convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
1550
- <iso-standard xmlns="http://riboseinc.com/isoxml">
1551
- <preface>
1552
- <foreword>
1553
- <p>
1554
- <xref target="N"/>
1555
- <xref target="note1"/>
1556
- <xref target="note2"/>
1557
- <xref target="AN"/>
1558
- <xref target="Anote1"/>
1559
- <xref target="Anote2"/>
1560
- </p>
1561
- </foreword>
1562
- </preface>
1563
- <sections>
1564
- <clause id="scope" type="scope">
1565
- <title>Scope</title>
1566
- <ol id="N1">
1567
- <li id="N">
1568
- <p>A</p>
1569
- <ol>
1570
- <li id="note1">
1571
- <p>A</p>
1572
- <ol>
1573
- <li id="note2">
1574
- <p>A</p>
1575
- <ol>
1576
- <li id="AN">
1577
- <p>A</p>
1578
- <ol>
1579
- <li id="Anote1">
1580
- <p>A</p>
1581
- <ol>
1582
- <li id="Anote2">
1583
- <p>A</p>
1584
- </li>
1585
- </ol>
1586
- </li>
1587
- </ol>
1588
- </li>
1589
- </ol>
1590
- </li>
1591
- </ol>
1592
- </li>
1593
- </ol>
1594
- </li>
1595
- </ol>
1596
- </clause>
1597
- </sections>
1598
- </iso-standard>
1599
- INPUT
1600
- <?xml version='1.0'?>
1601
- <iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
1602
- <preface>
1603
- <foreword displayorder='1'>
1604
- <p>
1605
- <xref target='N'>Clause 1 a)</xref>
1606
- <xref target='note1'>Clause 1 a.1)</xref>
1607
- <xref target='note2'>Clause 1 a.1.i)</xref>
1608
- <xref target='AN'>Clause 1 a.1.i.A)</xref>
1609
- <xref target='Anote1'>Clause 1 a.1.i.A.I)</xref>
1610
- <xref target='Anote2'>Clause 1 a.1.i.A.I.a)</xref>
1611
- </p>
1612
- </foreword>
1613
- </preface>
1614
- <sections>
1615
- <clause id='scope' type='scope' displayorder='2'>
1616
- <title depth='1'>1<tab/>Scope</title>
1617
- <ol id='N1'>
1618
- <li id='N'>
1619
- <p>A</p>
1620
- <ol>
1621
- <li id='note1'>
1622
- <p>A</p>
1623
- <ol>
1624
- <li id='note2'>
1625
- <p>A</p>
1626
- <ol>
1627
- <li id='AN'>
1628
- <p>A</p>
1629
- <ol>
1630
- <li id='Anote1'>
1631
- <p>A</p>
1632
- <ol>
1633
- <li id='Anote2'>
1634
- <p>A</p>
1635
- </li>
1636
- </ol>
1637
- </li>
1638
- </ol>
1639
- </li>
1640
- </ol>
1641
- </li>
1642
- </ol>
1643
- </li>
1644
- </ol>
1645
- </li>
1646
- </ol>
1647
- </clause>
1648
- </sections>
1649
- </iso-standard>
1650
- OUTPUT
1671
+ .convert("test", input, true))).to be_equivalent_to xmlpp(output)
1651
1672
  end
1652
1673
  end