metanorma-ietf 3.5.3 → 3.5.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 378d773da5d48f1d408bdf1764876cf9000c4fbc7d3c91dbf30df1c5f50ffa06
4
- data.tar.gz: 49055c291b27e058204ff5958cc4e31c8f56fecc2503b3417dbd3723869550fc
3
+ metadata.gz: b2bbef6e584be1dd783e7737b1e05b43a6ed524acc3cd3affb2edbe407d3417b
4
+ data.tar.gz: '097b2d98f09a4ff356b7000ba0ccb683194c36a8edfbb9c39895a314f663da68'
5
5
  SHA512:
6
- metadata.gz: f4aea53f5e58916d5fd7282089d6eb52c16a48f643888d1e0c39a6f8312955cc1ffa0b8de2eff1fd4045ecffcea9bc8f73b98f92d703920473a91ce6485d1969
7
- data.tar.gz: 5320a0b3bbfadbc20035596de82b6c9856c165219dc65e3de56709e60fcf510a6a826bdd0b91f5797c6bb23c6c6614c9e3649d3435fb9b2ce1aeceda78f62a0a
6
+ metadata.gz: aab2b309ce5d38c345ffd952fdcbcc07f723b35b2d3d31a2be9301ed0a390d31a8991c83aa6500ec47cfd1b11004f3ef99961ab89f7509168547b281685dc578
7
+ data.tar.gz: 55d97a53151343f37471913d54ee369f847bce6eff6fceb160980e5025a257714a992790562eab342d9be92c071fcbe9ee42309b1185514c14b79bf5698762b7
@@ -3,54 +3,54 @@ module IsoDoc
3
3
  class RfcConvert < ::IsoDoc::Convert
4
4
  def em_parse(node, out)
5
5
  out.em do |e|
6
- node.children.each { |n| parse(n, e) }
6
+ children_parse(node, e)
7
7
  end
8
8
  end
9
9
 
10
10
  def sup_parse(node, out)
11
11
  out.sup do |e|
12
- node.children.each { |n| parse(n, e) }
12
+ children_parse(node, e)
13
13
  end
14
14
  end
15
15
 
16
16
  def sub_parse(node, out)
17
17
  out.sub do |e|
18
- node.children.each { |n| parse(n, e) }
18
+ children_parse(node, e)
19
19
  end
20
20
  end
21
21
 
22
22
  def tt_parse(node, out)
23
23
  out.tt do |e|
24
- node.children.each { |n| parse(n, e) }
24
+ children_parse(node, e)
25
25
  end
26
26
  end
27
27
 
28
28
  def strong_parse(node, out)
29
29
  out.strong do |e|
30
- node.children.each { |n| parse(n, e) }
30
+ children_parse(node, e)
31
31
  end
32
32
  end
33
33
 
34
34
  def bcp14_parse(node, out)
35
35
  out.bcp14 do |e|
36
- node.children.each { |n| parse(n, e) }
36
+ children_parse(node, e)
37
37
  end
38
38
  end
39
39
 
40
40
  def display_text_parse(node, out)
41
- node.children.each { |n| parse(n, out) }
41
+ children_parse(node, out)
42
42
  end
43
43
 
44
44
  def strike_parse(node, out)
45
- node.children.each { |n| parse(n, out) }
45
+ children_parse(node, out)
46
46
  end
47
47
 
48
48
  def smallcap_parse(node, out)
49
- node.children.each { |n| parse(n, out) }
49
+ children_parse(node, out)
50
50
  end
51
51
 
52
52
  def keyword_parse(node, out)
53
- node.children.each { |n| parse(n, out) }
53
+ children_parse(node, out)
54
54
  end
55
55
 
56
56
  def text_parse(node, out)
@@ -65,8 +65,8 @@ module IsoDoc
65
65
  when "MathML"
66
66
  a = node.at(ns("./asciimath"))&.remove
67
67
  a&.children&.text ||
68
- Plurimath::Math
69
- .parse(node.children.to_xml, "mathml").to_asciimath
68
+ Plurimath::Math
69
+ .parse(node.children.to_xml, "mathml").to_asciimath
70
70
  else HTMLEntities.new.encode(node.text)
71
71
  end
72
72
  out << "#{@openmathdelim} #{stem} #{@closemathdelim}"
@@ -85,7 +85,7 @@ module IsoDoc
85
85
  def semx_link_parse(node, out)
86
86
  out.eref **attr_code(target: node["target"],
87
87
  brackets: node["style"]) do |l|
88
- node.children.each { |n| parse(n, l) }
88
+ children_parse(node, l)
89
89
  end
90
90
  end
91
91
 
@@ -183,7 +183,11 @@ module IsoDoc
183
183
  end
184
184
 
185
185
  def span_parse(node, out)
186
- children_parse(node, out)
186
+ if node["class"] == "bcp14"
187
+ bcp14_parse(node, out)
188
+ else
189
+ children_parse(node, out)
190
+ end
187
191
  end
188
192
  end
189
193
  end
@@ -67,7 +67,7 @@ module IsoDoc
67
67
 
68
68
  def error_parse(node, out)
69
69
  case node.name
70
- when "bcp14" then bcp14_parse(node, out)
70
+ when "bcp14" then bcp14_parse(node, out) # legacy
71
71
  when "concept" then concept_parse(node, out)
72
72
  when "display-text" then display_text_parse(node, out)
73
73
  when "verbal-definition", "non-verbal-representation",
@@ -1701,16 +1701,22 @@ which can be bookmarks as well as block or section references</a:documentation>
1701
1701
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as a footnote.
1702
1702
  The target of a footnote is the location it is embedded in within the text</a:documentation>
1703
1703
  <element name="fn">
1704
- <attribute name="reference">
1705
- <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1706
- </attribute>
1707
- <oneOrMore>
1708
- <ref name="paragraph">
1709
- <a:documentation>The content of the footnote</a:documentation>
1710
- </ref>
1711
- </oneOrMore>
1704
+ <ref name="FnAttributes"/>
1705
+ <ref name="FnBody"/>
1712
1706
  </element>
1713
1707
  </define>
1708
+ <define name="FnBody">
1709
+ <oneOrMore>
1710
+ <ref name="paragraph">
1711
+ <a:documentation>The content of the footnote</a:documentation>
1712
+ </ref>
1713
+ </oneOrMore>
1714
+ </define>
1715
+ <define name="FnAttributes">
1716
+ <attribute name="reference">
1717
+ <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1718
+ </attribute>
1719
+ </define>
1714
1720
  <define name="callout">
1715
1721
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as annotation of source code</a:documentation>
1716
1722
  <element name="callout">
@@ -1,13 +1,14 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
3
- <!--
4
- Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
5
- of relaton
6
-
7
- Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
8
- (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
9
- -->
10
3
  <include href="biblio.rng">
4
+ <!-- ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix -->
5
+ <!--
6
+ Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
7
+ of relaton
8
+
9
+ Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
10
+ (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
11
+ -->
11
12
  <define name="BibData">
12
13
  <a:documentation>The bibliographic description of a standardisation document</a:documentation>
13
14
  <ref name="StandardBibliographicItem"/>
@@ -91,6 +92,9 @@ a standards definition organization</a:documentation>
91
92
  <a:documentation>Representation of the identifier for the standardisation document, giving its individual semantic components</a:documentation>
92
93
  </ref>
93
94
  </zeroOrMore>
95
+ <ref name="DocumentImages">
96
+ <a:documentation>Coverpage and other images to be rendered with document</a:documentation>
97
+ </ref>
94
98
  </define>
95
99
  <define name="doctype">
96
100
  <a:documentation>Classification of the standardisation document</a:documentation>
@@ -268,6 +272,32 @@ and not those document components</a:documentation>
268
272
  </optional>
269
273
  </element>
270
274
  </define>
275
+ <define name="DocumentImages">
276
+ <zeroOrMore>
277
+ <element name="coverpage-image">
278
+ <a:documentation>Images to be displayed on the coverpage of the document</a:documentation>
279
+ <ref name="image-no-id"/>
280
+ </element>
281
+ </zeroOrMore>
282
+ <zeroOrMore>
283
+ <element name="innercoverpage-image">
284
+ <a:documentation>Images to be displayed on the inner coverpage of the document</a:documentation>
285
+ <ref name="image-no-id"/>
286
+ </element>
287
+ </zeroOrMore>
288
+ <zeroOrMore>
289
+ <element name="tocside-image">
290
+ <a:documentation>Images to be displayed on the Table of Contents page of the document</a:documentation>
291
+ <ref name="image-no-id"/>
292
+ </element>
293
+ </zeroOrMore>
294
+ <zeroOrMore>
295
+ <element name="backpage-image">
296
+ <a:documentation>Images to be displayed on the backpage of the document</a:documentation>
297
+ <ref name="image-no-id"/>
298
+ </element>
299
+ </zeroOrMore>
300
+ </define>
271
301
  <define name="StandardBibliographicItem">
272
302
  <ref name="BibliographicItem"/>
273
303
  <zeroOrMore>
@@ -1,23 +1,25 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- instantiations of this grammar may replace leaf strings
4
- with more elaborated types; e.g. title (text) replaced with
5
- title-main, title-intro, title-part; type replaced with
6
- enum.
7
-
8
- some renaming at leaf nodes is permissible
9
-
10
- obligations can change both from optional to mandatory,
11
- and from mandatory to optional; optional elements may
12
- be omitted; freely positioned alternatives may be replaced
13
- with strict ordering
14
-
15
- DO NOT introduce a namespace here. We do not want a distinct namespace
16
- for these elements, and a distinct namespace for any grammar inheriting
17
- these elements; we just want one namespace for any child grammars
18
- of this.
19
- -->
20
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!--
4
+ ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix
5
+
6
+ Instantiations of this grammar may replace leaf strings
7
+ with more elaborated types; e.g. title (text) replaced with
8
+ title-main, title-intro, title-part; type replaced with
9
+ enum.
10
+
11
+ Some renaming at leaf nodes is permissible
12
+
13
+ Obligations can change both from optional to mandatory,
14
+ and from mandatory to optional; optional elements may
15
+ be omitted; freely positioned alternatives may be replaced
16
+ with strict ordering
17
+
18
+ DO NOT introduce a namespace here. We do not want a distinct namespace
19
+ for these elements, and a distinct namespace for any grammar inheriting
20
+ these elements; we just want one namespace for any child grammars
21
+ of this.
22
+ -->
21
23
  <!--
22
24
  https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
23
25
  iso8601date = xsd:string { pattern = "([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?" }
@@ -1241,6 +1243,11 @@ Refer to `BibliographicItem` for definitions</a:documentation>
1241
1243
  </define>
1242
1244
  <define name="formattedref">
1243
1245
  <element name="formattedref">
1246
+ <optional>
1247
+ <attribute name="format">
1248
+ <a:documentation>format of formatted reference; Metanorma assumes references are formatted as Metanorma XML</a:documentation>
1249
+ </attribute>
1250
+ </optional>
1244
1251
  <oneOrMore>
1245
1252
  <ref name="TextElement"/>
1246
1253
  </oneOrMore>
@@ -1812,6 +1819,11 @@ May be used to differentiate rendering of notes in bibliographies</a:documentati
1812
1819
  <a:documentation>Abstract of bibliographic item</a:documentation>
1813
1820
  <element name="abstract">
1814
1821
  <ref name="LocalizedStringAttributes"/>
1822
+ <optional>
1823
+ <attribute name="format">
1824
+ <a:documentation>What format the formatted abstract is in. In Metanorma, assumed to be Metanorma XML</a:documentation>
1825
+ </attribute>
1826
+ </optional>
1815
1827
  <choice>
1816
1828
  <oneOrMore>
1817
1829
  <ref name="BasicBlockNoId">
@@ -43,12 +43,11 @@ module Metanorma
43
43
  "NOT RECOMMENDED", "OPTIONAL"].freeze
44
44
 
45
45
  def bcp14_cleanup(xmldoc)
46
- return unless @bcp_bold
47
-
46
+ @bcp_bold or return
48
47
  xmldoc.xpath("//strong").each do |s|
49
- next unless BCP_KEYWORDS.include?(s.text)
50
-
51
- s.name = "bcp14"
48
+ BCP_KEYWORDS.include?(s.text) or next
49
+ s["class"] = "bcp14"
50
+ s.name = "span"
52
51
  end
53
52
  end
54
53
 
@@ -56,14 +56,19 @@ module Metanorma
56
56
  when :latexmath then stem_parse(node.text, xml, :latexmath, node)
57
57
  else
58
58
  case node.role
59
- when "bcp14" then xml.bcp14 { |s| s << node.text.upcase }
60
- else
61
- xml << node.text
59
+ when "bcp14" then bcp14(node, xml)
60
+ else xml << node.text
62
61
  end
63
62
  end
64
63
  end
65
64
  end
66
65
 
66
+ def bcp14(node, xml)
67
+ xml.span **{ class: "bcp14" } do |s|
68
+ s << node.text.upcase
69
+ end
70
+ end
71
+
67
72
  def inline_anchor_xref(node)
68
73
  f, c = xref_text(node)
69
74
  f1, c = eref_text(node) if f.nil?
@@ -119,14 +124,14 @@ module Metanorma
119
124
 
120
125
  def norm_ref_preface(sect); end
121
126
 
122
- def clause_parse(attrs, xml, node)
127
+ def clause_attrs_preprocess(attrs, node)
123
128
  attrs[:numbered] = node.attr("numbered")
124
129
  attrs[:removeInRFC] = node.attr("removeInRFC")
125
130
  attrs[:toc] = node.attr("toc")
126
131
  super
127
132
  end
128
133
 
129
- def annex_parse(attrs, xml, node)
134
+ def annex_attrs_preprocess(attrs, node)
130
135
  attrs[:numbered] = node.attr("numbered")
131
136
  attrs[:removeInRFC] = node.attr("removeInRFC")
132
137
  attrs[:toc] = node.attr("toc")
@@ -1,14 +1,8 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar ns='https://www.metanorma.org/ns/standoc' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!--
4
- VERSION v1.2.1
5
- Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
6
- we cannot have a new default namespace: we will end up with a grammar with two different
7
- namespaces, one for isostandard and one for ietf additions. And we do not want that.
8
- -->
9
3
  <include href="relaton-ietf.rng"/>
10
4
  <include href="isodoc.rng">
11
- <define name="ParagraphAttrs">
5
+ <define name="ParagraphAttributes">
12
6
  <optional>
13
7
  <attribute name="align">
14
8
  <ref name="Alignments"/>
@@ -28,7 +22,7 @@
28
22
  <attribute name="indent"/>
29
23
  </optional>
30
24
  </define>
31
- <define name="UlAttr">
25
+ <define name="UlAttributes">
32
26
  <optional>
33
27
  <attribute name="nobullet">
34
28
  <data type="boolean"/>
@@ -54,7 +48,7 @@
54
48
  <ref name="note"/>
55
49
  </zeroOrMore>
56
50
  </define>
57
- <define name="OlAttr">
51
+ <define name="OlAttributes">
58
52
  <attribute name="type">
59
53
  <choice>
60
54
  <value>roman</value>
@@ -86,7 +80,7 @@
86
80
  <ref name="note"/>
87
81
  </zeroOrMore>
88
82
  </define>
89
- <define name="DlAttr">
83
+ <define name="DlAttributes">
90
84
  <optional>
91
85
  <attribute name="newline"/>
92
86
  </optional>
@@ -106,34 +100,7 @@
106
100
  <ref name="note"/>
107
101
  </zeroOrMore>
108
102
  </define>
109
- <define name="review">
110
- <element name="review">
111
- <attribute name="id">
112
- <data type="ID"/>
113
- </attribute>
114
- <attribute name="reviewer"/>
115
- <optional>
116
- <attribute name="date">
117
- <data type="dateTime"/>
118
- </attribute>
119
- </optional>
120
- <attribute name="from">
121
- <data type="IDREF"/>
122
- </attribute>
123
- <optional>
124
- <attribute name="to">
125
- <data type="IDREF"/>
126
- </attribute>
127
- </optional>
128
- <optional>
129
- <attribute name="display"/>
130
- </optional>
131
- <oneOrMore>
132
- <ref name="paragraph"/>
133
- </oneOrMore>
134
- </element>
135
- </define>
136
- <define name="NoteAttr">
103
+ <define name="NoteAttributes">
137
104
  <optional>
138
105
  <attribute name="removeInRFC"/>
139
106
  </optional>
@@ -146,7 +113,7 @@
146
113
  <ref name="paragraph"/>
147
114
  </oneOrMore>
148
115
  </define>
149
- <define name="PreAttr">
116
+ <define name="PreAttributes">
150
117
  <optional>
151
118
  <attribute name="alt"/>
152
119
  </optional>
@@ -154,19 +121,6 @@
154
121
  <attribute name="align"/>
155
122
  </optional>
156
123
  </define>
157
- <define name="ImageAttr" combine="interleave">
158
- <optional>
159
- <attribute name="align"/>
160
- </optional>
161
- </define>
162
- <define name="SourceAttr" combine="interleave">
163
- <optional>
164
- <attribute name="number"/>
165
- </optional>
166
- <optional>
167
- <attribute name="markers"/>
168
- </optional>
169
- </define>
170
124
  <define name="xref">
171
125
  <element name="xref">
172
126
  <attribute name="target">
@@ -213,29 +167,8 @@
213
167
  <ref name="erefTypeURI"/>
214
168
  </element>
215
169
  </define>
216
- <define name="TableAttr" combine="interleave">
217
- <optional>
218
- <attribute name="number"/>
219
- </optional>
220
- <optional>
221
- <attribute name="align"/>
222
- </optional>
223
- <optional>
224
- <attribute name="width"/>
225
- </optional>
226
- </define>
227
170
  <define name="Clause-Section">
228
- <optional>
229
- <attribute name="id">
230
- <data type="ID"/>
231
- </attribute>
232
- </optional>
233
- <optional>
234
- <attribute name="language"/>
235
- </optional>
236
- <optional>
237
- <attribute name="script"/>
238
- </optional>
171
+ <ref name="Section-Attributes"/>
239
172
  <optional>
240
173
  <attribute name="numbered"/>
241
174
  </optional>
@@ -245,17 +178,6 @@
245
178
  <optional>
246
179
  <attribute name="toc"/>
247
180
  </optional>
248
- <optional>
249
- <attribute name="inline-header">
250
- <data type="boolean"/>
251
- </attribute>
252
- </optional>
253
- <attribute name="obligation">
254
- <choice>
255
- <value>normative</value>
256
- <value>informative</value>
257
- </choice>
258
- </attribute>
259
181
  <optional>
260
182
  <ref name="section-title"/>
261
183
  </optional>
@@ -274,23 +196,7 @@
274
196
  </define>
275
197
  <define name="annex">
276
198
  <element name="annex">
277
- <optional>
278
- <attribute name="id">
279
- <data type="ID"/>
280
- </attribute>
281
- </optional>
282
- <optional>
283
- <attribute name="language"/>
284
- </optional>
285
- <optional>
286
- <attribute name="script"/>
287
- </optional>
288
- <attribute name="obligation">
289
- <choice>
290
- <value>normative</value>
291
- <value>informative</value>
292
- </choice>
293
- </attribute>
199
+ <ref name="Annex-Section-Attributes"/>
294
200
  <optional>
295
201
  <attribute name="numbered"/>
296
202
  </optional>
@@ -314,17 +220,7 @@
314
220
  </element>
315
221
  </define>
316
222
  <define name="Content-Section">
317
- <optional>
318
- <attribute name="id">
319
- <data type="ID"/>
320
- </attribute>
321
- </optional>
322
- <optional>
323
- <attribute name="language"/>
324
- </optional>
325
- <optional>
326
- <attribute name="script"/>
327
- </optional>
223
+ <ref name="Section-Attributes"/>
328
224
  <optional>
329
225
  <attribute name="numbered"/>
330
226
  </optional>
@@ -358,70 +254,35 @@
358
254
  <data type="boolean"/>
359
255
  </attribute>
360
256
  </optional>
361
- <element name="primary">
362
- <oneOrMore>
363
- <ref name="PureTextElement"/>
364
- </oneOrMore>
365
- </element>
366
- <optional>
367
- <element name="secondary">
368
- <oneOrMore>
369
- <ref name="PureTextElement"/>
370
- </oneOrMore>
371
- </element>
372
- </optional>
373
- <optional>
374
- <element name="tertiary">
375
- <oneOrMore>
376
- <ref name="PureTextElement"/>
377
- </oneOrMore>
378
- </element>
379
- </optional>
257
+ <ref name="index-primary"/>
258
+ <ref name="index-secondary"/>
259
+ <ref name="index-tertiary"/>
380
260
  </element>
381
261
  </define>
382
- <define name="standard-document">
383
- <element name="metanorma">
384
- <ref name="Root-Attributes"/>
385
- <ref name="bibdata"/>
386
- <zeroOrMore>
387
- <ref name="termdocsource"/>
388
- </zeroOrMore>
389
- <optional>
390
- <ref name="misccontainer"/>
391
- </optional>
392
- <optional>
393
- <ref name="boilerplate"/>
394
- </optional>
395
- <ref name="preface"/>
396
- <oneOrMore>
397
- <ref name="sections"/>
398
- </oneOrMore>
399
- <zeroOrMore>
400
- <ref name="annex"/>
401
- </zeroOrMore>
402
- <ref name="bibliography"/>
403
- <zeroOrMore>
404
- <ref name="indexsect"/>
405
- </zeroOrMore>
406
- </element>
262
+ <define name="TextElement" combine="choice">
263
+ <ref name="review"/>
407
264
  </define>
408
265
  </include>
409
266
  <!-- end overrides -->
410
- <define name="TextElement" combine="choice">
411
- <choice>
412
- <ref name="bcp14"/>
413
- <ref name="review"/>
414
- </choice>
267
+ <define name="ReviewAttributes" combine="interleave">
268
+ <optional>
269
+ <attribute name="display"/>
270
+ </optional>
415
271
  </define>
416
- <define name="bcp14">
417
- <element name="bcp14">
418
- <text/>
419
- </element>
272
+ <define name="ImageAttributes" combine="interleave">
273
+ <optional>
274
+ <attribute name="align"/>
275
+ </optional>
420
276
  </define>
421
- <define name="comment">
422
- <element name="comment">
423
- <text/>
424
- </element>
277
+ <define name="SourceAttributes" combine="interleave">
278
+ <optional>
279
+ <attribute name="markers"/>
280
+ </optional>
281
+ </define>
282
+ <define name="TableAttributes" combine="interleave">
283
+ <optional>
284
+ <attribute name="align"/>
285
+ </optional>
425
286
  </define>
426
287
  <define name="erefTypeURI">
427
288
  <optional>
@@ -1,24 +1,27 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- instantiations of this grammar may replace leaf strings
4
- with more elaborated types; e.g. title (text) replaced with
5
- title-main, title-intro, title-part; type replaced with
6
- enum.
7
-
8
- some renaming at leaf nodes is permissible
9
-
10
- obligations can change both from optional to mandatory,
11
- and from mandatory to optional; optional elements may
12
- be omitted; freely positioned alternatives may be replaced
13
- with strict ordering
14
-
15
- DO NOT introduce a namespace here. We do not want a distinct namespace
16
- for these elements, and a distinct namespace for any grammar inheriting
17
- these elements; we just want one namespace for any child grammars
18
- of this.
19
- -->
20
- <!-- VERSION v2.0.2 -->
21
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!-- VERSION v2.0.4 -->
4
+
5
+ <!--
6
+ ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
7
+
8
+ instantiations of this grammar may replace leaf strings
9
+ with more elaborated types; e.g. title (text) replaced with
10
+ title-main, title-intro, title-part; type replaced with
11
+ enum.
12
+
13
+ some renaming at leaf nodes is permissible
14
+
15
+ obligations can change both from optional to mandatory,
16
+ and from mandatory to optional; optional elements may
17
+ be omitted; freely positioned alternatives may be replaced
18
+ with strict ordering
19
+
20
+ DO NOT introduce a namespace here. We do not want a distinct namespace
21
+ for these elements, and a distinct namespace for any grammar inheriting
22
+ these elements; we just want one namespace for any child grammars
23
+ of this.
24
+ -->
22
25
  <include href="reqt.rng"/>
23
26
  <include href="basicdoc.rng">
24
27
  <define name="amend">
@@ -33,15 +36,6 @@
33
36
  </zeroOrMore>
34
37
  </element>
35
38
  </define>
36
- <define name="fn" combine="interleave">
37
- <optional>
38
- <attribute name="hiddenref">
39
- <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
40
- This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
41
- <data type="boolean"/>
42
- </attribute>
43
- </optional>
44
- </define>
45
39
  <define name="index-primary">
46
40
  <element name="primary">
47
41
  <oneOrMore>
@@ -423,20 +417,12 @@ normative or informative references, some split references into sections organiz
423
417
  </oneOrMore>
424
418
  </choice>
425
419
  </define>
426
- <define name="TdAttributes" combine="interleave">
427
- <attribute name="style">
428
- <a:documentation>CSS style: only background-color supported</a:documentation>
429
- </attribute>
430
- </define>
431
- <define name="ThAttributes" combine="interleave">
432
- <attribute name="style">
433
- <a:documentation>CSS style: only background-color supported</a:documentation>
434
- </attribute>
435
- </define>
436
420
  <define name="TrAttributes">
437
- <attribute name="style">
438
- <a:documentation>CSS style: only background-color supported</a:documentation>
439
- </attribute>
421
+ <optional>
422
+ <attribute name="style">
423
+ <a:documentation>CSS style: only background-color supported</a:documentation>
424
+ </attribute>
425
+ </optional>
440
426
  </define>
441
427
  <define name="table-note">
442
428
  <element name="note">
@@ -500,6 +486,22 @@ gives an explicit page orientation</a:documentation>
500
486
  </define>
501
487
  </include>
502
488
  <!-- end overrides -->
489
+ <define name="FnAttributes" combine="interleave">
490
+ <optional>
491
+ <attribute name="hiddenref">
492
+ <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
493
+ This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
494
+ <data type="boolean"/>
495
+ </attribute>
496
+ </optional>
497
+ </define>
498
+ <define name="TdAttributes" combine="interleave">
499
+ <optional>
500
+ <attribute name="style">
501
+ <a:documentation>CSS style: only background-color supported</a:documentation>
502
+ </attribute>
503
+ </optional>
504
+ </define>
503
505
  <define name="NumberingAttributes" combine="interleave">
504
506
  <optional>
505
507
  <attribute name="number">
@@ -678,6 +680,13 @@ titlecase, or lowercase</a:documentation>
678
680
  </attribute>
679
681
  </optional>
680
682
  </define>
683
+ <define name="Basic-Section-Attributes" combine="interleave">
684
+ <optional>
685
+ <attribute name="obligation">
686
+ <ref name="ObligationType"/>
687
+ </attribute>
688
+ </optional>
689
+ </define>
681
690
  <define name="ObligationType">
682
691
  <a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
683
692
  <choice>
@@ -1192,13 +1201,6 @@ numbers</a:documentation>
1192
1201
  </attribute>
1193
1202
  </optional>
1194
1203
  </define>
1195
- <define name="Basic-Section-Attributes" combine="interleave">
1196
- <optional>
1197
- <attribute name="obligation">
1198
- <ref name="ObligationType"/>
1199
- </attribute>
1200
- </optional>
1201
- </define>
1202
1204
  <define name="reference-clause">
1203
1205
  <a:documentation>References clause with recursive nesting</a:documentation>
1204
1206
  <element name="clause">
@@ -1239,7 +1241,7 @@ numbers</a:documentation>
1239
1241
  </choice>
1240
1242
  </attribute>
1241
1243
  <attribute name="flavor">
1242
- <a:documentation>Metanorma flavor, indicating SDO whose requiremnts the realisation aligns to</a:documentation>
1244
+ <a:documentation>Metanorma flavor, indicating SDO whose requirements the realisation aligns to</a:documentation>
1243
1245
  </attribute>
1244
1246
  </define>
1245
1247
  <define name="standard-document">
@@ -1249,6 +1251,11 @@ numbers</a:documentation>
1249
1251
  <ref name="bibdata">
1250
1252
  <a:documentation>Bibliographic description of the document itself, expressed in the Relaton model</a:documentation>
1251
1253
  </ref>
1254
+ <zeroOrMore>
1255
+ <ref name="termdocsource">
1256
+ <a:documentation>Source for term definitions in the document</a:documentation>
1257
+ </ref>
1258
+ </zeroOrMore>
1252
1259
  <optional>
1253
1260
  <ref name="misccontainer">
1254
1261
  <a:documentation>Extension point for extraneous elements that need to be added to standards document as data</a:documentation>
@@ -1259,34 +1266,7 @@ numbers</a:documentation>
1259
1266
  <a:documentation>Front matter that is repeated at the start of documents issued from an SDO, with content not specific to the document</a:documentation>
1260
1267
  </ref>
1261
1268
  </optional>
1262
- <optional>
1263
- <ref name="preface">
1264
- <a:documentation>Prefatory sections</a:documentation>
1265
- </ref>
1266
- </optional>
1267
- <ref name="sections">
1268
- <a:documentation>Main body of document</a:documentation>
1269
- </ref>
1270
- <zeroOrMore>
1271
- <ref name="annex">
1272
- <a:documentation>Annex sections</a:documentation>
1273
- </ref>
1274
- </zeroOrMore>
1275
- <optional>
1276
- <ref name="bibliography">
1277
- <a:documentation>Bibliographic sections</a:documentation>
1278
- </ref>
1279
- </optional>
1280
- <zeroOrMore>
1281
- <ref name="indexsect">
1282
- <a:documentation>Index of the document</a:documentation>
1283
- </ref>
1284
- </zeroOrMore>
1285
- <optional>
1286
- <ref name="colophon">
1287
- <a:documentation>Colophon or postface material</a:documentation>
1288
- </ref>
1289
- </optional>
1269
+ <ref name="DocumentBody"/>
1290
1270
  <optional>
1291
1271
  <ref name="review-container">
1292
1272
  <a:documentation>Annotations to the document</a:documentation>
@@ -1294,6 +1274,36 @@ numbers</a:documentation>
1294
1274
  </optional>
1295
1275
  </element>
1296
1276
  </define>
1277
+ <define name="DocumentBody">
1278
+ <optional>
1279
+ <ref name="preface">
1280
+ <a:documentation>Prefatory sections</a:documentation>
1281
+ </ref>
1282
+ </optional>
1283
+ <ref name="sections">
1284
+ <a:documentation>Main body of document</a:documentation>
1285
+ </ref>
1286
+ <zeroOrMore>
1287
+ <ref name="annex">
1288
+ <a:documentation>Annex sections</a:documentation>
1289
+ </ref>
1290
+ </zeroOrMore>
1291
+ <optional>
1292
+ <ref name="bibliography">
1293
+ <a:documentation>Bibliographic sections</a:documentation>
1294
+ </ref>
1295
+ </optional>
1296
+ <zeroOrMore>
1297
+ <ref name="indexsect">
1298
+ <a:documentation>Index of the document</a:documentation>
1299
+ </ref>
1300
+ </zeroOrMore>
1301
+ <optional>
1302
+ <ref name="colophon">
1303
+ <a:documentation>Colophon or postface material</a:documentation>
1304
+ </ref>
1305
+ </optional>
1306
+ </define>
1297
1307
  <define name="misccontainer">
1298
1308
  <a:documentation>Elements added to metanorma-extension are open-ended, and constitute source data</a:documentation>
1299
1309
  <element name="metanorma-extension">
@@ -1318,6 +1328,7 @@ numbers</a:documentation>
1318
1328
  <ref name="foreword"/>
1319
1329
  <ref name="introduction"/>
1320
1330
  <ref name="acknowledgements"/>
1331
+ <ref name="executivesummary"/>
1321
1332
  </choice>
1322
1333
  </oneOrMore>
1323
1334
  </element>
@@ -1341,6 +1352,11 @@ numbers</a:documentation>
1341
1352
  <ref name="Content-Section"/>
1342
1353
  </element>
1343
1354
  </define>
1355
+ <define name="executivesummary">
1356
+ <element name="executivesummary">
1357
+ <ref name="Content-Section"/>
1358
+ </element>
1359
+ </define>
1344
1360
  <define name="indexsect">
1345
1361
  <element name="indexsect">
1346
1362
  <ref name="Content-Section"/>
@@ -1566,6 +1582,15 @@ used in document amendments</a:documentation>
1566
1582
  <define name="annex">
1567
1583
  <element name="annex">
1568
1584
  <ref name="Annex-Section"/>
1585
+ <zeroOrMore>
1586
+ <ref name="annex-appendix"/>
1587
+ </zeroOrMore>
1588
+ </element>
1589
+ </define>
1590
+ <define name="annex-appendix">
1591
+ <a:documentation>Appendix, distinct subclause type for annexes (annex to annex, rather than subclause to annex)</a:documentation>
1592
+ <element name="appendix">
1593
+ <ref name="Clause-Section"/>
1569
1594
  </element>
1570
1595
  </define>
1571
1596
  <define name="terms">
@@ -1608,9 +1633,7 @@ used in document amendments</a:documentation>
1608
1633
  <define name="term">
1609
1634
  <a:documentation>Terminology entry with its definition</a:documentation>
1610
1635
  <element name="term">
1611
- <ref name="OptionalId"/>
1612
- <ref name="LocalizedStringAttributes"/>
1613
- <ref name="BlockAttributes"/>
1636
+ <ref name="TermAttributes"/>
1614
1637
  <oneOrMore>
1615
1638
  <ref name="preferred">
1616
1639
  <a:documentation>One or more names under which the term being defined is canonically known</a:documentation>
@@ -1662,6 +1685,11 @@ used in document amendments</a:documentation>
1662
1685
  </ref>
1663
1686
  </element>
1664
1687
  </define>
1688
+ <define name="TermAttributes">
1689
+ <ref name="OptionalId"/>
1690
+ <ref name="LocalizedStringAttributes"/>
1691
+ <ref name="BlockAttributes"/>
1692
+ </define>
1665
1693
  <define name="preferred">
1666
1694
  <element name="preferred">
1667
1695
  <ref name="Designation"/>
@@ -2323,26 +2351,32 @@ links within an SVG file, so that the SVG file can hyperlink to anchors within t
2323
2351
  </element>
2324
2352
  </define>
2325
2353
  <define name="ul_li">
2326
- <a:documentation>Unorderd list item for standards documents</a:documentation>
2354
+ <a:documentation>Unordered list item for standards documents</a:documentation>
2327
2355
  <element name="li">
2328
2356
  <ref name="OptionalId"/>
2329
- <optional>
2330
- <attribute name="uncheckedcheckbox">
2331
- <a:documentation>Include a checkbox for the list item</a:documentation>
2332
- <data type="boolean"/>
2333
- </attribute>
2334
- </optional>
2335
- <optional>
2336
- <attribute name="checkedcheckbox">
2337
- <a:documentation>Check the checkbox for the list item</a:documentation>
2338
- <data type="boolean"/>
2339
- </attribute>
2340
- </optional>
2341
- <oneOrMore>
2342
- <ref name="BasicBlock"/>
2343
- </oneOrMore>
2357
+ <ref name="UlLiAttributes"/>
2358
+ <ref name="UlLiBody"/>
2344
2359
  </element>
2345
2360
  </define>
2361
+ <define name="UlLiBody">
2362
+ <oneOrMore>
2363
+ <ref name="BasicBlock"/>
2364
+ </oneOrMore>
2365
+ </define>
2366
+ <define name="UlLiAttributes">
2367
+ <optional>
2368
+ <attribute name="uncheckedcheckbox">
2369
+ <a:documentation>Include a checkbox for the list item</a:documentation>
2370
+ <data type="boolean"/>
2371
+ </attribute>
2372
+ </optional>
2373
+ <optional>
2374
+ <attribute name="checkedcheckbox">
2375
+ <a:documentation>Check the checkbox for the list item</a:documentation>
2376
+ <data type="boolean"/>
2377
+ </attribute>
2378
+ </optional>
2379
+ </define>
2346
2380
  <define name="floating-title">
2347
2381
  <a:documentation>A floating title, outside of the clause hierarchy of the document</a:documentation>
2348
2382
  <element name="floating-title">
@@ -1,66 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0">
2
+ <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
3
3
  <include href="biblio-standoc.rng">
4
- <define name="DocumentType">
5
- <choice>
6
- <value>rfc</value>
7
- <value>internet-draft</value>
8
- </choice>
9
- </define>
10
- <define name="BibDataExtensionType">
11
- <optional>
12
- <attribute name="schema-version"/>
13
- </optional>
14
- <optional>
15
- <ref name="doctype"/>
16
- </optional>
17
- <optional>
18
- <ref name="docsubtype"/>
19
- </optional>
20
- <ref name="flavor"/>
21
- <zeroOrMore>
22
- <ref name="editorialgroup"/>
23
- </zeroOrMore>
24
- <zeroOrMore>
25
- <ref name="ics"/>
26
- </zeroOrMore>
27
- <zeroOrMore>
28
- <ref name="area"/>
29
- </zeroOrMore>
30
- <optional>
31
- <ref name="stream"/>
32
- </optional>
33
- <optional>
34
- <ref name="ipr"/>
35
- </optional>
36
- <optional>
37
- <ref name="consensus"/>
38
- </optional>
39
- <optional>
40
- <ref name="index-include"/>
41
- </optional>
42
- <optional>
43
- <ref name="ipr-extract"/>
44
- </optional>
45
- <optional>
46
- <ref name="sort-refs"/>
47
- </optional>
48
- <optional>
49
- <ref name="sym-refs"/>
50
- </optional>
51
- <optional>
52
- <ref name="toc-include"/>
53
- </optional>
54
- <optional>
55
- <ref name="toc-depth"/>
56
- </optional>
57
- <optional>
58
- <ref name="show-on-front-page"/>
59
- </optional>
60
- <optional>
61
- <ref name="processing-instructions"/>
62
- </optional>
63
- </define>
64
4
  <define name="editorialgroup">
65
5
  <element name="editorialgroup">
66
6
  <zeroOrMore>
@@ -68,7 +8,76 @@
68
8
  </zeroOrMore>
69
9
  </element>
70
10
  </define>
11
+ <define name="DocumentType">
12
+ <choice>
13
+ <value>rfc</value>
14
+ <value>internet-draft</value>
15
+ </choice>
16
+ </define>
71
17
  </include>
18
+ <define name="BibDataExtensionType" combine="interleave">
19
+ <zeroOrMore>
20
+ <ref name="area">
21
+ <a:documentation>which IETF area this document relates to. Value should be either the full name or the abbreviation of one of the IETF areas as
22
+ listed on &lt;http://www.ietf.org/iesg/area.html</a:documentation>
23
+ </ref>
24
+ </zeroOrMore>
25
+ <optional>
26
+ <ref name="stream">
27
+ <a:documentation>Document stream of document described in https://tools.ietf.org/html/rfc7841</a:documentation>
28
+ </ref>
29
+ </optional>
30
+ <optional>
31
+ <ref name="ipr">
32
+ <a:documentation>IP status of document. See https://tools.ietf.org/html/rfc7991#section-2.45.5</a:documentation>
33
+ </ref>
34
+ </optional>
35
+ <optional>
36
+ <ref name="processing-instructions">
37
+ <a:documentation>Processing instructions which will be added to generated RFC XML in the form `&lt;?rfc keyword='value'?&gt;</a:documentation>
38
+ </ref>
39
+ </optional>
40
+ <optional>
41
+ <ref name="consensus">
42
+ <a:documentation>Document consensus for this document </a:documentation>
43
+ </ref>
44
+ </optional>
45
+ <optional>
46
+ <ref name="index-include">
47
+ <a:documentation>Specifies whether formatter should include an index in generated files. If the source file has no `&lt;iref&gt;` elements, an index is never generated</a:documentation>
48
+ </ref>
49
+ </optional>
50
+ <optional>
51
+ <ref name="ipr-extract">
52
+ <a:documentation>Identifies a section that can be extracted from text. See https://tools.ietf.org/html/rfc7991#section-2.45.6</a:documentation>
53
+ </ref>
54
+ </optional>
55
+ <optional>
56
+ <ref name="sort-refs">
57
+ <a:documentation>Specifies whether the prep tool for RFC XML should sort references</a:documentation>
58
+ </ref>
59
+ </optional>
60
+ <optional>
61
+ <ref name="sym-refs">
62
+ <a:documentation>Specifies whether the RFC XML formatter should use symbolic references (such as "`[RFC2119]`") or not (such as "`[3]`")</a:documentation>
63
+ </ref>
64
+ </optional>
65
+ <optional>
66
+ <ref name="toc-include">
67
+ <a:documentation>Specifies whether the RFC XML formatter should contain a table of contents</a:documentation>
68
+ </ref>
69
+ </optional>
70
+ <optional>
71
+ <ref name="toc-depth">
72
+ <a:documentation>Determines the depth of the table-of-contents; e.g. a value of `3` means three levels of heading are included</a:documentation>
73
+ </ref>
74
+ </optional>
75
+ <optional>
76
+ <ref name="show-on-front-page">
77
+ <a:documentation>Display organization of author on front page of IAB documents. Applied to all organizations named in the document front matter</a:documentation>
78
+ </ref>
79
+ </optional>
80
+ </define>
72
81
  <define name="committee">
73
82
  <element name="committee">
74
83
  <ref name="IsoWorkgroup"/>
@@ -1,5 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <define name="requirement">
4
+ <element name="requirement">
5
+ <ref name="RequirementType"/>
6
+ </element>
7
+ </define>
8
+ <!-- ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437 -->
3
9
  <!--
4
10
  Presupposes isodoc.rnc, is included in it
5
11
  include "isodoc.rnc" { }
@@ -7,14 +13,9 @@
7
13
  This is the Metanorma default provisions model; it is overridden by other provisions models,
8
14
  such as Modspec
9
15
  -->
10
- <define name="requirement">
16
+ <define name="recommendation">
11
17
  <a:documentation>Specification of an attribute of a subject that is required.
12
18
  NOTE: A requirement can contain other requirements</a:documentation>
13
- <element name="requirement">
14
- <ref name="RequirementType"/>
15
- </element>
16
- </define>
17
- <define name="recommendation">
18
19
  <a:documentation>Specification of an attribute of a subject that is recommended</a:documentation>
19
20
  <element name="recommendation">
20
21
  <ref name="RequirementType"/>
@@ -16,8 +16,8 @@ module Metanorma
16
16
  end
17
17
 
18
18
  def submission_validate(doc)
19
- stream = doc.at(("//bibdata/series[@type = 'stream']/title"))&.text
20
- status = doc.at(("//bibdata/status/stage"))&.text
19
+ stream = doc.at("//bibdata/series[@type = 'stream']/title")&.text
20
+ status = doc.at("//bibdata/status/stage")&.text
21
21
  stream == "editorial" && status != "informational" and
22
22
  @log.add("Document Attributes", nil,
23
23
  "Editorial stream must have Informational status")
@@ -32,8 +32,7 @@ module Metanorma
32
32
  end
33
33
 
34
34
  def workgroup_validate(doc)
35
- return if @workgroups.empty?
36
-
35
+ @workgroups.empty? and return
37
36
  doc.xpath("//bibdata/ext/editorialgroup/workgroup").each do |wg|
38
37
  wg_norm = wg.text.sub(/ (Working|Research) Group$/, "")
39
38
  @workgroups.include?(wg_norm) and next
@@ -43,10 +42,8 @@ module Metanorma
43
42
  end
44
43
  end
45
44
 
46
- def validate(doc)
47
- content_validate(doc)
48
- schema_validate(formattedstr_strip(doc.dup),
49
- File.join(File.dirname(__FILE__), "ietf.rng"))
45
+ def schema_file
46
+ "ietf.rng"
50
47
  end
51
48
 
52
49
  def cache_workgroup(_node)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.5.3".freeze
3
+ VERSION = "3.5.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.3
4
+ version: 3.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-31 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-ietf-data