# File lib/feed-normalizer.rb, line 117 def self.parse(xml, opts = {}) # Get a string ASAP, as multiple read()'s will start returning nil.. xml = xml.respond_to?(:read) ? xml.read : xml.to_s if opts[:force_parser] result = opts[:force_parser].parse(xml, opts[:loose]) return result if result return nil if opts[:try_others] == false end ParserRegistry.parsers.each do |parser| result = parser.parse(xml, opts[:loose]) return result if result end # if we got here, no parsers worked. return nil end