Module: MultiXml::Parsers::Nokogiri

Extended by:
Nokogiri
Includes:
Libxml2Parser
Included in:
Nokogiri
Defined in:
lib/multi_xml/parsers/nokogiri.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from Libxml2Parser

#node_to_hash

Instance Method Details

#parse(xml) ⇒ Object


14
15
16
17
18
# File 'lib/multi_xml/parsers/nokogiri.rb', line 14

def parse(xml)
  doc = ::Nokogiri::XML(xml)
  raise(doc.errors.first) unless doc.errors.empty?
  node_to_hash(doc.root)
end

#parse_errorObject


10
11
12
# File 'lib/multi_xml/parsers/nokogiri.rb', line 10

def parse_error
  ::Nokogiri::XML::SyntaxError
end