metanorma-ietf 1.0.10 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +3 -2
  3. data/.github/workflows/ubuntu.yml +3 -2
  4. data/.github/workflows/windows.yml +4 -3
  5. data/README.adoc +9 -0
  6. data/lib/asciidoctor/ietf/basicdoc.rng +1045 -0
  7. data/lib/asciidoctor/ietf/biblio.rng +1142 -0
  8. data/lib/asciidoctor/ietf/blocks.rb +76 -0
  9. data/lib/asciidoctor/ietf/converter.rb +211 -0
  10. data/lib/asciidoctor/ietf/front.rb +143 -0
  11. data/lib/asciidoctor/ietf/ietf.rng +882 -0
  12. data/lib/asciidoctor/ietf/isodoc.rng +514 -0
  13. data/lib/asciidoctor/ietf/isostandard.rng +860 -0
  14. data/lib/asciidoctor/ietf/reqt.rng +171 -0
  15. data/lib/asciidoctor/ietf/validate.rb +84 -0
  16. data/lib/isodoc/ietf/blocks.rb +215 -0
  17. data/lib/isodoc/ietf/cleanup.rb +220 -0
  18. data/lib/isodoc/ietf/footnotes.rb +70 -0
  19. data/lib/isodoc/ietf/front.rb +232 -0
  20. data/lib/isodoc/ietf/inline.rb +136 -0
  21. data/lib/isodoc/ietf/metadata.rb +62 -0
  22. data/lib/isodoc/ietf/references.rb +129 -0
  23. data/lib/isodoc/ietf/reqt.rb +74 -0
  24. data/lib/isodoc/ietf/rfc_convert.rb +60 -0
  25. data/lib/isodoc/ietf/section.rb +162 -0
  26. data/lib/isodoc/ietf/table.rb +43 -0
  27. data/lib/isodoc/ietf/terms.rb +65 -0
  28. data/lib/metanorma-ietf.rb +2 -1
  29. data/lib/metanorma/ietf/processor.rb +16 -37
  30. data/lib/metanorma/ietf/version.rb +1 -1
  31. data/metanorma-ietf.gemspec +3 -3
  32. metadata +36 -36
  33. data/Gemfile.lock +0 -327
  34. data/lib/asciidoctor/rfc.rb +0 -8
  35. data/lib/asciidoctor/rfc/common/base.rb +0 -544
  36. data/lib/asciidoctor/rfc/common/front.rb +0 -120
  37. data/lib/asciidoctor/rfc/common/validate.rb +0 -31
  38. data/lib/asciidoctor/rfc/v2/base.rb +0 -380
  39. data/lib/asciidoctor/rfc/v2/blocks.rb +0 -299
  40. data/lib/asciidoctor/rfc/v2/converter.rb +0 -60
  41. data/lib/asciidoctor/rfc/v2/front.rb +0 -69
  42. data/lib/asciidoctor/rfc/v2/inline_anchor.rb +0 -111
  43. data/lib/asciidoctor/rfc/v2/lists.rb +0 -135
  44. data/lib/asciidoctor/rfc/v2/table.rb +0 -116
  45. data/lib/asciidoctor/rfc/v2/validate.rng +0 -716
  46. data/lib/asciidoctor/rfc/v3/base.rb +0 -330
  47. data/lib/asciidoctor/rfc/v3/blocks.rb +0 -246
  48. data/lib/asciidoctor/rfc/v3/converter.rb +0 -62
  49. data/lib/asciidoctor/rfc/v3/front.rb +0 -122
  50. data/lib/asciidoctor/rfc/v3/inline_anchor.rb +0 -89
  51. data/lib/asciidoctor/rfc/v3/lists.rb +0 -176
  52. data/lib/asciidoctor/rfc/v3/svg.rng +0 -9081
  53. data/lib/asciidoctor/rfc/v3/table.rb +0 -65
  54. data/lib/asciidoctor/rfc/v3/validate.rng +0 -2143
@@ -0,0 +1,76 @@
1
+ module Asciidoctor
2
+ module Ietf
3
+ class Converter < ::Asciidoctor::Standoc::Converter
4
+ def para_attrs(node)
5
+ attr_code( keepWithNext: node.attr("keepWithNext"),
6
+ keepWithPrevious: node.attr("keepWithPrevious"),
7
+ id: ::Asciidoctor::Standoc::Utils::anchor_or_uuid(node))
8
+ end
9
+
10
+ def ul_attr(node)
11
+ attr_code(id: ::Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
12
+ nobullet: node.attr("nobullet"),
13
+ spacing: node.attr("spacing"))
14
+ end
15
+
16
+ def ol_attr(node)
17
+ attr_code(id: ::Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
18
+ type: node.attr("format") || olist_style(node.style),
19
+ group: node.attr("group"),
20
+ spacing: node.attr("spacing"),
21
+ start: node.attr("start"))
22
+ end
23
+
24
+ def dl_attr(node)
25
+ attr_code(id: ::Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
26
+ newline: node.attr("newline"),
27
+ indent: node.attr("indent"),
28
+ spacing: node.attr("spacing"))
29
+ end
30
+
31
+ def todo_attrs(node)
32
+ super.merge(attr_code(display: node.attr("display")))
33
+ end
34
+
35
+ def sidebar(node)
36
+ return unless draft?
37
+ noko do |xml|
38
+ xml.review **(sidebar_attrs(node)) do |r|
39
+ node.title.nil? or r.name { |name| name << node.title }
40
+ wrap_in_para(node, r)
41
+ end
42
+ end
43
+ end
44
+
45
+ def note(n)
46
+ noko do |xml|
47
+ xml.note **attr_code(id: ::Asciidoctor::Standoc::Utils::anchor_or_uuid(n),
48
+ removeInRFC: n.attr("remove-in-rfc")) do |c|
49
+ n.title.nil? or c.name { |name| name << n.title }
50
+ wrap_in_para(n, c)
51
+ end
52
+ end.join("\n")
53
+ end
54
+
55
+ def literal(node)
56
+ noko do |xml|
57
+ xml.figure **literal_attrs(node) do |f|
58
+ figure_title(node, f)
59
+ f.pre node.lines.join("\n"),
60
+ **attr_code(align: node.attr("align"),
61
+ id: ::Asciidoctor::Standoc::Utils::anchor_or_uuid(nil),
62
+ alt: node.attr("alt"))
63
+ end
64
+ end
65
+ end
66
+
67
+ def image_attributes(node)
68
+ super.merge(attr_code(align: node.attr("align")))
69
+ end
70
+
71
+ def listing_attrs(node)
72
+ super.merge(attr_code(markers: node.attr("markers"), src: node.attr("src")))
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,211 @@
1
+ require "asciidoctor"
2
+ require "asciidoctor/standoc/converter"
3
+ require "isodoc/ietf/rfc_convert"
4
+ require_relative "./front"
5
+ require_relative "./blocks"
6
+ require_relative "./validate"
7
+
8
+ module Asciidoctor
9
+ module Ietf
10
+ class Converter < ::Asciidoctor::Standoc::Converter
11
+
12
+ register_for "ietf"
13
+
14
+ def initialize(backend, opts)
15
+ super
16
+ @libdir = File.dirname(__FILE__)
17
+ end
18
+
19
+ def makexml(node)
20
+ result = ["<?xml version='1.0' encoding='UTF-8'?>\n<ietf-standard>"]
21
+ @draft = node.attributes.has_key?("draft")
22
+ @workgroups = cache_workgroup(node)
23
+ @bcp_bold = !node.attr?("no-rfc-bold-bcp14")
24
+ result << noko { |ixml| front node, ixml }
25
+ result << noko { |ixml| middle node, ixml }
26
+ result << "</ietf-standard>"
27
+ result = textcleanup(result)
28
+ ret1 = cleanup(Nokogiri::XML(result))
29
+ validate(ret1) unless @novalid
30
+ ret1.root.add_namespace(nil, "https://open.ribose.com/standards/ietf")
31
+ ret1
32
+ end
33
+
34
+ def document(node)
35
+ init(node)
36
+ ret1 = makexml(node)
37
+ ret = ret1.to_xml(indent: 2)
38
+ unless node.attr("nodoc") || !node.attr("docfile")
39
+ filename = node.attr("docfile").gsub(/\.adoc/, ".xml").
40
+ gsub(%r{^.*/}, "")
41
+ File.open(filename, "w") { |f| f.write(ret) }
42
+ rfc_converter(node).convert filename unless node.attr("nodoc")
43
+ end
44
+ @files_to_delete.each { |f| FileUtils.rm f }
45
+ ret
46
+ end
47
+
48
+ def doctype(node)
49
+ ret = node.attr("doctype")
50
+ ret = "Internet-Draft" if ret == "article"
51
+ ret
52
+ end
53
+
54
+ def inline_quoted(node)
55
+ noko do |xml|
56
+ case node.type
57
+ when :emphasis then xml.em { |s| s << node.text }
58
+ when :strong then xml.strong { |s| s << node.text }
59
+ when :monospaced then xml.tt { |s| s << node.text }
60
+ when :double then xml << "\"#{node.text}\""
61
+ when :single then xml << "'#{node.text}'"
62
+ when :superscript then xml.sup { |s| s << node.text }
63
+ when :subscript then xml.sub { |s| s << node.text }
64
+ when :asciimath then stem_parse(node.text, xml, :asciimath)
65
+ when :latexmath then stem_parse(node.text, xml, :latexmath)
66
+ else
67
+ case node.role
68
+ when "bcp14" then xml.bcp14 { |s| s << node.text.upcase }
69
+ else
70
+ xml << node.text
71
+ end
72
+ end
73
+ end.join
74
+ end
75
+
76
+ def inline_anchor_xref(node)
77
+ f, c = xref_text(node)
78
+ f1, c = eref_text(node) if f.nil?
79
+ t, rel = xref_rel(node)
80
+ noko do |xml|
81
+ xml.xref **attr_code(target: t, type: "inline",
82
+ displayFormat: f1, format: f,
83
+ relative: rel ) do |x|
84
+ x << c
85
+ end
86
+ end.join
87
+ end
88
+
89
+ def table_attrs(node)
90
+ super.merge(align: node.attr("align"))
91
+ end
92
+
93
+ def eref_text(node)
94
+ matched = /^(of|comma|parens|bare),(.*+)$/.match node.text
95
+ if matched.nil?
96
+ f = nil
97
+ c = node&.text&.sub(/^fn: /, "")
98
+ else
99
+ f = matched[1]
100
+ c = matched[2]
101
+ end
102
+ [f, c]
103
+ end
104
+
105
+ def xref_text(node)
106
+ matched = /^format=(counter|title|none|default)(:.*+)?$/.match node.text
107
+ if matched.nil?
108
+ f = nil
109
+ c = node&.text&.sub(/^fn: /, "")
110
+ else
111
+ f = matched[1]
112
+ c = matched[2]&.sub(/^:/, "")
113
+ end
114
+ [f, c]
115
+ end
116
+
117
+ def xref_rel(node)
118
+ matched = /^([^#]+)#(.+)$/.match node.target
119
+ if matched.nil?
120
+ t = node.target.sub(/^#/, "")
121
+ rel = nil
122
+ else
123
+ t = matched[1].sub(/\.(xml|adoc)$/, "")
124
+ rel = matched[2]
125
+ end
126
+ [t, rel]
127
+ end
128
+
129
+ def cleanup(xmldoc)
130
+ bcp14_cleanup(xmldoc)
131
+ rfc_anchor_cleanup(xmldoc)
132
+ super
133
+ end
134
+
135
+ BCP_KEYWORDS = ["MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
136
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", "OPTIONAL"].freeze
137
+
138
+ def bcp14_cleanup(xmldoc)
139
+ return unless @bcp_bold
140
+ xmldoc.xpath("//strong").each do |s|
141
+ next unless BCP_KEYWORDS.include?(s.text)
142
+ s.name = "bcp14"
143
+ end
144
+ end
145
+
146
+ def rfc_anchor_cleanup(xmldoc)
147
+ map = {}
148
+ xmldoc.xpath("//bibitem[docidentifier/@type = 'rfc-anchor']").each do |b|
149
+ map[b["id"]] = b.at("./docidentifier[@type = 'rfc-anchor']").text
150
+ b["id"] = b.at("./docidentifier[@type = 'rfc-anchor']").text
151
+ end
152
+ xmldoc.xpath("//eref | //origin").each do |x|
153
+ map[x["bibitemid"]] and x["bibitemid"] = map[x["bibitemid"]]
154
+ end
155
+ xmldoc
156
+ end
157
+
158
+ def smartquotes_cleanup(xmldoc)
159
+ xmldoc.traverse do |n|
160
+ next unless n.text?
161
+ n.replace(HTMLEntities.new.encode(
162
+ n.text.gsub(/\u2019|\u2018|\u201a|\u201b/, "'").
163
+ gsub(/\u201c|\u201d|\u201e|\u201f/, '"'), :basic))
164
+ end
165
+ xmldoc
166
+ end
167
+
168
+ def xref_to_eref(x)
169
+ super
170
+ x.delete("format")
171
+ end
172
+
173
+ def xref_cleanup(xmldoc)
174
+ super
175
+ xmldoc.xpath("//xref").each do |x|
176
+ x.delete("displayFormat")
177
+ x.delete("relative")
178
+ end
179
+ end
180
+
181
+ def norm_ref_preface(f)
182
+ end
183
+
184
+ def clause_parse(attrs, xml, node)
185
+ attrs[:numbered] = node.attr("numbered")
186
+ attrs[:removeInRFC] = node.attr("removeInRFC")
187
+ attrs[:toc] = node.attr("toc")
188
+ super
189
+ end
190
+
191
+ def introduction_parse(attrs, xml, node)
192
+ clause_parse(attrs, xml, node)
193
+ end
194
+
195
+ def quotesource_cleanup(xmldoc)
196
+ xmldoc.xpath("//quote/source | //terms/source").each do |x|
197
+ if x["target"] =~ URI::DEFAULT_PARSER.make_regexp
198
+ x["uri"] = x["target"]
199
+ x.delete("target")
200
+ else
201
+ xref_to_eref(x)
202
+ end
203
+ end
204
+ end
205
+
206
+ def rfc_converter(node)
207
+ IsoDoc::Ietf::RfcConvert.new(html_extract_attributes(node))
208
+ end
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,143 @@
1
+ module Asciidoctor
2
+ module Ietf
3
+ class Converter < ::Asciidoctor::Standoc::Converter
4
+ def relaton_relations
5
+ %w(included-in described-by derived-from equivalent obsoletes updates)
6
+ end
7
+
8
+ def metadata_author(node, xml)
9
+ personal_author(node, xml)
10
+ end
11
+
12
+ def metadata_publisher(node, xml)
13
+ publishers = node.attr("publisher") || "IETF"
14
+ publishers.split(/,[ ]?/).each do |p|
15
+ xml.contributor do |c|
16
+ c.role **{ type: "publisher" }
17
+ c.organization { |a| organization(a, p) }
18
+ end
19
+ end
20
+ end
21
+
22
+ def metadata_copyright(node, xml)
23
+ publishers = node.attr("publisher") || "IETF"
24
+ publishers.split(/,[ ]?/).each do |p|
25
+ xml.copyright do |c|
26
+ c.from (node.attr("copyright-year") || Date.today.year)
27
+ c.owner do |owner|
28
+ owner.organization { |o| organization(o, p) }
29
+ end
30
+ end
31
+ end
32
+ end
33
+
34
+ def organization(org, orgname)
35
+ if ["IETF",
36
+ "Internet Engineering Task Force"].include? orgname
37
+ org.name "Internet Engineering Task Force"
38
+ org.abbreviation "IETF"
39
+ else
40
+ org.name orgname
41
+ end
42
+ end
43
+
44
+ def metadata_series(node, xml)
45
+ xml.series **{ type: "stream" } do |s|
46
+ s.title (node.attr("submission-type") || "IETF")
47
+ end
48
+ a = node.attr("intended-series") and
49
+ xml.series **{ type: "intended" } do |s|
50
+ parts = a.split(/ /)
51
+ s.title parts[0]
52
+ s.number parts[1..-1].join(" ") if parts.size > 1
53
+ end
54
+ end
55
+
56
+ def title(node, xml)
57
+ ["en"].each do |lang|
58
+ at = { language: lang, format: "text/plain" }
59
+ xml.title **attr_code(at.merge(type: "main")) do |t|
60
+ t << ::Asciidoctor::Standoc::Utils::asciidoc_sub(
61
+ node.attr("title") || node.attr("title-en") || node.title)
62
+ end
63
+ a = node.attr("abbrev") and
64
+ xml.title a, **attr_code(at.merge(type: "abbrev"))
65
+ a = node.attr("asciititle") and
66
+ xml.title a, **attr_code(at.merge(type: "ascii"))
67
+ end
68
+ end
69
+
70
+ def metadata_committee(node, xml)
71
+ return unless node.attr("workgroup")
72
+ xml.editorialgroup do |a|
73
+ committee_component("workgroup", node, a)
74
+ end
75
+ end
76
+
77
+ def metadata_ext(node, xml)
78
+ super
79
+ x = node.attr("area") and x.split(/,\s*/).each do |a|
80
+ xml.area a
81
+ end
82
+ x = node.attr("ipr") and xml.ipr x
83
+ x = node.attr("consensus") and xml.consensus x
84
+ x = node.attr("index-include") and xml.indexInclude x
85
+ x = node.attr("ipr-extract") and xml.iprExtract x
86
+ x = node.attr("sort-refs") and xml.sortRefs x
87
+ x = node.attr("sym-refs") and xml.symRefs x
88
+ x = node.attr("toc-include") and xml.tocInclude x
89
+ x = node.attr("toc-depth") and xml.tocDepth x
90
+ x = node.attr("show-on-front-page") and xml.showOnFrontPage x
91
+ xml.pi { |pi| set_pi(node, pi) }
92
+ end
93
+
94
+ def set_pi(node, pi)
95
+ rfc_pis = {
96
+ artworkdelimiter: node.attr("artworkdelimiter"),
97
+ artworklines: node.attr("artworklines"),
98
+ authorship: node.attr("authorship"),
99
+ autobreaks: node.attr("autobreaks"),
100
+ background: node.attr("background"),
101
+ colonspace: node.attr("colonspace"),
102
+ comments: node.attr("comments"),
103
+ docmapping: node.attr("docmapping"),
104
+ editing: node.attr("editing"),
105
+ emoticonic: node.attr("emoticonic"),
106
+ footer: node.attr("footer"),
107
+ header: node.attr("header"),
108
+ inline: node.attr("inline"),
109
+ iprnotified: node.attr("iprnotified"),
110
+ linkmailto: node.attr("linkmailto"),
111
+ linefile: node.attr("linefile"),
112
+ notedraftinprogress: node.attr("notedraftinprogress"),
113
+ private: node.attr("private"),
114
+ refparent: node.attr("refparent"),
115
+ rfcedstyle: node.attr("rfcedstyle"),
116
+ slides: node.attr("slides"),
117
+ "text-list-symbols": node.attr("text-list-symbols"),
118
+ tocappendix: node.attr("tocappendix"),
119
+ tocindent: node.attr("tocindent"),
120
+ tocnarrow: node.attr("tocnarrow"),
121
+ tocompact: node.attr("tocompact"),
122
+ topblock: node.attr("topblock"),
123
+ useobject: node.attr("useobject"),
124
+ strict: node.attr("strict"),
125
+ compact: node.attr("compact"),
126
+ subcompact: node.attr("subcompact"),
127
+ toc: node.attr("toc-include") == "false" ? "no" : "yes",
128
+ tocdepth: node.attr("toc-depth"),
129
+ symrefs: node.attr("sym-refs"),
130
+ sortrefs: node.attr("sort-refs"),
131
+ }
132
+ pi_code(rfc_pis, pi)
133
+ end
134
+
135
+ def pi_code(rfc_pis, pi)
136
+ rfc_pis.each_pair do |k, v|
137
+ next if v.nil?
138
+ pi.send k.to_s, v
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,882 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!--
4
+ Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
+ we cannot have a new default namespace: we will end up with a grammar with two different
6
+ namespaces, one for isostandard and one for ietf additions. And we do not want that.
7
+ -->
8
+ <include href="isostandard.rng">
9
+ <start>
10
+ <ref name="ietf-standard"/>
11
+ </start>
12
+ <define name="DocumentType">
13
+ <choice>
14
+ <value>rfc</value>
15
+ <value>internet-draft</value>
16
+ </choice>
17
+ </define>
18
+ <define name="BibDataExtensionType">
19
+ <optional>
20
+ <ref name="doctype"/>
21
+ </optional>
22
+ <zeroOrMore>
23
+ <ref name="editorialgroup"/>
24
+ </zeroOrMore>
25
+ <zeroOrMore>
26
+ <ref name="ics"/>
27
+ </zeroOrMore>
28
+ <zeroOrMore>
29
+ <ref name="area"/>
30
+ </zeroOrMore>
31
+ <optional>
32
+ <ref name="ipr"/>
33
+ </optional>
34
+ <optional>
35
+ <ref name="consensus"/>
36
+ </optional>
37
+ <optional>
38
+ <ref name="index-include"/>
39
+ </optional>
40
+ <optional>
41
+ <ref name="ipr-extract"/>
42
+ </optional>
43
+ <optional>
44
+ <ref name="sort-refs"/>
45
+ </optional>
46
+ <optional>
47
+ <ref name="sym-refs"/>
48
+ </optional>
49
+ <optional>
50
+ <ref name="toc-include"/>
51
+ </optional>
52
+ <optional>
53
+ <ref name="toc-depth"/>
54
+ </optional>
55
+ <optional>
56
+ <ref name="show-on-front-page"/>
57
+ </optional>
58
+ <optional>
59
+ <ref name="processing-instructions"/>
60
+ </optional>
61
+ </define>
62
+ <define name="ParagraphType">
63
+ <attribute name="id">
64
+ <data type="ID"/>
65
+ </attribute>
66
+ <optional>
67
+ <attribute name="align">
68
+ <ref name="Alignments"/>
69
+ </attribute>
70
+ </optional>
71
+ <optional>
72
+ <attribute name="keepWithNext">
73
+ <data type="boolean"/>
74
+ </attribute>
75
+ </optional>
76
+ <optional>
77
+ <attribute name="keepWithPrevious">
78
+ <data type="boolean"/>
79
+ </attribute>
80
+ </optional>
81
+ <zeroOrMore>
82
+ <ref name="TextElement"/>
83
+ </zeroOrMore>
84
+ <zeroOrMore>
85
+ <ref name="note"/>
86
+ </zeroOrMore>
87
+ </define>
88
+ <define name="paragraph-with-footnote">
89
+ <element name="p">
90
+ <attribute name="id">
91
+ <data type="ID"/>
92
+ </attribute>
93
+ <optional>
94
+ <attribute name="align">
95
+ <ref name="Alignments"/>
96
+ </attribute>
97
+ </optional>
98
+ <zeroOrMore>
99
+ <choice>
100
+ <ref name="TextElement"/>
101
+ <ref name="fn"/>
102
+ </choice>
103
+ </zeroOrMore>
104
+ <zeroOrMore>
105
+ <ref name="note"/>
106
+ </zeroOrMore>
107
+ </element>
108
+ </define>
109
+ <define name="ul">
110
+ <element name="ul">
111
+ <attribute name="id">
112
+ <data type="ID"/>
113
+ </attribute>
114
+ <optional>
115
+ <attribute name="nobullet"/>
116
+ </optional>
117
+ <optional>
118
+ <attribute name="spacing"/>
119
+ </optional>
120
+ <oneOrMore>
121
+ <ref name="li"/>
122
+ </oneOrMore>
123
+ <zeroOrMore>
124
+ <ref name="note"/>
125
+ </zeroOrMore>
126
+ </element>
127
+ </define>
128
+ <define name="ol">
129
+ <element name="ol">
130
+ <attribute name="id">
131
+ <data type="ID"/>
132
+ </attribute>
133
+ <attribute name="type">
134
+ <choice>
135
+ <value>roman</value>
136
+ <value>alphabet</value>
137
+ <value>arabic</value>
138
+ <value>roman_upper</value>
139
+ <value>alphabet_upper</value>
140
+ <value>text</value>
141
+ </choice>
142
+ </attribute>
143
+ <optional>
144
+ <attribute name="group"/>
145
+ </optional>
146
+ <optional>
147
+ <attribute name="spacing"/>
148
+ </optional>
149
+ <optional>
150
+ <attribute name="start"/>
151
+ </optional>
152
+ <oneOrMore>
153
+ <ref name="li"/>
154
+ </oneOrMore>
155
+ <zeroOrMore>
156
+ <ref name="note"/>
157
+ </zeroOrMore>
158
+ </element>
159
+ </define>
160
+ <define name="dl">
161
+ <element name="dl">
162
+ <attribute name="id">
163
+ <data type="ID"/>
164
+ </attribute>
165
+ <optional>
166
+ <attribute name="newline"/>
167
+ </optional>
168
+ <optional>
169
+ <attribute name="indent"/>
170
+ </optional>
171
+ <optional>
172
+ <attribute name="spacing"/>
173
+ </optional>
174
+ <oneOrMore>
175
+ <ref name="dt"/>
176
+ <ref name="dd"/>
177
+ </oneOrMore>
178
+ <zeroOrMore>
179
+ <ref name="note"/>
180
+ </zeroOrMore>
181
+ </element>
182
+ </define>
183
+ <define name="review">
184
+ <element name="review">
185
+ <attribute name="id">
186
+ <data type="ID"/>
187
+ </attribute>
188
+ <attribute name="reviewer"/>
189
+ <optional>
190
+ <attribute name="date">
191
+ <data type="dateTime"/>
192
+ </attribute>
193
+ </optional>
194
+ <attribute name="from">
195
+ <data type="IDREF"/>
196
+ </attribute>
197
+ <optional>
198
+ <attribute name="to">
199
+ <data type="IDREF"/>
200
+ </attribute>
201
+ </optional>
202
+ <optional>
203
+ <attribute name="display"/>
204
+ </optional>
205
+ <oneOrMore>
206
+ <ref name="paragraph"/>
207
+ </oneOrMore>
208
+ </element>
209
+ </define>
210
+ <define name="note">
211
+ <element name="note">
212
+ <attribute name="id">
213
+ <data type="ID"/>
214
+ </attribute>
215
+ <optional>
216
+ <attribute name="removeInRFC"/>
217
+ </optional>
218
+ <optional>
219
+ <ref name="tname"/>
220
+ </optional>
221
+ <oneOrMore>
222
+ <ref name="paragraph"/>
223
+ </oneOrMore>
224
+ </element>
225
+ </define>
226
+ <define name="pre">
227
+ <element name="pre">
228
+ <attribute name="id">
229
+ <data type="ID"/>
230
+ </attribute>
231
+ <optional>
232
+ <attribute name="alt"/>
233
+ </optional>
234
+ <optional>
235
+ <attribute name="align"/>
236
+ </optional>
237
+ <optional>
238
+ <ref name="tname"/>
239
+ </optional>
240
+ <text/>
241
+ <zeroOrMore>
242
+ <ref name="note"/>
243
+ </zeroOrMore>
244
+ </element>
245
+ </define>
246
+ <define name="image">
247
+ <element name="image">
248
+ <attribute name="id">
249
+ <data type="ID"/>
250
+ </attribute>
251
+ <attribute name="src">
252
+ <data type="anyURI"/>
253
+ </attribute>
254
+ <attribute name="mimetype"/>
255
+ <optional>
256
+ <attribute name="filename"/>
257
+ </optional>
258
+ <optional>
259
+ <attribute name="width">
260
+ <choice>
261
+ <data type="int"/>
262
+ <value>auto</value>
263
+ </choice>
264
+ </attribute>
265
+ </optional>
266
+ <optional>
267
+ <attribute name="height">
268
+ <choice>
269
+ <data type="int"/>
270
+ <value>auto</value>
271
+ </choice>
272
+ </attribute>
273
+ </optional>
274
+ <optional>
275
+ <attribute name="alt"/>
276
+ </optional>
277
+ <optional>
278
+ <attribute name="title"/>
279
+ </optional>
280
+ <optional>
281
+ <attribute name="longdesc">
282
+ <data type="anyURI"/>
283
+ </attribute>
284
+ </optional>
285
+ <optional>
286
+ <attribute name="align"/>
287
+ </optional>
288
+ </element>
289
+ </define>
290
+ <define name="sourcecode">
291
+ <element name="sourcecode">
292
+ <attribute name="id">
293
+ <data type="ID"/>
294
+ </attribute>
295
+ <optional>
296
+ <attribute name="unnumbered">
297
+ <data type="boolean"/>
298
+ </attribute>
299
+ </optional>
300
+ <optional>
301
+ <attribute name="subsequence"/>
302
+ </optional>
303
+ <optional>
304
+ <attribute name="lang"/>
305
+ </optional>
306
+ <optional>
307
+ <attribute name="markers"/>
308
+ </optional>
309
+ <optional>
310
+ <ref name="tname"/>
311
+ </optional>
312
+ <oneOrMore>
313
+ <choice>
314
+ <text/>
315
+ <ref name="callout"/>
316
+ </choice>
317
+ </oneOrMore>
318
+ <zeroOrMore>
319
+ <ref name="annotation"/>
320
+ </zeroOrMore>
321
+ <zeroOrMore>
322
+ <ref name="note"/>
323
+ </zeroOrMore>
324
+ </element>
325
+ </define>
326
+ <define name="xref">
327
+ <element name="xref">
328
+ <attribute name="target">
329
+ <data type="IDREF"/>
330
+ </attribute>
331
+ <optional>
332
+ <attribute name="type">
333
+ <ref name="ReferenceFormat"/>
334
+ </attribute>
335
+ </optional>
336
+ <optional>
337
+ <attribute name="alt"/>
338
+ </optional>
339
+ <optional>
340
+ <attribute name="format"/>
341
+ </optional>
342
+ <text/>
343
+ </element>
344
+ </define>
345
+ <define name="erefType">
346
+ <optional>
347
+ <attribute name="normative">
348
+ <data type="boolean"/>
349
+ </attribute>
350
+ </optional>
351
+ <attribute name="citeas"/>
352
+ <attribute name="type">
353
+ <ref name="ReferenceFormat"/>
354
+ </attribute>
355
+ <optional>
356
+ <attribute name="alt"/>
357
+ </optional>
358
+ <optional>
359
+ <attribute name="displayFormat"/>
360
+ </optional>
361
+ <optional>
362
+ <attribute name="relative"/>
363
+ </optional>
364
+ <ref name="CitationType"/>
365
+ <text/>
366
+ </define>
367
+ <define name="quote-source">
368
+ <element name="source">
369
+ <ref name="erefTypeURI"/>
370
+ </element>
371
+ </define>
372
+ <define name="table">
373
+ <element name="table">
374
+ <attribute name="id">
375
+ <data type="ID"/>
376
+ </attribute>
377
+ <optional>
378
+ <attribute name="unnumbered">
379
+ <data type="boolean"/>
380
+ </attribute>
381
+ </optional>
382
+ <optional>
383
+ <attribute name="subsequence"/>
384
+ </optional>
385
+ <optional>
386
+ <attribute name="alt"/>
387
+ </optional>
388
+ <optional>
389
+ <attribute name="summary"/>
390
+ </optional>
391
+ <optional>
392
+ <attribute name="uri">
393
+ <data type="anyURI"/>
394
+ </attribute>
395
+ </optional>
396
+ <optional>
397
+ <attribute name="align"/>
398
+ </optional>
399
+ <optional>
400
+ <ref name="tname"/>
401
+ </optional>
402
+ <optional>
403
+ <ref name="thead"/>
404
+ </optional>
405
+ <ref name="tbody"/>
406
+ <optional>
407
+ <ref name="tfoot"/>
408
+ </optional>
409
+ <zeroOrMore>
410
+ <ref name="table-note"/>
411
+ </zeroOrMore>
412
+ <optional>
413
+ <ref name="dl"/>
414
+ </optional>
415
+ </element>
416
+ </define>
417
+ <define name="Clause-Section">
418
+ <optional>
419
+ <attribute name="id">
420
+ <data type="ID"/>
421
+ </attribute>
422
+ </optional>
423
+ <optional>
424
+ <attribute name="language"/>
425
+ </optional>
426
+ <optional>
427
+ <attribute name="script"/>
428
+ </optional>
429
+ <optional>
430
+ <attribute name="numbered"/>
431
+ </optional>
432
+ <optional>
433
+ <attribute name="removeInRFC"/>
434
+ </optional>
435
+ <optional>
436
+ <attribute name="toc"/>
437
+ </optional>
438
+ <optional>
439
+ <attribute name="inline-header">
440
+ <data type="boolean"/>
441
+ </attribute>
442
+ </optional>
443
+ <attribute name="obligation">
444
+ <choice>
445
+ <value>normative</value>
446
+ <value>informative</value>
447
+ </choice>
448
+ </attribute>
449
+ <optional>
450
+ <ref name="section-title"/>
451
+ </optional>
452
+ <group>
453
+ <group>
454
+ <zeroOrMore>
455
+ <ref name="BasicBlock"/>
456
+ </zeroOrMore>
457
+ <zeroOrMore>
458
+ <ref name="note"/>
459
+ </zeroOrMore>
460
+ </group>
461
+ <zeroOrMore>
462
+ <choice>
463
+ <ref name="clause-subsection"/>
464
+ <ref name="terms"/>
465
+ <ref name="definitions"/>
466
+ </choice>
467
+ </zeroOrMore>
468
+ </group>
469
+ </define>
470
+ <define name="annex">
471
+ <element name="annex">
472
+ <optional>
473
+ <attribute name="id">
474
+ <data type="ID"/>
475
+ </attribute>
476
+ </optional>
477
+ <optional>
478
+ <attribute name="language"/>
479
+ </optional>
480
+ <optional>
481
+ <attribute name="script"/>
482
+ </optional>
483
+ <attribute name="obligation">
484
+ <choice>
485
+ <value>normative</value>
486
+ <value>informative</value>
487
+ </choice>
488
+ </attribute>
489
+ <optional>
490
+ <attribute name="numbered"/>
491
+ </optional>
492
+ <optional>
493
+ <attribute name="removeInRFC"/>
494
+ </optional>
495
+ <optional>
496
+ <attribute name="toc"/>
497
+ </optional>
498
+ <optional>
499
+ <ref name="section-title"/>
500
+ </optional>
501
+ <group>
502
+ <group>
503
+ <zeroOrMore>
504
+ <ref name="BasicBlock"/>
505
+ </zeroOrMore>
506
+ <zeroOrMore>
507
+ <ref name="note"/>
508
+ </zeroOrMore>
509
+ </group>
510
+ <zeroOrMore>
511
+ <ref name="clause-subsection"/>
512
+ </zeroOrMore>
513
+ </group>
514
+ </element>
515
+ </define>
516
+ <define name="Content-Section">
517
+ <optional>
518
+ <attribute name="id">
519
+ <data type="ID"/>
520
+ </attribute>
521
+ </optional>
522
+ <optional>
523
+ <attribute name="language"/>
524
+ </optional>
525
+ <optional>
526
+ <attribute name="script"/>
527
+ </optional>
528
+ <optional>
529
+ <attribute name="numbered"/>
530
+ </optional>
531
+ <optional>
532
+ <attribute name="removeInRFC"/>
533
+ </optional>
534
+ <optional>
535
+ <attribute name="toc"/>
536
+ </optional>
537
+ <optional>
538
+ <ref name="section-title"/>
539
+ </optional>
540
+ <group>
541
+ <group>
542
+ <zeroOrMore>
543
+ <ref name="BasicBlock"/>
544
+ </zeroOrMore>
545
+ <zeroOrMore>
546
+ <ref name="note"/>
547
+ </zeroOrMore>
548
+ </group>
549
+ <zeroOrMore>
550
+ <ref name="content-subsection"/>
551
+ </zeroOrMore>
552
+ </group>
553
+ </define>
554
+ <define name="editorialgroup">
555
+ <element name="editorialgroup">
556
+ <zeroOrMore>
557
+ <ref name="committee"/>
558
+ </zeroOrMore>
559
+ </element>
560
+ </define>
561
+ </include>
562
+ <define name="TextElement" combine="choice">
563
+ <ref name="bcp14"/>
564
+ </define>
565
+ <define name="bcp14">
566
+ <element name="bcp14">
567
+ <text/>
568
+ </element>
569
+ </define>
570
+ <define name="committee">
571
+ <element name="committee">
572
+ <ref name="IsoWorkgroup"/>
573
+ </element>
574
+ </define>
575
+ <define name="area">
576
+ <element name="area">
577
+ <choice>
578
+ <value>art</value>
579
+ <value>gen</value>
580
+ <value>int</value>
581
+ <value>ops</value>
582
+ <value>rtg</value>
583
+ <value>sec</value>
584
+ <value>tsv</value>
585
+ <value>Applications and Real-Time</value>
586
+ <value>General</value>
587
+ <value>Internet</value>
588
+ <value>Operations and Management</value>
589
+ <value>Routing</value>
590
+ <value>Security</value>
591
+ <value>Transport</value>
592
+ </choice>
593
+ </element>
594
+ </define>
595
+ <define name="comment">
596
+ <element name="comment">
597
+ <text/>
598
+ </element>
599
+ </define>
600
+ <define name="ipr">
601
+ <element name="ipr">
602
+ <text/>
603
+ </element>
604
+ </define>
605
+ <define name="consensus">
606
+ <element name="consensus">
607
+ <text/>
608
+ </element>
609
+ </define>
610
+ <define name="index-include">
611
+ <element name="indexInclude">
612
+ <text/>
613
+ </element>
614
+ </define>
615
+ <define name="ipr-extract">
616
+ <element name="iprExtract">
617
+ <text/>
618
+ </element>
619
+ </define>
620
+ <define name="sort-refs">
621
+ <element name="sortRefs">
622
+ <text/>
623
+ </element>
624
+ </define>
625
+ <define name="sym-refs">
626
+ <element name="symRefs">
627
+ <text/>
628
+ </element>
629
+ </define>
630
+ <define name="toc-include">
631
+ <element name="tocInclude">
632
+ <text/>
633
+ </element>
634
+ </define>
635
+ <define name="toc-depth">
636
+ <element name="tocDepth">
637
+ <text/>
638
+ </element>
639
+ </define>
640
+ <define name="show-on-front-page">
641
+ <element name="showOnFrontPage">
642
+ <text/>
643
+ </element>
644
+ </define>
645
+ <define name="processing-instructions">
646
+ <element name="pi">
647
+ <optional>
648
+ <element name="artworkdelimiter">
649
+ <text/>
650
+ </element>
651
+ </optional>
652
+ <optional>
653
+ <element name="artworklines">
654
+ <text/>
655
+ </element>
656
+ </optional>
657
+ <optional>
658
+ <element name="authorship">
659
+ <text/>
660
+ </element>
661
+ </optional>
662
+ <optional>
663
+ <element name="autobreaks">
664
+ <text/>
665
+ </element>
666
+ </optional>
667
+ <optional>
668
+ <element name="background">
669
+ <text/>
670
+ </element>
671
+ </optional>
672
+ <optional>
673
+ <element name="colonspace">
674
+ <text/>
675
+ </element>
676
+ </optional>
677
+ <optional>
678
+ <element name="comments">
679
+ <text/>
680
+ </element>
681
+ </optional>
682
+ <optional>
683
+ <element name="docmapping">
684
+ <text/>
685
+ </element>
686
+ </optional>
687
+ <optional>
688
+ <element name="editing">
689
+ <text/>
690
+ </element>
691
+ </optional>
692
+ <optional>
693
+ <element name="emoticonic">
694
+ <text/>
695
+ </element>
696
+ </optional>
697
+ <optional>
698
+ <element name="footer">
699
+ <text/>
700
+ </element>
701
+ </optional>
702
+ <optional>
703
+ <element name="header">
704
+ <text/>
705
+ </element>
706
+ </optional>
707
+ <optional>
708
+ <element name="inline">
709
+ <text/>
710
+ </element>
711
+ </optional>
712
+ <optional>
713
+ <element name="iprnotified">
714
+ <text/>
715
+ </element>
716
+ </optional>
717
+ <optional>
718
+ <element name="linkmailto">
719
+ <text/>
720
+ </element>
721
+ </optional>
722
+ <optional>
723
+ <element name="linefile">
724
+ <text/>
725
+ </element>
726
+ </optional>
727
+ <optional>
728
+ <element name="notedraftinprogress">
729
+ <text/>
730
+ </element>
731
+ </optional>
732
+ <optional>
733
+ <element name="private">
734
+ <text/>
735
+ </element>
736
+ </optional>
737
+ <optional>
738
+ <element name="refparent">
739
+ <text/>
740
+ </element>
741
+ </optional>
742
+ <optional>
743
+ <element name="rfcedstyle">
744
+ <text/>
745
+ </element>
746
+ </optional>
747
+ <optional>
748
+ <element name="slides">
749
+ <text/>
750
+ </element>
751
+ </optional>
752
+ <optional>
753
+ <element name="text-list-symbols">
754
+ <text/>
755
+ </element>
756
+ </optional>
757
+ <optional>
758
+ <element name="tocappendix">
759
+ <text/>
760
+ </element>
761
+ </optional>
762
+ <optional>
763
+ <element name="tocindent">
764
+ <text/>
765
+ </element>
766
+ </optional>
767
+ <optional>
768
+ <element name="tocnarrow">
769
+ <text/>
770
+ </element>
771
+ </optional>
772
+ <optional>
773
+ <element name="tocompact">
774
+ <text/>
775
+ </element>
776
+ </optional>
777
+ <optional>
778
+ <element name="topblock">
779
+ <text/>
780
+ </element>
781
+ </optional>
782
+ <optional>
783
+ <element name="useobject">
784
+ <text/>
785
+ </element>
786
+ </optional>
787
+ <optional>
788
+ <element name="strict">
789
+ <text/>
790
+ </element>
791
+ </optional>
792
+ <optional>
793
+ <element name="compact">
794
+ <text/>
795
+ </element>
796
+ </optional>
797
+ <optional>
798
+ <element name="subcompact">
799
+ <text/>
800
+ </element>
801
+ </optional>
802
+ <optional>
803
+ <element name="toc">
804
+ <text/>
805
+ </element>
806
+ </optional>
807
+ <optional>
808
+ <element name="tocdepth">
809
+ <text/>
810
+ </element>
811
+ </optional>
812
+ <optional>
813
+ <element name="symrefs">
814
+ <text/>
815
+ </element>
816
+ </optional>
817
+ <optional>
818
+ <element name="sortrefs">
819
+ <text/>
820
+ </element>
821
+ </optional>
822
+ </element>
823
+ </define>
824
+ <define name="erefTypeURI">
825
+ <optional>
826
+ <attribute name="normative">
827
+ <data type="boolean"/>
828
+ </attribute>
829
+ </optional>
830
+ <optional>
831
+ <attribute name="citeas"/>
832
+ </optional>
833
+ <attribute name="type">
834
+ <ref name="ReferenceFormat"/>
835
+ </attribute>
836
+ <optional>
837
+ <attribute name="alt"/>
838
+ </optional>
839
+ <optional>
840
+ <attribute name="displayFormat"/>
841
+ </optional>
842
+ <optional>
843
+ <attribute name="relative"/>
844
+ </optional>
845
+ <optional>
846
+ <attribute name="bibitemid">
847
+ <data type="IDREF"/>
848
+ </attribute>
849
+ </optional>
850
+ <optional>
851
+ <attribute name="uri">
852
+ <data type="anyURI"/>
853
+ </attribute>
854
+ </optional>
855
+ <zeroOrMore>
856
+ <ref name="locality"/>
857
+ </zeroOrMore>
858
+ <optional>
859
+ <ref name="date"/>
860
+ </optional>
861
+ <text/>
862
+ </define>
863
+ <define name="ietf-standard">
864
+ <element name="ietf-standard">
865
+ <ref name="bibdata"/>
866
+ <zeroOrMore>
867
+ <ref name="termdocsource"/>
868
+ </zeroOrMore>
869
+ <optional>
870
+ <ref name="boilerplate"/>
871
+ </optional>
872
+ <ref name="preface"/>
873
+ <oneOrMore>
874
+ <ref name="sections"/>
875
+ </oneOrMore>
876
+ <zeroOrMore>
877
+ <ref name="annex"/>
878
+ </zeroOrMore>
879
+ <ref name="bibliography"/>
880
+ </element>
881
+ </define>
882
+ </grammar>