Builder – a simple way to create XML markup and data structures using the Ruby Builder gem

Here’s an example:

  require ‘rubygems’

  require_gem ‘builder’, ‘~> 2.0’

  builder = Builder::XmlMarkup.new

  xml = builder.person { |b| b.name(“Jim”); b.phone(“555-1234”) }

  xml #=> <person><name>Jim</name><phone>555-1234</phone></person>

http://builder.rubyforge.org

Leave a Reply

Your email address will not be published. Required fields are marked *