bug #597: Tentative solution

This commit is contained in:
Tino Vázquez committed 2011-05-06 14:58:24 +02:00
1 parent a07b8e4b1c
commit 14db7b5f8d
1 file changed
+7 -8
+7 -8
View File
@@ -104,16 +104,15 @@ module OpenNebula
def retrieve_elements(filter)
ids_array = Array.new
if NOKOGIRI
elements=@xml.xpath(filter.to_s)
if elements.size == 0
return nil
end
elements.each{ |e| ids_array << e.text }
if NOKOGIRI
@xml.xpath(filter).each { |pelem|
ids_array << pelem.text
}
else
@xml.each(filter.to_s) { |e| ids_array << e.text }
@xml.elements.each(filter) { |pelem|
ids_array << pelem.text
}
end
return ids_array