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:
parent
6f563ae73f
commit
5e4cf53a15
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user