Module: MultiXml::Parsers::Rexml
Overview
:nodoc:
Instance Method Summary collapse
-
#parse(xml) ⇒ Object
Parse an XML Document IO into a simple hash using REXML.
- #parse_error ⇒ Object
Instance Method Details
#parse(xml) ⇒ Object
Parse an XML Document IO into a simple hash using REXML
xml:: XML Document IO to parse
16 17 18 19 20 21 |
# File 'lib/multi_xml/parsers/rexml.rb', line 16 def parse(xml) doc = REXML::Document.new(xml) raise(REXML::ParseException, "The document #{doc.to_s.inspect} does not have a valid root") unless doc.root merge_element!({}, doc.root) end |
#parse_error ⇒ Object
8 9 10 |
# File 'lib/multi_xml/parsers/rexml.rb', line 8 def parse_error ::REXML::ParseException end |