Module: MultiXml::Parsers::SaxHandler Private

Included in:
LibxmlSax::Handler, NokogiriSax::Handler
Defined in:
lib/multi_xml/parsers/sax_handler.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.

Shared SAX handler logic for building hash trees from XML events

This module provides the core stack-based parsing logic used by both NokogiriSax and LibxmlSax parsers. Including classes must implement the callback methods that their respective SAX libraries expect.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultHash (readonly)

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 parsed result

Returns:

  • (Hash)

    the parsed hash



27
28
29
# File 'lib/multi_xml/parsers/sax_handler.rb', line 27

def result
  @result
end

Instance Method Details

#initialize_handlervoid

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.

This method returns an undefined value.

Initialize the handler state



17
18
19
20
21
# File 'lib/multi_xml/parsers/sax_handler.rb', line 17

def initialize_handler
  @result = {}
  @stack = [@result]
  @pending_attrs = []
end