metanorma-ogc 0.0.9 → 0.1.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.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/appveyor.yml +7 -2
- data/lib/asciidoctor/ogc/biblio.rng +27 -3
- data/lib/asciidoctor/ogc/converter.rb +1 -70
- data/lib/asciidoctor/ogc/front.rb +4 -7
- data/lib/asciidoctor/ogc/isodoc.rng +128 -71
- data/lib/asciidoctor/ogc/isostandard.rng +29 -304
- data/lib/asciidoctor/ogc/ogc.rng +6 -80
- data/lib/asciidoctor/ogc/reqt.rng +5 -0
- data/lib/asciidoctor/ogc/validate.rb +91 -0
- data/lib/isodoc/ogc/base_convert.rb +23 -14
- data/lib/isodoc/ogc/html/html_ogc_titlepage.html +4 -4
- data/lib/isodoc/ogc/html/word_ogc_titlepage.html +3 -3
- data/lib/isodoc/ogc/html_convert.rb +1 -0
- data/lib/isodoc/ogc/metadata.rb +11 -8
- data/lib/isodoc/ogc/pdf_convert.rb +1 -0
- data/lib/isodoc/ogc/word_convert.rb +1 -0
- data/lib/metanorma/ogc/version.rb +1 -1
- data/metanorma-ogc.gemspec +3 -3
- metadata +9 -22
@@ -4,36 +4,6 @@
|
|
4
4
|
<start>
|
5
5
|
<ref name="iso-standard"/>
|
6
6
|
</start>
|
7
|
-
<define name="language">
|
8
|
-
<element name="language">
|
9
|
-
<choice>
|
10
|
-
<value>en</value>
|
11
|
-
<value>fr</value>
|
12
|
-
</choice>
|
13
|
-
</element>
|
14
|
-
</define>
|
15
|
-
<define name="script">
|
16
|
-
<element name="script">
|
17
|
-
<value>Latn</value>
|
18
|
-
</element>
|
19
|
-
</define>
|
20
|
-
<!-- add type to docidentifier in isodoc? -->
|
21
|
-
<define name="docidentifier">
|
22
|
-
<element name="docidentifier">
|
23
|
-
<optional>
|
24
|
-
<attribute name="type"/>
|
25
|
-
</optional>
|
26
|
-
<choice>
|
27
|
-
<text/>
|
28
|
-
<group>
|
29
|
-
<ref name="documentnumber"/>
|
30
|
-
<optional>
|
31
|
-
<ref name="tc-documentnumber"/>
|
32
|
-
</optional>
|
33
|
-
</group>
|
34
|
-
</choice>
|
35
|
-
</element>
|
36
|
-
</define>
|
37
7
|
<define name="organization">
|
38
8
|
<element name="organization">
|
39
9
|
<ref name="orgname"/>
|
@@ -63,190 +33,24 @@
|
|
63
33
|
</optional>
|
64
34
|
</element>
|
65
35
|
</define>
|
66
|
-
<define name="
|
67
|
-
<optional>
|
68
|
-
<attribute name="type">
|
69
|
-
<ref name="BibItemType"/>
|
70
|
-
</attribute>
|
71
|
-
</optional>
|
72
|
-
<optional>
|
73
|
-
<ref name="fetched"/>
|
74
|
-
</optional>
|
75
|
-
<choice>
|
76
|
-
<oneOrMore>
|
77
|
-
<ref name="btitle"/>
|
78
|
-
</oneOrMore>
|
79
|
-
<ref name="formattedref"/>
|
80
|
-
</choice>
|
81
|
-
<zeroOrMore>
|
82
|
-
<ref name="bsource"/>
|
83
|
-
</zeroOrMore>
|
84
|
-
<zeroOrMore>
|
85
|
-
<ref name="docidentifier"/>
|
86
|
-
</zeroOrMore>
|
87
|
-
<optional>
|
88
|
-
<ref name="docnumber"/>
|
89
|
-
</optional>
|
90
|
-
<zeroOrMore>
|
91
|
-
<ref name="bdate"/>
|
92
|
-
</zeroOrMore>
|
93
|
-
<zeroOrMore>
|
94
|
-
<ref name="contributor"/>
|
95
|
-
</zeroOrMore>
|
96
|
-
<optional>
|
97
|
-
<ref name="edition"/>
|
98
|
-
</optional>
|
99
|
-
<optional>
|
100
|
-
<ref name="version"/>
|
101
|
-
</optional>
|
102
|
-
<zeroOrMore>
|
103
|
-
<ref name="biblionote"/>
|
104
|
-
</zeroOrMore>
|
105
|
-
<zeroOrMore>
|
106
|
-
<ref name="language"/>
|
107
|
-
</zeroOrMore>
|
108
|
-
<zeroOrMore>
|
109
|
-
<ref name="script"/>
|
110
|
-
</zeroOrMore>
|
111
|
-
<zeroOrMore>
|
112
|
-
<ref name="abstract"/>
|
113
|
-
</zeroOrMore>
|
114
|
-
<optional>
|
115
|
-
<ref name="status"/>
|
116
|
-
</optional>
|
117
|
-
<optional>
|
118
|
-
<ref name="copyright"/>
|
119
|
-
</optional>
|
120
|
-
<zeroOrMore>
|
121
|
-
<ref name="docrelation"/>
|
122
|
-
</zeroOrMore>
|
123
|
-
<zeroOrMore>
|
124
|
-
<ref name="series"/>
|
125
|
-
</zeroOrMore>
|
126
|
-
<optional>
|
127
|
-
<ref name="medium"/>
|
128
|
-
</optional>
|
129
|
-
<zeroOrMore>
|
130
|
-
<ref name="bplace"/>
|
131
|
-
</zeroOrMore>
|
132
|
-
<zeroOrMore>
|
133
|
-
<ref name="extent"/>
|
134
|
-
</zeroOrMore>
|
135
|
-
<zeroOrMore>
|
136
|
-
<ref name="accesslocation"/>
|
137
|
-
</zeroOrMore>
|
138
|
-
<optional>
|
139
|
-
<ref name="bclassification"/>
|
140
|
-
</optional>
|
141
|
-
<optional>
|
142
|
-
<ref name="validity"/>
|
143
|
-
</optional>
|
144
|
-
<optional>
|
145
|
-
<ref name="editorialgroup"/>
|
146
|
-
</optional>
|
147
|
-
<zeroOrMore>
|
148
|
-
<ref name="ics"/>
|
149
|
-
</zeroOrMore>
|
150
|
-
<optional>
|
151
|
-
<ref name="allParts"/>
|
152
|
-
</optional>
|
153
|
-
</define>
|
154
|
-
<define name="BibData">
|
155
|
-
<optional>
|
156
|
-
<attribute name="type">
|
157
|
-
<ref name="BibItemType"/>
|
158
|
-
</attribute>
|
159
|
-
</optional>
|
160
|
-
<oneOrMore>
|
161
|
-
<ref name="btitle"/>
|
162
|
-
</oneOrMore>
|
163
|
-
<optional>
|
164
|
-
<ref name="formattedref"/>
|
165
|
-
</optional>
|
166
|
-
<zeroOrMore>
|
167
|
-
<ref name="bsource"/>
|
168
|
-
</zeroOrMore>
|
169
|
-
<zeroOrMore>
|
170
|
-
<ref name="docidentifier"/>
|
171
|
-
</zeroOrMore>
|
172
|
-
<optional>
|
173
|
-
<ref name="docnumber"/>
|
174
|
-
</optional>
|
175
|
-
<zeroOrMore>
|
176
|
-
<ref name="bdate"/>
|
177
|
-
</zeroOrMore>
|
178
|
-
<zeroOrMore>
|
179
|
-
<ref name="contributor"/>
|
180
|
-
</zeroOrMore>
|
181
|
-
<optional>
|
182
|
-
<ref name="edition"/>
|
183
|
-
</optional>
|
184
|
-
<optional>
|
185
|
-
<ref name="version"/>
|
186
|
-
</optional>
|
187
|
-
<zeroOrMore>
|
188
|
-
<ref name="biblionote"/>
|
189
|
-
</zeroOrMore>
|
190
|
-
<zeroOrMore>
|
191
|
-
<ref name="language"/>
|
192
|
-
</zeroOrMore>
|
193
|
-
<zeroOrMore>
|
194
|
-
<ref name="script"/>
|
195
|
-
</zeroOrMore>
|
196
|
-
<zeroOrMore>
|
197
|
-
<ref name="abstract"/>
|
198
|
-
</zeroOrMore>
|
199
|
-
<optional>
|
200
|
-
<ref name="status"/>
|
201
|
-
</optional>
|
202
|
-
<ref name="copyright"/>
|
203
|
-
<zeroOrMore>
|
204
|
-
<ref name="docrelation"/>
|
205
|
-
</zeroOrMore>
|
206
|
-
<zeroOrMore>
|
207
|
-
<ref name="series"/>
|
208
|
-
</zeroOrMore>
|
36
|
+
<define name="BibDataExtensionType">
|
209
37
|
<optional>
|
210
|
-
<ref name="
|
211
|
-
</optional>
|
212
|
-
<zeroOrMore>
|
213
|
-
<ref name="bplace"/>
|
214
|
-
</zeroOrMore>
|
215
|
-
<zeroOrMore>
|
216
|
-
<ref name="extent"/>
|
217
|
-
</zeroOrMore>
|
218
|
-
<zeroOrMore>
|
219
|
-
<ref name="accesslocation"/>
|
220
|
-
</zeroOrMore>
|
221
|
-
<optional>
|
222
|
-
<ref name="bclassification"/>
|
223
|
-
</optional>
|
224
|
-
<optional>
|
225
|
-
<ref name="validity"/>
|
38
|
+
<ref name="doctype"/>
|
226
39
|
</optional>
|
227
40
|
<ref name="editorialgroup"/>
|
228
41
|
<zeroOrMore>
|
229
42
|
<ref name="ics"/>
|
230
43
|
</zeroOrMore>
|
231
|
-
<
|
232
|
-
<ref name="allParts"/>
|
233
|
-
</optional>
|
44
|
+
<ref name="structuredidentifier"/>
|
234
45
|
</define>
|
235
46
|
<define name="bdate">
|
236
47
|
<element name="date">
|
237
48
|
<attribute name="type">
|
238
49
|
<choice>
|
239
|
-
<
|
240
|
-
<
|
241
|
-
<value>created</value>
|
242
|
-
<value>implemented</value>
|
243
|
-
<value>obsoleted</value>
|
244
|
-
<value>confirmed</value>
|
245
|
-
<value>updated</value>
|
246
|
-
<value>issued</value>
|
50
|
+
<ref name="BibliographicDateType"/>
|
51
|
+
<text/>
|
247
52
|
</choice>
|
248
53
|
</attribute>
|
249
|
-
<!-- ( ( bfrom, bto? ) | date_on ) -->
|
250
54
|
<choice>
|
251
55
|
<group>
|
252
56
|
<element name="from">
|
@@ -267,47 +71,6 @@
|
|
267
71
|
</choice>
|
268
72
|
</element>
|
269
73
|
</define>
|
270
|
-
<define name="biblionote">
|
271
|
-
<element name="note">
|
272
|
-
<optional>
|
273
|
-
<!-- Biblio date notes can be footnoted -->
|
274
|
-
<attribute name="reference"/>
|
275
|
-
</optional>
|
276
|
-
<ref name="FormattedString"/>
|
277
|
-
</element>
|
278
|
-
</define>
|
279
|
-
<define name="status">
|
280
|
-
<element name="status">
|
281
|
-
<choice>
|
282
|
-
<ref name="FormattedString"/>
|
283
|
-
<group>
|
284
|
-
<ref name="stage"/>
|
285
|
-
<optional>
|
286
|
-
<ref name="substage"/>
|
287
|
-
</optional>
|
288
|
-
<optional>
|
289
|
-
<ref name="iteration"/>
|
290
|
-
</optional>
|
291
|
-
</group>
|
292
|
-
</choice>
|
293
|
-
</element>
|
294
|
-
</define>
|
295
|
-
<define name="btitle">
|
296
|
-
<element name="title">
|
297
|
-
<choice>
|
298
|
-
<ref name="FormattedString"/>
|
299
|
-
<group>
|
300
|
-
<optional>
|
301
|
-
<ref name="title-intro"/>
|
302
|
-
</optional>
|
303
|
-
<ref name="title-main"/>
|
304
|
-
<optional>
|
305
|
-
<ref name="title-part"/>
|
306
|
-
</optional>
|
307
|
-
</group>
|
308
|
-
</choice>
|
309
|
-
</element>
|
310
|
-
</define>
|
311
74
|
<define name="sections">
|
312
75
|
<element name="sections">
|
313
76
|
<ref name="clause"/>
|
@@ -752,6 +515,16 @@
|
|
752
515
|
</optional>
|
753
516
|
</element>
|
754
517
|
</define>
|
518
|
+
<define name="DocumentType">
|
519
|
+
<choice>
|
520
|
+
<value>international-standard</value>
|
521
|
+
<value>technical-specification</value>
|
522
|
+
<value>technical-report</value>
|
523
|
+
<value>publicly-available-specification</value>
|
524
|
+
<value>international-workshop-agreement</value>
|
525
|
+
<value>guide</value>
|
526
|
+
</choice>
|
527
|
+
</define>
|
755
528
|
</include>
|
756
529
|
<!-- end overrides -->
|
757
530
|
<!--
|
@@ -764,6 +537,9 @@
|
|
764
537
|
<zeroOrMore>
|
765
538
|
<ref name="termdocsource"/>
|
766
539
|
</zeroOrMore>
|
540
|
+
<optional>
|
541
|
+
<ref name="boilerplate"/>
|
542
|
+
</optional>
|
767
543
|
<ref name="preface"/>
|
768
544
|
<oneOrMore>
|
769
545
|
<ref name="sections"/>
|
@@ -784,16 +560,6 @@
|
|
784
560
|
</oneOrMore>
|
785
561
|
</element>
|
786
562
|
</define>
|
787
|
-
<define name="BibItemType" combine="choice">
|
788
|
-
<choice>
|
789
|
-
<value>international-standard</value>
|
790
|
-
<value>technical-specification</value>
|
791
|
-
<value>technical-report</value>
|
792
|
-
<value>publicly-available-specification</value>
|
793
|
-
<value>international-workshop-agreement</value>
|
794
|
-
<value>guide</value>
|
795
|
-
</choice>
|
796
|
-
</define>
|
797
563
|
<define name="editorialgroup">
|
798
564
|
<element name="editorialgroup">
|
799
565
|
<oneOrMore>
|
@@ -825,38 +591,17 @@
|
|
825
591
|
<ref name="Content-Section"/>
|
826
592
|
</element>
|
827
593
|
</define>
|
828
|
-
<define name="
|
829
|
-
<element name="
|
830
|
-
<
|
831
|
-
<
|
832
|
-
|
833
|
-
|
834
|
-
<
|
835
|
-
<
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
<value>95</value>
|
840
|
-
</choice>
|
841
|
-
</element>
|
842
|
-
</define>
|
843
|
-
<define name="substage">
|
844
|
-
<element name="substage">
|
845
|
-
<choice>
|
846
|
-
<value>00</value>
|
847
|
-
<value>20</value>
|
848
|
-
<value>60</value>
|
849
|
-
<value>90</value>
|
850
|
-
<value>92</value>
|
851
|
-
<value>93</value>
|
852
|
-
<value>98</value>
|
853
|
-
<value>99</value>
|
854
|
-
</choice>
|
855
|
-
</element>
|
856
|
-
</define>
|
857
|
-
<define name="iteration">
|
858
|
-
<element name="iteration">
|
859
|
-
<data type="int"/>
|
594
|
+
<define name="structuredidentifier">
|
595
|
+
<element name="structuredidentifier">
|
596
|
+
<optional>
|
597
|
+
<attribute name="type"/>
|
598
|
+
</optional>
|
599
|
+
<group>
|
600
|
+
<ref name="documentnumber"/>
|
601
|
+
<optional>
|
602
|
+
<ref name="tc-documentnumber"/>
|
603
|
+
</optional>
|
604
|
+
</group>
|
860
605
|
</element>
|
861
606
|
</define>
|
862
607
|
<define name="documentnumber">
|
@@ -910,26 +655,6 @@
|
|
910
655
|
<text/>
|
911
656
|
</element>
|
912
657
|
</define>
|
913
|
-
<define name="title-intro">
|
914
|
-
<element name="title-intro">
|
915
|
-
<ref name="FormattedString"/>
|
916
|
-
</element>
|
917
|
-
</define>
|
918
|
-
<define name="title-main">
|
919
|
-
<element name="title-main">
|
920
|
-
<ref name="FormattedString"/>
|
921
|
-
</element>
|
922
|
-
</define>
|
923
|
-
<define name="title-part">
|
924
|
-
<element name="title-part">
|
925
|
-
<ref name="FormattedString"/>
|
926
|
-
</element>
|
927
|
-
</define>
|
928
|
-
<define name="allParts">
|
929
|
-
<element name="allparts">
|
930
|
-
<data type="boolean"/>
|
931
|
-
</element>
|
932
|
-
</define>
|
933
658
|
<define name="clause-hanging-paragraph-with-footnote">
|
934
659
|
<element name="clause">
|
935
660
|
<optional>
|
data/lib/asciidoctor/ogc/ogc.rng
CHANGED
@@ -9,24 +9,6 @@
|
|
9
9
|
<start>
|
10
10
|
<ref name="ogc-standard"/>
|
11
11
|
</start>
|
12
|
-
<define name="language">
|
13
|
-
<element name="language">
|
14
|
-
<value>en</value>
|
15
|
-
</element>
|
16
|
-
</define>
|
17
|
-
<define name="docidentifier">
|
18
|
-
<element name="docidentifier">
|
19
|
-
<optional>
|
20
|
-
<attribute name="type"/>
|
21
|
-
</optional>
|
22
|
-
<text/>
|
23
|
-
</element>
|
24
|
-
</define>
|
25
|
-
<define name="btitle">
|
26
|
-
<element name="title">
|
27
|
-
<ref name="FormattedString"/>
|
28
|
-
</element>
|
29
|
-
</define>
|
30
12
|
<define name="figure">
|
31
13
|
<element name="figure">
|
32
14
|
<attribute name="id">
|
@@ -67,18 +49,7 @@
|
|
67
49
|
</choice>
|
68
50
|
</element>
|
69
51
|
</define>
|
70
|
-
<define name="
|
71
|
-
<element name="status">
|
72
|
-
<choice>
|
73
|
-
<value>rfc</value>
|
74
|
-
<value>candidate</value>
|
75
|
-
<value>published</value>
|
76
|
-
<value>deprecated</value>
|
77
|
-
<value>retired</value>
|
78
|
-
</choice>
|
79
|
-
</element>
|
80
|
-
</define>
|
81
|
-
<define name="BibItemType" combine="choice">
|
52
|
+
<define name="DocumentType">
|
82
53
|
<choice>
|
83
54
|
<value>standard</value>
|
84
55
|
<value>standard-with-suite</value>
|
@@ -108,58 +79,10 @@
|
|
108
79
|
</optional>
|
109
80
|
</element>
|
110
81
|
</define>
|
111
|
-
<define name="
|
112
|
-
<optional>
|
113
|
-
<attribute name="type">
|
114
|
-
<ref name="BibItemType"/>
|
115
|
-
</attribute>
|
116
|
-
</optional>
|
117
|
-
<oneOrMore>
|
118
|
-
<ref name="btitle"/>
|
119
|
-
</oneOrMore>
|
120
|
-
<optional>
|
121
|
-
<ref name="formattedref"/>
|
122
|
-
</optional>
|
123
|
-
<zeroOrMore>
|
124
|
-
<ref name="bsource"/>
|
125
|
-
</zeroOrMore>
|
126
|
-
<zeroOrMore>
|
127
|
-
<ref name="docidentifier"/>
|
128
|
-
</zeroOrMore>
|
82
|
+
<define name="BibDataExtensionType">
|
129
83
|
<optional>
|
130
|
-
<ref name="
|
84
|
+
<ref name="doctype"/>
|
131
85
|
</optional>
|
132
|
-
<zeroOrMore>
|
133
|
-
<ref name="bdate"/>
|
134
|
-
</zeroOrMore>
|
135
|
-
<zeroOrMore>
|
136
|
-
<ref name="contributor"/>
|
137
|
-
</zeroOrMore>
|
138
|
-
<optional>
|
139
|
-
<ref name="edition"/>
|
140
|
-
</optional>
|
141
|
-
<optional>
|
142
|
-
<ref name="version"/>
|
143
|
-
</optional>
|
144
|
-
<zeroOrMore>
|
145
|
-
<ref name="biblionote"/>
|
146
|
-
</zeroOrMore>
|
147
|
-
<zeroOrMore>
|
148
|
-
<ref name="language"/>
|
149
|
-
</zeroOrMore>
|
150
|
-
<zeroOrMore>
|
151
|
-
<ref name="script"/>
|
152
|
-
</zeroOrMore>
|
153
|
-
<zeroOrMore>
|
154
|
-
<ref name="abstract"/>
|
155
|
-
</zeroOrMore>
|
156
|
-
<optional>
|
157
|
-
<ref name="status"/>
|
158
|
-
</optional>
|
159
|
-
<ref name="copyright"/>
|
160
|
-
<zeroOrMore>
|
161
|
-
<ref name="docrelation"/>
|
162
|
-
</zeroOrMore>
|
163
86
|
<ref name="editorialgroup"/>
|
164
87
|
<zeroOrMore>
|
165
88
|
<ref name="ics"/>
|
@@ -197,6 +120,9 @@
|
|
197
120
|
<zeroOrMore>
|
198
121
|
<ref name="termdocsource"/>
|
199
122
|
</zeroOrMore>
|
123
|
+
<optional>
|
124
|
+
<ref name="boilerplate"/>
|
125
|
+
</optional>
|
200
126
|
<ref name="preface"/>
|
201
127
|
<oneOrMore>
|
202
128
|
<ref name="sections"/>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
module Asciidoctor
|
2
|
+
module Ogc
|
3
|
+
class Converter < Standoc::Converter
|
4
|
+
def title_validate(root)
|
5
|
+
nil
|
6
|
+
end
|
7
|
+
|
8
|
+
def content_validate(doc)
|
9
|
+
super
|
10
|
+
bibdata_validate(doc.root)
|
11
|
+
end
|
12
|
+
|
13
|
+
def bibdata_validate(doc)
|
14
|
+
stage_validate(doc)
|
15
|
+
end
|
16
|
+
|
17
|
+
def stage_validate(xmldoc)
|
18
|
+
stage = xmldoc&.at("//bibdata/status/stage")&.text
|
19
|
+
%w(rfc candidate published deprecated retired).include? stage or
|
20
|
+
warn "Document Attributes: #{stage} is not a recognised status"
|
21
|
+
end
|
22
|
+
|
23
|
+
def section_validate(doc)
|
24
|
+
sections_sequence_validate(doc.root)
|
25
|
+
end
|
26
|
+
|
27
|
+
STANDARDTYPE = %w{standard standard-with-suite abstract-specification
|
28
|
+
community-standard profile}.freeze
|
29
|
+
|
30
|
+
# spec of permissible section sequence
|
31
|
+
# we skip normative references, it goes to end of list
|
32
|
+
SEQ =
|
33
|
+
[
|
34
|
+
{
|
35
|
+
msg: "Prefatory material must be followed by (clause) Scope",
|
36
|
+
val: [{ tag: "clause", title: "Scope" }],
|
37
|
+
},
|
38
|
+
{
|
39
|
+
msg: "Scope must be followed by Conformance",
|
40
|
+
val: [{ tag: "clause", title: "Conformance" }],
|
41
|
+
},
|
42
|
+
{
|
43
|
+
msg: "Normative References must be followed by "\
|
44
|
+
"Terms and Definitions",
|
45
|
+
val: [
|
46
|
+
{ tag: "terms", title: "Terms and definitions" },
|
47
|
+
{ tag: "clause", title: "Terms and definitions" },
|
48
|
+
{
|
49
|
+
tag: "terms",
|
50
|
+
title: "Terms, definitions, symbols and abbreviated terms",
|
51
|
+
},
|
52
|
+
{
|
53
|
+
tag: "clause",
|
54
|
+
title: "Terms, definitions, symbols and abbreviated terms",
|
55
|
+
},
|
56
|
+
],
|
57
|
+
},
|
58
|
+
].freeze
|
59
|
+
|
60
|
+
def seqcheck(names, msg, accepted)
|
61
|
+
n = names.shift
|
62
|
+
unless accepted.include? n
|
63
|
+
warn "OGC style: #{msg}"
|
64
|
+
names = []
|
65
|
+
end
|
66
|
+
names
|
67
|
+
end
|
68
|
+
|
69
|
+
def sections_sequence_validate(root)
|
70
|
+
return unless STANDARDTYPE.include? root&.at("//bibdata/ext/doctype")&.text
|
71
|
+
f = root.at("//sections").elements
|
72
|
+
names = f.map { |s| { tag: s.name, title: s&.at("./title")&.text } }
|
73
|
+
names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val]) || return
|
74
|
+
names = seqcheck(names, SEQ[1][:msg], SEQ[1][:val]) || return
|
75
|
+
names = seqcheck(names, SEQ[2][:msg], SEQ[2][:val]) || return
|
76
|
+
n = names.shift
|
77
|
+
if !n.nil? && n[:tag] == "definitions"
|
78
|
+
n = names.shift
|
79
|
+
end
|
80
|
+
unless n
|
81
|
+
warn "OGC style: Document must contain at least one clause"
|
82
|
+
return
|
83
|
+
end
|
84
|
+
root.at("//references | //clause[descendant::references][not(parent::clause)]") or
|
85
|
+
seqcheck([{tag: "clause"}],
|
86
|
+
"Normative References are mandatory", [{tag: "references"}])
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|