1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-10 13:57:22 +03:00

Fix REXML and Nokogiri to_hash output

This commit is contained in:
Daniel Molina 2011-02-18 11:13:51 +01:00
parent 6f563ae73f
commit 5e4cf53a15

View File

@ -246,7 +246,7 @@ module OpenNebula
if NOKOGIRI
array = element.children
if array.length == 1 and array.first.text?
if array.length==1 and (array.first.text? or array.first.cdata?)
r = array.first.text
else
r = {}
@ -257,8 +257,8 @@ module OpenNebula
}
end
else
r = {}
if element.has_elements?
r = {}
element.each_element { |c| to_hash(r, c) }
elsif element.has_text?
r = element.text