Module: MultiXml::Parsers::Libxml Private

Extended by:
Libxml
Includes:
DomParser
Included in:
Libxml
Defined in:
lib/multi_xml/parsers/libxml.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 LibXML library

Instance Method Summary collapse

Methods included from DomParser

#node_to_hash

Instance Method Details

#parse(io) ⇒ 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

Parameters:

  • io (IO)

    IO-like object containing XML

Returns:

  • (Hash)

    Parsed XML as a hash

Raises:

  • (LibXML::XML::Error)

    if XML is malformed



25
26
27
# File 'lib/multi_xml/parsers/libxml.rb', line 25

def parse(io)
  node_to_hash(LibXML::XML::Parser.io(io).parse.root)
end

#parse_errorClass

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

Returns:

  • (Class)

    LibXML::XML::Error



17
# File 'lib/multi_xml/parsers/libxml.rb', line 17

def parse_error = ::LibXML::XML::Error