rfcxml 0.3.0 → 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.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/roundtrip.yml +79 -0
  3. data/.gitignore +3 -0
  4. data/.rubocop.yml +9 -3
  5. data/.rubocop_todo.yml +86 -20
  6. data/Gemfile +3 -1
  7. data/README.adoc +255 -35
  8. data/Rakefile +55 -0
  9. data/lib/rfcxml/v3/abstract.rb +2 -1
  10. data/lib/rfcxml/v3/address.rb +2 -1
  11. data/lib/rfcxml/v3/annotation.rb +2 -1
  12. data/lib/rfcxml/v3/area.rb +1 -1
  13. data/lib/rfcxml/v3/artset.rb +2 -1
  14. data/lib/rfcxml/v3/artwork.rb +13 -10
  15. data/lib/rfcxml/v3/aside.rb +2 -1
  16. data/lib/rfcxml/v3/author.rb +16 -9
  17. data/lib/rfcxml/v3/back.rb +2 -1
  18. data/lib/rfcxml/v3/bcp14.rb +1 -1
  19. data/lib/rfcxml/v3/blockquote.rb +2 -1
  20. data/lib/rfcxml/v3/boilerplate.rb +2 -1
  21. data/lib/rfcxml/v3/br.rb +1 -1
  22. data/lib/rfcxml/v3/c.rb +2 -1
  23. data/lib/rfcxml/v3/city.rb +1 -1
  24. data/lib/rfcxml/v3/cityarea.rb +1 -1
  25. data/lib/rfcxml/v3/code.rb +1 -1
  26. data/lib/rfcxml/v3/contact.rb +2 -1
  27. data/lib/rfcxml/v3/country.rb +1 -1
  28. data/lib/rfcxml/v3/cref.rb +2 -1
  29. data/lib/rfcxml/v3/date.rb +4 -4
  30. data/lib/rfcxml/v3/dd.rb +2 -1
  31. data/lib/rfcxml/v3/displayreference.rb +1 -1
  32. data/lib/rfcxml/v3/dl.rb +2 -1
  33. data/lib/rfcxml/v3/dt.rb +2 -1
  34. data/lib/rfcxml/v3/email.rb +1 -1
  35. data/lib/rfcxml/v3/eref.rb +1 -1
  36. data/lib/rfcxml/v3/extaddr.rb +1 -1
  37. data/lib/rfcxml/v3/facsimile.rb +1 -1
  38. data/lib/rfcxml/v3/figure.rb +17 -11
  39. data/lib/rfcxml/v3/format.rb +1 -1
  40. data/lib/rfcxml/v3/front.rb +2 -1
  41. data/lib/rfcxml/v3/iref.rb +4 -3
  42. data/lib/rfcxml/v3/keyword.rb +1 -1
  43. data/lib/rfcxml/v3/li.rb +2 -1
  44. data/lib/rfcxml/v3/link.rb +1 -1
  45. data/lib/rfcxml/v3/list.rb +2 -1
  46. data/lib/rfcxml/v3/middle.rb +2 -1
  47. data/lib/rfcxml/v3/name.rb +2 -1
  48. data/lib/rfcxml/v3/note.rb +2 -1
  49. data/lib/rfcxml/v3/ol.rb +5 -2
  50. data/lib/rfcxml/v3/organization.rb +10 -5
  51. data/lib/rfcxml/v3/phone.rb +1 -1
  52. data/lib/rfcxml/v3/pobox.rb +1 -1
  53. data/lib/rfcxml/v3/postal.rb +2 -1
  54. data/lib/rfcxml/v3/postal_line.rb +1 -1
  55. data/lib/rfcxml/v3/postamble.rb +2 -1
  56. data/lib/rfcxml/v3/preamble.rb +2 -1
  57. data/lib/rfcxml/v3/refcontent.rb +2 -1
  58. data/lib/rfcxml/v3/reference.rb +7 -4
  59. data/lib/rfcxml/v3/referencegroup.rb +2 -1
  60. data/lib/rfcxml/v3/references.rb +2 -1
  61. data/lib/rfcxml/v3/region.rb +1 -1
  62. data/lib/rfcxml/v3/relref.rb +1 -1
  63. data/lib/rfcxml/v3/rfc.rb +60 -12
  64. data/lib/rfcxml/v3/section.rb +11 -4
  65. data/lib/rfcxml/v3/series_info.rb +5 -4
  66. data/lib/rfcxml/v3/sortingcode.rb +1 -1
  67. data/lib/rfcxml/v3/sourcecode.rb +13 -9
  68. data/lib/rfcxml/v3/spanx.rb +1 -1
  69. data/lib/rfcxml/v3/street.rb +1 -1
  70. data/lib/rfcxml/v3/strong.rb +2 -1
  71. data/lib/rfcxml/v3/sub.rb +2 -1
  72. data/lib/rfcxml/v3/sup.rb +2 -1
  73. data/lib/rfcxml/v3/table.rb +1 -1
  74. data/lib/rfcxml/v3/tbody.rb +1 -1
  75. data/lib/rfcxml/v3/td.rb +23 -4
  76. data/lib/rfcxml/v3/text.rb +2 -1
  77. data/lib/rfcxml/v3/texttable.rb +12 -6
  78. data/lib/rfcxml/v3/tfoot.rb +1 -1
  79. data/lib/rfcxml/v3/th.rb +1 -1
  80. data/lib/rfcxml/v3/thead.rb +1 -1
  81. data/lib/rfcxml/v3/title.rb +3 -2
  82. data/lib/rfcxml/v3/toc.rb +1 -1
  83. data/lib/rfcxml/v3/tr.rb +3 -1
  84. data/lib/rfcxml/v3/tt.rb +1 -1
  85. data/lib/rfcxml/v3/ttcol.rb +4 -2
  86. data/lib/rfcxml/v3/u.rb +1 -1
  87. data/lib/rfcxml/v3/ul.rb +10 -4
  88. data/lib/rfcxml/v3/uri.rb +1 -1
  89. data/lib/rfcxml/v3/vspace.rb +1 -1
  90. data/lib/rfcxml/v3/workgroup.rb +1 -1
  91. data/lib/rfcxml/v3/xref.rb +2 -1
  92. data/lib/rfcxml/version.rb +1 -1
  93. data/lib/rfcxml.rb +1 -0
  94. data/scripts/README.md +110 -0
  95. data/scripts/roundtrip_test.rb +361 -0
  96. metadata +5 -2
@@ -12,7 +12,8 @@ module Rfcxml
12
12
  attribute :uri, Uri
13
13
 
14
14
  xml do
15
- root "address"
15
+ element "address"
16
+ ordered
16
17
 
17
18
  map_element "postal", to: :postal
18
19
  map_element "phone", to: :phone
@@ -21,7 +21,8 @@ module Rfcxml
21
21
  attribute :xref, Xref, collection: true
22
22
 
23
23
  xml do
24
- root "annotation", mixed: true
24
+ element "annotation"
25
+ mixed_content
25
26
 
26
27
  map_content to: :content
27
28
  map_element "bcp14", to: :bcp14
@@ -8,7 +8,7 @@ module Rfcxml
8
8
  attribute :content, :string
9
9
 
10
10
  xml do
11
- root "area"
11
+ element "area"
12
12
 
13
13
  map_content to: :content
14
14
  end
@@ -10,7 +10,8 @@ module Rfcxml
10
10
  attribute :artwork, Artwork, collection: true
11
11
 
12
12
  xml do
13
- root "artset"
13
+ element "artset"
14
+ ordered
14
15
 
15
16
  map_attribute "anchor", to: :anchor
16
17
  map_attribute "pn", to: :pn
@@ -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, default: -> { "" }
12
- attribute :type, :string, default: -> { "" }
11
+ attribute :name, :string
12
+ attribute :type, :string
13
13
  attribute :src, :string
14
- attribute :align, :string, default: -> { "left" }
15
- attribute :alt, :string, default: -> { "" }
16
- attribute :width, :string, default: -> { "" }
17
- attribute :height, :string, default: -> { "" }
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
- root "artwork"
21
+ element "artwork"
22
22
 
23
- map_content to: :content
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
@@ -19,7 +19,8 @@ module Rfcxml
19
19
  attribute :ul, Ul, collection: true
20
20
 
21
21
  xml do
22
- root "aside"
22
+ element "aside"
23
+ ordered
23
24
 
24
25
  map_attribute "anchor", to: :anchor
25
26
  map_attribute "pn", to: :pn
@@ -11,22 +11,29 @@ module Rfcxml
11
11
  attribute :surname, :string
12
12
  attribute :ascii_surname, :string
13
13
  attribute :fullname, :string
14
- attribute :role, :string
14
+ attribute :role, :string, values: %w[editor]
15
15
  attribute :ascii_fullname, :string
16
16
  attribute :organization, Organization
17
17
  attribute :address, Address
18
18
 
19
19
  xml do
20
- root "author"
20
+ element "author"
21
+ ordered
21
22
 
22
23
  map_attribute "anchor", to: :anchor
23
- map_attribute "initials", to: :initials
24
- map_attribute "asciiInitials", to: :ascii_initials
25
- map_attribute "surname", to: :surname
26
- map_attribute "asciiSurname", to: :ascii_surname
27
- map_attribute "fullname", to: :fullname
28
- map_attribute "role", to: :role
29
- map_attribute "asciiFullname", to: :ascii_fullname
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 } }
30
37
  map_element "organization", to: :organization
31
38
  map_element "address", to: :address
32
39
  end
@@ -10,7 +10,8 @@ module Rfcxml
10
10
  attribute :section, Section, collection: true
11
11
 
12
12
  xml do
13
- root "back"
13
+ element "back"
14
+ ordered
14
15
 
15
16
  map_element "displayreference", to: :displayreference
16
17
  map_element "references", to: :references
@@ -8,7 +8,7 @@ module Rfcxml
8
8
  attribute :content, :string
9
9
 
10
10
  xml do
11
- root "bcp14"
11
+ element "bcp14"
12
12
 
13
13
  map_content to: :content
14
14
  end
@@ -33,7 +33,8 @@ module Rfcxml
33
33
  attribute :xref, Xref, collection: true
34
34
 
35
35
  xml do
36
- root "blockquote"
36
+ element "blockquote"
37
+ ordered
37
38
 
38
39
  map_content to: :content
39
40
  map_attribute "anchor", to: :anchor
@@ -8,7 +8,8 @@ module Rfcxml
8
8
  attribute :section, Section, collection: true
9
9
 
10
10
  xml do
11
- root "boilerplate"
11
+ element "boilerplate"
12
+ ordered
12
13
 
13
14
  map_element "section", to: :section
14
15
  end
data/lib/rfcxml/v3/br.rb CHANGED
@@ -6,7 +6,7 @@ module Rfcxml
6
6
  module V3
7
7
  class Br < Lutaml::Model::Serializable
8
8
  xml do
9
- root "br"
9
+ element "br"
10
10
  end
11
11
  end
12
12
  end
data/lib/rfcxml/v3/c.rb CHANGED
@@ -13,7 +13,8 @@ module Rfcxml
13
13
  attribute :xref, Xref, collection: true
14
14
 
15
15
  xml do
16
- root "c"
16
+ element "c"
17
+ ordered
17
18
 
18
19
  map_content to: :content
19
20
  map_element "cref", to: :cref
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "city"
12
+ element "city"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "cityarea"
12
+ element "cityarea"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "code"
12
+ element "code"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -16,7 +16,8 @@ module Rfcxml
16
16
  attribute :address, Address
17
17
 
18
18
  xml do
19
- root "contact"
19
+ element "contact"
20
+ ordered
20
21
 
21
22
  map_attribute "anchor", to: :anchor
22
23
  map_attribute "initials", to: :initials
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "country"
12
+ element "country"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -20,7 +20,8 @@ module Rfcxml
20
20
  attribute :xref, Xref, collection: true
21
21
 
22
22
  xml do
23
- root "cref"
23
+ element "cref"
24
+ ordered
24
25
 
25
26
  map_content to: :content
26
27
  map_attribute "anchor", to: :anchor
@@ -11,12 +11,12 @@ module Rfcxml
11
11
  attribute :year, :string
12
12
 
13
13
  xml do
14
- root "date"
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
@@ -34,7 +34,8 @@ module Rfcxml
34
34
  attribute :aside, Aside, collection: true
35
35
 
36
36
  xml do
37
- root "dd", mixed: true
37
+ element "dd"
38
+ mixed_content
38
39
 
39
40
  map_content to: :content
40
41
  map_attribute "anchor", to: :anchor
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :to, :string
10
10
 
11
11
  xml do
12
- root "displayreference"
12
+ element "displayreference"
13
13
 
14
14
  map_attribute "target", to: :target
15
15
  map_attribute "to", to: :to
data/lib/rfcxml/v3/dl.rb CHANGED
@@ -14,7 +14,8 @@ module Rfcxml
14
14
  attribute :dd, Dd, collection: true
15
15
 
16
16
  xml do
17
- root "dl", mixed: true
17
+ element "dl"
18
+ mixed_content
18
19
 
19
20
  map_attribute "anchor", to: :anchor
20
21
  map_attribute "spacing", to: :spacing
data/lib/rfcxml/v3/dt.rb CHANGED
@@ -22,7 +22,8 @@ module Rfcxml
22
22
  attribute :xref, Xref, collection: true
23
23
 
24
24
  xml do
25
- root "dt"
25
+ element "dt"
26
+ ordered
26
27
 
27
28
  map_content to: :content
28
29
  map_attribute "anchor", to: :anchor
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "email"
12
+ element "email"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -10,7 +10,7 @@ module Rfcxml
10
10
  attribute :target, :string
11
11
 
12
12
  xml do
13
- root "eref"
13
+ element "eref"
14
14
 
15
15
  map_content to: :content
16
16
  map_attribute "brackets", to: :brackets
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "extaddr"
12
+ element "extaddr"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -8,7 +8,7 @@ module Rfcxml
8
8
  attribute :content, :string
9
9
 
10
10
  xml do
11
- root "facsimile"
11
+ element "facsimile"
12
12
 
13
13
  map_content to: :content
14
14
  end
@@ -7,14 +7,18 @@ module Rfcxml
7
7
  class Figure < Lutaml::Model::Serializable
8
8
  attribute :anchor, :string
9
9
  attribute :pn, :string
10
- attribute :title, :string, default: -> { "" }
11
- attribute :suppress_title, :string, default: -> { "false" }
10
+ attribute :title, :string
11
+ attribute :suppress_title, :string,
12
+ values: %w[true false],
13
+ default: -> { "false" }
12
14
  attribute :src, :string
13
15
  attribute :original_src, :string
14
- attribute :align, :string, default: -> { "left" }
15
- attribute :alt, :string, default: -> { "" }
16
- attribute :width, :string, default: -> { "" }
17
- attribute :height, :string, default: -> { "" }
16
+ attribute :align, :string,
17
+ values: %w[left center right],
18
+ default: -> { "left" }
19
+ attribute :alt, :string
20
+ attribute :width, :string
21
+ attribute :height, :string
18
22
  attribute :name, Name
19
23
  attribute :iref, Iref, collection: true
20
24
  attribute :preamble, Preamble
@@ -24,18 +28,20 @@ module Rfcxml
24
28
  attribute :postamble, Postamble
25
29
 
26
30
  xml do
27
- root "figure"
31
+ element "figure"
32
+ ordered
28
33
 
29
34
  map_attribute "anchor", to: :anchor
30
35
  map_attribute "pn", to: :pn
31
- map_attribute "title", to: :title
36
+ map_attribute "title", to: :title, value_map: { to: { empty: :empty } }
32
37
  map_attribute "suppress-title", to: :suppress_title
33
38
  map_attribute "src", to: :src
34
39
  map_attribute "originalSrc", to: :original_src
35
40
  map_attribute "align", to: :align
36
- map_attribute "alt", to: :alt
37
- map_attribute "width", to: :width
38
- map_attribute "height", to: :height
41
+ map_attribute "alt", to: :alt, value_map: { to: { empty: :empty } }
42
+ map_attribute "width", to: :width, value_map: { to: { empty: :empty } }
43
+ map_attribute "height", to: :height,
44
+ value_map: { to: { empty: :empty } }
39
45
 
40
46
  %w[name iref preamble artset artwork sourcecode
41
47
  postamble].each do |element|
@@ -10,7 +10,7 @@ module Rfcxml
10
10
  attribute :octets, :string
11
11
 
12
12
  xml do
13
- root "format"
13
+ element "format"
14
14
 
15
15
  map_attribute "target", to: :target
16
16
  map_attribute "type", to: :type
@@ -18,7 +18,8 @@ module Rfcxml
18
18
  attribute :toc, Toc
19
19
 
20
20
  xml do
21
- root "front"
21
+ element "front"
22
+ ordered
22
23
 
23
24
  map_element "title", to: :title
24
25
  map_element "seriesInfo", to: :series_info
@@ -6,15 +6,16 @@ module Rfcxml
6
6
  module V3
7
7
  class Iref < Lutaml::Model::Serializable
8
8
  attribute :item, :string
9
- attribute :subitem, :string, default: -> { "" }
9
+ attribute :subitem, :string
10
10
  attribute :primary, :string, default: -> { "false" }
11
11
  attribute :pn, :string
12
12
 
13
13
  xml do
14
- root "iref"
14
+ element "iref"
15
15
 
16
16
  map_attribute "item", to: :item
17
- map_attribute "subitem", to: :subitem
17
+ map_attribute "subitem", to: :subitem,
18
+ value_map: { to: { empty: :empty } }
18
19
  map_attribute "primary", to: :primary
19
20
  map_attribute "pn", to: :pn
20
21
  end
@@ -8,7 +8,7 @@ module Rfcxml
8
8
  attribute :content, :string
9
9
 
10
10
  xml do
11
- root "keyword"
11
+ element "keyword"
12
12
 
13
13
  map_content to: :content
14
14
  end
data/lib/rfcxml/v3/li.rb CHANGED
@@ -35,7 +35,8 @@ module Rfcxml
35
35
  attribute :derived_counter, :string
36
36
 
37
37
  xml do
38
- root "li", mixed: true
38
+ element "li"
39
+ mixed_content
39
40
 
40
41
  map_content to: :content
41
42
  map_attribute "anchor", to: :anchor
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :rel, :string
10
10
 
11
11
  xml do
12
- root "link"
12
+ element "link"
13
13
 
14
14
  map_attribute "href", to: :href
15
15
  map_attribute "rel", to: :rel
@@ -12,7 +12,8 @@ module Rfcxml
12
12
  attribute :text, "Rfcxml::V3::Text", collection: true
13
13
 
14
14
  xml do
15
- root "list"
15
+ element "list"
16
+ ordered
16
17
 
17
18
  map_attribute "style", to: :style
18
19
  map_attribute "hangIndent", to: :hang_indent
@@ -8,7 +8,8 @@ module Rfcxml
8
8
  attribute :section, Section, collection: true
9
9
 
10
10
  xml do
11
- root "middle"
11
+ element "middle"
12
+ ordered
12
13
 
13
14
  map_element "section", to: :section
14
15
  end
@@ -21,7 +21,8 @@ module Rfcxml
21
21
  attribute :xref, Xref, collection: true
22
22
 
23
23
  xml do
24
- root "name"
24
+ element "name"
25
+ mixed_content
25
26
 
26
27
  map_content to: :content
27
28
  map_attribute "slugifiedName", to: :slugified_name
@@ -15,7 +15,8 @@ module Rfcxml
15
15
  attribute :ul, Ul, collection: true
16
16
 
17
17
  xml do
18
- root "note"
18
+ element "note"
19
+ ordered
19
20
 
20
21
  map_attribute "title", to: :title
21
22
  map_attribute "pn", to: :pn
data/lib/rfcxml/v3/ol.rb CHANGED
@@ -9,13 +9,16 @@ module Rfcxml
9
9
  attribute :type, :string, default: -> { "1" }
10
10
  attribute :start, :string, default: -> { "1" }
11
11
  attribute :group, :string
12
- attribute :spacing, :string, default: -> { "normal" }
12
+ attribute :spacing, :string,
13
+ values: %w[normal compact],
14
+ default: -> { "normal" }
13
15
  attribute :indent, :string, default: -> { "adaptive" }
14
16
  attribute :pn, :string
15
17
  attribute :li, Li, collection: true
16
18
 
17
19
  xml do
18
- root "ol"
20
+ element "ol"
21
+ ordered
19
22
 
20
23
  map_attribute "anchor", to: :anchor
21
24
  map_attribute "type", to: :type
@@ -9,15 +9,20 @@ module Rfcxml
9
9
  attribute :abbrev, :string
10
10
  attribute :ascii, :string
11
11
  attribute :ascii_abbrev, :string
12
- attribute :show_on_front_page, :string, default: -> { "true" }
12
+ attribute :show_on_front_page, :string,
13
+ values: %w[true false],
14
+ default: -> { "true" }
13
15
 
14
16
  xml do
15
- root "organization"
17
+ element "organization"
18
+ mixed_content
16
19
 
17
20
  map_content to: :content
18
- map_attribute "abbrev", to: :abbrev
19
- map_attribute "ascii", to: :ascii
20
- map_attribute "asciiAbbrev", to: :ascii_abbrev
21
+ map_attribute "abbrev", to: :abbrev,
22
+ value_map: { to: { empty: :empty } }
23
+ map_attribute "ascii", to: :ascii, value_map: { to: { empty: :empty } }
24
+ map_attribute "asciiAbbrev", to: :ascii_abbrev,
25
+ value_map: { to: { empty: :empty } }
21
26
  map_attribute "showOnFrontPage", to: :show_on_front_page
22
27
  end
23
28
  end
@@ -8,7 +8,7 @@ module Rfcxml
8
8
  attribute :content, :string
9
9
 
10
10
  xml do
11
- root "phone"
11
+ element "phone"
12
12
 
13
13
  map_content to: :content
14
14
  end
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "pobox"
12
+ element "pobox"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -17,7 +17,8 @@ module Rfcxml
17
17
  attribute :postal_line, PostalLine, collection: true
18
18
 
19
19
  xml do
20
- root "postal"
20
+ element "postal"
21
+ ordered
21
22
 
22
23
  map_element "extaddr", to: :extaddr
23
24
  map_element "street", to: :street
@@ -9,7 +9,7 @@ module Rfcxml
9
9
  attribute :ascii, :string
10
10
 
11
11
  xml do
12
- root "postalLine"
12
+ element "postalLine"
13
13
 
14
14
  map_content to: :content
15
15
  map_attribute "ascii", to: :ascii
@@ -13,7 +13,8 @@ module Rfcxml
13
13
  attribute :xref, Xref, collection: true
14
14
 
15
15
  xml do
16
- root "postamble"
16
+ element "postamble"
17
+ ordered
17
18
 
18
19
  map_content to: :content
19
20
  map_element "cref", to: :cref
@@ -21,7 +21,8 @@ module Rfcxml
21
21
  attribute :xref, Xref, collection: true
22
22
 
23
23
  xml do
24
- root "preamble"
24
+ element "preamble"
25
+ ordered
25
26
 
26
27
  map_content to: :content
27
28
  map_element "bcp14", to: :bcp14