class FeedMapper

Public Class Methods

massage_feed(xml) click to toggle source
# File lib/feed_mapper.rb, line 18
def self.massage_feed(xml)

  doc = Nokogiri::XML(xml)
  
  doc.xpath("/").first.children.first.name="root"

  @@find_to_replace.each_pair do |key, value|
    unless doc.xpath(key).first.nil? then 
      doc.xpath(key).each do |child|        
        child.name=(value)
      end
    end
  end
  return doc

end