public
Description: Magically navigate through xml as if it were a ruby object
Clone URL: git://github.com/bwyrosdick/xml-magic.git
Search Repo:
name age message
folder CHANGELOG Wed Mar 05 21:40:22 -0800 2008 built 0.1.0 gem [bwyrosdick]
folder LICENSE Wed Mar 05 21:40:22 -0800 2008 built 0.1.0 gem [bwyrosdick]
folder README Wed Mar 05 21:52:32 -0800 2008 built 0.1.0 gem [bwyrosdick]
folder demo.rb Wed Mar 05 21:40:22 -0800 2008 built 0.1.0 gem [bwyrosdick]
folder lib/ Sat Mar 15 20:44:00 -0700 2008 Added BlankSlate and improved test messages. [Anthony Crumley]
folder test/ Sat Mar 15 20:44:00 -0700 2008 Added BlankSlate and improved test messages. [Anthony Crumley]
folder xml-magic-0.1.0.gem Wed Mar 05 21:40:22 -0800 2008 built 0.1.0 gem [bwyrosdick]
folder xml-magic-0.1.1.gem Sun Mar 16 04:40:14 -0700 2008 added date to gemspec and rebuilt gem [bwyrosdick]
folder xml_magic.gemspec Sun Mar 16 04:40:14 -0700 2008 added date to gemspec and rebuilt gem [bwyrosdick]
README
xml-magic makes accessing xml objects more like any other ruby object

== example

require 'xml_magic'

xml = <<XML
<project title="XML Magic">
  <description>Test description.</description>
  <contact type="Project Manager">Anthony</contact>
  <contact type="Worker Bee">Ben</contact>
  <contact type="Designer Bee">Jason</contact>
</project>
XML

project_info = CommonThread::XML::XmlMagic.new(xml)

puts project_info[:title]
puts project_info.description
for contact in project_info.contact
  puts "#{contact} the #{contact[:type]}"
end

== example output

XML Magic
Test description.
Anthony the Project Manager
Ben the Worker Bee
Jason the Designer Bee