metanorma-iso 2.2.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/iso/html/header-dis.html +111 -29
  3. data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
  4. data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
  5. data/lib/isodoc/iso/html/style-human.css +2 -3
  6. data/lib/isodoc/iso/html/style-human.scss +0 -1
  7. data/lib/isodoc/iso/html/style-iso.css +2 -3
  8. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +10 -4
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +10 -4
  11. data/lib/isodoc/iso/i18n-en.yaml +13 -8
  12. data/lib/isodoc/iso/i18n-fr.yaml +9 -3
  13. data/lib/isodoc/iso/i18n-ru.yaml +9 -2
  14. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -2
  15. data/lib/isodoc/iso/iso.amendment.xsl +226 -40
  16. data/lib/isodoc/iso/iso.international-standard.xsl +226 -40
  17. data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
  18. data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
  19. data/lib/isodoc/iso/presentation_xref.rb +10 -7
  20. data/lib/isodoc/iso/sections.rb +1 -1
  21. data/lib/isodoc/iso/word_convert.rb +6 -4
  22. data/lib/isodoc/iso/word_dis_cleanup.rb +24 -3
  23. data/lib/isodoc/iso/word_dis_convert.rb +4 -1
  24. data/lib/metanorma/iso/base.rb +2 -1
  25. data/lib/metanorma/iso/basicdoc.rng +0 -27
  26. data/lib/metanorma/iso/biblio-standoc.rng +164 -0
  27. data/lib/metanorma/iso/biblio.rng +50 -18
  28. data/lib/metanorma/iso/isodoc.rng +68 -206
  29. data/lib/metanorma/iso/isostandard-amd.rng +3 -54
  30. data/lib/metanorma/iso/isostandard-compile.rng +7 -0
  31. data/lib/metanorma/iso/isostandard.rng +1 -195
  32. data/lib/metanorma/iso/relaton-iso.rng +225 -0
  33. data/lib/metanorma/iso/validate.rb +6 -6
  34. data/lib/metanorma/iso/version.rb +1 -1
  35. data/lib/metanorma/requirements/modspec.rb +22 -38
  36. data/metanorma-iso.gemspec +5 -2
  37. metadata +7 -86
  38. data/.github/workflows/rake.yml +0 -15
  39. data/.github/workflows/release.yml +0 -24
  40. data/.github/workflows/ubuntu.yml +0 -41
  41. data/Rakefile +0 -8
  42. data/bin/rspec +0 -17
  43. data/spec/assets/header.html +0 -7
  44. data/spec/assets/html.css +0 -2
  45. data/spec/assets/htmlcover.html +0 -4
  46. data/spec/assets/htmlintro.html +0 -5
  47. data/spec/assets/i18n.yaml +0 -2
  48. data/spec/assets/iso.adoc +0 -10
  49. data/spec/assets/iso.headless.html +0 -33
  50. data/spec/assets/iso.xml +0 -71
  51. data/spec/assets/rice_image1.png +0 -0
  52. data/spec/assets/scripts.html +0 -3
  53. data/spec/assets/std.css +0 -2
  54. data/spec/assets/word.css +0 -2
  55. data/spec/assets/wordcover.html +0 -3
  56. data/spec/assets/wordintro.html +0 -4
  57. data/spec/examples/103_01_02.html +0 -247
  58. data/spec/examples/english.yaml +0 -69
  59. data/spec/examples/iso_123_.xml +0 -45
  60. data/spec/examples/iso_123_all_parts.xml +0 -45
  61. data/spec/examples/iso_123_no_year_note.xml +0 -46
  62. data/spec/examples/iso_124_.xml +0 -41
  63. data/spec/examples/iso_216_.xml +0 -47
  64. data/spec/examples/iso_iec_12382_.xml +0 -48
  65. data/spec/examples/rice.adoc +0 -714
  66. data/spec/examples/rice.preview.html +0 -1870
  67. data/spec/examples/rice.sh +0 -4
  68. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  69. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  70. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  71. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  72. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  73. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  74. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  75. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  76. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  77. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  78. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  79. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  80. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  81. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  82. data/spec/examples/rice_img/rice_image1.png +0 -0
  83. data/spec/examples/rice_img/rice_image2.png +0 -0
  84. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  85. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  86. data/spec/examples/rice_img/rice_image3_3.png +0 -0
  87. data/spec/isodoc/amd_spec.rb +0 -986
  88. data/spec/isodoc/blocks_spec.rb +0 -1174
  89. data/spec/isodoc/i18n_spec.rb +0 -1579
  90. data/spec/isodoc/inline_spec.rb +0 -1060
  91. data/spec/isodoc/iso_spec.rb +0 -255
  92. data/spec/isodoc/metadata_spec.rb +0 -701
  93. data/spec/isodoc/postproc_spec.rb +0 -1089
  94. data/spec/isodoc/ref_spec.rb +0 -439
  95. data/spec/isodoc/section_spec.rb +0 -998
  96. data/spec/isodoc/table_spec.rb +0 -420
  97. data/spec/isodoc/terms_spec.rb +0 -314
  98. data/spec/isodoc/word_dis_spec.rb +0 -2064
  99. data/spec/isodoc/xref_spec.rb +0 -1747
  100. data/spec/metanorma/amd_spec.rb +0 -724
  101. data/spec/metanorma/base_spec.rb +0 -1384
  102. data/spec/metanorma/blank_spec.rb +0 -38
  103. data/spec/metanorma/blocks_spec.rb +0 -624
  104. data/spec/metanorma/cleanup_spec.rb +0 -1645
  105. data/spec/metanorma/inline_spec.rb +0 -203
  106. data/spec/metanorma/lists_spec.rb +0 -197
  107. data/spec/metanorma/macros_spec.rb +0 -99
  108. data/spec/metanorma/processor_spec.rb +0 -161
  109. data/spec/metanorma/refs_spec.rb +0 -672
  110. data/spec/metanorma/section_spec.rb +0 -492
  111. data/spec/metanorma/table_spec.rb +0 -329
  112. data/spec/metanorma/validate_spec.rb +0 -2153
  113. data/spec/relaton/render_spec.rb +0 -568
  114. data/spec/requirements/requirement_components_spec.rb +0 -622
  115. data/spec/requirements/requirements_spec.rb +0 -1681
  116. data/spec/requirements/xref_spec.rb +0 -1211
  117. data/spec/spec_helper.rb +0 -313
  118. data/spec/vcr_cassettes/docrels.yml +0 -385
  119. data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
@@ -1,90 +1,10 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
4
4
  <include href="isodoc.rng">
5
5
  <start>
6
6
  <ref name="iso-standard"/>
7
7
  </start>
8
- <define name="organization">
9
- <element name="organization">
10
- <oneOrMore>
11
- <ref name="orgname"/>
12
- </oneOrMore>
13
- <optional>
14
- <ref name="abbreviation"/>
15
- </optional>
16
- <optional>
17
- <ref name="uri"/>
18
- </optional>
19
- <zeroOrMore>
20
- <ref name="org-identifier"/>
21
- </zeroOrMore>
22
- <zeroOrMore>
23
- <ref name="contact"/>
24
- </zeroOrMore>
25
- <optional>
26
- <ref name="technical-committee"/>
27
- </optional>
28
- <optional>
29
- <ref name="subcommittee"/>
30
- </optional>
31
- <optional>
32
- <ref name="workgroup"/>
33
- </optional>
34
- <optional>
35
- <ref name="secretariat"/>
36
- </optional>
37
- </element>
38
- </define>
39
- <define name="BibDataExtensionType">
40
- <ref name="doctype"/>
41
- <optional>
42
- <ref name="docsubtype"/>
43
- </optional>
44
- <optional>
45
- <ref name="horizontal"/>
46
- </optional>
47
- <ref name="editorialgroup"/>
48
- <optional>
49
- <ref name="approvalgroup"/>
50
- </optional>
51
- <zeroOrMore>
52
- <ref name="ics"/>
53
- </zeroOrMore>
54
- <ref name="structuredidentifier"/>
55
- <optional>
56
- <ref name="stagename"/>
57
- </optional>
58
- </define>
59
- <define name="bdate">
60
- <element name="date">
61
- <attribute name="type">
62
- <choice>
63
- <ref name="BibliographicDateType"/>
64
- <text/>
65
- </choice>
66
- </attribute>
67
- <choice>
68
- <group>
69
- <element name="from">
70
- <ref name="ISO8601Date"/>
71
- </element>
72
- <optional>
73
- <element name="to">
74
- <ref name="ISO8601Date"/>
75
- </element>
76
- </optional>
77
- </group>
78
- <element name="on">
79
- <choice>
80
- <ref name="ISO8601Date"/>
81
- <value>--</value>
82
- <value>–</value>
83
- </choice>
84
- </element>
85
- </choice>
86
- </element>
87
- </define>
88
8
  <define name="sections">
89
9
  <element name="sections">
90
10
  <zeroOrMore>
@@ -266,40 +186,6 @@
266
186
  </optional>
267
187
  </element>
268
188
  </define>
269
- <define name="DocumentType">
270
- <choice>
271
- <value>international-standard</value>
272
- <value>technical-specification</value>
273
- <value>technical-report</value>
274
- <value>publicly-available-specification</value>
275
- <value>international-workshop-agreement</value>
276
- <value>guide</value>
277
- <value>amendment</value>
278
- <value>technical-corrigendum</value>
279
- <value>directive</value>
280
- </choice>
281
- </define>
282
- <define name="DocumentSubtype">
283
- <choice>
284
- <value>specification</value>
285
- <value>method-of-test</value>
286
- <value>vocabulary</value>
287
- <value>code-of-practice</value>
288
- </choice>
289
- </define>
290
- <define name="structuredidentifier">
291
- <element name="structuredidentifier">
292
- <optional>
293
- <attribute name="type"/>
294
- </optional>
295
- <group>
296
- <ref name="documentnumber"/>
297
- <optional>
298
- <ref name="tc-documentnumber"/>
299
- </optional>
300
- </group>
301
- </element>
302
- </define>
303
189
  <define name="foreword">
304
190
  <element name="foreword">
305
191
  <ref name="Basic-Section"/>
@@ -310,11 +196,6 @@
310
196
  <ref name="Content-Section"/>
311
197
  </element>
312
198
  </define>
313
- <define name="editorialgroup">
314
- <element name="editorialgroup">
315
- <ref name="ISOProjectGroup"/>
316
- </element>
317
- </define>
318
199
  <define name="Content-Section">
319
200
  <optional>
320
201
  <attribute name="id">
@@ -360,33 +241,6 @@
360
241
  </define>
361
242
  </include>
362
243
  <!-- end overrides -->
363
- <define name="ISOProjectGroup">
364
- <zeroOrMore>
365
- <ref name="agency"/>
366
- </zeroOrMore>
367
- <oneOrMore>
368
- <ref name="technical-committee"/>
369
- </oneOrMore>
370
- <zeroOrMore>
371
- <ref name="subcommittee"/>
372
- </zeroOrMore>
373
- <zeroOrMore>
374
- <ref name="workgroup"/>
375
- </zeroOrMore>
376
- <optional>
377
- <ref name="secretariat"/>
378
- </optional>
379
- </define>
380
- <define name="approvalgroup">
381
- <element name="approvalgroup">
382
- <ref name="ISOProjectGroup"/>
383
- </element>
384
- </define>
385
- <define name="agency">
386
- <element name="agency">
387
- <text/>
388
- </element>
389
- </define>
390
244
  <!--
391
245
  We display the Normative References between scope and terms; but to keep the
392
246
  grammar simple, we keep the references together
@@ -423,46 +277,6 @@
423
277
  </zeroOrMore>
424
278
  </element>
425
279
  </define>
426
- <define name="horizontal">
427
- <element name="horizontal">
428
- <data type="boolean"/>
429
- </element>
430
- </define>
431
- <define name="documentnumber">
432
- <element name="project-number">
433
- <optional>
434
- <attribute name="part">
435
- <data type="int"/>
436
- </attribute>
437
- </optional>
438
- <optional>
439
- <attribute name="subpart">
440
- <data type="int"/>
441
- </attribute>
442
- </optional>
443
- <text/>
444
- </element>
445
- </define>
446
- <define name="tc-documentnumber">
447
- <element name="tc-document-number">
448
- <data type="int"/>
449
- </element>
450
- </define>
451
- <define name="subcommittee">
452
- <element name="subcommittee">
453
- <ref name="IsoWorkgroup"/>
454
- </element>
455
- </define>
456
- <define name="workgroup">
457
- <element name="workgroup">
458
- <ref name="IsoWorkgroup"/>
459
- </element>
460
- </define>
461
- <define name="secretariat">
462
- <element name="secretariat">
463
- <text/>
464
- </element>
465
- </define>
466
280
  <define name="clause-hanging-paragraph-with-footnote">
467
281
  <element name="clause">
468
282
  <optional>
@@ -506,12 +320,4 @@
506
320
  <ref name="Clause-Section"/>
507
321
  </element>
508
322
  </define>
509
- <define name="stagename">
510
- <element name="stagename">
511
- <optional>
512
- <attribute name="abbreviation"/>
513
- </optional>
514
- <text/>
515
- </element>
516
- </define>
517
323
  </grammar>
@@ -0,0 +1,225 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <include href="biblio-standoc.rng">
4
+ <define name="BibDataExtensionType">
5
+ <optional>
6
+ <attribute name="schema-version"/>
7
+ </optional>
8
+ <ref name="doctype"/>
9
+ <optional>
10
+ <ref name="docsubtype"/>
11
+ </optional>
12
+ <optional>
13
+ <ref name="horizontal"/>
14
+ </optional>
15
+ <ref name="editorialgroup"/>
16
+ <optional>
17
+ <ref name="approvalgroup"/>
18
+ </optional>
19
+ <zeroOrMore>
20
+ <ref name="ics"/>
21
+ </zeroOrMore>
22
+ <ref name="structuredidentifier"/>
23
+ <optional>
24
+ <ref name="stagename"/>
25
+ </optional>
26
+ <optional>
27
+ <ref name="updates_document_type"/>
28
+ </optional>
29
+ </define>
30
+ <define name="bdate">
31
+ <element name="date">
32
+ <attribute name="type">
33
+ <choice>
34
+ <ref name="BibliographicDateType"/>
35
+ <text/>
36
+ </choice>
37
+ </attribute>
38
+ <choice>
39
+ <group>
40
+ <element name="from">
41
+ <ref name="ISO8601Date"/>
42
+ </element>
43
+ <optional>
44
+ <element name="to">
45
+ <ref name="ISO8601Date"/>
46
+ </element>
47
+ </optional>
48
+ </group>
49
+ <element name="on">
50
+ <choice>
51
+ <ref name="ISO8601Date"/>
52
+ <value>--</value>
53
+ <value>–</value>
54
+ </choice>
55
+ </element>
56
+ </choice>
57
+ </element>
58
+ </define>
59
+ <define name="organization">
60
+ <element name="organization">
61
+ <oneOrMore>
62
+ <ref name="orgname"/>
63
+ </oneOrMore>
64
+ <optional>
65
+ <ref name="abbreviation"/>
66
+ </optional>
67
+ <optional>
68
+ <ref name="uri"/>
69
+ </optional>
70
+ <zeroOrMore>
71
+ <ref name="org-identifier"/>
72
+ </zeroOrMore>
73
+ <zeroOrMore>
74
+ <ref name="contact"/>
75
+ </zeroOrMore>
76
+ <optional>
77
+ <ref name="technical-committee"/>
78
+ </optional>
79
+ <optional>
80
+ <ref name="subcommittee"/>
81
+ </optional>
82
+ <optional>
83
+ <ref name="workgroup"/>
84
+ </optional>
85
+ <optional>
86
+ <ref name="secretariat"/>
87
+ </optional>
88
+ </element>
89
+ </define>
90
+ <define name="DocumentType">
91
+ <choice>
92
+ <value>international-standard</value>
93
+ <value>technical-specification</value>
94
+ <value>technical-report</value>
95
+ <value>publicly-available-specification</value>
96
+ <value>international-workshop-agreement</value>
97
+ <value>guide</value>
98
+ <value>amendment</value>
99
+ <value>technical-corrigendum</value>
100
+ <value>directive</value>
101
+ </choice>
102
+ </define>
103
+ <define name="DocumentSubtype">
104
+ <choice>
105
+ <value>specification</value>
106
+ <value>method-of-test</value>
107
+ <value>vocabulary</value>
108
+ <value>code-of-practice</value>
109
+ </choice>
110
+ </define>
111
+ <define name="structuredidentifier">
112
+ <element name="structuredidentifier">
113
+ <optional>
114
+ <attribute name="type"/>
115
+ </optional>
116
+ <group>
117
+ <ref name="documentnumber"/>
118
+ <optional>
119
+ <ref name="tc-documentnumber"/>
120
+ </optional>
121
+ </group>
122
+ </element>
123
+ </define>
124
+ <define name="editorialgroup">
125
+ <element name="editorialgroup">
126
+ <ref name="ISOProjectGroup"/>
127
+ </element>
128
+ </define>
129
+ </include>
130
+ <define name="updates_document_type">
131
+ <element name="updates-document-type">
132
+ <ref name="DocumentType"/>
133
+ </element>
134
+ </define>
135
+ <define name="ISOProjectGroup">
136
+ <zeroOrMore>
137
+ <ref name="agency"/>
138
+ </zeroOrMore>
139
+ <oneOrMore>
140
+ <ref name="technical-committee"/>
141
+ </oneOrMore>
142
+ <zeroOrMore>
143
+ <ref name="subcommittee"/>
144
+ </zeroOrMore>
145
+ <zeroOrMore>
146
+ <ref name="workgroup"/>
147
+ </zeroOrMore>
148
+ <optional>
149
+ <ref name="secretariat"/>
150
+ </optional>
151
+ </define>
152
+ <define name="approvalgroup">
153
+ <element name="approvalgroup">
154
+ <ref name="ISOProjectGroup"/>
155
+ </element>
156
+ </define>
157
+ <define name="agency">
158
+ <element name="agency">
159
+ <text/>
160
+ </element>
161
+ </define>
162
+ <define name="horizontal">
163
+ <element name="horizontal">
164
+ <data type="boolean"/>
165
+ </element>
166
+ </define>
167
+ <define name="documentnumber">
168
+ <element name="project-number">
169
+ <optional>
170
+ <attribute name="part">
171
+ <data type="int"/>
172
+ </attribute>
173
+ </optional>
174
+ <optional>
175
+ <attribute name="subpart">
176
+ <data type="int"/>
177
+ </attribute>
178
+ </optional>
179
+ <optional>
180
+ <attribute name="amendment">
181
+ <data type="int"/>
182
+ </attribute>
183
+ </optional>
184
+ <optional>
185
+ <attribute name="corrigendum">
186
+ <data type="int"/>
187
+ </attribute>
188
+ </optional>
189
+ <optional>
190
+ <attribute name="origyr">
191
+ <ref name="ISO8601Date"/>
192
+ </attribute>
193
+ </optional>
194
+ <text/>
195
+ </element>
196
+ </define>
197
+ <define name="tc-documentnumber">
198
+ <element name="tc-document-number">
199
+ <data type="int"/>
200
+ </element>
201
+ </define>
202
+ <define name="subcommittee">
203
+ <element name="subcommittee">
204
+ <ref name="IsoWorkgroup"/>
205
+ </element>
206
+ </define>
207
+ <define name="workgroup">
208
+ <element name="workgroup">
209
+ <ref name="IsoWorkgroup"/>
210
+ </element>
211
+ </define>
212
+ <define name="secretariat">
213
+ <element name="secretariat">
214
+ <text/>
215
+ </element>
216
+ </define>
217
+ <define name="stagename">
218
+ <element name="stagename">
219
+ <optional>
220
+ <attribute name="abbreviation"/>
221
+ </optional>
222
+ <text/>
223
+ </element>
224
+ </define>
225
+ </grammar>
@@ -66,7 +66,7 @@ module Metanorma
66
66
  if /^(ISO|IEC)/.match?(t["citeas"]) &&
67
67
  !/: ?(\d+{4}|–)$/.match?(t["citeas"])
68
68
  @log.add("Style", t,
69
- "undated reference #{t['citeas']} should not contain "\
69
+ "undated reference #{t['citeas']} should not contain " \
70
70
  "specific elements")
71
71
  end
72
72
  end
@@ -79,7 +79,7 @@ module Metanorma
79
79
  # https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-r-ref_clause3
80
80
  def term_xrefs_validate(xmldoc)
81
81
  termids = xmldoc
82
- .xpath("//sections/terms | //sections/clause[.//terms] | "\
82
+ .xpath("//sections/terms | //sections/clause[.//terms] | " \
83
83
  "//annex[.//terms]").each_with_object({}) do |t, m|
84
84
  t.xpath(".//*/@id").each { |a| m[a.text] = true }
85
85
  t.name == "terms" and m[t["id"]] = true
@@ -93,11 +93,11 @@ module Metanorma
93
93
  closest_id = xref.xpath("./ancestor::*[@id]")&.last or return
94
94
  (termids[xref["target"]] && !termids[closest_id["id"]]) and
95
95
  @log.add("Style", xref,
96
- "only terms clauses can cross-reference terms clause "\
96
+ "only terms clauses can cross-reference terms clause " \
97
97
  "(#{xref['target']})")
98
98
  (!termids[xref["target"]] && termids[closest_id["id"]]) and
99
99
  @log.add("Style", xref,
100
- "non-terms clauses cannot cross-reference terms clause "\
100
+ "non-terms clauses cannot cross-reference terms clause " \
101
101
  "(#{xref['target']})")
102
102
  end
103
103
 
@@ -179,7 +179,7 @@ module Metanorma
179
179
  xmldoc.xpath("//bibitem[date/on = '–']").each do |b|
180
180
  b.at("./note[@type = 'Unpublished-Status']") or
181
181
  @log.add("Style", b,
182
- "Reference #{b&.at('./@id')&.text} does not have an "\
182
+ "Reference #{b&.at('./@id')&.text} does not have an " \
183
183
  "associated footnote indicating unpublished status")
184
184
  end
185
185
  end
@@ -191,7 +191,7 @@ module Metanorma
191
191
  when "amendment", "technical-corrigendum" # @amd
192
192
  "isostandard-amd.rng"
193
193
  else
194
- "isostandard.rng"
194
+ "isostandard-compile.rng"
195
195
  end
196
196
  schema_validate(formattedstr_strip(doc.dup),
197
197
  File.join(File.dirname(__FILE__), schema))
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.2.1".freeze
3
+ VERSION = "2.2.3".freeze
4
4
  end
5
5
  end
@@ -29,41 +29,28 @@ module Metanorma
29
29
  out
30
30
  end
31
31
 
32
- def recommend_title(node, out)
33
- label = node.at(ns("./identifier")) or return
34
- out.add_child("<tr><td>#{@labels['modspec']['identifier']}</td>"\
35
- "<td><tt>#{label.children.to_xml}</tt></td>")
36
- end
37
-
38
- def requirement_component_parse(node, out)
39
- if node["exclude"] != "true" && node.name == "description"
40
- lbl = "statement"
41
- recommend_class(node.parent) == "recommendclass" and
42
- lbl = "description"
43
- out << "<tr><td>#{@labels['modspec'][lbl]}</td>"\
44
- "<td>#{node.children.to_xml}</td></tr>"
45
- else
46
- super
47
- end
48
- end
49
-
50
- def requirement_table_cleanup(node, table)
51
- return table unless table["type"] == "recommendclass"
52
-
53
- label = if node["type"] == "conformanceclass" then "conformancetests"
54
- else "provisions" end
32
+ def requirement_table_nested_cleanup(node, table)
33
+ table["type"] == "recommendclass" or return table
55
34
  ins = table.at(ns("./tbody/tr[td/table]")) or return table
56
- ins.replace("<tr><td>#{@labels['modspec'][label]}</td>" +
57
- "<td>#{nested_tables_names(table)}</td></tr>")
35
+ ins.replace(requirement_table_cleanup_nested_replacement(node, table))
58
36
  table.xpath(ns("./tbody/tr[td/table]")).each(&:remove)
59
37
  table
60
38
  end
61
39
 
40
+ def requirement_table_cleanup_nested_replacement(node, table)
41
+ label = "provision"
42
+ node["type"] == "conformanceclass" and label = "conformancetest"
43
+ n = nested_tables_names(table)
44
+ hdr = @i18n.inflect(@labels["modspec"][label],
45
+ number: n.size == 1 ? "sg" : "pl")
46
+ "<tr><th>#{hdr}</th><td>#{n.join('<br/>')}</td></tr>"
47
+ end
48
+
62
49
  def nested_tables_names(table)
63
50
  table.xpath(ns("./tbody/tr/td/table"))
64
51
  .each_with_object([]) do |t, m|
65
52
  m << t.at(ns("./name")).children.to_xml
66
- end.join("<br/>")
53
+ end
67
54
  end
68
55
 
69
56
  def postprocess_anchor_struct(block, anchor)
@@ -86,20 +73,17 @@ module Metanorma
86
73
  end
87
74
  end
88
75
 
89
- def reqt_links_test(docxml)
90
- docxml.xpath(ns("//requirement | //recommendation | //permission"))
91
- .each_with_object({}) do |r, m|
92
- next unless %w(conformanceclass
93
- verification).include?(r["type"])
76
+ def reqt_links_test1(reqt, acc)
77
+ return unless %w(conformanceclass
78
+ verification).include?(reqt["type"])
94
79
 
95
- subj = r.at(ns("./classification[tag = 'target']/value"))
96
- id = r.at(ns("./identifier")) or next
97
- lbl = @xrefs.anchor(@reqt_ids[id.text.strip][:id], :xref_reqt2reqt,
98
- false)
99
- next unless subj
80
+ subj = reqt_extract_target(reqt)
81
+ id = reqt.at(ns("./identifier")) or return
82
+ lbl = @xrefs.anchor(@reqt_ids[id.text.strip][:id], :xref_reqt2reqt,
83
+ false)
84
+ return unless subj
100
85
 
101
- m[subj.text] = { lbl: lbl, id: r["id"] }
102
- end
86
+ acc[subj.text] = { lbl: lbl, id: reqt["id"] }
103
87
  end
104
88
 
105
89
  def reqt_links_class(docxml)
@@ -25,9 +25,12 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.bindir = "bin"
27
27
  spec.require_paths = ["lib"]
28
- spec.files = `git ls-files`.split("\n")
28
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
29
+ f.match(%r{^(test|spec|features|bin|.github)/}) \
30
+ || f.match(%r{Rakefile|bin/rspec})
31
+ end
29
32
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
30
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
33
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
31
34
 
32
35
  spec.add_dependency "metanorma-standoc", "~> 2.2.4"
33
36
  spec.add_dependency "mnconvert", "~> 1.14"