Is there a simple way to detect if an XML node exists in Rails?
To get the @result instance variable I use
response, data = Net::HTTP.post_form(url, params)
@result = Hash.from_xml(response.body)
I've tried:
if @result['GetProperties']['Errors'].exists?
or just
if @result['GetProperties']['Errors']
but both result in the following error:
undefined method `[]' for nil:NilClass
I should make clear that I have no problem parsing XML - I just need to know how to detect if a node exists