rfcxml 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/rake.yml +18 -0
  3. data/.github/workflows/release.yml +25 -0
  4. data/.gitignore +11 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +11 -0
  7. data/.rubocop_todo.yml +20 -0
  8. data/CODE_OF_CONDUCT.md +84 -0
  9. data/Gemfile +12 -0
  10. data/README.adoc +75 -0
  11. data/Rakefile +12 -0
  12. data/bin/console +11 -0
  13. data/bin/setup +8 -0
  14. data/lib/rfcxml/v3/abstract.rb +32 -0
  15. data/lib/rfcxml/v3/address.rb +31 -0
  16. data/lib/rfcxml/v3/annotation.rb +57 -0
  17. data/lib/rfcxml/v3/area.rb +17 -0
  18. data/lib/rfcxml/v3/artset.rb +23 -0
  19. data/lib/rfcxml/v3/artwork.rb +37 -0
  20. data/lib/rfcxml/v3/aside.rb +50 -0
  21. data/lib/rfcxml/v3/author.rb +38 -0
  22. data/lib/rfcxml/v3/back.rb +25 -0
  23. data/lib/rfcxml/v3/bcp14.rb +17 -0
  24. data/lib/rfcxml/v3/blockquote.rb +92 -0
  25. data/lib/rfcxml/v3/boilerplate.rb +19 -0
  26. data/lib/rfcxml/v3/br.rb +13 -0
  27. data/lib/rfcxml/v3/c.rb +33 -0
  28. data/lib/rfcxml/v3/city.rb +19 -0
  29. data/lib/rfcxml/v3/cityarea.rb +19 -0
  30. data/lib/rfcxml/v3/code.rb +19 -0
  31. data/lib/rfcxml/v3/contact.rb +36 -0
  32. data/lib/rfcxml/v3/country.rb +19 -0
  33. data/lib/rfcxml/v3/cref.rb +51 -0
  34. data/lib/rfcxml/v3/date.rb +23 -0
  35. data/lib/rfcxml/v3/dd.rb +92 -0
  36. data/lib/rfcxml/v3/displayreference.rb +19 -0
  37. data/lib/rfcxml/v3/dl.rb +35 -0
  38. data/lib/rfcxml/v3/dt.rb +58 -0
  39. data/lib/rfcxml/v3/em.rb +14 -0
  40. data/lib/rfcxml/v3/email.rb +19 -0
  41. data/lib/rfcxml/v3/eref.rb +21 -0
  42. data/lib/rfcxml/v3/extaddr.rb +19 -0
  43. data/lib/rfcxml/v3/facsimile.rb +17 -0
  44. data/lib/rfcxml/v3/figure.rb +57 -0
  45. data/lib/rfcxml/v3/format.rb +21 -0
  46. data/lib/rfcxml/v3/front.rb +49 -0
  47. data/lib/rfcxml/v3/iref.rb +23 -0
  48. data/lib/rfcxml/v3/keyword.rb +17 -0
  49. data/lib/rfcxml/v3/li.rb +97 -0
  50. data/lib/rfcxml/v3/link.rb +19 -0
  51. data/lib/rfcxml/v3/list.rb +27 -0
  52. data/lib/rfcxml/v3/middle.rb +19 -0
  53. data/lib/rfcxml/v3/name.rb +56 -0
  54. data/lib/rfcxml/v3/note.rb +37 -0
  55. data/lib/rfcxml/v3/ol.rb +33 -0
  56. data/lib/rfcxml/v3/organization.rb +25 -0
  57. data/lib/rfcxml/v3/phone.rb +17 -0
  58. data/lib/rfcxml/v3/pobox.rb +19 -0
  59. data/lib/rfcxml/v3/postal.rb +46 -0
  60. data/lib/rfcxml/v3/postal_line.rb +19 -0
  61. data/lib/rfcxml/v3/postamble.rb +33 -0
  62. data/lib/rfcxml/v3/preamble.rb +57 -0
  63. data/lib/rfcxml/v3/refcontent.rb +28 -0
  64. data/lib/rfcxml/v3/reference.rb +43 -0
  65. data/lib/rfcxml/v3/referencegroup.rb +25 -0
  66. data/lib/rfcxml/v3/references.rb +33 -0
  67. data/lib/rfcxml/v3/region.rb +19 -0
  68. data/lib/rfcxml/v3/relref.rb +29 -0
  69. data/lib/rfcxml/v3/rfc.rb +70 -0
  70. data/lib/rfcxml/v3/section.rb +78 -0
  71. data/lib/rfcxml/v3/series_info.rb +27 -0
  72. data/lib/rfcxml/v3/sortingcode.rb +19 -0
  73. data/lib/rfcxml/v3/sourcecode.rb +31 -0
  74. data/lib/rfcxml/v3/spanx.rb +19 -0
  75. data/lib/rfcxml/v3/street.rb +19 -0
  76. data/lib/rfcxml/v3/strong.rb +43 -0
  77. data/lib/rfcxml/v3/sub.rb +49 -0
  78. data/lib/rfcxml/v3/sup.rb +28 -0
  79. data/lib/rfcxml/v3/table.rb +37 -0
  80. data/lib/rfcxml/v3/tbody.rb +21 -0
  81. data/lib/rfcxml/v3/td.rb +89 -0
  82. data/lib/rfcxml/v3/text.rb +82 -0
  83. data/lib/rfcxml/v3/texttable.rb +41 -0
  84. data/lib/rfcxml/v3/tfoot.rb +21 -0
  85. data/lib/rfcxml/v3/th.rb +14 -0
  86. data/lib/rfcxml/v3/thead.rb +21 -0
  87. data/lib/rfcxml/v3/title.rb +25 -0
  88. data/lib/rfcxml/v3/toc.rb +19 -0
  89. data/lib/rfcxml/v3/tr.rb +24 -0
  90. data/lib/rfcxml/v3/tt.rb +53 -0
  91. data/lib/rfcxml/v3/ttcol.rb +34 -0
  92. data/lib/rfcxml/v3/u.rb +25 -0
  93. data/lib/rfcxml/v3/ul.rb +31 -0
  94. data/lib/rfcxml/v3/uri.rb +17 -0
  95. data/lib/rfcxml/v3/vspace.rb +17 -0
  96. data/lib/rfcxml/v3/workgroup.rb +17 -0
  97. data/lib/rfcxml/v3/xref.rb +41 -0
  98. data/lib/rfcxml/v3/xref_text.rb +30 -0
  99. data/lib/rfcxml/v3.rb +8 -0
  100. data/lib/rfcxml/version.rb +5 -0
  101. data/lib/rfcxml.rb +17 -0
  102. data/reference-docs/v3-modified.rnc +1145 -0
  103. data/reference-docs/v3.rnc +1145 -0
  104. data/reference-docs/v3.xsd +1410 -0
  105. data/reference-docs/xml.xsd +19 -0
  106. data/rfcxml.gemspec +47 -0
  107. data/sig/xml2rfc.rbs +4 -0
  108. metadata +264 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5efe8a260bf98e3225ba28754c0fac980f1efb22d074086857215da8d3fda2e9
4
+ data.tar.gz: ab5895433c94c49a1f0f53a477d95a770713bdd43f6e5d52840a4008c9bd4ab0
5
+ SHA512:
6
+ metadata.gz: 2b96f27d45079fddbe254816477f7ca6d7a36e70271fbc54abe3d2d7aaafb27fd1dad991471dbbc847c5e3932f4d5f60bbd4c8aa72fc9718532fb89d123076a2
7
+ data.tar.gz: d50e0ecc6b2325dd398c2e43669e21d5ecca7437f083c894cea95f9710f2e5c4014fd37b5f92bae46db88949183e571ae08f43886dfd799ddea622e8c67587c9
@@ -0,0 +1,18 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ rake:
16
+ uses: metanorma/ci/.github/workflows/generic-rake.yml@main
17
+ secrets:
18
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -0,0 +1,25 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release
4
+
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ next_version:
9
+ description: |
10
+ Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
11
+ Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
12
+ required: true
13
+ default: 'skip'
14
+ repository_dispatch:
15
+ types: [ do-release ]
16
+
17
+ jobs:
18
+ release:
19
+ uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
20
+ with:
21
+ next_version: ${{ github.event.inputs.next_version }}
22
+ secrets:
23
+ rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
24
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
25
+
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,11 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ inherit_from:
4
+ - .rubocop_todo.yml
5
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
+
7
+ # local repo-specific modifications
8
+ # ...
9
+
10
+ AllCops:
11
+ TargetRubyVersion: 3.4
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,20 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2025-01-07 10:02:25 UTC using RuboCop version 1.69.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: Severity, Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'rfcxml.gemspec'
15
+
16
+ # Offense count: 6
17
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
18
+ # AllowedMethods: refine
19
+ Metrics/BlockLength:
20
+ Max: 34
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ronald.tse@ribose.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in rfcxml.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/README.adoc ADDED
@@ -0,0 +1,75 @@
1
+ = RFC XML Ruby library
2
+
3
+ The `rfcxml` library is a parser and generator for RFC XML documents. It is
4
+ intended to be used to parse and generate RFC XML v3 documents.
5
+
6
+
7
+ == Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ [source,ruby]
12
+ ----
13
+ gem 'rfcxml'
14
+ ----
15
+
16
+ And then execute:
17
+
18
+ [source]
19
+ ----
20
+ $ bundle install
21
+ ----
22
+
23
+ Or install it yourself as:
24
+
25
+ [source]
26
+ ----
27
+ $ gem install rfcxml
28
+ ----
29
+
30
+
31
+
32
+ == Usage
33
+
34
+ To parse an RFC XML document:
35
+
36
+ [source,ruby]
37
+ ----
38
+ require 'rfcxml'
39
+
40
+ rfc = Rfcxml::Document.new(File.read('rfc.xml'))
41
+ puts rfc.title
42
+ puts rfc.abstract
43
+ puts rfc.sections
44
+ ----
45
+
46
+ To generate an RFC XML document:
47
+
48
+ [source,ruby]
49
+ ----
50
+ require 'rfcxml'
51
+
52
+ rfc = Rfcxml::Document.new
53
+ rfc.title = 'An RFC Title'
54
+ rfc.abstract = 'An RFC Abstract'
55
+ rfc.sections = [
56
+ Rfcxml::Section.new('Section 1', 'This is the first section'),
57
+ Rfcxml::Section.new('Section 2', 'This is the second section')
58
+ ]
59
+
60
+ puts rfc.to_xml
61
+ ----
62
+
63
+
64
+
65
+ == Contributing
66
+
67
+ Bug reports and pull requests are welcome on GitHub at
68
+ https://github.com/metanorma/rfcxml.
69
+
70
+
71
+ == Copyright and license
72
+
73
+ The gem is available as open source under the terms of the BSD 2-clause license.
74
+
75
+ All rights reserved. Ribose.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rfcxml"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ require_relative "dl"
6
+ require_relative "ol"
7
+ require_relative "text"
8
+ require_relative "ul"
9
+
10
+ module Rfcxml
11
+ module V3
12
+ class Abstract < Lutaml::Model::Serializable
13
+ attribute :anchor, :string
14
+ attribute :pn, :string
15
+ attribute :dl, Dl, collection: true
16
+ attribute :ol, Ol, collection: true
17
+ attribute :t, Text, collection: true
18
+ attribute :ul, Ul, collection: true
19
+
20
+ xml do
21
+ root "abstract"
22
+
23
+ map_attribute "anchor", to: :anchor
24
+ map_attribute "pn", to: :pn
25
+ map_element "dl", to: :dl
26
+ map_element "ol", to: :ol
27
+ map_element "t", to: :t
28
+ map_element "ul", to: :ul
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ require_relative "email"
6
+ require_relative "facsimile"
7
+ require_relative "phone"
8
+ require_relative "postal"
9
+ require_relative "uri"
10
+
11
+ module Rfcxml
12
+ module V3
13
+ class Address < Lutaml::Model::Serializable
14
+ attribute :postal, Postal
15
+ attribute :phone, Phone
16
+ attribute :facsimile, Facsimile
17
+ attribute :email, Email, collection: true
18
+ attribute :uri, Uri
19
+
20
+ xml do
21
+ root "address"
22
+
23
+ map_element "postal", to: :postal
24
+ map_element "phone", to: :phone
25
+ map_element "facsimile", to: :facsimile
26
+ map_element "email", to: :email
27
+ map_element "uri", to: :uri
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
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
+ module Rfcxml
20
+ module V3
21
+ class Annotation < Lutaml::Model::Serializable
22
+ attribute :content, :string
23
+ attribute :bcp14, Bcp14, collection: true
24
+ attribute :cref, Cref, collection: true
25
+ attribute :em, Em, collection: true
26
+ attribute :eref, Eref, collection: true
27
+ attribute :iref, Iref, collection: true
28
+ attribute :relref, Relref, collection: true
29
+ attribute :spanx, Spanx, collection: true
30
+ attribute :strong, Strong, collection: true
31
+ attribute :sub, Sub, collection: true
32
+ attribute :sup, Sup, collection: true
33
+ attribute :tt, Tt, collection: true
34
+ attribute :u, U, collection: true
35
+ attribute :xref, Xref, collection: true
36
+
37
+ xml do
38
+ root "annotation", mixed: true
39
+
40
+ map_content to: :content
41
+ map_element "bcp14", to: :bcp14
42
+ map_element "cref", to: :cref
43
+ map_element "em", to: :em
44
+ map_element "eref", to: :eref
45
+ map_element "iref", to: :iref
46
+ map_element "relref", to: :relref
47
+ map_element "spanx", to: :spanx
48
+ map_element "strong", to: :strong
49
+ map_element "sub", to: :sub
50
+ map_element "sup", to: :sup
51
+ map_element "tt", to: :tt
52
+ map_element "u", to: :u
53
+ map_element "xref", to: :xref
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ module Rfcxml
6
+ module V3
7
+ class Area < Lutaml::Model::Serializable
8
+ attribute :content, :string
9
+
10
+ xml do
11
+ root "area"
12
+
13
+ map_content to: :content
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ require_relative "artwork"
6
+
7
+ module Rfcxml
8
+ module V3
9
+ class Artset < Lutaml::Model::Serializable
10
+ attribute :anchor, :string
11
+ attribute :pn, :string
12
+ attribute :artwork, Artwork, collection: true
13
+
14
+ xml do
15
+ root "artset"
16
+
17
+ map_attribute "anchor", to: :anchor
18
+ map_attribute "pn", to: :pn
19
+ map_element "artwork", to: :artwork
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ module Rfcxml
6
+ module V3
7
+ class Artwork < Lutaml::Model::Serializable
8
+ attribute :content, :string
9
+ attribute :anchor, :string
10
+ attribute :pn, :string
11
+ attribute :name, :string, default: -> { "" }
12
+ attribute :type, :string, default: -> { "" }
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: -> { "" }
18
+ attribute :original_src, :string
19
+
20
+ xml do
21
+ root "artwork"
22
+
23
+ map_content to: :content
24
+ map_attribute "anchor", to: :anchor
25
+ map_attribute "pn", to: :pn
26
+ map_attribute "name", to: :name
27
+ map_attribute "type", to: :type
28
+ map_attribute "src", to: :src
29
+ map_attribute "align", to: :align
30
+ map_attribute "alt", to: :alt
31
+ map_attribute "width", to: :width
32
+ map_attribute "height", to: :height
33
+ map_attribute "originalSrc", to: :original_src
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
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
+ module Rfcxml
17
+ module V3
18
+ class Aside < Lutaml::Model::Serializable
19
+ attribute :anchor, :string
20
+ attribute :pn, :string
21
+ attribute :artset, Artset, collection: true
22
+ attribute :artwork, Artwork, collection: true
23
+ attribute :blockquote, Blockquote, collection: true
24
+ attribute :dl, Dl, collection: true
25
+ attribute :figure, Figure, collection: true
26
+ attribute :iref, Iref, collection: true
27
+ attribute :ol, Ol, collection: true
28
+ attribute :t, Text, collection: true
29
+ attribute :table, Table, collection: true
30
+ attribute :ul, Ul, collection: true
31
+
32
+ xml do
33
+ root "aside"
34
+
35
+ map_attribute "anchor", to: :anchor
36
+ map_attribute "pn", to: :pn
37
+ map_element "artset", to: :artset
38
+ map_element "artwork", to: :artwork
39
+ map_element "blockquote", to: :blockquote
40
+ map_element "dl", to: :dl
41
+ map_element "figure", to: :figure
42
+ map_element "iref", to: :iref
43
+ map_element "ol", to: :ol
44
+ map_element "t", to: :t
45
+ map_element "table", to: :table
46
+ map_element "ul", to: :ul
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ require_relative "address"
6
+ require_relative "organization"
7
+
8
+ module Rfcxml
9
+ module V3
10
+ class Author < Lutaml::Model::Serializable
11
+ attribute :anchor, :string
12
+ attribute :initials, :string
13
+ attribute :ascii_initials, :string
14
+ attribute :surname, :string
15
+ attribute :ascii_surname, :string
16
+ attribute :fullname, :string
17
+ attribute :role, :string
18
+ attribute :ascii_fullname, :string
19
+ attribute :organization, Organization
20
+ attribute :address, Address
21
+
22
+ xml do
23
+ root "author"
24
+
25
+ map_attribute "anchor", to: :anchor
26
+ map_attribute "initials", to: :initials
27
+ map_attribute "asciiInitials", to: :ascii_initials
28
+ map_attribute "surname", to: :surname
29
+ map_attribute "asciiSurname", to: :ascii_surname
30
+ map_attribute "fullname", to: :fullname
31
+ map_attribute "role", to: :role
32
+ map_attribute "asciiFullname", to: :ascii_fullname
33
+ map_element "organization", to: :organization
34
+ map_element "address", to: :address
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ require_relative "displayreference"
6
+ require_relative "references"
7
+ require_relative "section"
8
+
9
+ module Rfcxml
10
+ module V3
11
+ class Back < Lutaml::Model::Serializable
12
+ attribute :displayreference, Displayreference, collection: true
13
+ attribute :references, References, collection: true
14
+ attribute :section, Section, collection: true
15
+
16
+ xml do
17
+ root "back"
18
+
19
+ map_element "displayreference", to: :displayreference
20
+ map_element "references", to: :references
21
+ map_element "section", to: :section
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ module Rfcxml
6
+ module V3
7
+ class Bcp14 < Lutaml::Model::Serializable
8
+ attribute :content, :string
9
+
10
+ xml do
11
+ root "bcp14"
12
+
13
+ map_content to: :content
14
+ end
15
+ end
16
+ end
17
+ end