metanorma-iso 2.1.7 → 2.1.8

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -1
  3. data/.github/workflows/release.yml +24 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -2
  5. data/lib/isodoc/iso/html/style-human.scss +35 -1
  6. data/lib/isodoc/iso/html/style-iso.scss +36 -1
  7. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  8. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  9. data/lib/isodoc/iso/i18n-ru.yaml +4 -0
  10. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  11. data/lib/isodoc/iso/init.rb +4 -0
  12. data/lib/isodoc/iso/iso.amendment.xsl +126 -162
  13. data/lib/isodoc/iso/iso.international-standard.xsl +126 -162
  14. data/lib/isodoc/iso/presentation_xml_convert.rb +18 -0
  15. data/lib/isodoc/iso/xref.rb +35 -4
  16. data/lib/metanorma/iso/base.rb +4 -0
  17. data/lib/metanorma/iso/biblio.rng +8 -5
  18. data/lib/metanorma/iso/cleanup.rb +5 -0
  19. data/lib/metanorma/iso/front_id.rb +59 -25
  20. data/lib/metanorma/iso/section.rb +5 -0
  21. data/lib/metanorma/iso/validate.rb +3 -2
  22. data/lib/metanorma/iso/version.rb +1 -1
  23. data/lib/metanorma/requirements/modspec.rb +60 -0
  24. data/lib/metanorma/requirements/requirements.rb +16 -0
  25. data/lib/metanorma-iso.rb +2 -1
  26. data/metanorma-iso.gemspec +1 -1
  27. data/spec/assets/iso.adoc +10 -0
  28. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  29. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  30. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  31. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  32. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  33. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  34. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  35. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  36. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  37. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  38. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  39. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  40. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  41. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  42. data/spec/isodoc/ref_spec.rb +9 -9
  43. data/spec/metanorma/amd_spec.rb +0 -10
  44. data/spec/metanorma/base_spec.rb +0 -10
  45. data/spec/metanorma/cleanup_spec.rb +136 -0
  46. data/spec/metanorma/macros_spec.rb +99 -0
  47. data/spec/metanorma/processor_spec.rb +86 -86
  48. data/spec/metanorma/validate_spec.rb +41 -40
  49. data/spec/requirements/requirements_spec.rb +1299 -0
  50. data/spec/requirements/xref_spec.rb +1205 -0
  51. data/spec/vcr_cassettes/docrels.yml +385 -0
  52. metadata +40 -25
  53. data/lib/isodoc/iso/html/htmlstyle.css +0 -47
  54. data/lib/isodoc/iso/html/isodoc-dis.css +0 -4493
  55. data/lib/isodoc/iso/html/isodoc.css +0 -1346
  56. data/lib/isodoc/iso/html/style-human.css +0 -1030
  57. data/lib/isodoc/iso/html/style-iso.css +0 -1056
  58. data/lib/isodoc/iso/html/wordstyle-dis.css +0 -2280
  59. data/lib/isodoc/iso/html/wordstyle.css +0 -1728
@@ -0,0 +1,1299 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Metanorma::Requirements::Iso::Modspec do
4
+ it "treates Modspec requirements as tables for cross-referencing" do
5
+ input = <<~INPUT
6
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
7
+ <preface><foreword id="A"><title>Preface</title>
8
+ <table id="A0"/>
9
+ <permission model="ogc" id="A1">
10
+ <identifier>/ogc/recommendation/wfs/2</identifier>
11
+ </permission>
12
+ <table id="A2"/>
13
+ </foreword>
14
+ <introduction id="B"><title>Introduction</title>
15
+ <p><xref target="A0"/><xref target="A1"/><xref target="A2"/></p>
16
+ </introduction>
17
+ </preface>
18
+ </ogc-standard>
19
+ INPUT
20
+ presxml = <<~OUTPUT
21
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
22
+ <preface>
23
+ <foreword id='A' displayorder='1'>
24
+ <title>Preface</title>
25
+ <table id='A0'>
26
+ <name>Table 1</name>
27
+ </table>
28
+ <table id='A1' class='modspec' type='recommend'>
29
+ <name>Table 2 — Permission 1</name>
30
+ <tbody>
31
+ <tr>
32
+ <td>Identifier</td>
33
+ <td>
34
+ <tt>/ogc/recommendation/wfs/2</tt>
35
+ </td>
36
+ </tr>
37
+ </tbody>
38
+ </table>
39
+ <table id='A2'>
40
+ <name>Table 3</name>
41
+ </table>
42
+ </foreword>
43
+ <introduction id='B' displayorder='2'>
44
+ <title>Introduction</title>
45
+ <p>
46
+ <xref target='A0'>
47
+ <span class='citetbl'>Table 1</span>
48
+ </xref>
49
+ <xref target='A1'>
50
+ <span class='citetbl'>Table 2, Permission 1</span>
51
+ </xref>
52
+ <xref target='A2'>
53
+ <span class='citetbl'>Table 3</span>
54
+ </xref>
55
+ </p>
56
+ </introduction>
57
+ </preface>
58
+ </ogc-standard>
59
+ OUTPUT
60
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
61
+ .convert("test", input, true)
62
+ .gsub(%r{^.*<body}m, "<body")
63
+ .gsub(%r{</body>.*}m, "</body>")))
64
+ .to be_equivalent_to xmlpp(presxml)
65
+ end
66
+
67
+ it "processes permissions" do
68
+ input = <<~INPUT
69
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
70
+ <preface><foreword id="A"><title>Preface</title>
71
+ <permission model="ogc" id="A1">
72
+ <identifier>/ogc/recommendation/wfs/2</identifier>
73
+ <inherit>/ss/584/2015/level/1</inherit>
74
+ <inherit><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></inherit>
75
+ <subject>user</subject>
76
+ <classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
77
+ <description>
78
+ <p id="_">I recommend <em>this</em>.</p>
79
+ </description>
80
+ <specification exclude="true" type="tabular">
81
+ <p id="_">This is the object of the recommendation:</p>
82
+ <table id="_">
83
+ <tbody>
84
+ <tr>
85
+ <td style="text-align:left;">Object</td>
86
+ <td style="text-align:left;">Value</td>
87
+ <td style="text-align:left;">Accomplished</td>
88
+ </tr>
89
+ </tbody>
90
+ </table>
91
+ </specification>
92
+ <description>
93
+ <dl>
94
+ <dt>A</dt><dd>B</dd>
95
+ <dt>C</dt><dd>D</dd>
96
+ </dl>
97
+ </description>
98
+ <measurement-target exclude="false">
99
+ <p id="_">The measurement target shall be measured as:</p>
100
+ <formula id="_">
101
+ <stem type="AsciiMath">r/1 = 0</stem>
102
+ </formula>
103
+ </measurement-target>
104
+ <verification exclude="false">
105
+ <p id="_">The following code will be run for verification:</p>
106
+ <sourcecode id="_">CoreRoot(success): HttpResponse
107
+ if (success)
108
+ recommendation(label: success-response)
109
+ end
110
+ </sourcecode>
111
+ </verification>
112
+ <import exclude="true">
113
+ <sourcecode id="_">success-response()</sourcecode>
114
+ </import>
115
+ <component class="test-purpose"><p>TEST PURPOSE</p></component>
116
+ <component class="test-method"><p>TEST METHOD</p></component>
117
+ <component class="conditions"><p>CONDITIONS</p></component>
118
+ <component class="part"><p>FIRST PART</p></component>
119
+ <component class="part"><p>SECOND PART</p></component>
120
+ <component class="part"><p>THIRD PART</p></component>
121
+ <component class="reference"><p>REFERENCE PART</p></component>
122
+ <component class="panda GHz express"><p>PANDA PART</p></component>
123
+ </permission>
124
+ </foreword></preface>
125
+ <bibliography><references id="_bibliography" obligation="informative" normative="false">
126
+ <title>Bibliography</title>
127
+ <bibitem id="rfc2616" type="standard"> <fetched>2020-03-27</fetched> <title format="text/plain" language="en" script="Latn">Hypertext Transfer Protocol — HTTP/1.1</title> <uri type="xml">https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri> <uri type="src">https://www.rfc-editor.org/info/rfc2616</uri> <docidentifier type="IETF">RFC 2616</docidentifier> <docidentifier type="IETF" scope="anchor">RFC2616</docidentifier> <docidentifier type="DOI">10.17487/RFC2616</docidentifier> <date type="published"> <on>1999-06</on> </date> <contributor> <role type="author"/> <person> <name> <completename language="en">R. Fielding</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Gettys</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">J. Mogul</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">H. Frystyk</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">L. Masinter</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">P. Leach</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <contributor> <role type="author"/> <person> <name> <completename language="en">T. Berners-Lee</completename> </name> <affiliation> <organization> <name>IETF</name> <abbreviation>IETF</abbreviation> </organization> </affiliation> </person> </contributor> <language>en</language> <script>Latn</script> <abstract format="text/plain" language="en" script="Latn">HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as “HTTP/1.1”, and is an update to RFC 2068. [STANDARDS-TRACK]</abstract> <series type="main"> <title format="text/plain" language="en" script="Latn">RFC</title> <number>2616</number> </series> <place>Fremont, CA</place></bibitem>
128
+ </references></bibliography>
129
+ </ogc-standard>
130
+ INPUT
131
+
132
+ presxml = <<~OUTPUT
133
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document" type="presentation">
134
+ <preface><foreword id="A" displayorder="1"><title>Preface</title>
135
+ <table id="A1" class="modspec" type="recommend">
136
+ <name>Table 1 — Permission 1</name>
137
+ <tbody>
138
+ <tr><td>Identifier</td><td><tt>/ogc/recommendation/wfs/2</tt></td></tr>
139
+ <tr><td>Subject</td><td>user</td></tr><tr><td>Dependency</td><td>/ss/584/2015/level/1</td></tr><tr><td>Dependency</td><td><eref type="inline" bibitemid="rfc2616" citeas="RFC 2616">RFC 2616 (HTTP/1.1)</eref></td></tr>
140
+ <tr>
141
+ <td>Control-class</td>
142
+ <td>Technical</td>
143
+ </tr>
144
+ <tr>
145
+ <td>Priority</td>
146
+ <td>P0</td>
147
+ </tr>
148
+ <tr>
149
+ <td>Family</td>
150
+ <td>System and Communications Protection</td>
151
+ </tr>
152
+ <tr>
153
+ <td>Family</td>
154
+ <td>System and Communications Protocols</td>
155
+ </tr>
156
+ <tr>
157
+ <td>Statement</td><td>
158
+ <p id='_'>
159
+ I recommend
160
+ <em>this</em>
161
+ .
162
+ </p>
163
+ </td>
164
+ </tr>
165
+ <tr>
166
+ <td>Statement</td>
167
+ <td>
168
+ <dl>
169
+ <dt>A</dt>
170
+ <dd>B</dd>
171
+ <dt>C</dt>
172
+ <dd>D</dd>
173
+ </dl>
174
+ </td>
175
+ </tr>
176
+ <tr>
177
+ <td colspan='2'>
178
+ <p id='_'>The measurement target shall be measured as:</p>
179
+ <formula id='_'>
180
+ <name>1</name>
181
+ <stem type='AsciiMath'>r/1 = 0</stem>
182
+ </formula>
183
+ </td>
184
+ </tr>
185
+ <tr>
186
+ <td colspan='2'>
187
+ <p id='_'>The following code will be run for verification:</p>
188
+ <sourcecode id='_'>
189
+ CoreRoot(success): HttpResponse if (success)
190
+ recommendation(label: success-response) end
191
+ </sourcecode>
192
+ </td>
193
+ </tr>
194
+ <tr>
195
+ <td>Test purpose</td>
196
+ <td>
197
+ <p>TEST PURPOSE</p>
198
+ </td>
199
+ </tr>
200
+ <tr>
201
+ <td>Test method</td>
202
+ <td>
203
+ <p>TEST METHOD</p>
204
+ </td>
205
+ </tr>
206
+ <tr>
207
+ <td>Conditions</td>
208
+ <td>
209
+ <p>CONDITIONS</p>
210
+ </td>
211
+ </tr>
212
+ <tr>
213
+ <td>A</td>
214
+ <td>
215
+ <p>FIRST PART</p>
216
+ </td>
217
+ </tr>
218
+ <tr>
219
+ <td>B</td>
220
+ <td>
221
+ <p>SECOND PART</p>
222
+ </td>
223
+ </tr>
224
+ <tr>
225
+ <td>C</td>
226
+ <td>
227
+ <p>THIRD PART</p>
228
+ </td>
229
+ </tr>
230
+ <tr>
231
+ <td>Reference</td>
232
+ <td>
233
+ <p>REFERENCE PART</p>
234
+ </td>
235
+ </tr>
236
+ <tr>
237
+ <td>Panda GHz express</td>
238
+ <td>
239
+ <p>PANDA PART</p>
240
+ </td>
241
+ </tr>
242
+ </tbody></table>
243
+ </foreword></preface>
244
+ <bibliography><references id="_bibliography" obligation="informative" normative="false" displayorder="2">
245
+ <title depth="1">Bibliography</title>
246
+ <bibitem id="rfc2616" type="standard">
247
+ <formattedref> <em>
248
+ <span class='stddocTitle'>Hypertext Transfer Protocol — HTTP/1.1</span>
249
+ </em>
250
+ </formattedref>
251
+ <uri type='xml'>https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2616.xml</uri>
252
+ <uri type='src'>https://www.rfc-editor.org/info/rfc2616</uri>
253
+ <docidentifier type='metanorma-ordinal'>[1]</docidentifier>
254
+ <docidentifier type='IETF'>IETF RFC 2616</docidentifier>
255
+ <docidentifier type='IETF' scope='anchor'>IETF RFC2616</docidentifier>
256
+ <docidentifier type='DOI'>DOI 10.17487/RFC2616</docidentifier>
257
+ </bibitem>
258
+ </references></bibliography>
259
+ </ogc-standard>
260
+ OUTPUT
261
+
262
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
263
+ .convert("test", input, true)
264
+ .gsub(%r{^.*<body}m, "<body")
265
+ .gsub(%r{</body>.*}m, "</body>")))
266
+ .to be_equivalent_to xmlpp(presxml)
267
+ end
268
+
269
+ it "processes permission verifications" do
270
+ input = <<~INPUT
271
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
272
+ <preface>
273
+ <foreword id="A"><title>Preface</title>
274
+ <permission model="ogc" id="A1" type="verification">
275
+ <identifier>/ogc/recommendation/wfs/2</identifier>
276
+ <inherit>/ss/584/2015/level/1</inherit>
277
+ <subject>user</subject>
278
+ <classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
279
+ <description>
280
+ <p id="_">I recommend <em>this</em>.</p>
281
+ </description>
282
+ <specification exclude="true" type="tabular">
283
+ <p id="_">This is the object of the recommendation:</p>
284
+ <table id="_">
285
+ <tbody>
286
+ <tr>
287
+ <td style="text-align:left;">Object</td>
288
+ <td style="text-align:left;">Value</td>
289
+ <td style="text-align:left;">Accomplished</td>
290
+ </tr>
291
+ </tbody>
292
+ </table>
293
+ </specification>
294
+ <description>
295
+ <dl>
296
+ <dt>A</dt><dd>B</dd>
297
+ <dt>C</dt><dd>D</dd>
298
+ </dl>
299
+ </description>
300
+ <measurement-target exclude="false">
301
+ <p id="_">The measurement target shall be measured as:</p>
302
+ <formula id="_">
303
+ <stem type="AsciiMath">r/1 = 0</stem>
304
+ </formula>
305
+ </measurement-target>
306
+ <verification exclude="false">
307
+ <p id="_">The following code will be run for verification:</p>
308
+ <sourcecode id="_">CoreRoot(success): HttpResponse
309
+ if (success)
310
+ recommendation(label: success-response)
311
+ end
312
+ </sourcecode>
313
+ </verification>
314
+ <import exclude="true">
315
+ <sourcecode id="_">success-response()</sourcecode>
316
+ </import>
317
+ </permission>
318
+ </foreword></preface>
319
+ </ogc-standard>
320
+ INPUT
321
+
322
+ presxml = <<~OUTPUT
323
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
324
+ <preface>
325
+ <foreword id='A' displayorder='1'>
326
+ <title>Preface</title>
327
+ <table id='A1' class='modspec' type='recommendtest'>
328
+ <name>Table 1 — Permission test 1</name>
329
+ <tbody>
330
+ <tr>
331
+ <td>Identifier</td>
332
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
333
+ </tr>
334
+ <tr>
335
+ <td>Subject</td>
336
+ <td>user</td>
337
+ </tr>
338
+ <tr>
339
+ <td>Dependency</td>
340
+ <td>/ss/584/2015/level/1</td>
341
+ </tr>
342
+ <tr>
343
+ <td>Control-class</td>
344
+ <td>Technical</td>
345
+ </tr>
346
+ <tr>
347
+ <td>Priority</td>
348
+ <td>P0</td>
349
+ </tr>
350
+ <tr>
351
+ <td>Family</td>
352
+ <td>System and Communications Protection</td>
353
+ </tr>
354
+ <tr>
355
+ <td>Family</td>
356
+ <td>System and Communications Protocols</td>
357
+ </tr>
358
+ <tr>
359
+ <td>Statement</td><td>
360
+ <p id='_'>
361
+ I recommend
362
+ <em>this</em>
363
+ .
364
+ </p>
365
+ </td>
366
+ </tr>
367
+ <tr>
368
+ <td>Statement</td>
369
+ <td>
370
+ <dl>
371
+ <dt>A</dt>
372
+ <dd>B</dd>
373
+ <dt>C</dt>
374
+ <dd>D</dd>
375
+ </dl>
376
+ </td>
377
+ </tr>
378
+ <tr>
379
+ <td colspan='2'>
380
+ <p id='_'>The measurement target shall be measured as:</p>
381
+ <formula id='_'>
382
+ <name>1</name>
383
+ <stem type='AsciiMath'>r/1 = 0</stem>
384
+ </formula>
385
+ </td>
386
+ </tr>
387
+ <tr>
388
+ <td colspan='2'>
389
+ <p id='_'>The following code will be run for verification:</p>
390
+ <sourcecode id='_'>
391
+ CoreRoot(success): HttpResponse if (success)
392
+ recommendation(label: success-response) end#{' '}
393
+ </sourcecode>
394
+ </td>
395
+ </tr>
396
+ </tbody>
397
+ </table>
398
+ </foreword>
399
+ </preface>
400
+ </ogc-standard>
401
+ OUTPUT
402
+
403
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
404
+ .convert("test", input, true)
405
+ .gsub(%r{^.*<body}m, "<body")
406
+ .gsub(%r{</body>.*}m, "</body>")))
407
+ .to be_equivalent_to xmlpp(presxml)
408
+ end
409
+
410
+ it "processes abstract tests" do
411
+ input = <<~INPUT
412
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
413
+ <preface>
414
+ <foreword id="A"><title>Preface</title>
415
+ <permission model="ogc" id="A1" type="abstracttest">
416
+ <identifier>/ogc/recommendation/wfs/2</identifier>
417
+ <inherit>/ss/584/2015/level/1</inherit>
418
+ <subject>user</subject>
419
+ <classification> <tag>control-class</tag> <value>Technical</value> </classification><classification> <tag>priority</tag> <value>P0</value> </classification><classification> <tag>family</tag> <value>System and Communications Protection</value> </classification><classification> <tag>family</tag> <value>System and Communications Protocols</value> </classification>
420
+ <description>
421
+ <p id="_">I recommend <em>this</em>.</p>
422
+ </description>
423
+ <specification exclude="true" type="tabular">
424
+ <p id="_">This is the object of the recommendation:</p>
425
+ <table id="_">
426
+ <tbody>
427
+ <tr>
428
+ <td style="text-align:left;">Object</td>
429
+ <td style="text-align:left;">Value</td>
430
+ <td style="text-align:left;">Accomplished</td>
431
+ </tr>
432
+ </tbody>
433
+ </table>
434
+ </specification>
435
+ <description>
436
+ <dl>
437
+ <dt>A</dt><dd>B</dd>
438
+ <dt>C</dt><dd>D</dd>
439
+ </dl>
440
+ </description>
441
+ <measurement-target exclude="false">
442
+ <p id="_">The measurement target shall be measured as:</p>
443
+ <formula id="_">
444
+ <stem type="AsciiMath">r/1 = 0</stem>
445
+ </formula>
446
+ </measurement-target>
447
+ <verification exclude="false">
448
+ <p id="_">The following code will be run for verification:</p>
449
+ <sourcecode id="_">CoreRoot(success): HttpResponse
450
+ if (success)
451
+ recommendation(label: success-response)
452
+ end
453
+ </sourcecode>
454
+ </verification>
455
+ <import exclude="true">
456
+ <sourcecode id="_">success-response()</sourcecode>
457
+ </import>
458
+ </permission>
459
+ </foreword></preface>
460
+ </ogc-standard>
461
+ INPUT
462
+ presxml = <<~OUTPUT
463
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document" type="presentation">
464
+ <preface>
465
+ <foreword id="A" displayorder="1"><title>Preface</title>
466
+ <table id="A1" type="recommendtest" class="modspec">
467
+ <name>Table 1 — Abstract test 1</name>
468
+ <tbody>
469
+ <tr><td>Identifier</td><td><tt>/ogc/recommendation/wfs/2</tt></td></tr>
470
+ <tr><td>Subject</td><td>user</td></tr><tr><td>Dependency</td><td>/ss/584/2015/level/1</td></tr><tr><td>Control-class</td><td>Technical</td></tr><tr><td>Priority</td><td>P0</td></tr><tr><td>Family</td><td>System and Communications Protection</td></tr><tr><td>Family</td><td>System and Communications Protocols</td></tr>
471
+
472
+ <tr><td>Statement</td><td>
473
+ <p id="_">I recommend <em>this</em>.</p>
474
+ </td></tr>
475
+ <tr><td>Statement</td>
476
+ <td>
477
+ <dl>
478
+ <dt>A</dt>
479
+ <dd>B</dd>
480
+ <dt>C</dt>
481
+ <dd>D</dd>
482
+ </dl>
483
+ </td>
484
+ </tr>
485
+ <tr> <td colspan='2'>
486
+ <p id="_">The measurement target shall be measured as:</p>
487
+ <formula id="_"><name>1</name>
488
+ <stem type="AsciiMath">r/1 = 0</stem>
489
+ </formula>
490
+ </td></tr><tr><td colspan="2">
491
+ <p id="_">The following code will be run for verification:</p>
492
+ <sourcecode id="_">CoreRoot(success): HttpResponse
493
+ if (success)
494
+ recommendation(label: success-response)
495
+ end
496
+ </sourcecode>
497
+ </td></tr></tbody></table>
498
+ </foreword></preface>
499
+ </ogc-standard>
500
+ OUTPUT
501
+
502
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
503
+ .convert("test", input, true)
504
+ .gsub(%r{^.*<body}m, "<body")
505
+ .gsub(%r{</body>.*}m, "</body>")))
506
+ .to be_equivalent_to xmlpp(presxml)
507
+ end
508
+
509
+ it "processes permission classes" do
510
+ input = <<~INPUT
511
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
512
+ <preface><foreword id="A"><title>Preface</title>
513
+ <permission model="ogc" id="A1" type="class" keep-with-next="true" keep-lines-together="true">
514
+ <identifier>/ogc/recommendation/wfs/2</identifier>
515
+ <inherit>/ss/584/2015/level/1</inherit>
516
+ <inherit>/ss/584/2015/level/2</inherit>
517
+ <subject>user</subject>
518
+ <permission model="ogc" id="A2">
519
+ <identifier>/ogc/recommendation/wfs/10</identifier>
520
+ </permission>
521
+ <requirement model="ogc" id="A3">
522
+ <identifier>Requirement 1</identifier>
523
+ </requirement>
524
+ <recommendation model="ogc" id="A4">
525
+ <identifier>Recommendation 1</identifier>
526
+ </recommendation>
527
+ </permission>
528
+ <permission model="ogc" id="B1">
529
+ <identifier>/ogc/recommendation/wfs/10</identifier>
530
+ </permission>
531
+ </foreword></preface>
532
+ </ogc-standard>
533
+ INPUT
534
+
535
+ presxml = <<~OUTPUT
536
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
537
+ <preface>
538
+ <foreword id='A' displayorder='1'>
539
+ <title>Preface</title>
540
+ <table id='A1' keep-with-next='true' keep-lines-together='true' class='modspec' type='recommendclass'>
541
+ <name>Table 1 — Permissions class 1</name>
542
+ <tbody>
543
+ <tr>
544
+ <td>Identifier</td>
545
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
546
+ </tr>
547
+ <tr>
548
+ <td>Target type</td>
549
+ <td>user</td>
550
+ </tr>
551
+ <tr>
552
+ <td>Dependency</td>
553
+ <td>/ss/584/2015/level/1</td>
554
+ </tr>
555
+ <tr>
556
+ <td>Dependency</td>
557
+ <td>/ss/584/2015/level/2</td>
558
+ </tr>
559
+ <tr>
560
+ <td>Provisions</td>
561
+ <td>
562
+ <xref target='B1'>
563
+ Permission 1:
564
+ <tt>/ogc/recommendation/wfs/10</tt>
565
+ </xref>
566
+ <br/>
567
+ <xref target='A3'>
568
+ Requirement 1-1:
569
+ <tt>Requirement 1</tt>
570
+ </xref>
571
+ <br/>
572
+ <xref target='A4'>
573
+ Recommendation 1-1:
574
+ <tt>Recommendation 1</tt>
575
+ </xref>
576
+ </td>
577
+ </tr>
578
+ </tbody>
579
+ </table>
580
+ <table id='B1' class='modspec' type='recommend'>
581
+ <name>Table 2 — Permission 1</name>
582
+ <tbody>
583
+ <tr>
584
+ <td>Identifier</td>
585
+ <td><tt>/ogc/recommendation/wfs/10</tt></td>
586
+ </tr>
587
+ <tr>
588
+ <td>Included in</td>
589
+ <td>
590
+ <xref target='A1'>
591
+ Permissions class 1:
592
+ <tt>/ogc/recommendation/wfs/2</tt>
593
+ </xref>
594
+ </td>
595
+ </tr>
596
+ </tbody>
597
+ </table>
598
+ </foreword>
599
+ </preface>
600
+ </ogc-standard>
601
+ OUTPUT
602
+
603
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
604
+ .convert("test", input, true)
605
+ .gsub(%r{^.*<body}m, "<body")
606
+ .gsub(%r{</body>.*}m, "</body>")))
607
+ .to be_equivalent_to xmlpp(presxml)
608
+ end
609
+
610
+ it "processes conformance classes" do
611
+ input = <<~INPUT
612
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
613
+ <preface><foreword id="A"><title>Preface</title>
614
+ <permission model="ogc" id="A1" type="conformanceclass">
615
+ <identifier>/ogc/recommendation/wfs/2</identifier>
616
+ <inherit>/ss/584/2015/level/1</inherit>
617
+ <inherit>ABC</inherit>
618
+ <subject>user</subject>
619
+ <classification><tag>target</target><value>ABC</value></classification>
620
+ <classification><tag>indirect-dependency</target><value><link target="http://www.example.com/"/></value></classification>
621
+ <classification><tag>indirect-dependency</target><value>ABC</value></classification>
622
+ <permission model="ogc" id="A2">
623
+ <identifier>Permission 1</identifier>
624
+ </permission>
625
+ <requirement model="ogc" id="A3">
626
+ <identifier>Requirement 1</identifier>
627
+ </requirement>
628
+ <recommendation model="ogc" id="A4">
629
+ <identifier>Recommendation 1</identifier>
630
+ </recommendation>
631
+ </permission>
632
+ <permission model="ogc" id="B" type="conformanceclass">
633
+ <identifier>ABC</identifier>
634
+ </permission>
635
+ <permission model="ogc" id="B2">
636
+ <identifier>Permission 1</identifier>
637
+ </permission>
638
+ </foreword></preface>
639
+ </ogc-standard>
640
+ INPUT
641
+
642
+ presxml = <<~OUTPUT
643
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
644
+ <preface>
645
+ <foreword id='A' displayorder='1'>
646
+ <title>Preface</title>
647
+ <table id='A1' class='modspec' type='recommendclass'>
648
+ <name>Table 1 — Conformance class 1</name>
649
+ <tbody>
650
+ <tr>
651
+ <td>Identifier</td>
652
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
653
+ </tr>
654
+ <tr>
655
+ <td>Subject</td>
656
+ <td>user</td>
657
+ </tr>
658
+ <tr>
659
+ <td>Requirements class</td>
660
+ <td>
661
+ <xref target='B'>Conformance class 2: <tt>ABC</tt></xref>
662
+ </td>
663
+ </tr>
664
+ <tr>
665
+ <td>Dependency</td>
666
+ <td>/ss/584/2015/level/1</td>
667
+ </tr>
668
+ <tr>
669
+ <td>Dependency</td>
670
+ <td>
671
+ <xref target='B'>Conformance class 2: <tt>ABC</tt></xref>
672
+ </td>
673
+ </tr>
674
+ <tr>
675
+ <td>Indirect Dependency</td>
676
+ <td>
677
+ <link target='http://www.example.com/'/>
678
+ </td>
679
+ </tr>
680
+ <tr>
681
+ <td>Indirect Dependency</td>
682
+ <td>
683
+ <xref target='B'>Conformance class 2: <tt>ABC</tt></xref>
684
+ </td>
685
+ </tr>
686
+ <tr>
687
+ <td>Provisions</td>
688
+ <td>
689
+ <xref target='B2'>
690
+ Permission 1:
691
+ <tt>Permission 1</tt>
692
+ </xref>
693
+ <br/>
694
+ <xref target='A3'>
695
+ Requirement 1-1:
696
+ <tt>Requirement 1</tt>
697
+ </xref>
698
+ <br/>
699
+ <xref target='A4'>
700
+ Recommendation 1-1:
701
+ <tt>Recommendation 1</tt>
702
+ </xref>
703
+ </td>
704
+ </tr>
705
+ </tbody>
706
+ </table>
707
+ <table id='B' class='modspec' type='recommendclass'>
708
+ <name>Table 2 — Conformance class 2</name>
709
+ <tbody>
710
+ <tr>
711
+ <td>Identifier</td>
712
+ <td><tt>ABC</tt></td>
713
+ </tr>
714
+ </tbody>
715
+ </table>
716
+ <table id='B2' class='modspec' type='recommend'>
717
+ <name>Table 3 — Permission 1</name>
718
+ <tbody>
719
+ <tr>
720
+ <td>Identifier</td>
721
+ <td><tt>Permission 1</tt></td>
722
+ </tr>
723
+ <tr>
724
+ <td>Included in</td>
725
+ <td>
726
+ <xref target='A1'>
727
+ Conformance class 1:
728
+ <tt>/ogc/recommendation/wfs/2</tt>
729
+ </xref>
730
+ </td>
731
+ </tr>
732
+ </tbody>
733
+ </table>
734
+ </foreword>
735
+ </preface>
736
+ </ogc-standard>
737
+ OUTPUT
738
+
739
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
740
+ .convert("test", input, true)
741
+ .gsub(%r{^.*<body}m, "<body")
742
+ .gsub(%r{</body>.*}m, "</body>")))
743
+ .to be_equivalent_to xmlpp(presxml)
744
+ end
745
+
746
+ it "processes conformance classes in French" do
747
+ input = <<~INPUT
748
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
749
+ <bibdata><language>fr</language></bibdata>
750
+ <preface><foreword id="A"><title>Preface</title>
751
+ <permission model="ogc" id="A1" type="conformanceclass">
752
+ <identifier>/ogc/recommendation/wfs/2</identifier>
753
+ <inherit>/ss/584/2015/level/1</inherit>
754
+ <inherit>ABC</inherit>
755
+ <subject>user</subject>
756
+ <classification><tag>target</target><value>ABC</value></classification>
757
+ <classification><tag>indirect-dependency</target><value><link target="http://www.example.com/"/></value></classification>
758
+ <classification><tag>indirect-dependency</target><value>ABC</value></classification>
759
+ <permission model="ogc" id="A2">
760
+ <identifier>Permission 1</identifier>
761
+ </permission>
762
+ <requirement model="ogc" id="A3">
763
+ <identifier>Requirement 1</identifier>
764
+ </requirement>
765
+ <recommendation model="ogc" id="A4">
766
+ <identifier>Recommendation 1</identifier>
767
+ </recommendation>
768
+ </permission>
769
+ <permission model="ogc" id="B" type="conformanceclass">
770
+ <identifier>ABC</identifier>
771
+ </permission>
772
+ <permission model="ogc" id="B2">
773
+ <identifier>Permission 1</identifier>
774
+ </permission>
775
+ </foreword></preface>
776
+ </ogc-standard>
777
+ INPUT
778
+ presxml = <<~OUTPUT
779
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
780
+ <bibdata>
781
+ <language current='true'>fr</language>
782
+ </bibdata>
783
+ <preface>
784
+ <foreword id='A' displayorder='1'>
785
+ <title>Preface</title>
786
+ <table id='A1' class='modspec' type='recommendclass'>
787
+ <name>Tableau 1 — Classe de confirmité 1</name>
788
+ <tbody>
789
+ <tr>
790
+ <td>Identifiant</td>
791
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
792
+ </tr>
793
+ <tr>
794
+ <td>Sujet</td>
795
+ <td>user</td>
796
+ </tr>
797
+ <tr>
798
+ <td>Classe d&#x2019;exigences</td>
799
+ <td>
800
+ <xref target='B'>Classe de confirmité 2: <tt>ABC</tt></xref>
801
+ </td>
802
+ </tr>
803
+ <tr>
804
+ <td>D&#xE9;pendance</td>
805
+ <td>/ss/584/2015/level/1</td>
806
+ </tr>
807
+ <tr>
808
+ <td>D&#xE9;pendance</td>
809
+ <td>
810
+ <xref target='B'>Classe de confirmité 2: <tt>ABC</tt></xref>
811
+ </td>
812
+ </tr>
813
+ <tr>
814
+ <td>D&#xE9;pendance indirecte</td>
815
+ <td>
816
+ <link target='http://www.example.com/'/>
817
+ </td>
818
+ </tr>
819
+ <tr>
820
+ <td>D&#xE9;pendance indirecte</td>
821
+ <td>
822
+ <xref target='B'>Classe de confirmité 2: <tt>ABC</tt></xref>
823
+ </td>
824
+ </tr>
825
+ <tr>
826
+ <td>Dispositions</td>
827
+ <td>
828
+ <xref target='B2'>
829
+ Autorisation 1:
830
+ <tt>Permission 1</tt>
831
+ </xref>
832
+ <br/>
833
+ <xref target='A3'>
834
+ Exigence 1-1:
835
+ <tt>Requirement 1</tt>
836
+ </xref>
837
+ <br/>
838
+ <xref target='A4'>
839
+ Recommandation 1-1:
840
+ <tt>Recommendation 1</tt>
841
+ </xref>
842
+ </td>
843
+ </tr>
844
+ </tbody>
845
+ </table>
846
+ <table id='B' class='modspec' type='recommendclass'>
847
+ <name>Tableau 2 — Classe de confirmité 2</name>
848
+ <tbody>
849
+ <tr>
850
+ <td>Identifiant</td>
851
+ <td><tt>ABC</tt></td>
852
+ </tr>
853
+ </tbody>
854
+ </table>
855
+ <table id='B2' class='modspec' type='recommend'>
856
+ <name>Tableau 3 — Autorisation 1</name>
857
+ <tbody>
858
+ <tr>
859
+ <td>Identifiant</td>
860
+ <td><tt>Permission 1</tt></td>
861
+ </tr>
862
+ <tr>
863
+ <td>Inclus dans</td>
864
+ <td>
865
+ <xref target='A1'>
866
+ Classe de confirmit&#xE9; 1:
867
+ <tt>/ogc/recommendation/wfs/2</tt>
868
+ </xref>
869
+ </td>
870
+ </tr>
871
+ </tbody>
872
+ </table>
873
+ </foreword>
874
+ </preface>
875
+ </ogc-standard>
876
+ OUTPUT
877
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
878
+ .convert("test", input, true)
879
+ .gsub(%r{<localized-strings>.*</localized-strings>}m, "")
880
+ .gsub(%r{^.*<body}m, "<body")
881
+ .gsub(%r{</body>.*}m, "</body>")))
882
+ .to be_equivalent_to xmlpp(presxml)
883
+ end
884
+
885
+ it "processes requirement classes" do
886
+ input = <<~INPUT
887
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
888
+ <preface><foreword id="A"><title>Preface</title>
889
+ <requirement model="ogc" id="A1" type="class">
890
+ <identifier>/ogc/recommendation/wfs/2</identifier>
891
+ <inherit>/ss/584/2015/level/1</inherit>
892
+ <inherit>/ss/584/2015/level/2</inherit>
893
+ <subject>user</subject>
894
+ <permission model="ogc" id="A2">
895
+ <identifier>Permission 1</identifier>
896
+ </permission>
897
+ <requirement model="ogc" id="A3">
898
+ <identifier>Requirement 1</identifier>
899
+ </requirement>
900
+ <recommendation model="ogc" id="A4">
901
+ <identifier>Recommendation 1</identifier>
902
+ </recommendation>
903
+ </requirement>
904
+ <permission model="ogc" id="A5">
905
+ <identifier>Permission 1</identifier>
906
+ </permission>
907
+ </foreword></preface>
908
+ </ogc-standard>
909
+ INPUT
910
+
911
+ presxml = <<~OUTPUT
912
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
913
+ <preface>
914
+ <foreword id='A' displayorder='1'>
915
+ <title>Preface</title>
916
+ <table id='A1' class='modspec' type='recommendclass'>
917
+ <name>Table 1 — Requirements class 1</name>
918
+ <tbody>
919
+ <tr>
920
+ <td>Identifier</td>
921
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
922
+ </tr>
923
+ <tr>
924
+ <td>Target type</td>
925
+ <td>user</td>
926
+ </tr>
927
+ <tr>
928
+ <td>Dependency</td>
929
+ <td>/ss/584/2015/level/1</td>
930
+ </tr>
931
+ <tr>
932
+ <td>Dependency</td>
933
+ <td>/ss/584/2015/level/2</td>
934
+ </tr>
935
+ <tr>
936
+ <td>Provisions</td>
937
+ <td>
938
+ <xref target='A5'>
939
+ Permission 1:
940
+ <tt>Permission 1</tt>
941
+ </xref>
942
+ <br/>
943
+ <xref target='A3'>
944
+ Requirement 1-1:
945
+ <tt>Requirement 1</tt>
946
+ </xref>
947
+ <br/>
948
+ <xref target='A4'>
949
+ Recommendation 1-1:
950
+ <tt>Recommendation 1</tt>
951
+ </xref>
952
+ </td>
953
+ </tr>
954
+ </tbody>
955
+ </table>
956
+ <table id='A5' class='modspec' type='recommend'>
957
+ <name>Table 2 — Permission 1</name>
958
+ <tbody>
959
+ <tr>
960
+ <td>Identifier</td>
961
+ <td><tt>Permission 1</tt></td>
962
+ </tr>
963
+ <tr>
964
+ <td>Included in</td>
965
+ <td>
966
+ <xref target='A1'>
967
+ Requirements class 1:
968
+ <tt>/ogc/recommendation/wfs/2</tt>
969
+ </xref>
970
+ </td>
971
+ </tr>
972
+ </tbody>
973
+ </table>
974
+ </foreword>
975
+ </preface>
976
+ </ogc-standard>
977
+ OUTPUT
978
+
979
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
980
+ .convert("test", input, true)
981
+ .gsub(%r{^.*<body}m, "<body")
982
+ .gsub(%r{</body>.*}m, "</body>")))
983
+ .to be_equivalent_to xmlpp(presxml)
984
+ end
985
+
986
+ it "processes recommendation classes" do
987
+ input = <<~INPUT
988
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
989
+ <preface><foreword id="A"><title>Preface</title>
990
+ <recommendation model="ogc" id="A1" type="class">
991
+ <identifier>/ogc/recommendation/wfs/2</identifier>
992
+ <inherit>/ss/584/2015/level/1</inherit>
993
+ <inherit>/ss/584/2015/level/2</inherit>
994
+ <subject>user</subject>
995
+ <permission model="ogc" id="A2">
996
+ <identifier>Permission 1</identifier>
997
+ </permission>
998
+ <requirement model="ogc" id="A3">
999
+ <identifier>Requirement 1</identifier>
1000
+ </requirement>
1001
+ <recommendation model="ogc" id="A4">
1002
+ <identifier>Recommendation 1</identifier>
1003
+ </recommendation>
1004
+ </recommendation>
1005
+ </foreword></preface>
1006
+ </ogc-standard>
1007
+ INPUT
1008
+
1009
+ presxml = <<~OUTPUT
1010
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
1011
+ <preface>
1012
+ <foreword id='A' displayorder='1'>
1013
+ <title>Preface</title>
1014
+ <table id='A1' class='modspec' type='recommendclass'>
1015
+ <name>Table 1 — Recommendations class 1</name>
1016
+ <tbody>
1017
+ <tr>
1018
+ <td>Identifier</td>
1019
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
1020
+ </tr>
1021
+ <tr>
1022
+ <td>Target type</td>
1023
+ <td>user</td>
1024
+ </tr>
1025
+ <tr>
1026
+ <td>Dependency</td>
1027
+ <td>/ss/584/2015/level/1</td>
1028
+ </tr>
1029
+ <tr>
1030
+ <td>Dependency</td>
1031
+ <td>/ss/584/2015/level/2</td>
1032
+ </tr>
1033
+ <tr>
1034
+ <td>Provisions</td>
1035
+ <td>
1036
+ <xref target='A2'>
1037
+ Permission 1-1:
1038
+ <tt>Permission 1</tt>
1039
+ </xref>
1040
+ <br/>
1041
+ <xref target='A3'>
1042
+ Requirement 1-1:
1043
+ <tt>Requirement 1</tt>
1044
+ </xref>
1045
+ <br/>
1046
+ <xref target='A4'>
1047
+ Recommendation 1-1:
1048
+ <tt>Recommendation 1</tt>
1049
+ </xref>
1050
+ </td>
1051
+ </tr>
1052
+ </tbody>
1053
+ </table>
1054
+ </foreword>
1055
+ </preface>
1056
+ </ogc-standard>
1057
+ OUTPUT
1058
+
1059
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1060
+ .convert("test", input, true)
1061
+ .gsub(%r{^.*<body}m, "<body")
1062
+ .gsub(%r{</body>.*}m, "</body>")))
1063
+ .to be_equivalent_to xmlpp(presxml)
1064
+ end
1065
+
1066
+ it "processes requirements" do
1067
+ input = <<~INPUT
1068
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
1069
+ <preface><foreword id="A0"><title>Preface</title>
1070
+ <requirement model="ogc" id="A" unnumbered="true">
1071
+ <title>A New Requirement</title>
1072
+ <identifier>/ogc/recommendation/wfs/2</identifier>
1073
+ <inherit>/ss/584/2015/level/1</inherit>
1074
+ <subject>user</subject>
1075
+ <description>
1076
+ <p id="_">I recommend <em>this</em>.</p>
1077
+ </description>
1078
+ <specification exclude="true" type="tabular" keep-with-next="true" keep-lines-together="true">
1079
+ <p id="_">This is the object of the recommendation:</p>
1080
+ <table id="_">
1081
+ <tbody>
1082
+ <tr>
1083
+ <td style="text-align:left;">Object</td>
1084
+ <td style="text-align:left;">Value</td>
1085
+ </tr>
1086
+ <tr>
1087
+ <td style="text-align:left;">Mission</td>
1088
+ <td style="text-align:left;">Accomplished</td>
1089
+ </tr>
1090
+ </tbody>
1091
+ </table>
1092
+ </specification>
1093
+ <description>
1094
+ <p id="_">As for the measurement targets,</p>
1095
+ </description>
1096
+ <measurement-target exclude="false">
1097
+ <p id="_">The measurement target shall be measured as:</p>
1098
+ <formula id="B">
1099
+ <stem type="AsciiMath">r/1 = 0</stem>
1100
+ </formula>
1101
+ </measurement-target>
1102
+ <verification exclude="false">
1103
+ <p id="_">The following code will be run for verification:</p>
1104
+ <sourcecode id="_">CoreRoot(success): HttpResponse
1105
+ if (success)
1106
+ recommendation(label: success-response)
1107
+ end
1108
+ </sourcecode>
1109
+ </verification>
1110
+ <import exclude="true">
1111
+ <sourcecode id="_">success-response()</sourcecode>
1112
+ </import>
1113
+ </requirement>
1114
+ </foreword></preface>
1115
+ </ogc-standard>
1116
+ INPUT
1117
+ presxml = <<~OUTPUT
1118
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
1119
+ <preface>
1120
+ <foreword id='A0' displayorder='1'>
1121
+ <title>Preface</title>
1122
+ <table id='A' unnumbered='true' class='modspec' type='recommend'>
1123
+ <name>Table — Requirement: A New Requirement</name>
1124
+ <tbody>
1125
+ <tr>
1126
+ <td>Identifier</td>
1127
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
1128
+ </tr>
1129
+ <tr>
1130
+ <td>Subject</td>
1131
+ <td>user</td>
1132
+ </tr>
1133
+ <tr>
1134
+ <td>Dependency</td>
1135
+ <td>/ss/584/2015/level/1</td>
1136
+ </tr>
1137
+ <tr>
1138
+ <td>Statement</td><td>
1139
+ <p id='_'>
1140
+ I recommend
1141
+ <em>this</em>
1142
+ .
1143
+ </p>
1144
+ </td>
1145
+ </tr>
1146
+ <tr>
1147
+ <td>Statement</td><td>
1148
+ <p id='_'>As for the measurement targets,</p>
1149
+ </td>
1150
+ </tr>
1151
+ <tr>
1152
+ <td colspan='2'>
1153
+ <p id='_'>The measurement target shall be measured as:</p>
1154
+ <formula id='B'>
1155
+ <name>1</name>
1156
+ <stem type='AsciiMath'>r/1 = 0</stem>
1157
+ </formula>
1158
+ </td>
1159
+ </tr>
1160
+ <tr>
1161
+ <td colspan='2'>
1162
+ <p id='_'>The following code will be run for verification:</p>
1163
+ <sourcecode id='_'>
1164
+ CoreRoot(success): HttpResponse if (success)
1165
+ recommendation(label: success-response) end
1166
+ </sourcecode>
1167
+ </td>
1168
+ </tr>
1169
+ </tbody>
1170
+ </table>
1171
+ </foreword>
1172
+ </preface>
1173
+ </ogc-standard>
1174
+ OUTPUT
1175
+
1176
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1177
+ .convert("test", input, true)
1178
+ .gsub(%r{^.*<body}m, "<body")
1179
+ .gsub(%r{</body>.*}m, "</body>")))
1180
+ .to be_equivalent_to xmlpp(presxml)
1181
+ end
1182
+
1183
+ it "processes recommendations" do
1184
+ input = <<~INPUT
1185
+ <ogc-standard xmlns="https://standards.opengeospatial.org/document">
1186
+ <preface><foreword id="A"><title>Preface</title>
1187
+ <recommendation model="ogc" id="_">
1188
+ <identifier>/ogc/recommendation/wfs/2</identifier>
1189
+ <inherit>/ss/584/2015/level/1</inherit>
1190
+ <subject>user</subject>
1191
+ <description>
1192
+ <p id="_">I recommend <em>this</em>.</p>
1193
+ </description>
1194
+ <specification exclude="true" type="tabular">
1195
+ <p id="_">This is the object of the recommendation:</p>
1196
+ <table id="_">
1197
+ <tbody>
1198
+ <tr>
1199
+ <td style="text-align:left;">Object</td>
1200
+ <td style="text-align:left;">Value</td>
1201
+ </tr>
1202
+ <tr>
1203
+ <td style="text-align:left;">Mission</td>
1204
+ <td style="text-align:left;">Accomplished</td>
1205
+ </tr>
1206
+ </tbody>
1207
+ </table>
1208
+ </specification>
1209
+ <description>
1210
+ <p id="_">As for the measurement targets,</p>
1211
+ </description>
1212
+ <measurement-target exclude="false">
1213
+ <p id="_">The measurement target shall be measured as:</p>
1214
+ <formula id="_">
1215
+ <stem type="AsciiMath">r/1 = 0</stem>
1216
+ </formula>
1217
+ </measurement-target>
1218
+ <verification exclude="false">
1219
+ <p id="_">The following code will be run for verification:</p>
1220
+ <sourcecode id="_">CoreRoot(success): HttpResponse
1221
+ if (success)
1222
+ recommendation(label: success-response)
1223
+ end
1224
+ </sourcecode>
1225
+ </verification>
1226
+ <import exclude="true">
1227
+ <sourcecode id="_">success-response()</sourcecode>
1228
+ </import>
1229
+ </recommendation>
1230
+ </foreword></preface>
1231
+ </ogc-standard>
1232
+ INPUT
1233
+
1234
+ presxml = <<~OUTPUT
1235
+ <ogc-standard xmlns='https://standards.opengeospatial.org/document' type='presentation'>
1236
+ <preface>
1237
+ <foreword id='A' displayorder='1'>
1238
+ <title>Preface</title>
1239
+ <table id='_' class='modspec' type='recommend'>
1240
+ <name>Table 1 — Recommendation 1</name>
1241
+ <tbody>
1242
+ <tr>
1243
+ <td>Identifier</td>
1244
+ <td><tt>/ogc/recommendation/wfs/2</tt></td>
1245
+ </tr>
1246
+ <tr>
1247
+ <td>Subject</td>
1248
+ <td>user</td>
1249
+ </tr>
1250
+ <tr>
1251
+ <td>Dependency</td>
1252
+ <td>/ss/584/2015/level/1</td>
1253
+ </tr>
1254
+ <tr>
1255
+ <td>Statement</td><td>
1256
+ <p id='_'>
1257
+ I recommend
1258
+ <em>this</em>
1259
+ .
1260
+ </p>
1261
+ </td>
1262
+ </tr>
1263
+ <tr>
1264
+ <td>Statement</td><td>
1265
+ <p id='_'>As for the measurement targets,</p>
1266
+ </td>
1267
+ </tr>
1268
+ <tr>
1269
+ <td colspan='2'>
1270
+ <p id='_'>The measurement target shall be measured as:</p>
1271
+ <formula id='_'>
1272
+ <name>1</name>
1273
+ <stem type='AsciiMath'>r/1 = 0</stem>
1274
+ </formula>
1275
+ </td>
1276
+ </tr>
1277
+ <tr>
1278
+ <td colspan='2'>
1279
+ <p id='_'>The following code will be run for verification:</p>
1280
+ <sourcecode id='_'>
1281
+ CoreRoot(success): HttpResponse if (success)
1282
+ recommendation(label: success-response) end
1283
+ </sourcecode>
1284
+ </td>
1285
+ </tr>
1286
+ </tbody>
1287
+ </table>
1288
+ </foreword>
1289
+ </preface>
1290
+ </ogc-standard>
1291
+ OUTPUT
1292
+
1293
+ expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({})
1294
+ .convert("test", input, true)
1295
+ .gsub(%r{^.*<body}m, "<body")
1296
+ .gsub(%r{</body>.*}m, "</body>")))
1297
+ .to be_equivalent_to xmlpp(presxml)
1298
+ end
1299
+ end