lib/sax-machine/sax_handler.rb in astro-sax-machine-0.0.19 vs lib/sax-machine/sax_handler.rb in astro-sax-machine-0.0.20

- old
+ new

@@ -43,11 +43,11 @@ set_element_config_for_element_value end end def end_element(name) - if parsing_collection? && @collection_config.name == name + if parsing_collection? && @collection_config.name == name.split(':').last @collection_handler.end_element(name) @object.send(@collection_config.accessor) << @collection_handler.object reset_current_collection elsif parsing_collection? @@ -107,16 +107,17 @@ ## # Decodes XML special characters. def self.decode_xml(str) return str.map &method(:decode_xml) if str.kind_of?(Array) - entities = { - '#38' => '&amp;', - '#13' => "\r", - } - entities.keys.inject(str) { |string, key| - string.gsub(/&#{key};/, entities[key]) - } + # entities = { + # '#38' => '&amp;', + # '#13' => "\r", + # } + # entities.keys.inject(str) { |string, key| + # string.gsub(/&#{key};/, entities[key]) + # } + CGI.unescapeHTML(str) end end end