Skip to content

Instantly share code, notes, and snippets.

@jpshackelford
jpshackelford / roxml_examples_01.rb
Created August 29, 2011 16:31
Sample Code for ROXML Text Node Factory
require 'rubygems'
require 'roxml'
xml = '
<library>
<name>Fullerton Public</name>
<phoneNumber>000-000-000</phoneNumber>
<media>
<item>
<medium>cassette-tape</medium>
require 'socket'
begin
# ssanders: Try to load RSpec based on the LOADPATH, this allows
# projects (e.g. Rails) to provide alternate versions via the buildpath
require 'spec'
rescue LoadError
# ssanders: Fallback to loading from the Gem
require 'rubygems'