* lib/xmlrpc.rb: Removed broken parser named XMLScanStreamParser.
It's not works with current Ruby version. [fix GH-1271][ruby-core:59588][Bug #9369] * lib/xmlrpc/config.rb: ditto. * lib/xmlrpc/parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d8e3a92411
commit
a2845a44f8
@ -1,3 +1,11 @@
|
|||||||
|
Wed Mar 2 15:13:33 2016 herwinw <herwin@quarantainenet.nl>
|
||||||
|
|
||||||
|
* lib/xmlrpc.rb: Removed broken parser named XMLScanStreamParser.
|
||||||
|
It's not works with current Ruby version.
|
||||||
|
[fix GH-1271][ruby-core:59588][Bug #9369]
|
||||||
|
* lib/xmlrpc/config.rb: ditto.
|
||||||
|
* lib/xmlrpc/parser.rb: ditto.
|
||||||
|
|
||||||
Wed Mar 2 15:08:33 2016 herwinw <herwin@quarantainenet.nl>
|
Wed Mar 2 15:08:33 2016 herwinw <herwin@quarantainenet.nl>
|
||||||
|
|
||||||
* lib/xmlrpc.rb: Removed broken parser named XMLTreeParser.
|
* lib/xmlrpc.rb: Removed broken parser named XMLTreeParser.
|
||||||
|
@ -56,9 +56,6 @@
|
|||||||
# * REXML (XMLParser::REXMLStreamParser)
|
# * REXML (XMLParser::REXMLStreamParser)
|
||||||
# * Not compiled (pure ruby)
|
# * Not compiled (pure ruby)
|
||||||
# * See ruby standard library
|
# * See ruby standard library
|
||||||
# * xml-scan (XMLParser::XMLScanStreamParser)
|
|
||||||
# * Not compiled (pure ruby)
|
|
||||||
# * See https://rubygems.org/gems/xmlscan
|
|
||||||
# * libxml (LibXMLStreamParser)
|
# * libxml (LibXMLStreamParser)
|
||||||
# * Compiled
|
# * Compiled
|
||||||
# * See https://rubygems.org/gems/libxml-ruby/
|
# * See https://rubygems.org/gems/libxml-ruby/
|
||||||
|
@ -14,7 +14,6 @@ module XMLRPC # :nodoc:
|
|||||||
# === Available parsers
|
# === Available parsers
|
||||||
#
|
#
|
||||||
# * XMLParser::REXMLStreamParser
|
# * XMLParser::REXMLStreamParser
|
||||||
# * XMLParser::XMLScanStreamParser
|
|
||||||
# * XMLParser::LibXMLStreamParser
|
# * XMLParser::LibXMLStreamParser
|
||||||
DEFAULT_PARSER = XMLParser::REXMLStreamParser
|
DEFAULT_PARSER = XMLParser::REXMLStreamParser
|
||||||
|
|
||||||
|
@ -592,75 +592,6 @@ module XMLRPC # :nodoc:
|
|||||||
|
|
||||||
end
|
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
|
class LibXMLStreamParser < AbstractStreamParser
|
||||||
def initialize
|
def initialize
|
||||||
require 'libxml'
|
require 'libxml'
|
||||||
@ -692,8 +623,7 @@ module XMLRPC # :nodoc:
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Classes = [REXMLStreamParser, XMLScanStreamParser,
|
Classes = [REXMLStreamParser, LibXMLStreamParser]
|
||||||
LibXMLStreamParser]
|
|
||||||
|
|
||||||
# yields an instance of each installed parser
|
# yields an instance of each installed parser
|
||||||
def self.each_installed_parser
|
def self.each_installed_parser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user