summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-26 02:25:40 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-26 02:25:40 +0000
commit0676ce8739bfcacf1d994fbeae137aceb0f5ff48 (patch)
treec3a6af8da4f8022ad097151b91977fbfdd8aef0d /lib
parent379c3b8b2483f8c93556e6308a094553e36dcb65 (diff)
* lib/xmlrpc.rb: Removed references to NQXML. It's obsoleted parser.
[fix GH-1245][ruby-core:59593][Feature #9371] * lib/xmlrpc/config.rb: ditto. * lib/xmlrpc/parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/xmlrpc.rb17
-rw-r--r--lib/xmlrpc/config.rb2
-rw-r--r--lib/xmlrpc/parser.rb95
3 files changed, 3 insertions, 111 deletions
diff --git a/lib/xmlrpc.rb b/lib/xmlrpc.rb
index 3928bf0d95..7cda39fc03 100644
--- a/lib/xmlrpc.rb
+++ b/lib/xmlrpc.rb
@@ -53,10 +53,6 @@
# * HTTPS protocol (SSL)
#
# * Parsers
-# * NQXML (XMLParser::NQXMLStreamParser, XMLParser::NQXMLTreeParser)
-# * Not compiled (pure ruby)
-# * Note: NQXML's website recommends rexml and isn't available on rubygems.org
-# * See http://nqxml.sourceforge.net/
# * Expat (XMLParser::XMLStreamParser, XMLParser::XMLTreeParser)
# * Compiled
# * Fastest parser and also uses the least memory
@@ -70,7 +66,7 @@
# * Fastest parser is Expat's XMLParser::XMLStreamParser!
#
# * General
-# * possible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers
+# * possible to choose between XMLParser module (Expat wrapper) and REXML (pure Ruby) parsers
# * Marshalling Ruby objects to Hashes and reconstruct them later from a Hash
# * SandStorm component architecture XMLRPC::Client interface
#
@@ -295,18 +291,11 @@
# s.set_parser(XMLRPC::XMLParser::XMLStreamParser.new)
# # ...
#
-# or:
-#
-# # ...
-# server = XMLRPC::Server.new(8080)
-# server.set_parser(XMLRPC::XMLParser::NQXMLParser.new)
-# # ...
-#
#
# Note XMLParser::XMLStreamParser (xmlparser gem) is faster and uses less memory than any
# other parser and scales well for large documents. For example for a 0.5 MB XML
-# document with many tags, XMLParser::XMLStreamParser is ~350 (!) times faster than
-# XMLParser::NQXMLTreeParser and still ~18 times as fast as XMLParser::XMLTreeParser.
+# document with many tags, XMLParser::XMLStreamParser is ~18 times as fast as
+# XMLParser::XMLTreeParser.
#
# You can change the XML-writer by calling method ParserWriterChooseMixin#set_writer.
module XMLRPC; end
diff --git a/lib/xmlrpc/config.rb b/lib/xmlrpc/config.rb
index f49adb6892..4550311f90 100644
--- a/lib/xmlrpc/config.rb
+++ b/lib/xmlrpc/config.rb
@@ -13,8 +13,6 @@ module XMLRPC # :nodoc:
# === Available parsers
#
- # * XMLParser::NQXMLTreeParser
- # * XMLParser::NQXMLStreamParser
# * XMLParser::XMLTreeParser
# * XMLParser::XMLStreamParser (fastest)
# * XMLParser::REXMLStreamParser
diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb
index 3b912b6be2..45b219bbfa 100644
--- a/lib/xmlrpc/parser.rb
+++ b/lib/xmlrpc/parser.rb
@@ -10,42 +10,6 @@ require "xmlrpc/base64"
require "xmlrpc/datetime"
-module NQXML
- class Node
-
- def removeChild(node)
- @children.delete(node)
- end
- def childNodes
- @children
- end
- def hasChildNodes
- not @children.empty?
- end
- def [] (index)
- @children[index]
- end
-
- def nodeType
- if @entity.instance_of? NQXML::Text then :TEXT
- elsif @entity.instance_of? NQXML::Comment then :COMMENT
- #elsif @entity.instance_of? NQXML::Element then :ELEMENT
- elsif @entity.instance_of? NQXML::Tag then :ELEMENT
- else :ELSE
- end
- end
-
- def nodeValue
- #TODO: error when wrong Entity-type
- @entity.text
- end
- def nodeName
- #TODO: error when wrong Entity-type
- @entity.name
- end
- end # class Node
-end # module NQXML
-
module XMLRPC # :nodoc:
# Raised when the remote procedure returns a fault-structure, which has two
@@ -612,35 +576,6 @@ module XMLRPC # :nodoc:
end
end # class XMLStreamParser
- class NQXMLStreamParser < AbstractStreamParser
- def initialize
- require "nqxml/streamingparser"
- @parser_class = XMLRPCParser
- end
-
- class XMLRPCParser
- include StreamParserMixin
-
- def parse(str)
- parser = NQXML::StreamingParser.new(str)
- parser.each do |ele|
- case ele
- when NQXML::Text
- @data = ele.text
- #character(ele.text)
- when NQXML::Tag
- if ele.isTagEnd
- endElement(ele.name)
- else
- startElement(ele.name, ele.attrs)
- end
- end
- end # do
- end # method parse
- end # class XMLRPCParser
-
- end # class NQXMLStreamParser
-
class XMLTreeParser < AbstractTreeParser
def initialize
@@ -693,34 +628,6 @@ module XMLRPC # :nodoc:
end # class XMLParser
- class NQXMLTreeParser < AbstractTreeParser
-
- def initialize
- require "nqxml/treeparser"
- end
-
- private
-
- def _nodeType(node)
- node.nodeType
- end
-
- def methodResponse_document(node)
- methodResponse(node)
- end
-
- def methodCall_document(node)
- methodCall(node)
- end
-
- def createCleanedTree(str)
- doc = ::NQXML::TreeParser.new(str).document.rootNode
- removeWhitespacesAndComments(doc)
- doc
- end
-
- end # class NQXMLTreeParser
-
class REXMLStreamParser < AbstractStreamParser
def initialize
require "rexml/document"
@@ -847,10 +754,8 @@ module XMLRPC # :nodoc:
end
XMLParser = XMLTreeParser
- NQXMLParser = NQXMLTreeParser
Classes = [XMLStreamParser, XMLTreeParser,
- NQXMLStreamParser, NQXMLTreeParser,
REXMLStreamParser, XMLScanStreamParser,
LibXMLStreamParser]