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.
Provides a stack machine used by both NokogiriSax and LibxmlSax handlers. Parser-specific subclasses translate their native callbacks into calls on this entrypoint:
- handle_start_element_ns(local, prefix, attr_tuples, ns_decls) where attr_tuples = [[attr_prefix_or_nil, local, value], ...] ns_decls = [[prefix_or_nil, uri], ...]
Instance Attribute Summary collapse
-
#result ⇒ Hash
readonly
private
Get the parsed result.
Instance Method Summary collapse
-
#initialize_handler(mode) ⇒ void
private
Initialize the handler state.
Instance Attribute Details
#result ⇒ Hash (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
33 34 35 |
# File 'lib/multi_xml/parsers/sax_handler.rb', line 33 def result @result end |
Instance Method Details
#initialize_handler(mode) ⇒ void
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
22 23 24 25 26 27 |
# File 'lib/multi_xml/parsers/sax_handler.rb', line 22 def initialize_handler(mode) @mode = mode @result = {} @stack = [@result] @pending = [] end |