1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #4896: xpath.rb can't print XPath-specified attributes

Signed-off-by: Ruben S. Montero <rsmontero@opennebula.org>
This commit is contained in:
Roy Keene 2016-11-04 11:02:20 +01:00 committed by Ruben S. Montero
parent 4c555b0d16
commit f46d64f785

View File

@ -64,7 +64,13 @@ ARGV.each do |xpath|
values << ar.join(' ')
else
element = xml.elements[xpath.dup]
values << element.text.to_s if !element.nil?
if !element.nil?
if element.class.method_defined?(:text)
values << element.text
else
values << element.to_s
end
end
end
values << "\0"
end