Introducing the XML-to-HAML gem

require 'xml-to-haml'

fruit=<<FRUIT
<fruit>
  <apple country="france" month="august">tasty<gdelicious/></apple>
  <pear/>
</fruit>
FRUIT

haml = XMLtoHAML.new(fruit).to_s
puts haml

output:

%fruit

%apple{ :country => 'france', :month => 'august'} tasty

    %gdelicious

  %pear

Tags:
Source:
1343hrs.txt
Published:
24-01-2013 13:43