rfcxml 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/roundtrip.yml +79 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +9 -3
- data/.rubocop_todo.yml +87 -17
- data/Gemfile +4 -2
- data/README.adoc +386 -18
- data/Rakefile +55 -0
- data/lib/rfcxml/v3/abstract.rb +2 -6
- data/lib/rfcxml/v3/address.rb +2 -7
- data/lib/rfcxml/v3/annotation.rb +2 -15
- data/lib/rfcxml/v3/area.rb +1 -1
- data/lib/rfcxml/v3/artset.rb +2 -3
- data/lib/rfcxml/v3/artwork.rb +13 -10
- data/lib/rfcxml/v3/aside.rb +2 -12
- data/lib/rfcxml/v3/author.rb +16 -12
- data/lib/rfcxml/v3/back.rb +2 -5
- data/lib/rfcxml/v3/bcp14.rb +1 -1
- data/lib/rfcxml/v3/blockquote.rb +2 -26
- data/lib/rfcxml/v3/boilerplate.rb +2 -3
- data/lib/rfcxml/v3/br.rb +1 -1
- data/lib/rfcxml/v3/c.rb +2 -7
- data/lib/rfcxml/v3/city.rb +1 -1
- data/lib/rfcxml/v3/cityarea.rb +1 -1
- data/lib/rfcxml/v3/code.rb +1 -1
- data/lib/rfcxml/v3/contact.rb +2 -4
- data/lib/rfcxml/v3/country.rb +1 -1
- data/lib/rfcxml/v3/cref.rb +2 -11
- data/lib/rfcxml/v3/date.rb +4 -4
- data/lib/rfcxml/v3/dd.rb +2 -25
- data/lib/rfcxml/v3/displayreference.rb +1 -1
- data/lib/rfcxml/v3/dl.rb +2 -7
- data/lib/rfcxml/v3/dt.rb +2 -14
- data/lib/rfcxml/v3/email.rb +1 -1
- data/lib/rfcxml/v3/eref.rb +1 -1
- data/lib/rfcxml/v3/extaddr.rb +1 -1
- data/lib/rfcxml/v3/facsimile.rb +1 -1
- data/lib/rfcxml/v3/figure.rb +17 -19
- data/lib/rfcxml/v3/format.rb +1 -1
- data/lib/rfcxml/v3/front.rb +2 -13
- data/lib/rfcxml/v3/iref.rb +4 -3
- data/lib/rfcxml/v3/keyword.rb +1 -1
- data/lib/rfcxml/v3/li.rb +2 -28
- data/lib/rfcxml/v3/link.rb +1 -1
- data/lib/rfcxml/v3/list.rb +3 -4
- data/lib/rfcxml/v3/middle.rb +2 -3
- data/lib/rfcxml/v3/name.rb +2 -14
- data/lib/rfcxml/v3/note.rb +2 -7
- data/lib/rfcxml/v3/ol.rb +5 -4
- data/lib/rfcxml/v3/organization.rb +10 -5
- data/lib/rfcxml/v3/phone.rb +1 -1
- data/lib/rfcxml/v3/pobox.rb +1 -1
- data/lib/rfcxml/v3/postal.rb +2 -12
- data/lib/rfcxml/v3/postal_line.rb +1 -1
- data/lib/rfcxml/v3/postamble.rb +2 -7
- data/lib/rfcxml/v3/preamble.rb +2 -15
- data/lib/rfcxml/v3/refcontent.rb +2 -4
- data/lib/rfcxml/v3/reference.rb +7 -10
- data/lib/rfcxml/v3/referencegroup.rb +2 -3
- data/lib/rfcxml/v3/references.rb +2 -5
- data/lib/rfcxml/v3/region.rb +1 -1
- data/lib/rfcxml/v3/relref.rb +1 -1
- data/lib/rfcxml/v3/rfc.rb +62 -14
- data/lib/rfcxml/v3/section.rb +11 -21
- data/lib/rfcxml/v3/series_info.rb +5 -4
- data/lib/rfcxml/v3/sortingcode.rb +1 -1
- data/lib/rfcxml/v3/sourcecode.rb +13 -9
- data/lib/rfcxml/v3/spanx.rb +1 -1
- data/lib/rfcxml/v3/street.rb +1 -1
- data/lib/rfcxml/v3/strong.rb +6 -8
- data/lib/rfcxml/v3/sub.rb +6 -15
- data/lib/rfcxml/v3/sup.rb +2 -3
- data/lib/rfcxml/v3/table.rb +1 -7
- data/lib/rfcxml/v3/tbody.rb +1 -3
- data/lib/rfcxml/v3/td.rb +23 -26
- data/lib/rfcxml/v3/text.rb +2 -20
- data/lib/rfcxml/v3/texttable.rb +12 -12
- data/lib/rfcxml/v3/tfoot.rb +1 -3
- data/lib/rfcxml/v3/th.rb +1 -3
- data/lib/rfcxml/v3/thead.rb +1 -3
- data/lib/rfcxml/v3/title.rb +3 -4
- data/lib/rfcxml/v3/toc.rb +1 -3
- data/lib/rfcxml/v3/tr.rb +3 -4
- data/lib/rfcxml/v3/tt.rb +5 -19
- data/lib/rfcxml/v3/ttcol.rb +4 -7
- data/lib/rfcxml/v3/u.rb +1 -1
- data/lib/rfcxml/v3/ul.rb +10 -6
- data/lib/rfcxml/v3/uri.rb +1 -1
- data/lib/rfcxml/v3/vspace.rb +1 -1
- data/lib/rfcxml/v3/workgroup.rb +1 -1
- data/lib/rfcxml/v3/xref.rb +2 -3
- data/lib/rfcxml/v3/xref_text.rb +7 -16
- data/lib/rfcxml/v3.rb +100 -2
- data/lib/rfcxml/version.rb +1 -1
- data/lib/rfcxml.rb +3 -4
- data/rfcxml.gemspec +3 -2
- data/scripts/README.md +110 -0
- data/scripts/roundtrip_test.rb +361 -0
- metadata +9 -6
- data/lib/rfcxml/v3/em.rb +0 -14
data/Rakefile
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require "bundler/gem_tasks"
|
|
4
4
|
require "rspec/core/rake_task"
|
|
5
|
+
require "open-uri"
|
|
6
|
+
require "rubygems/package"
|
|
7
|
+
require "zlib"
|
|
8
|
+
require "fileutils"
|
|
5
9
|
|
|
6
10
|
RSpec::Core::RakeTask.new(:spec)
|
|
7
11
|
|
|
@@ -10,3 +14,54 @@ require "rubocop/rake_task"
|
|
|
10
14
|
RuboCop::RakeTask.new
|
|
11
15
|
|
|
12
16
|
task default: %i[spec rubocop]
|
|
17
|
+
|
|
18
|
+
RFC_XML_URL = "https://www.rfc-editor.org/in-notes/tar/xmlsource-all.tar.gz"
|
|
19
|
+
RFC_XML_DIR = File.expand_path("spec/fixtures/xmlsource", __dir__)
|
|
20
|
+
RFC_XML_TAR = File.expand_path("tmp/xmlsource-all.tar.gz", __dir__)
|
|
21
|
+
|
|
22
|
+
namespace :rfc do
|
|
23
|
+
desc "Download and extract RFC XML files from rfc-editor.org"
|
|
24
|
+
task :download do
|
|
25
|
+
FileUtils.mkdir_p(RFC_XML_DIR)
|
|
26
|
+
FileUtils.mkdir_p(File.dirname(RFC_XML_TAR))
|
|
27
|
+
|
|
28
|
+
# Download tarball if not exists
|
|
29
|
+
unless File.exist?(RFC_XML_TAR)
|
|
30
|
+
puts "Downloading RFC XML tarball from #{RFC_XML_URL}..."
|
|
31
|
+
URI.open(RFC_XML_URL) do |remote|
|
|
32
|
+
File.binwrite(RFC_XML_TAR, remote.read)
|
|
33
|
+
end
|
|
34
|
+
puts "Downloaded to #{RFC_XML_TAR}"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Extract tarball
|
|
38
|
+
puts "Extracting to #{RFC_XML_DIR}..."
|
|
39
|
+
tar_extract = Gem::Package::TarReader.new(Zlib::GzipReader.open(RFC_XML_TAR))
|
|
40
|
+
tar_extract.rewind
|
|
41
|
+
tar_extract.each do |entry|
|
|
42
|
+
next unless entry.file? && entry.full_name.end_with?(".xml")
|
|
43
|
+
|
|
44
|
+
# Extract only the filename, flatten directory structure
|
|
45
|
+
filename = File.basename(entry.full_name)
|
|
46
|
+
target_path = File.join(RFC_XML_DIR, filename)
|
|
47
|
+
|
|
48
|
+
File.binwrite(target_path, entry.read)
|
|
49
|
+
end
|
|
50
|
+
tar_extract.close
|
|
51
|
+
|
|
52
|
+
xml_count = Dir.glob(File.join(RFC_XML_DIR, "*.xml")).count
|
|
53
|
+
puts "Done! Extracted #{xml_count} XML files to #{RFC_XML_DIR}"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
desc "Clean downloaded RFC XML files"
|
|
57
|
+
task :clean do
|
|
58
|
+
puts "Removing #{RFC_XML_DIR}..."
|
|
59
|
+
FileUtils.rm_rf(RFC_XML_DIR)
|
|
60
|
+
puts "Removing #{RFC_XML_TAR}..."
|
|
61
|
+
FileUtils.rm_f(RFC_XML_TAR)
|
|
62
|
+
puts "Done!"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
desc "Re-download RFC XML files (clean + download)"
|
|
66
|
+
task redownload: %i[clean download]
|
|
67
|
+
end
|
data/lib/rfcxml/v3/abstract.rb
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "dl"
|
|
6
|
-
require_relative "ol"
|
|
7
|
-
require_relative "text"
|
|
8
|
-
require_relative "ul"
|
|
9
|
-
|
|
10
5
|
module Rfcxml
|
|
11
6
|
module V3
|
|
12
7
|
class Abstract < Lutaml::Model::Serializable
|
|
@@ -18,7 +13,8 @@ module Rfcxml
|
|
|
18
13
|
attribute :ul, Ul, collection: true
|
|
19
14
|
|
|
20
15
|
xml do
|
|
21
|
-
|
|
16
|
+
element "abstract"
|
|
17
|
+
ordered
|
|
22
18
|
|
|
23
19
|
map_attribute "anchor", to: :anchor
|
|
24
20
|
map_attribute "pn", to: :pn
|
data/lib/rfcxml/v3/address.rb
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "email"
|
|
6
|
-
require_relative "facsimile"
|
|
7
|
-
require_relative "phone"
|
|
8
|
-
require_relative "postal"
|
|
9
|
-
require_relative "uri"
|
|
10
|
-
|
|
11
5
|
module Rfcxml
|
|
12
6
|
module V3
|
|
13
7
|
class Address < Lutaml::Model::Serializable
|
|
@@ -18,7 +12,8 @@ module Rfcxml
|
|
|
18
12
|
attribute :uri, Uri
|
|
19
13
|
|
|
20
14
|
xml do
|
|
21
|
-
|
|
15
|
+
element "address"
|
|
16
|
+
ordered
|
|
22
17
|
|
|
23
18
|
map_element "postal", to: :postal
|
|
24
19
|
map_element "phone", to: :phone
|
data/lib/rfcxml/v3/annotation.rb
CHANGED
|
@@ -2,20 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "bcp14"
|
|
6
|
-
require_relative "cref"
|
|
7
|
-
require_relative "em"
|
|
8
|
-
require_relative "eref"
|
|
9
|
-
require_relative "iref"
|
|
10
|
-
require_relative "relref"
|
|
11
|
-
require_relative "spanx"
|
|
12
|
-
require_relative "strong"
|
|
13
|
-
require_relative "sub"
|
|
14
|
-
require_relative "sup"
|
|
15
|
-
require_relative "tt"
|
|
16
|
-
require_relative "u"
|
|
17
|
-
require_relative "xref"
|
|
18
|
-
|
|
19
5
|
module Rfcxml
|
|
20
6
|
module V3
|
|
21
7
|
class Annotation < Lutaml::Model::Serializable
|
|
@@ -35,7 +21,8 @@ module Rfcxml
|
|
|
35
21
|
attribute :xref, Xref, collection: true
|
|
36
22
|
|
|
37
23
|
xml do
|
|
38
|
-
|
|
24
|
+
element "annotation"
|
|
25
|
+
mixed_content
|
|
39
26
|
|
|
40
27
|
map_content to: :content
|
|
41
28
|
map_element "bcp14", to: :bcp14
|
data/lib/rfcxml/v3/area.rb
CHANGED
data/lib/rfcxml/v3/artset.rb
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "artwork"
|
|
6
|
-
|
|
7
5
|
module Rfcxml
|
|
8
6
|
module V3
|
|
9
7
|
class Artset < Lutaml::Model::Serializable
|
|
@@ -12,7 +10,8 @@ module Rfcxml
|
|
|
12
10
|
attribute :artwork, Artwork, collection: true
|
|
13
11
|
|
|
14
12
|
xml do
|
|
15
|
-
|
|
13
|
+
element "artset"
|
|
14
|
+
ordered
|
|
16
15
|
|
|
17
16
|
map_attribute "anchor", to: :anchor
|
|
18
17
|
map_attribute "pn", to: :pn
|
data/lib/rfcxml/v3/artwork.rb
CHANGED
|
@@ -8,19 +8,21 @@ module Rfcxml
|
|
|
8
8
|
attribute :content, :string
|
|
9
9
|
attribute :anchor, :string
|
|
10
10
|
attribute :pn, :string
|
|
11
|
-
attribute :name, :string
|
|
12
|
-
attribute :type, :string
|
|
11
|
+
attribute :name, :string
|
|
12
|
+
attribute :type, :string
|
|
13
13
|
attribute :src, :string
|
|
14
|
-
attribute :align, :string,
|
|
15
|
-
attribute :alt, :string
|
|
16
|
-
attribute :width, :string
|
|
17
|
-
attribute :height, :string
|
|
14
|
+
attribute :align, :string, values: %w[left center right]
|
|
15
|
+
attribute :alt, :string
|
|
16
|
+
attribute :width, :string
|
|
17
|
+
attribute :height, :string
|
|
18
18
|
attribute :original_src, :string
|
|
19
19
|
|
|
20
20
|
xml do
|
|
21
|
-
|
|
21
|
+
element "artwork"
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
# Use map_all to capture both text content AND child elements like <svg>
|
|
24
|
+
# map_content only captures text nodes, not child elements
|
|
25
|
+
map_all to: :content
|
|
24
26
|
map_attribute "anchor", to: :anchor
|
|
25
27
|
map_attribute "pn", to: :pn
|
|
26
28
|
map_attribute "name", to: :name, value_map: { to: { empty: :empty } }
|
|
@@ -28,8 +30,9 @@ module Rfcxml
|
|
|
28
30
|
map_attribute "src", to: :src
|
|
29
31
|
map_attribute "align", to: :align
|
|
30
32
|
map_attribute "alt", to: :alt, value_map: { to: { empty: :empty } }
|
|
31
|
-
map_attribute "width", to: :width
|
|
32
|
-
map_attribute "height", to: :height
|
|
33
|
+
map_attribute "width", to: :width, value_map: { to: { empty: :empty } }
|
|
34
|
+
map_attribute "height", to: :height,
|
|
35
|
+
value_map: { to: { empty: :empty } }
|
|
33
36
|
map_attribute "originalSrc", to: :original_src
|
|
34
37
|
end
|
|
35
38
|
end
|
data/lib/rfcxml/v3/aside.rb
CHANGED
|
@@ -2,17 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "artset"
|
|
6
|
-
require_relative "artwork"
|
|
7
|
-
require_relative "blockquote"
|
|
8
|
-
require_relative "dl"
|
|
9
|
-
require_relative "figure"
|
|
10
|
-
require_relative "iref"
|
|
11
|
-
require_relative "ol"
|
|
12
|
-
require_relative "text"
|
|
13
|
-
require_relative "table"
|
|
14
|
-
require_relative "ul"
|
|
15
|
-
|
|
16
5
|
module Rfcxml
|
|
17
6
|
module V3
|
|
18
7
|
class Aside < Lutaml::Model::Serializable
|
|
@@ -30,7 +19,8 @@ module Rfcxml
|
|
|
30
19
|
attribute :ul, Ul, collection: true
|
|
31
20
|
|
|
32
21
|
xml do
|
|
33
|
-
|
|
22
|
+
element "aside"
|
|
23
|
+
ordered
|
|
34
24
|
|
|
35
25
|
map_attribute "anchor", to: :anchor
|
|
36
26
|
map_attribute "pn", to: :pn
|
data/lib/rfcxml/v3/author.rb
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "address"
|
|
6
|
-
require_relative "organization"
|
|
7
|
-
|
|
8
5
|
module Rfcxml
|
|
9
6
|
module V3
|
|
10
7
|
class Author < Lutaml::Model::Serializable
|
|
@@ -14,22 +11,29 @@ module Rfcxml
|
|
|
14
11
|
attribute :surname, :string
|
|
15
12
|
attribute :ascii_surname, :string
|
|
16
13
|
attribute :fullname, :string
|
|
17
|
-
attribute :role, :string
|
|
14
|
+
attribute :role, :string, values: %w[editor]
|
|
18
15
|
attribute :ascii_fullname, :string
|
|
19
16
|
attribute :organization, Organization
|
|
20
17
|
attribute :address, Address
|
|
21
18
|
|
|
22
19
|
xml do
|
|
23
|
-
|
|
20
|
+
element "author"
|
|
21
|
+
ordered
|
|
24
22
|
|
|
25
23
|
map_attribute "anchor", to: :anchor
|
|
26
|
-
map_attribute "initials", to: :initials
|
|
27
|
-
|
|
28
|
-
map_attribute "
|
|
29
|
-
|
|
30
|
-
map_attribute "
|
|
31
|
-
|
|
32
|
-
map_attribute "
|
|
24
|
+
map_attribute "initials", to: :initials,
|
|
25
|
+
value_map: { to: { empty: :empty } }
|
|
26
|
+
map_attribute "asciiInitials", to: :ascii_initials,
|
|
27
|
+
value_map: { to: { empty: :empty } }
|
|
28
|
+
map_attribute "surname", to: :surname,
|
|
29
|
+
value_map: { to: { empty: :empty } }
|
|
30
|
+
map_attribute "asciiSurname", to: :ascii_surname,
|
|
31
|
+
value_map: { to: { empty: :empty } }
|
|
32
|
+
map_attribute "fullname", to: :fullname,
|
|
33
|
+
value_map: { to: { empty: :empty } }
|
|
34
|
+
map_attribute "role", to: :role, value_map: { to: { empty: :empty } }
|
|
35
|
+
map_attribute "asciiFullname", to: :ascii_fullname,
|
|
36
|
+
value_map: { to: { empty: :empty } }
|
|
33
37
|
map_element "organization", to: :organization
|
|
34
38
|
map_element "address", to: :address
|
|
35
39
|
end
|
data/lib/rfcxml/v3/back.rb
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "displayreference"
|
|
6
|
-
require_relative "references"
|
|
7
|
-
require_relative "section"
|
|
8
|
-
|
|
9
5
|
module Rfcxml
|
|
10
6
|
module V3
|
|
11
7
|
class Back < Lutaml::Model::Serializable
|
|
@@ -14,7 +10,8 @@ module Rfcxml
|
|
|
14
10
|
attribute :section, Section, collection: true
|
|
15
11
|
|
|
16
12
|
xml do
|
|
17
|
-
|
|
13
|
+
element "back"
|
|
14
|
+
ordered
|
|
18
15
|
|
|
19
16
|
map_element "displayreference", to: :displayreference
|
|
20
17
|
map_element "references", to: :references
|
data/lib/rfcxml/v3/bcp14.rb
CHANGED
data/lib/rfcxml/v3/blockquote.rb
CHANGED
|
@@ -2,33 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "artset"
|
|
6
|
-
require_relative "artwork"
|
|
7
|
-
require_relative "bcp14"
|
|
8
|
-
require_relative "br"
|
|
9
|
-
require_relative "cref"
|
|
10
|
-
require_relative "dl"
|
|
11
|
-
require_relative "em"
|
|
12
|
-
require_relative "eref"
|
|
13
|
-
require_relative "figure"
|
|
14
|
-
require_relative "iref"
|
|
15
|
-
# require_relative "ol"
|
|
16
|
-
require_relative "relref"
|
|
17
|
-
require_relative "sourcecode"
|
|
18
|
-
require_relative "strong"
|
|
19
|
-
require_relative "sub"
|
|
20
|
-
require_relative "sup"
|
|
21
|
-
require_relative "text"
|
|
22
|
-
require_relative "tt"
|
|
23
|
-
require_relative "u"
|
|
24
|
-
require_relative "ul"
|
|
25
|
-
require_relative "xref"
|
|
26
|
-
|
|
27
5
|
module Rfcxml
|
|
28
6
|
module V3
|
|
29
|
-
class Ol < Lutaml::Model::Serializable; end
|
|
30
|
-
class Dl < Lutaml::Model::Serializable; end
|
|
31
|
-
|
|
32
7
|
class Blockquote < Lutaml::Model::Serializable
|
|
33
8
|
attribute :content, :string
|
|
34
9
|
attribute :anchor, :string
|
|
@@ -58,7 +33,8 @@ module Rfcxml
|
|
|
58
33
|
attribute :xref, Xref, collection: true
|
|
59
34
|
|
|
60
35
|
xml do
|
|
61
|
-
|
|
36
|
+
element "blockquote"
|
|
37
|
+
ordered
|
|
62
38
|
|
|
63
39
|
map_content to: :content
|
|
64
40
|
map_attribute "anchor", to: :anchor
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "section"
|
|
6
|
-
|
|
7
5
|
module Rfcxml
|
|
8
6
|
module V3
|
|
9
7
|
class Boilerplate < Lutaml::Model::Serializable
|
|
10
8
|
attribute :section, Section, collection: true
|
|
11
9
|
|
|
12
10
|
xml do
|
|
13
|
-
|
|
11
|
+
element "boilerplate"
|
|
12
|
+
ordered
|
|
14
13
|
|
|
15
14
|
map_element "section", to: :section
|
|
16
15
|
end
|
data/lib/rfcxml/v3/br.rb
CHANGED
data/lib/rfcxml/v3/c.rb
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "cref"
|
|
6
|
-
require_relative "eref"
|
|
7
|
-
require_relative "iref"
|
|
8
|
-
require_relative "spanx"
|
|
9
|
-
require_relative "xref"
|
|
10
|
-
|
|
11
5
|
module Rfcxml
|
|
12
6
|
module V3
|
|
13
7
|
class C < Lutaml::Model::Serializable
|
|
@@ -19,7 +13,8 @@ module Rfcxml
|
|
|
19
13
|
attribute :xref, Xref, collection: true
|
|
20
14
|
|
|
21
15
|
xml do
|
|
22
|
-
|
|
16
|
+
element "c"
|
|
17
|
+
ordered
|
|
23
18
|
|
|
24
19
|
map_content to: :content
|
|
25
20
|
map_element "cref", to: :cref
|
data/lib/rfcxml/v3/city.rb
CHANGED
data/lib/rfcxml/v3/cityarea.rb
CHANGED
data/lib/rfcxml/v3/code.rb
CHANGED
data/lib/rfcxml/v3/contact.rb
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "address"
|
|
6
|
-
require_relative "organization"
|
|
7
|
-
|
|
8
5
|
module Rfcxml
|
|
9
6
|
module V3
|
|
10
7
|
class Contact < Lutaml::Model::Serializable
|
|
@@ -19,7 +16,8 @@ module Rfcxml
|
|
|
19
16
|
attribute :address, Address
|
|
20
17
|
|
|
21
18
|
xml do
|
|
22
|
-
|
|
19
|
+
element "contact"
|
|
20
|
+
ordered
|
|
23
21
|
|
|
24
22
|
map_attribute "anchor", to: :anchor
|
|
25
23
|
map_attribute "initials", to: :initials
|
data/lib/rfcxml/v3/country.rb
CHANGED
data/lib/rfcxml/v3/cref.rb
CHANGED
|
@@ -2,16 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "br"
|
|
6
|
-
require_relative "em"
|
|
7
|
-
require_relative "eref"
|
|
8
|
-
require_relative "relref"
|
|
9
|
-
require_relative "strong"
|
|
10
|
-
require_relative "sub"
|
|
11
|
-
require_relative "sup"
|
|
12
|
-
require_relative "tt"
|
|
13
|
-
require_relative "xref"
|
|
14
|
-
|
|
15
5
|
module Rfcxml
|
|
16
6
|
module V3
|
|
17
7
|
class Cref < Lutaml::Model::Serializable
|
|
@@ -30,7 +20,8 @@ module Rfcxml
|
|
|
30
20
|
attribute :xref, Xref, collection: true
|
|
31
21
|
|
|
32
22
|
xml do
|
|
33
|
-
|
|
23
|
+
element "cref"
|
|
24
|
+
ordered
|
|
34
25
|
|
|
35
26
|
map_content to: :content
|
|
36
27
|
map_attribute "anchor", to: :anchor
|
data/lib/rfcxml/v3/date.rb
CHANGED
|
@@ -11,12 +11,12 @@ module Rfcxml
|
|
|
11
11
|
attribute :year, :string
|
|
12
12
|
|
|
13
13
|
xml do
|
|
14
|
-
|
|
14
|
+
element "date"
|
|
15
15
|
|
|
16
16
|
map_content to: :content
|
|
17
|
-
map_attribute "day", to: :day
|
|
18
|
-
map_attribute "month", to: :month
|
|
19
|
-
map_attribute "year", to: :year
|
|
17
|
+
map_attribute "day", to: :day, value_map: { to: { empty: :empty } }
|
|
18
|
+
map_attribute "month", to: :month, value_map: { to: { empty: :empty } }
|
|
19
|
+
map_attribute "year", to: :year, value_map: { to: { empty: :empty } }
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
data/lib/rfcxml/v3/dd.rb
CHANGED
|
@@ -2,30 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "artset"
|
|
6
|
-
require_relative "artwork"
|
|
7
|
-
require_relative "aside"
|
|
8
|
-
require_relative "bcp14"
|
|
9
|
-
require_relative "br"
|
|
10
|
-
require_relative "cref"
|
|
11
|
-
require_relative "dl"
|
|
12
|
-
require_relative "em"
|
|
13
|
-
require_relative "eref"
|
|
14
|
-
require_relative "figure"
|
|
15
|
-
require_relative "iref"
|
|
16
|
-
require_relative "ol"
|
|
17
|
-
require_relative "relref"
|
|
18
|
-
require_relative "sourcecode"
|
|
19
|
-
require_relative "strong"
|
|
20
|
-
require_relative "sub"
|
|
21
|
-
require_relative "sup"
|
|
22
|
-
require_relative "text"
|
|
23
|
-
require_relative "table"
|
|
24
|
-
require_relative "tt"
|
|
25
|
-
require_relative "u"
|
|
26
|
-
require_relative "ul"
|
|
27
|
-
require_relative "xref"
|
|
28
|
-
|
|
29
5
|
module Rfcxml
|
|
30
6
|
module V3
|
|
31
7
|
class Dd < Lutaml::Model::Serializable
|
|
@@ -58,7 +34,8 @@ module Rfcxml
|
|
|
58
34
|
attribute :aside, Aside, collection: true
|
|
59
35
|
|
|
60
36
|
xml do
|
|
61
|
-
|
|
37
|
+
element "dd"
|
|
38
|
+
mixed_content
|
|
62
39
|
|
|
63
40
|
map_content to: :content
|
|
64
41
|
map_attribute "anchor", to: :anchor
|
data/lib/rfcxml/v3/dl.rb
CHANGED
|
@@ -2,14 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "dd"
|
|
6
|
-
require_relative "dt"
|
|
7
|
-
|
|
8
5
|
module Rfcxml
|
|
9
6
|
module V3
|
|
10
|
-
# class Dd < Lutaml::Model::Serializable; end
|
|
11
|
-
# class Dt < Lutaml::Model::Serializable; end
|
|
12
|
-
|
|
13
7
|
class Dl < Lutaml::Model::Serializable
|
|
14
8
|
attribute :anchor, :string
|
|
15
9
|
attribute :spacing, :string, default: -> { "normal" }
|
|
@@ -20,7 +14,8 @@ module Rfcxml
|
|
|
20
14
|
attribute :dd, Dd, collection: true
|
|
21
15
|
|
|
22
16
|
xml do
|
|
23
|
-
|
|
17
|
+
element "dl"
|
|
18
|
+
mixed_content
|
|
24
19
|
|
|
25
20
|
map_attribute "anchor", to: :anchor
|
|
26
21
|
map_attribute "spacing", to: :spacing
|
data/lib/rfcxml/v3/dt.rb
CHANGED
|
@@ -2,19 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
|
|
5
|
-
require_relative "bcp14"
|
|
6
|
-
require_relative "br"
|
|
7
|
-
require_relative "cref"
|
|
8
|
-
require_relative "em"
|
|
9
|
-
require_relative "eref"
|
|
10
|
-
require_relative "iref"
|
|
11
|
-
require_relative "relref"
|
|
12
|
-
require_relative "strong"
|
|
13
|
-
require_relative "sub"
|
|
14
|
-
require_relative "sup"
|
|
15
|
-
require_relative "tt"
|
|
16
|
-
require_relative "xref"
|
|
17
|
-
|
|
18
5
|
module Rfcxml
|
|
19
6
|
module V3
|
|
20
7
|
class Dt < Lutaml::Model::Serializable
|
|
@@ -35,7 +22,8 @@ module Rfcxml
|
|
|
35
22
|
attribute :xref, Xref, collection: true
|
|
36
23
|
|
|
37
24
|
xml do
|
|
38
|
-
|
|
25
|
+
element "dt"
|
|
26
|
+
ordered
|
|
39
27
|
|
|
40
28
|
map_content to: :content
|
|
41
29
|
map_attribute "anchor", to: :anchor
|
data/lib/rfcxml/v3/email.rb
CHANGED
data/lib/rfcxml/v3/eref.rb
CHANGED
data/lib/rfcxml/v3/extaddr.rb
CHANGED