class Aws::Xml::Parser::LibxmlEngine

Public Class Methods

new(stack) click to toggle source
# File lib/aws-sdk-core/xml/parser/engines/libxml.rb, line 10
def initialize(stack)
  @stack = stack
end

Public Instance Methods

on_characters(chars) click to toggle source
# File lib/aws-sdk-core/xml/parser/engines/libxml.rb, line 31
def on_characters(chars)
  @stack.text(chars)
end
on_end_element_ns(*ignored) click to toggle source
# File lib/aws-sdk-core/xml/parser/engines/libxml.rb, line 27
def on_end_element_ns(*ignored)
  @stack.end_element
end
on_error(msg) click to toggle source
# File lib/aws-sdk-core/xml/parser/engines/libxml.rb, line 35
def on_error(msg)
  @stack.error(msg)
end
on_start_element_ns(element_name, attributes, *ignored) click to toggle source
# File lib/aws-sdk-core/xml/parser/engines/libxml.rb, line 20
def on_start_element_ns(element_name, attributes, *ignored)
  @stack.start_element(element_name)
  attributes.each do |attr_name, attr_value|
    @stack.attr(attr_name, attr_value)
  end
end
parse(xml) click to toggle source
# File lib/aws-sdk-core/xml/parser/engines/libxml.rb, line 14
def parse(xml)
  parser = ::LibXML::XML::SaxParser.string(xml)
  parser.callbacks = self
  parser.parse
end