Class: Fog::XenServer::NokogiriStreamParser

Inherits:
XMLRPC::XMLParser::AbstractStreamParser
  • Object
show all
Defined in:
lib/fog/xenserver/nokogiri_stream_parser.rb

Instance Method Summary collapse

Constructor Details

#initializeNokogiriStreamParser

Returns a new instance of NokogiriStreamParser.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fog/xenserver/nokogiri_stream_parser.rb', line 8

def initialize
  @parser_class = Class.new(Nokogiri::XML::SAX::Document) do

    include XMLRPC::XMLParser::StreamParserMixin

    alias_method :start_element, :startElement
    alias_method :end_element,   :endElement
    alias_method :characters,    :character
    alias_method :cdata_block,   :character

    def parse(str)
      Nokogiri::XML::SAX::Parser.new(self).parse(str)
    end
  end
end