Class: Fog::XenServer::NokogiriStreamParser
- Inherits:
-
XMLRPC::XMLParser::AbstractStreamParser
- Object
- XMLRPC::XMLParser::AbstractStreamParser
- Fog::XenServer::NokogiriStreamParser
- Defined in:
- lib/fog/xenserver.rb
Instance Method Summary collapse
-
#initialize ⇒ NokogiriStreamParser
constructor
A new instance of NokogiriStreamParser.
Constructor Details
#initialize ⇒ NokogiriStreamParser
Returns a new instance of NokogiriStreamParser.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/fog/xenserver.rb', line 57 def initialize require 'nokogiri/xml/sax/document' require 'nokogiri/xml/sax/parser' @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 |