Crackr

travis

Really simple XML parsing with Nokogiri.

require 'crackr'

str = '<?xml version="1.0" encoding="UTF-8"?>' +
      '<Book>' +
      '<ISBN>9780816614028</ISBN>' +
      '<Creator Role="Author">Gilles Deleuze</Creator>' +
      '<Creator Role="Contributor">Felix Guattari</Creator>' +
      '<Title>Thousand Plateaus</Title>' +
      '</Book>'

hsh = Crackr::XML.parse str
p hsh['Book']['ISBN'] # => '9780816614028'
p hsh['Book']['Creator'].map { |c| c['Role'] } # => ['Author', 'Contributor']