Module: MultiXml::Parsers::NokogiriSax Private
- Defined in:
- lib/multi_xml/parsers/nokogiri_sax.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
SAX-based parser using Nokogiri (faster for large documents)
Defined Under Namespace
Classes: Handler
Class Method Summary collapse
-
.parse(xml) ⇒ Hash
private
Parse XML from a string or IO object.
-
.parse_error ⇒ Class
private
Get the parse error class for this parser.
Class Method Details
.parse(xml) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Parse XML from a string or IO object
25 26 27 28 29 30 31 32 |
# File 'lib/multi_xml/parsers/nokogiri_sax.rb', line 25 def parse(xml) io = xml.respond_to?(:read) ? xml : StringIO.new(xml) return {} if io.eof? handler = Handler.new ::Nokogiri::XML::SAX::Parser.new(handler).parse(io) handler.result end |
.parse_error ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get the parse error class for this parser
17 |
# File 'lib/multi_xml/parsers/nokogiri_sax.rb', line 17 def parse_error = ::Nokogiri::XML::SyntaxError |