Skip to content

metanorma/rfcxml

Repository files navigation

RFC XML Ruby library

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.

Installation

Add this line to your application’s Gemfile:

gem 'rfcxml'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install rfcxml

Usage

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

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/rfcxml.

The gem is available as open source under the terms of the BSD 2-clause license.

All rights reserved. Ribose.

About

Ruby library for working with RFC XML v3

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •