metanorma-ietf 3.1.1 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ietf/cleanup.rb +3 -3
- data/lib/isodoc/ietf/front.rb +6 -6
- data/lib/isodoc/ietf/i18n-en.yaml +5 -5
- data/lib/isodoc/ietf/references.rb +17 -22
- data/lib/isodoc/ietf/section.rb +150 -150
- data/lib/isodoc/ietf/table.rb +33 -31
- data/lib/metanorma/ietf/basicdoc.rng +0 -1
- data/lib/metanorma/ietf/biblio.rng +12 -2
- data/lib/metanorma/ietf/cleanup.rb +2 -0
- data/lib/metanorma/ietf/isodoc.rng +12 -1
- data/lib/metanorma/ietf/validate.rb +16 -1
- data/lib/metanorma/ietf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6684b3f6e7543eb652b530245313c23cdf5e37694caa7887f8205b701c65445
|
4
|
+
data.tar.gz: e653280e65513f5462f7e24a99d23466148a93f9baa3ee298ead13f15ddd6a1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 210560d5093b93d01276d4c7fc97914b7b4b46f68899262019af3491e680dda0c3155ab9daef7035a7ffc0b6fe90350d291183b6546b844155040f59877a9457
|
7
|
+
data.tar.gz: 17be8103a4b71ab1cde206fdc0429379f803d912332f4adba1a31c36d0d6834d317eb1a89e6d4b603de135570260381327a6a605cf2e79d9da5782931b102fe7
|
data/lib/isodoc/ietf/cleanup.rb
CHANGED
@@ -187,10 +187,10 @@ module IsoDoc
|
|
187
187
|
end
|
188
188
|
|
189
189
|
def aside_cleanup(docxml)
|
190
|
-
docxml.xpath("
|
191
|
-
|
190
|
+
docxml.xpath("//*[aside]").each do |p|
|
191
|
+
%w(section).include?(p.name) and next
|
192
192
|
insert = p
|
193
|
-
p.xpath("
|
193
|
+
p.xpath("./aside").each do |a|
|
194
194
|
insert.next = a.remove
|
195
195
|
insert = insert.next_element
|
196
196
|
end
|
data/lib/isodoc/ietf/front.rb
CHANGED
@@ -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
|
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
|
-
|
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(
|
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,5 +1,5 @@
|
|
1
|
-
term_def_boilerplate:
|
2
|
-
no_terms_boilerplate:
|
3
|
-
internal_terms_boilerplate:
|
4
|
-
external_terms_boilerplate:
|
5
|
-
internal_external_terms_boilerplate:
|
1
|
+
term_def_boilerplate: ""
|
2
|
+
no_terms_boilerplate: ""
|
3
|
+
internal_terms_boilerplate: ""
|
4
|
+
external_terms_boilerplate: ""
|
5
|
+
internal_external_terms_boilerplate: ""
|
@@ -1,16 +1,14 @@
|
|
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)
|
9
7
|
end
|
10
|
-
isoxml.xpath(ns("//bibliography/references | "\
|
11
|
-
"//bibliography/clause[.//references] | "\
|
12
|
-
"//annex/clause[.//references] | "\
|
13
|
-
"//annex/references | "\
|
8
|
+
isoxml.xpath(ns("//bibliography/references | " \
|
9
|
+
"//bibliography/clause[.//references] | " \
|
10
|
+
"//annex/clause[.//references] | " \
|
11
|
+
"//annex/references | " \
|
14
12
|
"//sections/clause[.//references]")).each do |f|
|
15
13
|
bibliography1(f, out)
|
16
14
|
end
|
@@ -64,15 +62,15 @@ module IsoDoc
|
|
64
62
|
!id[:sdo].nil? && id[:sdo] != "(NO ID)" and out.refcontent id[:sdo]
|
65
63
|
docidentifiers&.each do |u|
|
66
64
|
u["type"] == "DOI" and
|
67
|
-
out.seriesInfo nil, **attr_code(value: u.text.sub(/^DOI
|
65
|
+
out.seriesInfo nil, **attr_code(value: u.text.sub(/^DOI[ ]/, ""),
|
68
66
|
name: "DOI")
|
69
67
|
%w(IETF RFC).include?(u["type"]) and docidentifier_ietf(u, out)
|
70
68
|
end
|
71
69
|
end
|
72
70
|
|
73
71
|
def docidentifier_ietf(ident, out)
|
74
|
-
if /^RFC
|
75
|
-
out.seriesInfo nil, **attr_code(value: ident.text.sub(/^RFC
|
72
|
+
if /^RFC[ ]/.match?(ident.text)
|
73
|
+
out.seriesInfo nil, **attr_code(value: ident.text.sub(/^RFC[ ]0*/, ""),
|
76
74
|
name: "RFC")
|
77
75
|
elsif /^I-D\./.match?(ident.text)
|
78
76
|
out.seriesInfo nil, **attr_code(value: ident.text.sub(/^I-D\./, ""),
|
@@ -99,26 +97,24 @@ module IsoDoc
|
|
99
97
|
end
|
100
98
|
|
101
99
|
def relaton_to_author(bib, node)
|
102
|
-
auths = bib.xpath(ns("./contributor[xmlns:role/@type = 'author' or "\
|
100
|
+
auths = bib.xpath(ns("./contributor[xmlns:role/@type = 'author' or " \
|
103
101
|
"xmlns:role/@type = 'editor']"))
|
104
102
|
auths.empty? and
|
105
|
-
auths = bib.xpath(ns("./contributor[xmlns:role/@type = "\
|
103
|
+
auths = bib.xpath(ns("./contributor[xmlns:role/@type = " \
|
106
104
|
"'publisher']"))
|
107
105
|
auths.each do |a|
|
108
106
|
role = a.at(ns("./role[@type = 'editor']")) ? "editor" : nil
|
109
|
-
p = a&.at(ns("./person/name")) and
|
110
|
-
relaton_person_to_author(p, role, node) or
|
107
|
+
(p = a&.at(ns("./person/name")) and
|
108
|
+
relaton_person_to_author(p, role, node)) or
|
111
109
|
relaton_org_to_author(a&.at(ns("./organization")), role, node)
|
112
110
|
end
|
113
111
|
end
|
114
112
|
|
115
113
|
def relaton_person_to_author(pers, role, node)
|
116
|
-
full = pers
|
117
|
-
surname = pers
|
118
|
-
initials = pers
|
119
|
-
|
120
|
-
end&.join(" ") ||
|
121
|
-
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(" ")
|
122
118
|
initials = nil if initials.empty?
|
123
119
|
node.author nil, **attr_code(
|
124
120
|
fullname: full,
|
@@ -143,9 +139,8 @@ module IsoDoc
|
|
143
139
|
date = bib.at(ns("./date[@type = 'published']")) ||
|
144
140
|
bib.at(ns("./date[@type = 'issued']")) ||
|
145
141
|
bib.at(ns("./date[@type = 'circulated']"))
|
146
|
-
|
147
|
-
|
148
|
-
attr = date_attr(date&.at(ns("./on | ./from"))&.text) || return
|
142
|
+
date or return
|
143
|
+
attr = date_attr(date.at(ns("./on | ./from"))&.text) or return
|
149
144
|
node.date **attr_code(attr)
|
150
145
|
end
|
151
146
|
|
data/lib/isodoc/ietf/section.rb
CHANGED
@@ -1,178 +1,178 @@
|
|
1
|
-
module IsoDoc
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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
|
-
|
100
|
-
|
98
|
+
def xpath_comma(xpath)
|
99
|
+
return nil if xpath.empty?
|
101
100
|
|
102
|
-
|
103
|
-
|
101
|
+
xpath.map(&:text).join(", ")
|
102
|
+
end
|
104
103
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
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
|
-
|
128
|
-
|
129
|
-
|
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
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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
|
-
|
141
|
-
|
139
|
+
def clause_parse_title(_node, div, clause, _out, _heading_attrs = {})
|
140
|
+
return unless clause
|
142
141
|
|
143
|
-
|
144
|
-
|
142
|
+
div.name do |n|
|
143
|
+
clause&.children&.each { |c2| parse(c2, n) }
|
144
|
+
end
|
145
145
|
end
|
146
|
-
end
|
147
146
|
|
148
|
-
|
149
|
-
|
147
|
+
def clause_parse(node, out)
|
148
|
+
return if node.at(ns(".//references"))
|
150
149
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
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
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
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
|
-
|
174
|
-
|
175
|
-
|
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
|
data/lib/isodoc/ietf/table.rb
CHANGED
@@ -1,43 +1,45 @@
|
|
1
|
-
module IsoDoc
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module IsoDoc
|
2
|
+
module Ietf
|
3
|
+
class RfcConvert < ::IsoDoc::Convert
|
4
|
+
def table_attrs(node)
|
5
|
+
attr_code(anchor: node["id"], align: node["align"])
|
6
|
+
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
def table_parse(node, out)
|
9
|
+
@in_table = true
|
10
|
+
out.table **table_attrs(node) do |t|
|
11
|
+
table_title_parse(node, out)
|
12
|
+
thead_parse(node, t)
|
13
|
+
tbody_parse(node, t)
|
14
|
+
tfoot_parse(node, t)
|
15
|
+
end
|
16
|
+
(dl = node.at(ns("./dl"))) && parse(dl, out)
|
17
|
+
node.xpath(ns("./note")).each { |n| parse(n, out) }
|
18
|
+
@in_table = false
|
14
19
|
end
|
15
|
-
(dl = node.at(ns("./dl"))) && parse(dl, out)
|
16
|
-
node.xpath(ns("./note")).each { |n| parse(n, out) }
|
17
|
-
@in_table = false
|
18
|
-
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
def table_title_parse(node, out)
|
22
|
+
name = node.at(ns("./name")) || return
|
23
|
+
out.name do |p|
|
24
|
+
name.children.each { |n| parse(n, p) }
|
25
|
+
end
|
24
26
|
end
|
25
|
-
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
def tr_parse(node, out, ord, totalrows, header)
|
29
|
+
out.tr do |r|
|
30
|
+
node.elements.each do |td|
|
31
|
+
attrs = make_tr_attr(td, ord, totalrows - 1, header)
|
32
|
+
r.send td.name, **attrs do |entry|
|
33
|
+
td.children.each { |n| parse(n, entry) }
|
34
|
+
end
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
36
|
-
end
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
def make_tr_attr(cell, _row, _totalrows, _header)
|
40
|
+
attr_code(rowspan: cell["rowspan"], colspan: cell["colspan"],
|
41
|
+
align: cell["align"])
|
42
|
+
end
|
41
43
|
end
|
42
44
|
end
|
43
45
|
end
|
@@ -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
|
-
<
|
316
|
+
<optional>
|
317
|
+
<ref name="organization"/>
|
318
|
+
</optional>
|
309
319
|
</element>
|
310
320
|
</define>
|
311
321
|
<define name="affiliationname">
|
@@ -1316,7 +1326,7 @@
|
|
1316
1326
|
<value>commentaryOf</value>
|
1317
1327
|
<value>hasCommentary</value>
|
1318
1328
|
<value>related</value>
|
1319
|
-
<value>
|
1329
|
+
<value>hasComplement</value>
|
1320
1330
|
<value>complementOf</value>
|
1321
1331
|
<value>obsoletes</value>
|
1322
1332
|
<value>obsoletedBy</value>
|
@@ -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">
|
@@ -1577,10 +1578,13 @@
|
|
1577
1578
|
<zeroOrMore>
|
1578
1579
|
<ref name="indexsect"/>
|
1579
1580
|
</zeroOrMore>
|
1581
|
+
<optional>
|
1582
|
+
<ref name="colophon"/>
|
1583
|
+
</optional>
|
1580
1584
|
</element>
|
1581
1585
|
</define>
|
1582
1586
|
<define name="misccontainer">
|
1583
|
-
<element name="
|
1587
|
+
<element name="metanorma-extension">
|
1584
1588
|
<oneOrMore>
|
1585
1589
|
<ref name="AnyElement"/>
|
1586
1590
|
</oneOrMore>
|
@@ -1599,6 +1603,13 @@
|
|
1599
1603
|
</oneOrMore>
|
1600
1604
|
</element>
|
1601
1605
|
</define>
|
1606
|
+
<define name="colophon">
|
1607
|
+
<element name="colophon">
|
1608
|
+
<oneOrMore>
|
1609
|
+
<ref name="content"/>
|
1610
|
+
</oneOrMore>
|
1611
|
+
</element>
|
1612
|
+
</define>
|
1602
1613
|
<define name="foreword">
|
1603
1614
|
<element name="foreword">
|
1604
1615
|
<ref name="Content-Section"/>
|
@@ -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,
|
41
|
+
@log.add("Document Attributes", nil,
|
42
|
+
"IETF: unrecognised working group #{wg.text}")
|
28
43
|
end
|
29
44
|
end
|
30
45
|
|
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.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mathml2asciimath
|