ruby-changes:41872
From: hsbt <ko1@a...>
Date: Fri, 26 Feb 2016 11:24:58 +0900 (JST)
Subject: [ruby-changes:41872] hsbt:r53946 (trunk): * lib/xmlrpc.rb: Removed references to NQXML. It's obsoleted parser.
hsbt 2016-02-26 11:25:40 +0900 (Fri, 26 Feb 2016) New Revision: 53946 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53946 Log: * 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. Modified files: trunk/ChangeLog trunk/lib/xmlrpc/config.rb trunk/lib/xmlrpc/parser.rb trunk/lib/xmlrpc.rb Index: lib/xmlrpc/parser.rb =================================================================== --- lib/xmlrpc/parser.rb (revision 53945) +++ lib/xmlrpc/parser.rb (revision 53946) @@ -10,42 +10,6 @@ require "xmlrpc/base64" https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/parser.rb#L10 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: https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/parser.rb#L576 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: https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/parser.rb#L628 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: https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/parser.rb#L754 end XMLParser = XMLTreeParser - NQXMLParser = NQXMLTreeParser Classes = [XMLStreamParser, XMLTreeParser, - NQXMLStreamParser, NQXMLTreeParser, REXMLStreamParser, XMLScanStreamParser, LibXMLStreamParser] Index: lib/xmlrpc/config.rb =================================================================== --- lib/xmlrpc/config.rb (revision 53945) +++ lib/xmlrpc/config.rb (revision 53946) @@ -13,8 +13,6 @@ module XMLRPC # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc/config.rb#L13 # === Available parsers # - # * XMLParser::NQXMLTreeParser - # * XMLParser::NQXMLStreamParser # * XMLParser::XMLTreeParser # * XMLParser::XMLStreamParser (fastest) # * XMLParser::REXMLStreamParser Index: lib/xmlrpc.rb =================================================================== --- lib/xmlrpc.rb (revision 53945) +++ lib/xmlrpc.rb (revision 53946) @@ -53,10 +53,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc.rb#L53 # * 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 @@ https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc.rb#L66 # * 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 @@ https://github.com/ruby/ruby/blob/trunk/lib/xmlrpc.rb#L291 # 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 Index: ChangeLog =================================================================== --- ChangeLog (revision 53945) +++ ChangeLog (revision 53946) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Feb 26 11:21:41 2016 herwinw <herwin@q...> + + * 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. + Fri Feb 26 11:10:19 2016 Rick Salevsky <rsalevsky@s...> * lib/tmpdir.rb: Unify to coding-style for method definition. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/