Module: MultiXML::Parsers::Nokogiri Private
- Extended by:
- MultiXML::Parser, Nokogiri
- Includes:
- DomParser
- Included in:
- Nokogiri
- Defined in:
- lib/multi_xml/parsers/nokogiri.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.
XML parser using the Nokogiri library
Constant Summary collapse
- ParseError =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Exception class raised on Nokogiri parse failure
::Nokogiri::XML::SyntaxError
Instance Method Summary collapse
-
#parse(io, namespaces: :strip) ⇒ Hash
private
Parse XML from an IO object.
Methods included from MultiXML::Parser
Methods included from DomParser
Instance Method Details
#parse(io, namespaces: :strip) ⇒ 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 an IO object
25 26 27 28 29 30 |
# File 'lib/multi_xml/parsers/nokogiri.rb', line 25 def parse(io, namespaces: :strip) doc = ::Nokogiri::XML(io) raise doc.errors.first unless doc.errors.empty? node_to_hash(doc.root, mode: namespaces) end |