Module: ActiveSupport::XmlMini_REXML

Extended by:
XmlMini_REXML
Included in:
XmlMini_REXML
Defined in:
lib/active_support/xml_mini/rexml.rb

Overview

:nodoc:

Constant Summary collapse

CONTENT_KEY =
'__content__'.freeze

Instance Method Summary collapse

Instance Method Details

#parse(string) ⇒ Object

Parse an XML Document string into a simple hash

Same as XmlSimple::xml_in but doesn’t shoot itself in the foot, and uses the defaults from ActiveSupport

string

XML Document string to parse



15
16
17
18
19
# File 'lib/active_support/xml_mini/rexml.rb', line 15

def parse(string)
  require 'rexml/document' unless defined?(REXML::Document)
  doc = REXML::Document.new(string)
  merge_element!({}, doc.root)
end