diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xmlrpc.rb | 3 | ||||
-rw-r--r-- | lib/xmlrpc/config.rb | 1 | ||||
-rw-r--r-- | lib/xmlrpc/parser.rb | 72 |
3 files changed, 1 insertions, 75 deletions
diff --git a/lib/xmlrpc.rb b/lib/xmlrpc.rb index c581efee7c..94d93a18b9 100644 --- a/lib/xmlrpc.rb +++ b/lib/xmlrpc.rb @@ -56,9 +56,6 @@ # * REXML (XMLParser::REXMLStreamParser) # * Not compiled (pure ruby) # * See ruby standard library -# * xml-scan (XMLParser::XMLScanStreamParser) -# * Not compiled (pure ruby) -# * See https://rubygems.org/gems/xmlscan # * libxml (LibXMLStreamParser) # * Compiled # * See https://rubygems.org/gems/libxml-ruby/ diff --git a/lib/xmlrpc/config.rb b/lib/xmlrpc/config.rb index 8c6ffc68ef..b7ed7a9f71 100644 --- a/lib/xmlrpc/config.rb +++ b/lib/xmlrpc/config.rb @@ -14,7 +14,6 @@ module XMLRPC # :nodoc: # === Available parsers # # * XMLParser::REXMLStreamParser - # * XMLParser::XMLScanStreamParser # * XMLParser::LibXMLStreamParser DEFAULT_PARSER = XMLParser::REXMLStreamParser diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb index 7b11710d37..a58da33720 100644 --- a/lib/xmlrpc/parser.rb +++ b/lib/xmlrpc/parser.rb @@ -592,75 +592,6 @@ module XMLRPC # :nodoc: end - class XMLScanStreamParser < AbstractStreamParser - def initialize - require "xmlscan/parser" - @parser_class = XMLScanParser - end - - class XMLScanParser - include StreamParserMixin - - Entities = { - "lt" => "<", - "gt" => ">", - "amp" => "&", - "quot" => '"', - "apos" => "'" - } - - def parse(str) - parser = XMLScan::XMLParser.new(self) - parser.parse(str) - end - - alias :on_stag :startElement - alias :on_etag :endElement - - def on_stag_end(name); end - - def on_stag_end_empty(name) - startElement(name) - endElement(name) - end - - def on_chardata(str) - character(str) - end - - def on_cdata(str) - character(str) - end - - def on_entityref(ent) - str = Entities[ent] - if str - character(str) - else - raise "unknown entity" - end - end - - def on_charref(code) - character(code.chr) - end - - def on_charref_hex(code) - character(code.chr) - end - - def method_missing(*a) - end - - # TODO: call/implement? - # valid_name? - # valid_chardata? - # valid_char? - # parse_error - - end - end - class LibXMLStreamParser < AbstractStreamParser def initialize require 'libxml' @@ -692,8 +623,7 @@ module XMLRPC # :nodoc: end end - Classes = [REXMLStreamParser, XMLScanStreamParser, - LibXMLStreamParser] + Classes = [REXMLStreamParser, LibXMLStreamParser] # yields an instance of each installed parser def self.each_installed_parser |