32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/saml/base.rb', line 32
def parse(xml, options = {})
if xml.is_a?(String)
ActiveSupport::XmlMini_REXML.parse(xml)
end
object = super
if object.is_a?(Array)
object.map { |x| x.from_xml = true }
elsif object
object.from_xml = true
end
object
rescue Nokogiri::XML::SyntaxError, REXML::ParseException => e
raise Saml::Errors::UnparseableMessage.new(e.message)
rescue TypeError => e
raise Saml::Errors::UnparseableMessage.new(e.message)
rescue NoMethodError => e
raise Saml::Errors::UnparseableMessage.new(e.message)
end
|