metanorma-ietf 3.1.2 → 3.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7aa109dac18747b04bbbc7b429e16c79af695a2b04c0717cb302e330f813f39
4
- data.tar.gz: e25ae275c7c5de72a5917c3cf00b74a73d35d9aa302f32f45c6fac954db93f99
3
+ metadata.gz: 77f374d41d27e5ae1c4180f322ac2bba54ff71bc94676c138f01441349155904
4
+ data.tar.gz: 4e1ce912a2612cc577c26eebeaf38baca2fb9bd128fce58ce94b0ce61bbf4691
5
5
  SHA512:
6
- metadata.gz: f839dcd5804af5ad1513a3be1cf7c5130c6a8cdec22ab2e23738d29d589715e78dca9824385d0a9e00a0e7770df72700975838c183b7eccc4d176eecd8b09a5e
7
- data.tar.gz: 41745aeefd8fce750193618471488dbe2b1a2bbf2cafdfff70ff8b9cd9f59e04eef25ed06cdac7b6c6a12b406fdb5425014ad7e683fcbf8d31f40661030fc439
6
+ metadata.gz: a1be7b947dd7e087e48721cea713fa11238809ebf64daa1e7442a12215b60e444a7d0e1ff5a387f2ddee50246d737b3f7359100f34a7dcae45e2632f2824ceaa
7
+ data.tar.gz: ad196ce8dabad6753c5d31cc022ea3c864b656a184d6fc6e46cd8482326714082833e8d8455636e9172cbf593945931c4e02ede4dfe1fd6a6909f9775c098cf7
@@ -187,10 +187,10 @@ module IsoDoc
187
187
  end
188
188
 
189
189
  def aside_cleanup(docxml)
190
- docxml.xpath("//t[descendant::aside] | //table[descendant::aside] | "\
191
- "//figure[descendant::aside]").each do |p|
190
+ docxml.xpath("//*[aside]").each do |p|
191
+ %w(section).include?(p.name) and next
192
192
  insert = p
193
- p.xpath(".//aside").each do |a|
193
+ p.xpath("./aside").each do |a|
194
194
  insert.next = a.remove
195
195
  insert = insert.next_element
196
196
  end
@@ -26,7 +26,7 @@ module IsoDoc::Ietf
26
26
  def output_if_translit(text)
27
27
  return nil if text.nil?
28
28
 
29
- text.transliterate != text ? text.transliterate : nil
29
+ text.transliterate == text ? nil : text.transliterate
30
30
  end
31
31
 
32
32
  def title(_isoxml, front)
@@ -45,7 +45,7 @@ module IsoDoc::Ietf
45
45
  attr_code(value: @meta.get[:docnumber] || "",
46
46
  asciiValue: output_if_translit(@meta.get[:docnumber]),
47
47
  status: @meta.get[:stage],
48
- stream: isoxml&.at(ns("//bibdata/series[@type = 'stream']/"\
48
+ stream: isoxml&.at(ns("//bibdata/series[@type = 'stream']/" \
49
49
  "title"))&.text)
50
50
  end
51
51
 
@@ -69,10 +69,10 @@ module IsoDoc::Ietf
69
69
  end
70
70
 
71
71
  def author(isoxml, front)
72
- isoxml.xpath(("//xmlns:bibdata/xmlns:contributor[xmlns:role/@type = "\
73
- "'author' or xmlns:role/@type = 'editor']")).each do |c|
72
+ isoxml.xpath(("//xmlns:bibdata/xmlns:contributor[xmlns:role/@type = " \
73
+ "'author' or xmlns:role/@type = 'editor']")).each do |c|
74
74
  role = c.at(ns("./role/@type")).text == "editor" ? "editor" : nil
75
- c.at("./organization") and org_author(c, role, front) or
75
+ (c.at("./organization") and org_author(c, role, front)) or
76
76
  person_author(c, role, front)
77
77
  end
78
78
  end
@@ -148,7 +148,7 @@ module IsoDoc::Ietf
148
148
  out.postal do |p|
149
149
  if line = addr.at(ns("./formattedAddress"))
150
150
  line.xpath(ns(".//br")).each { |br| br.replace("\n") }
151
- line.text.split(/\n/).each do |l|
151
+ line.text.split("\n").each do |l|
152
152
  p.postalLine l, **attr_code(ascii: l.transliterate)
153
153
  end
154
154
  else
@@ -1,8 +1,6 @@
1
1
  module IsoDoc
2
2
  module Ietf
3
3
  class RfcConvert < ::IsoDoc::Convert
4
- # TODO displayreference will be implemented as combination of autofetch and user-provided citations
5
-
6
4
  def bibliography(isoxml, out)
7
5
  isoxml.xpath(ns("//references/bibitem/docidentifier")).each do |i|
8
6
  i.children = docid_prefix(i["type"], i.text)
@@ -113,10 +111,10 @@ module IsoDoc
113
111
  end
114
112
 
115
113
  def relaton_person_to_author(pers, role, node)
116
- full = pers&.at(ns("./completename"))&.text
117
- surname = pers&.at(ns("./surname"))&.text
118
- initials = pers&.xpath(ns("./initial"))&.map(&:text)&.join(" ") ||
119
- pers&.xpath(ns("./forename"))&.map { |i| i.text[0] }&.join(" ")
114
+ full = pers.at(ns("./completename"))&.text
115
+ surname = pers.at(ns("./surname"))&.text
116
+ initials = pers.xpath(ns("./initial"))&.map(&:text)&.join(" ") ||
117
+ pers.xpath(ns("./forename"))&.map { |i| i.text[0] }&.join(" ")
120
118
  initials = nil if initials.empty?
121
119
  node.author nil, **attr_code(
122
120
  fullname: full,
@@ -1,178 +1,178 @@
1
- module IsoDoc::Ietf
2
- class RfcConvert < ::IsoDoc::Convert
3
- def common_rfc_pis(node)
4
- rfc_pis = {
5
- artworkdelimiter: node&.at(ns("//pi/artworkdelimiter"))&.text,
6
- artworklines: node&.at(ns("//pi/artworklines"))&.text,
7
- authorship: node&.at(ns("//pi/authorship"))&.text,
8
- autobreaks: node&.at(ns("//pi/autobreaks"))&.text,
9
- background: node&.at(ns("//pi/background"))&.text,
10
- colonspace: node&.at(ns("//pi/colonspace"))&.text,
11
- comments: node&.at(ns("//pi/comments"))&.text,
12
- docmapping: node&.at(ns("//pi/docmapping"))&.text,
13
- editing: node&.at(ns("//pi/editing"))&.text,
14
- emoticonic: node&.at(ns("//pi/emoticonic"))&.text,
15
- footer: node&.at(ns("//pi/footer"))&.text,
16
- header: node&.at(ns("//pi/header"))&.text,
17
- inline: node&.at(ns("//pi/inline"))&.text,
18
- iprnotified: node&.at(ns("//pi/iprnotified"))&.text,
19
- linkmailto: node&.at(ns("//pi/linkmailto"))&.text,
20
- linefile: node&.at(ns("//pi/linefile"))&.text,
21
- notedraftinprogress: node&.at(ns("//pi/notedraftinprogress"))&.text,
22
- private: node&.at(ns("//pi/private"))&.text,
23
- refparent: node&.at(ns("//pi/refparent"))&.text,
24
- rfcedstyle: node&.at(ns("//pi/rfcedstyle"))&.text,
25
- slides: node&.at(ns("//pi/slides"))&.text,
26
- "text-list-symbols": node&.at(ns("//pi/text-list-symbols"))&.text,
27
- tocappendix: node&.at(ns("//pi/tocappendix"))&.text,
28
- tocindent: node&.at(ns("//pi/tocindent"))&.text,
29
- tocnarrow: node&.at(ns("//pi/tocnarrow"))&.text,
30
- tocompact: node&.at(ns("//pi/tocompact"))&.text,
31
- topblock: node&.at(ns("//pi/topblock"))&.text,
32
- useobject: node&.at(ns("//pi/useobject"))&.text,
33
- strict: node&.at(ns("//pi/strict"))&.text || "yes",
34
- compact: node&.at(ns("//pi/compact"))&.text || "yes",
35
- subcompact: node&.at(ns("//pi/subcompact"))&.text || "no",
36
- toc: node&.at(ns("//pi/tocinclude"))&.text,
37
- tocdepth: node&.at(ns("//pi/toc-depth"))&.text || "4",
38
- symrefs: node&.at(ns("//pi/sym-refs"))&.text || "yes",
39
- sortrefs: node&.at(ns("//pi/sort-refs"))&.text || "yes",
40
- }
41
- attr_code(rfc_pis)
42
- end
1
+ module IsoDoc
2
+ module Ietf
3
+ class RfcConvert < ::IsoDoc::Convert
4
+ def common_rfc_pis(node)
5
+ rfc_pis = {
6
+ artworkdelimiter: node&.at(ns("//pi/artworkdelimiter"))&.text,
7
+ artworklines: node&.at(ns("//pi/artworklines"))&.text,
8
+ authorship: node&.at(ns("//pi/authorship"))&.text,
9
+ autobreaks: node&.at(ns("//pi/autobreaks"))&.text,
10
+ background: node&.at(ns("//pi/background"))&.text,
11
+ colonspace: node&.at(ns("//pi/colonspace"))&.text,
12
+ comments: node&.at(ns("//pi/comments"))&.text,
13
+ docmapping: node&.at(ns("//pi/docmapping"))&.text,
14
+ editing: node&.at(ns("//pi/editing"))&.text,
15
+ emoticonic: node&.at(ns("//pi/emoticonic"))&.text,
16
+ footer: node&.at(ns("//pi/footer"))&.text,
17
+ header: node&.at(ns("//pi/header"))&.text,
18
+ inline: node&.at(ns("//pi/inline"))&.text,
19
+ iprnotified: node&.at(ns("//pi/iprnotified"))&.text,
20
+ linkmailto: node&.at(ns("//pi/linkmailto"))&.text,
21
+ linefile: node&.at(ns("//pi/linefile"))&.text,
22
+ notedraftinprogress: node&.at(ns("//pi/notedraftinprogress"))&.text,
23
+ private: node&.at(ns("//pi/private"))&.text,
24
+ refparent: node&.at(ns("//pi/refparent"))&.text,
25
+ rfcedstyle: node&.at(ns("//pi/rfcedstyle"))&.text,
26
+ slides: node&.at(ns("//pi/slides"))&.text,
27
+ "text-list-symbols": node&.at(ns("//pi/text-list-symbols"))&.text,
28
+ tocappendix: node&.at(ns("//pi/tocappendix"))&.text,
29
+ tocindent: node&.at(ns("//pi/tocindent"))&.text,
30
+ tocnarrow: node&.at(ns("//pi/tocnarrow"))&.text,
31
+ tocompact: node&.at(ns("//pi/tocompact"))&.text,
32
+ topblock: node&.at(ns("//pi/topblock"))&.text,
33
+ useobject: node&.at(ns("//pi/useobject"))&.text,
34
+ strict: node&.at(ns("//pi/strict"))&.text || "yes",
35
+ compact: node&.at(ns("//pi/compact"))&.text || "yes",
36
+ subcompact: node&.at(ns("//pi/subcompact"))&.text || "no",
37
+ toc: node&.at(ns("//pi/tocinclude"))&.text,
38
+ tocdepth: node&.at(ns("//pi/toc-depth"))&.text || "4",
39
+ symrefs: node&.at(ns("//pi/sym-refs"))&.text || "yes",
40
+ sortrefs: node&.at(ns("//pi/sort-refs"))&.text || "yes",
41
+ }
42
+ attr_code(rfc_pis)
43
+ end
43
44
 
44
- def set_pis(node, doc)
45
- rfc_pis = common_rfc_pis(node)
46
- rfc_pis.each_pair do |k, v|
47
- pi = Nokogiri::XML::ProcessingInstruction.new(doc, "rfc",
48
- "#{k}=\"#{v}\"")
49
- doc.root.add_previous_sibling(pi)
45
+ def set_pis(node, doc)
46
+ rfc_pis = common_rfc_pis(node)
47
+ rfc_pis.each_pair do |k, v|
48
+ pi = Nokogiri::XML::ProcessingInstruction.new(doc, "rfc",
49
+ "#{k}=\"#{v}\"")
50
+ doc.root.add_previous_sibling(pi)
51
+ end
52
+ doc.to_xml
50
53
  end
51
- doc.to_xml
52
- end
53
54
 
54
- def rfc_attributes(docxml)
55
- t = Time.now.getutc
56
- obs = xpath_comma(docxml
57
- .xpath(ns("//bibdata/relation[@type = 'obsoletes']/bibitem/docidentifier")))
58
- upd = xpath_comma(docxml
59
- .xpath(ns("//bibdata/relation[@type = 'updates']/bibitem/docidentifier")))
60
- {
61
- docName: @meta.get[:doctype] == "Internet Draft" ? @meta.get[:docnumber] : nil,
62
- number: @meta.get[:doctype].casecmp?("rfc") ? @meta.get[:docnumber] : nil,
63
- category: series2category(
64
- docxml&.at(ns("//bibdata/series[@type = 'intended']/title"))&.text,
65
- ),
66
- ipr: docxml&.at(ns("//bibdata/ext/ipr"))&.text,
67
- consensus: docxml&.at(ns("//bibdata/ext/consensus"))&.text,
68
- obsoletes: obs,
69
- updates: upd,
70
- indexInclude: docxml&.at(ns("//bibdata/ext/indexInclude"))&.text,
71
- iprExtract: docxml&.at(ns("//bibdata/ext/iprExtract"))&.text,
72
- sortRefs: docxml&.at(ns("//bibdata/ext/sortRefs"))&.text,
73
- symRefs: docxml&.at(ns("//bibdata/ext/symRefs"))&.text,
74
- tocInclude: docxml&.at(ns("//bibdata/ext/tocInclude"))&.text,
75
- tocDepth: docxml&.at(ns("//bibdata/ext/tocDepth"))&.text,
76
- submissionType: docxml&.at(ns(
77
- "//bibdata/series[@type = 'stream']/title",
78
- ))&.text || "IETF",
79
- 'xml:lang': docxml&.at(ns("//bibdata/language"))&.text,
80
- version: "3",
81
- 'xmlns:xi': "http://www.w3.org/2001/XInclude",
82
- }
83
- end
55
+ def rfc_attributes(docxml)
56
+ # t = Time.now.getutc
57
+ obs = xpath_comma(docxml
58
+ .xpath(ns("//bibdata/relation[@type = 'obsoletes']/bibitem/docidentifier")))
59
+ upd = xpath_comma(docxml
60
+ .xpath(ns("//bibdata/relation[@type = 'updates']/bibitem/docidentifier")))
61
+ {
62
+ docName: @meta.get[:doctype] == "Internet Draft" ? @meta.get[:docnumber] : nil,
63
+ number: @meta.get[:doctype].casecmp?("rfc") ? @meta.get[:docnumber] : nil,
64
+ category: series2category(
65
+ docxml&.at(ns("//bibdata/series[@type = 'intended']/title"))&.text,
66
+ ),
67
+ ipr: docxml&.at(ns("//bibdata/ext/ipr"))&.text,
68
+ consensus: docxml&.at(ns("//bibdata/ext/consensus"))&.text,
69
+ obsoletes: obs,
70
+ updates: upd,
71
+ indexInclude: docxml&.at(ns("//bibdata/ext/indexInclude"))&.text,
72
+ iprExtract: docxml&.at(ns("//bibdata/ext/iprExtract"))&.text,
73
+ sortRefs: docxml&.at(ns("//bibdata/ext/sortRefs"))&.text,
74
+ symRefs: docxml&.at(ns("//bibdata/ext/symRefs"))&.text,
75
+ tocInclude: docxml&.at(ns("//bibdata/ext/tocInclude"))&.text,
76
+ tocDepth: docxml&.at(ns("//bibdata/ext/tocDepth"))&.text,
77
+ submissionType: docxml&.at(ns(
78
+ "//bibdata/series[@type = 'stream']/title",
79
+ ))&.text || "IETF",
80
+ "xml:lang": docxml&.at(ns("//bibdata/language"))&.text,
81
+ version: "3",
82
+ "xmlns:xi": "http://www.w3.org/2001/XInclude",
83
+ }
84
+ end
84
85
 
85
- def series2category(series)
86
- case series&.downcase
87
- when "standard", "std" then "std"
88
- when "informational", "info" then "info"
89
- when "experimental", "exp" then "exp"
90
- when "bcp" then "bcp"
91
- when "fyi" then "info"
92
- when "full-standard" then "std"
93
- when "historic" then "historic"
94
- else
95
- "std"
86
+ def series2category(series)
87
+ case series&.downcase
88
+ when "standard", "std", "full-standard" then "std"
89
+ when "informational", "info", "fyi" then "info"
90
+ when "experimental", "exp" then "exp"
91
+ when "bcp" then "bcp"
92
+ when "historic" then "historic"
93
+ else
94
+ "std"
95
+ end
96
96
  end
97
- end
98
97
 
99
- def xpath_comma(xpath)
100
- return nil if xpath.empty?
98
+ def xpath_comma(xpath)
99
+ return nil if xpath.empty?
101
100
 
102
- xpath.map(&:text).join(", ")
103
- end
101
+ xpath.map(&:text).join(", ")
102
+ end
104
103
 
105
- def make_link(out, isoxml)
106
- links = isoxml
107
- .xpath(ns("//bibdata/relation[@type = 'includedIn' or "\
108
- "@type = 'describedBy' or @type = 'derivedFrom' or "\
109
- "@type = 'instance']")) || return
110
- links.each do |l|
111
- out.link **{ href: l&.at(ns("./bibitem/docidentifier"))&.text,
112
- rel: rel2iana(l["type"]) }
104
+ def make_link(out, isoxml)
105
+ links = isoxml
106
+ .xpath(ns("//bibdata/relation[@type = 'includedIn' or " \
107
+ "@type = 'describedBy' or @type = 'derivedFrom' or " \
108
+ "@type = 'instance']")) || return
109
+ links.each do |l|
110
+ out.link href: l&.at(ns("./bibitem/docidentifier"))&.text,
111
+ rel: rel2iana(l["type"])
112
+ end
113
113
  end
114
- end
115
114
 
116
- def rel2iana(type)
117
- case type
118
- when "includedIn" then "item"
119
- when "describedBy" then "describedby"
120
- when "derivedFrom" then "convertedfrom"
121
- when "instance" then "alternate"
122
- else
123
- "alternate"
115
+ def rel2iana(type)
116
+ case type
117
+ when "includedIn" then "item"
118
+ when "describedBy" then "describedby"
119
+ when "derivedFrom" then "convertedfrom"
120
+ when "instance" then "alternate"
121
+ else
122
+ "alternate"
123
+ end
124
124
  end
125
- end
126
125
 
127
- def make_middle(out, isoxml)
128
- out.middle do |middle|
129
- clause isoxml, middle
126
+ def make_middle(out, isoxml)
127
+ out.middle do |middle|
128
+ clause isoxml, middle
129
+ end
130
130
  end
131
- end
132
131
 
133
- def make_back(out, isoxml)
134
- out.back do |back|
135
- bibliography isoxml, back
136
- annex isoxml, back
132
+ def make_back(out, isoxml)
133
+ out.back do |back|
134
+ bibliography isoxml, back
135
+ annex isoxml, back
136
+ end
137
137
  end
138
- end
139
138
 
140
- def clause_parse_title(_node, div, clause, _out, _heading_attrs = {})
141
- return unless clause
139
+ def clause_parse_title(_node, div, clause, _out, _heading_attrs = {})
140
+ return unless clause
142
141
 
143
- div.name do |n|
144
- clause&.children&.each { |c2| parse(c2, n) }
142
+ div.name do |n|
143
+ clause&.children&.each { |c2| parse(c2, n) }
144
+ end
145
145
  end
146
- end
147
146
 
148
- def clause_parse(node, out)
149
- return if node.at(ns(".//references"))
147
+ def clause_parse(node, out)
148
+ return if node.at(ns(".//references"))
150
149
 
151
- out.section **attr_code(
152
- anchor: node["id"], numbered: node["numbered"],
153
- removeInRFC: node["removeInRFC"], toc: node["toc"]
154
- ) do |div|
155
- clause_parse_title(node, div, node.at(ns("./title")), out)
156
- node.children.reject { |c1| c1.name == "title" }.each do |c1|
157
- parse(c1, div)
150
+ out.section **attr_code(
151
+ anchor: node["id"], numbered: node["numbered"],
152
+ removeInRFC: node["removeInRFC"], toc: node["toc"]
153
+ ) do |div|
154
+ clause_parse_title(node, div, node.at(ns("./title")), out)
155
+ node.children.reject { |c1| c1.name == "title" }.each do |c1|
156
+ parse(c1, div)
157
+ end
158
158
  end
159
159
  end
160
- end
161
160
 
162
- def clause(isoxml, out)
163
- isoxml.xpath("//xmlns:preface/child::*"\
164
- "[not(name() = 'abstract' or name() = 'foreword')] "\
165
- "| //xmlns:sections/child::*").each do |c|
166
- # cdup = c.dup
167
- # cdup.xpath(ns(".//references")).each { |r| r.remove }
168
- # cdup.at("./*[local-name() != 'title'][normalize-space(text()) != '']") or next
169
- clause_parse(c, out)
161
+ def clause(isoxml, out)
162
+ isoxml.xpath("//xmlns:preface/child::*" \
163
+ "[not(name() = 'abstract' or name() = 'foreword')] " \
164
+ "| //xmlns:sections/child::*").each do |c|
165
+ # cdup = c.dup
166
+ # cdup.xpath(ns(".//references")).each { |r| r.remove }
167
+ # cdup.at("./*[local-name() != 'title'][normalize-space(text()) != '']") or next
168
+ clause_parse(c, out)
169
+ end
170
170
  end
171
- end
172
171
 
173
- def annex(isoxml, out)
174
- isoxml.xpath(ns("//annex")).each do |c|
175
- clause_parse(c, out)
172
+ def annex(isoxml, out)
173
+ isoxml.xpath(ns("//annex")).each do |c|
174
+ clause_parse(c, out)
175
+ end
176
176
  end
177
177
  end
178
178
  end
@@ -522,7 +522,6 @@
522
522
  <value>tip</value>
523
523
  <value>important</value>
524
524
  <value>caution</value>
525
- <value>statement</value>
526
525
  </choice>
527
526
  </define>
528
527
  <define name="figure">
@@ -216,6 +216,9 @@
216
216
  <optional>
217
217
  <ref name="fullname"/>
218
218
  </optional>
219
+ <zeroOrMore>
220
+ <ref name="credential"/>
221
+ </zeroOrMore>
219
222
  <zeroOrMore>
220
223
  <ref name="affiliation"/>
221
224
  </zeroOrMore>
@@ -232,6 +235,11 @@
232
235
  <ref name="FullNameType"/>
233
236
  </element>
234
237
  </define>
238
+ <define name="credential">
239
+ <element name="credential">
240
+ <text/>
241
+ </element>
242
+ </define>
235
243
  <define name="FullNameType">
236
244
  <choice>
237
245
  <group>
@@ -305,7 +313,9 @@
305
313
  <zeroOrMore>
306
314
  <ref name="affiliationdescription"/>
307
315
  </zeroOrMore>
308
- <ref name="organization"/>
316
+ <optional>
317
+ <ref name="organization"/>
318
+ </optional>
309
319
  </element>
310
320
  </define>
311
321
  <define name="affiliationname">
@@ -83,6 +83,8 @@ module Metanorma
83
83
  end
84
84
 
85
85
  def section_names_refs_cleanup(xml); end
86
+
87
+ def note_cleanup(xmldoc); end
86
88
  end
87
89
  end
88
90
  end
@@ -66,6 +66,7 @@
66
66
  <value>caution</value>
67
67
  <value>statement</value>
68
68
  <value>editorial</value>
69
+ <value>box</value>
69
70
  </choice>
70
71
  </define>
71
72
  <define name="index">
@@ -219,24 +220,7 @@
219
220
  <attribute name="id">
220
221
  <data type="ID"/>
221
222
  </attribute>
222
- <optional>
223
- <attribute name="keep-with-next">
224
- <data type="boolean"/>
225
- </attribute>
226
- </optional>
227
- <optional>
228
- <attribute name="keep-lines-together">
229
- <data type="boolean"/>
230
- </attribute>
231
- </optional>
232
- <optional>
233
- <attribute name="tag"/>
234
- </optional>
235
- <optional>
236
- <attribute name="multilingual-rendering">
237
- <ref name="MultilingualRenderingType"/>
238
- </attribute>
239
- </optional>
223
+ <ref name="BlockAttributes"/>
240
224
  <optional>
241
225
  <ref name="tname"/>
242
226
  </optional>
@@ -253,24 +237,7 @@
253
237
  <attribute name="id">
254
238
  <data type="ID"/>
255
239
  </attribute>
256
- <optional>
257
- <attribute name="keep-with-next">
258
- <data type="boolean"/>
259
- </attribute>
260
- </optional>
261
- <optional>
262
- <attribute name="keep-lines-together">
263
- <data type="boolean"/>
264
- </attribute>
265
- </optional>
266
- <optional>
267
- <attribute name="tag"/>
268
- </optional>
269
- <optional>
270
- <attribute name="multilingual-rendering">
271
- <ref name="MultilingualRenderingType"/>
272
- </attribute>
273
- </optional>
240
+ <ref name="BlockAttributes"/>
274
241
  <optional>
275
242
  <attribute name="type">
276
243
  <choice>
@@ -298,29 +265,12 @@
298
265
  <attribute name="id">
299
266
  <data type="ID"/>
300
267
  </attribute>
301
- <optional>
302
- <attribute name="keep-with-next">
303
- <data type="boolean"/>
304
- </attribute>
305
- </optional>
306
- <optional>
307
- <attribute name="keep-lines-together">
308
- <data type="boolean"/>
309
- </attribute>
310
- </optional>
268
+ <ref name="BlockAttributes"/>
311
269
  <optional>
312
270
  <attribute name="key">
313
271
  <data type="boolean"/>
314
272
  </attribute>
315
273
  </optional>
316
- <optional>
317
- <attribute name="tag"/>
318
- </optional>
319
- <optional>
320
- <attribute name="multilingual-rendering">
321
- <ref name="MultilingualRenderingType"/>
322
- </attribute>
323
- </optional>
324
274
  <optional>
325
275
  <ref name="tname"/>
326
276
  </optional>
@@ -361,24 +311,7 @@
361
311
  <optional>
362
312
  <attribute name="number"/>
363
313
  </optional>
364
- <optional>
365
- <attribute name="keep-with-next">
366
- <data type="boolean"/>
367
- </attribute>
368
- </optional>
369
- <optional>
370
- <attribute name="keep-lines-together">
371
- <data type="boolean"/>
372
- </attribute>
373
- </optional>
374
- <optional>
375
- <attribute name="tag"/>
376
- </optional>
377
- <optional>
378
- <attribute name="multilingual-rendering">
379
- <ref name="MultilingualRenderingType"/>
380
- </attribute>
381
- </optional>
314
+ <ref name="BlockAttributes"/>
382
315
  <optional>
383
316
  <ref name="tname"/>
384
317
  </optional>
@@ -426,27 +359,10 @@
426
359
  <data type="anyURI"/>
427
360
  </attribute>
428
361
  </optional>
429
- <optional>
430
- <attribute name="keep-with-next">
431
- <data type="boolean"/>
432
- </attribute>
433
- </optional>
434
- <optional>
435
- <attribute name="keep-lines-together">
436
- <data type="boolean"/>
437
- </attribute>
438
- </optional>
439
362
  <optional>
440
363
  <attribute name="width"/>
441
364
  </optional>
442
- <optional>
443
- <attribute name="tag"/>
444
- </optional>
445
- <optional>
446
- <attribute name="multilingual-rendering">
447
- <ref name="MultilingualRenderingType"/>
448
- </attribute>
449
- </optional>
365
+ <ref name="BlockAttributes"/>
450
366
  <optional>
451
367
  <ref name="colgroup"/>
452
368
  </optional>
@@ -484,27 +400,10 @@
484
400
  <optional>
485
401
  <attribute name="subsequence"/>
486
402
  </optional>
487
- <optional>
488
- <attribute name="keep-with-next">
489
- <data type="boolean"/>
490
- </attribute>
491
- </optional>
492
- <optional>
493
- <attribute name="keep-lines-together">
494
- <data type="boolean"/>
495
- </attribute>
496
- </optional>
497
403
  <optional>
498
404
  <attribute name="class"/>
499
405
  </optional>
500
- <optional>
501
- <attribute name="tag"/>
502
- </optional>
503
- <optional>
504
- <attribute name="multilingual-rendering">
505
- <ref name="MultilingualRenderingType"/>
506
- </attribute>
507
- </optional>
406
+ <ref name="BlockAttributes"/>
508
407
  <optional>
509
408
  <ref name="source"/>
510
409
  </optional>
@@ -550,27 +449,10 @@
550
449
  <optional>
551
450
  <attribute name="subsequence"/>
552
451
  </optional>
553
- <optional>
554
- <attribute name="keep-with-next">
555
- <data type="boolean"/>
556
- </attribute>
557
- </optional>
558
- <optional>
559
- <attribute name="keep-lines-together">
560
- <data type="boolean"/>
561
- </attribute>
562
- </optional>
563
452
  <optional>
564
453
  <attribute name="lang"/>
565
454
  </optional>
566
- <optional>
567
- <attribute name="tag"/>
568
- </optional>
569
- <optional>
570
- <attribute name="multilingual-rendering">
571
- <ref name="MultilingualRenderingType"/>
572
- </attribute>
573
- </optional>
455
+ <ref name="BlockAttributes"/>
574
456
  <optional>
575
457
  <attribute name="linenums">
576
458
  <data type="boolean"/>
@@ -609,29 +491,12 @@
609
491
  <optional>
610
492
  <attribute name="subsequence"/>
611
493
  </optional>
612
- <optional>
613
- <attribute name="keep-with-next">
614
- <data type="boolean"/>
615
- </attribute>
616
- </optional>
617
- <optional>
618
- <attribute name="keep-lines-together">
619
- <data type="boolean"/>
620
- </attribute>
621
- </optional>
622
494
  <optional>
623
495
  <attribute name="inequality">
624
496
  <data type="boolean"/>
625
497
  </attribute>
626
498
  </optional>
627
- <optional>
628
- <attribute name="tag"/>
629
- </optional>
630
- <optional>
631
- <attribute name="multilingual-rendering">
632
- <ref name="MultilingualRenderingType"/>
633
- </attribute>
634
- </optional>
499
+ <ref name="BlockAttributes"/>
635
500
  <ref name="stem"/>
636
501
  <optional>
637
502
  <ref name="dl"/>
@@ -650,27 +515,7 @@
650
515
  <ref name="Alignments"/>
651
516
  </attribute>
652
517
  </optional>
653
- <optional>
654
- <attribute name="keep-with-next">
655
- <data type="boolean"/>
656
- </attribute>
657
- </optional>
658
- <optional>
659
- <attribute name="keep-lines-together">
660
- <data type="boolean"/>
661
- </attribute>
662
- </optional>
663
- <optional>
664
- <attribute name="tag"/>
665
- </optional>
666
- <optional>
667
- <attribute name="type"/>
668
- </optional>
669
- <optional>
670
- <attribute name="multilingual-rendering">
671
- <ref name="MultilingualRenderingType"/>
672
- </attribute>
673
- </optional>
518
+ <ref name="BlockAttributes"/>
674
519
  <zeroOrMore>
675
520
  <ref name="TextElement"/>
676
521
  </zeroOrMore>
@@ -688,27 +533,10 @@
688
533
  <ref name="Alignments"/>
689
534
  </attribute>
690
535
  </optional>
691
- <optional>
692
- <attribute name="keep-with-next">
693
- <data type="boolean"/>
694
- </attribute>
695
- </optional>
696
- <optional>
697
- <attribute name="keep-lines-together">
698
- <data type="boolean"/>
699
- </attribute>
700
- </optional>
701
- <optional>
702
- <attribute name="tag"/>
703
- </optional>
704
536
  <optional>
705
537
  <attribute name="type"/>
706
538
  </optional>
707
- <optional>
708
- <attribute name="multilingual-rendering">
709
- <ref name="MultilingualRenderingType"/>
710
- </attribute>
711
- </optional>
539
+ <ref name="BlockAttributes"/>
712
540
  <zeroOrMore>
713
541
  <choice>
714
542
  <ref name="TextElement"/>
@@ -730,24 +558,7 @@
730
558
  <ref name="Alignments"/>
731
559
  </attribute>
732
560
  </optional>
733
- <optional>
734
- <attribute name="keep-with-next">
735
- <data type="boolean"/>
736
- </attribute>
737
- </optional>
738
- <optional>
739
- <attribute name="keep-lines-together">
740
- <data type="boolean"/>
741
- </attribute>
742
- </optional>
743
- <optional>
744
- <attribute name="tag"/>
745
- </optional>
746
- <optional>
747
- <attribute name="multilingual-rendering">
748
- <ref name="MultilingualRenderingType"/>
749
- </attribute>
750
- </optional>
561
+ <ref name="BlockAttributes"/>
751
562
  <optional>
752
563
  <ref name="quote-source"/>
753
564
  </optional>
@@ -827,27 +638,9 @@
827
638
  <optional>
828
639
  <attribute name="subsequence"/>
829
640
  </optional>
830
- <optional>
831
- <attribute name="keep-with-next">
832
- <data type="boolean"/>
833
- </attribute>
834
- </optional>
835
- <optional>
836
- <attribute name="keep-lines-together">
837
- <data type="boolean"/>
838
- </attribute>
839
- </optional>
840
641
  <optional>
841
642
  <attribute name="type"/>
842
643
  </optional>
843
- <optional>
844
- <attribute name="tag"/>
845
- </optional>
846
- <optional>
847
- <attribute name="multilingual-rendering">
848
- <ref name="MultilingualRenderingType"/>
849
- </attribute>
850
- </optional>
851
644
  <optional>
852
645
  <attribute name="coverpage">
853
646
  <data type="boolean"/>
@@ -858,6 +651,7 @@
858
651
  <data type="boolean"/>
859
652
  </attribute>
860
653
  </optional>
654
+ <ref name="BlockAttributes"/>
861
655
  <oneOrMore>
862
656
  <choice>
863
657
  <ref name="paragraph"/>
@@ -1331,14 +1125,7 @@
1331
1125
  <optional>
1332
1126
  <attribute name="class"/>
1333
1127
  </optional>
1334
- <optional>
1335
- <attribute name="tag"/>
1336
- </optional>
1337
- <optional>
1338
- <attribute name="multilingual-rendering">
1339
- <ref name="MultilingualRenderingType"/>
1340
- </attribute>
1341
- </optional>
1128
+ <ref name="BlockAttributes"/>
1342
1129
  <zeroOrMore>
1343
1130
  <choice>
1344
1131
  <ref name="TextElement"/>
@@ -1577,6 +1364,9 @@
1577
1364
  <zeroOrMore>
1578
1365
  <ref name="indexsect"/>
1579
1366
  </zeroOrMore>
1367
+ <optional>
1368
+ <ref name="colophon"/>
1369
+ </optional>
1580
1370
  </element>
1581
1371
  </define>
1582
1372
  <define name="misccontainer">
@@ -1599,6 +1389,13 @@
1599
1389
  </oneOrMore>
1600
1390
  </element>
1601
1391
  </define>
1392
+ <define name="colophon">
1393
+ <element name="colophon">
1394
+ <oneOrMore>
1395
+ <ref name="content"/>
1396
+ </oneOrMore>
1397
+ </element>
1398
+ </define>
1602
1399
  <define name="foreword">
1603
1400
  <element name="foreword">
1604
1401
  <ref name="Content-Section"/>
@@ -1897,7 +1694,10 @@
1897
1694
  </zeroOrMore>
1898
1695
  <choice>
1899
1696
  <oneOrMore>
1900
- <ref name="term"/>
1697
+ <choice>
1698
+ <ref name="term"/>
1699
+ <ref name="terms"/>
1700
+ </choice>
1901
1701
  </oneOrMore>
1902
1702
  <group>
1903
1703
  <zeroOrMore>
@@ -1923,14 +1723,7 @@
1923
1723
  <optional>
1924
1724
  <attribute name="script"/>
1925
1725
  </optional>
1926
- <optional>
1927
- <attribute name="tag"/>
1928
- </optional>
1929
- <optional>
1930
- <attribute name="multilingual-rendering">
1931
- <ref name="MultilingualRenderingType"/>
1932
- </attribute>
1933
- </optional>
1726
+ <ref name="BlockAttributes"/>
1934
1727
  <oneOrMore>
1935
1728
  <ref name="preferred"/>
1936
1729
  </oneOrMore>
@@ -2271,24 +2064,7 @@
2271
2064
  <optional>
2272
2065
  <attribute name="subsequence"/>
2273
2066
  </optional>
2274
- <optional>
2275
- <attribute name="keep-with-next">
2276
- <data type="boolean"/>
2277
- </attribute>
2278
- </optional>
2279
- <optional>
2280
- <attribute name="keep-lines-together">
2281
- <data type="boolean"/>
2282
- </attribute>
2283
- </optional>
2284
- <optional>
2285
- <attribute name="tag"/>
2286
- </optional>
2287
- <optional>
2288
- <attribute name="multilingual-rendering">
2289
- <ref name="MultilingualRenderingType"/>
2290
- </attribute>
2291
- </optional>
2067
+ <ref name="BlockAttributes"/>
2292
2068
  <oneOrMore>
2293
2069
  <choice>
2294
2070
  <ref name="paragraph"/>
@@ -2305,24 +2081,7 @@
2305
2081
  <attribute name="id">
2306
2082
  <data type="ID"/>
2307
2083
  </attribute>
2308
- <optional>
2309
- <attribute name="keep-with-next">
2310
- <data type="boolean"/>
2311
- </attribute>
2312
- </optional>
2313
- <optional>
2314
- <attribute name="keep-lines-together">
2315
- <data type="boolean"/>
2316
- </attribute>
2317
- </optional>
2318
- <optional>
2319
- <attribute name="tag"/>
2320
- </optional>
2321
- <optional>
2322
- <attribute name="multilingual-rendering">
2323
- <ref name="MultilingualRenderingType"/>
2324
- </attribute>
2325
- </optional>
2084
+ <ref name="BlockAttributes"/>
2326
2085
  <oneOrMore>
2327
2086
  <choice>
2328
2087
  <ref name="formula"/>
@@ -2449,14 +2208,7 @@
2449
2208
  <optional>
2450
2209
  <attribute name="title"/>
2451
2210
  </optional>
2452
- <optional>
2453
- <attribute name="tag"/>
2454
- </optional>
2455
- <optional>
2456
- <attribute name="multilingual-rendering">
2457
- <ref name="MultilingualRenderingType"/>
2458
- </attribute>
2459
- </optional>
2211
+ <ref name="BlockAttributes"/>
2460
2212
  <optional>
2461
2213
  <element name="location">
2462
2214
  <zeroOrMore>
@@ -2516,14 +2268,7 @@
2516
2268
  </define>
2517
2269
  <define name="imagemap">
2518
2270
  <element name="imagemap">
2519
- <optional>
2520
- <attribute name="tag"/>
2521
- </optional>
2522
- <optional>
2523
- <attribute name="multilingual-rendering">
2524
- <ref name="MultilingualRenderingType"/>
2525
- </attribute>
2526
- </optional>
2271
+ <ref name="BlockAttributes"/>
2527
2272
  <ref name="figure"/>
2528
2273
  <zeroOrMore>
2529
2274
  <element name="area">
@@ -2569,14 +2314,7 @@
2569
2314
  </define>
2570
2315
  <define name="svgmap">
2571
2316
  <element name="svgmap">
2572
- <optional>
2573
- <attribute name="tag"/>
2574
- </optional>
2575
- <optional>
2576
- <attribute name="multilingual-rendering">
2577
- <ref name="MultilingualRenderingType"/>
2578
- </attribute>
2579
- </optional>
2317
+ <ref name="BlockAttributes"/>
2580
2318
  <ref name="figure"/>
2581
2319
  <zeroOrMore>
2582
2320
  <element name="target">
@@ -2683,6 +2421,29 @@
2683
2421
  </oneOrMore>
2684
2422
  </element>
2685
2423
  </define>
2424
+ <define name="BlockAttributes">
2425
+ <optional>
2426
+ <attribute name="keep-with-next">
2427
+ <data type="boolean"/>
2428
+ </attribute>
2429
+ </optional>
2430
+ <optional>
2431
+ <attribute name="keep-lines-together">
2432
+ <data type="boolean"/>
2433
+ </attribute>
2434
+ </optional>
2435
+ <optional>
2436
+ <attribute name="tag"/>
2437
+ </optional>
2438
+ <optional>
2439
+ <attribute name="multilingual-rendering">
2440
+ <ref name="MultilingualRenderingType"/>
2441
+ </attribute>
2442
+ </optional>
2443
+ <optional>
2444
+ <attribute name="columns"/>
2445
+ </optional>
2446
+ </define>
2686
2447
  <start>
2687
2448
  <ref name="standard-document"/>
2688
2449
  </start>
@@ -1,4 +1,5 @@
1
1
  require "metanorma/ietf/data/workgroups"
2
+ require "metanorma-utils"
2
3
 
3
4
  module Metanorma
4
5
  module Ietf
@@ -7,6 +8,19 @@ module Metanorma
7
8
  super
8
9
  image_validate(doc)
9
10
  workgroup_validate(doc)
11
+ submission_validate(doc)
12
+ end
13
+
14
+ def ns(path)
15
+ ::Metanorma::Utils::ns(path)
16
+ end
17
+
18
+ def submission_validate(doc)
19
+ stream = doc.at(("//bibdata/series[@type = 'stream']/title"))&.text
20
+ status = doc.at(("//bibdata/status/stage"))&.text
21
+ stream == "editorial" && status != "informational" and
22
+ @log.add("Document Attributes", nil,
23
+ "Editorial stream must have Informational status")
10
24
  end
11
25
 
12
26
  def image_validate(doc)
@@ -24,7 +38,8 @@ module Metanorma
24
38
  wg_norm = wg.text.sub(/ (Working|Research) Group$/, "")
25
39
  next if @workgroups.include?(wg_norm)
26
40
 
27
- @log.add("Document Attributes", nil, "IETF: unrecognised working group #{wg.text}")
41
+ @log.add("Document Attributes", nil,
42
+ "IETF: unrecognised working group #{wg.text}")
28
43
  end
29
44
  end
30
45
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "3.1.2".freeze
3
+ VERSION = "3.1.4".freeze
4
4
  end
5
5
  end
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
 
39
39
  spec.add_dependency "mathml2asciimath"
40
40
  spec.add_dependency "metanorma-ietf-data"
41
- spec.add_dependency "metanorma-standoc", "~> 2.3.0"
41
+ spec.add_dependency "metanorma-standoc", "~> 2.4.0"
42
42
 
43
43
  spec.add_development_dependency "debug"
44
44
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.1.2
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-23 00:00:00.000000000 Z
11
+ date: 2023-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mathml2asciimath
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.3.0
47
+ version: 2.4.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.3.0
54
+ version: 2.4.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: debug
57
57
  requirement: !ruby/object:Gem::Requirement