Project

General

Profile

Feature #9379

Support for using libxml-ruby as XML parser in xmlrpc-libs

Added by Herwin . over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
[ruby-core:59633]

Description

The default backend in the XMLRPC parser is REXML. This should work at most occasions, but it definitely isn't the fastest implementation. The attached patch allows a backend using libxml-ruby http://xml4r.github.io/libxml-ruby/ which should be more efficient. It successfully passes the unit tests available in the file test/xmlrpc/test_parser.rb

The default isn't changed in this patch, so when libxml-ruby isn't available nothing is changed. Even if it's available, you still have to change the parsing backend before it is used.

libxml-as-xmlrpc-parser.diff Magnifier (1.79 KB) Herwin ., 01/08/2014 12:32 AM

Associated revisions

Revision 47902
Added by Hiroshi SHIBATA over 1 year ago

  • lib/xmlrpc/parser.rb: added new parser class using libxml-ruby gem. [Feature #9379]
  • lib/xmlrpc/config.rb: ditto.

Revision 47902
Added by Hiroshi SHIBATA over 1 year ago

  • lib/xmlrpc/parser.rb: added new parser class using libxml-ruby gem. [Feature #9379]
  • lib/xmlrpc/config.rb: ditto.

Revision 47902
Added by Hiroshi SHIBATA over 1 year ago

  • lib/xmlrpc/parser.rb: added new parser class using libxml-ruby gem. [Feature #9379]
  • lib/xmlrpc/config.rb: ditto.

History

#1 [ruby-core:61989] Updated by Thomas Sawyer about 2 years ago

This seems like a very reasonable idea. (Maybe it would even be possible to add support for Nokogiri too?) One thing though, is there a way to not load REXML at all if it is not needed?

#2 [ruby-core:62016] Updated by Herwin . about 2 years ago

I guess support for Nokogiri will be possible as well, I just needed something more efficient than REXML and libXML was the first thing I tried, and it just worked.

Regarding your second point: that really needs some restructuring of loading the backends, I think that is a little bit outside the scope of this ticket.

#3 [ruby-core:65659] Updated by Hiroshi SHIBATA over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Applied in changeset r47902.


  • lib/xmlrpc/parser.rb: added new parser class using libxml-ruby gem. [Feature #9379]
  • lib/xmlrpc/config.rb: ditto.

#4 [ruby-core:65682] Updated by Zachary Scott over 1 year ago

  • Status changed from Closed to Assigned
  • Assignee set to Hiroshi SHIBATA

Needs tests

#5 [ruby-core:65687] Updated by Hiroshi SHIBATA over 1 year ago

  • Status changed from Assigned to Closed

all StreamParser have no tests.

Also available in: Atom PDF