Koara is a modular lightweight markup language. This project can render the koara AST to Xml in Ruby. The AST is created by the core koara parser.
-
Gem
gem install koara-xml
require 'koara'
require 'koara/xml'
parser = Koara::Parser.new
result = parser.parse('Hello World!')
renderer = Koara::Xml::XmlRenderer.new
result.accept(renderer)
puts renderer.output
You can configure the Renderer:
-
renderer.declaration_tag(declaration_tag) Default:
null
Add an XML Declaration Tag add the top of the generated output.