Objective :
Convert XML to ruby Hash , with all node and attributes values
What i tried :
xml =
'<test id="appears">
<comment id="doesnt appear">
it worked
</comment>
<comment>
see!
</comment>
<comment />
</test>'
hash = Hash.from_xml(xml)
Now i get this hash
#=>{"test"=>{"id"=>"appears", "comment"=>["it worked", "see!", nil]}}
Notice how the id attribute on the first comment element doesn't appear.
How to resolve this ?