The rfcxml
library is a parser and generator for RFC XML documents. It is
intended to be used to parse and generate RFC XML v3 documents.
Add this line to your application’s Gemfile:
gem 'rfcxml'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install rfcxml
To parse an RFC XML document:
require 'rfcxml'
rfc = Rfcxml::Document.new(File.read('rfc.xml'))
puts rfc.title
puts rfc.abstract
puts rfc.sections
To generate an RFC XML document:
require 'rfcxml'
rfc = Rfcxml::Document.new
rfc.title = 'An RFC Title'
rfc.abstract = 'An RFC Abstract'
rfc.sections = [
Rfcxml::Section.new('Section 1', 'This is the first section'),
Rfcxml::Section.new('Section 2', 'This is the second section')
]
puts rfc.to_xml
Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/rfcxml.