Module: Nori::Parser::Nokogiri

Defined in:
lib/nori/parser/nokogiri.rb

Overview

Nori::Parser::Nokogiri

Nokogiri SAX parser.

Defined Under Namespace

Classes: Document

Class Method Summary collapse

Class Method Details

.parse(xml, options) ⇒ Object


49
50
51
52
53
54
55
# File 'lib/nori/parser/nokogiri.rb', line 49

def self.parse(xml, options)
  document = Document.new
  document.options = options
  parser = ::Nokogiri::XML::SAX::Parser.new document
  parser.parse xml
  document.stack.length > 0 ? document.stack.pop.to_hash : {}
end