Path: | doc/releases/builder-2.0.0.rdoc |
Last Update: | Tue Mar 09 01:32:53 -0700 2010 |
NOTE: The escaping attribute values by default is different than in previous releases of Builder. This makes version 2.0.0 somewhat incompatible with the 1.x series of Builder. If you use "&", "<", or ">" in attributes values, you may have to change your code. (Essentially you remove the manual escaping. The new way is easier, believe me).
Builder::XmlMarkup is a library that allows easy programmatic creation of XML markup. For example:
builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2) builder.person { |b| b.name("Jim"); b.phone("555-1234") }
will generate:
<person> <name>Jim</name> <phone>555-1234</phone> </person>
The easiest way to get and install builder is via RubyGems …
gem install builder (you may need root/admin privileges)