Sha256: 9dfdcde70d323f264a72c66786dc24264e0030f0b2ab01677916078ea9d5c097

Contents?: true

Size: 788 Bytes

Versions: 4

Compression:

Stored size: 788 Bytes

Contents

require 'rexml/document'
require 'rexml/xpath'
require 'rforce/soap_pullable'


module RForce
  # Turns an XML response from the server into a Ruby
  # object whose methods correspond to nested XML elements.
  class SoapResponseRexml
    include SoapPullable

    %w(attlistdecl cdata comment doctype doctype_end elementdecl
       entity entitydecl instruction notationdecl xmldecl).each do |unused|
      define_method(unused) {|*args|}
    end

    def initialize(content)
      @content = content
    end
    
    # Parses an XML string into structured data.
    def parse
      @current_value = nil
      @stack = []
      @parsed = OpenHash.new({})
      @done = false
      @namespaces = []

      REXML::Document.parse_stream @content, self
      
      @parsed
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rforcedotcom-20.0.0 lib/rforce/soap_response_rexml.rb
rforce-0.4.1 lib/rforce/soap_response_rexml.rb
rforce-0.4 lib/rforce/soap_response_rexml.rb
rforce-0.3 lib/rforce/soap_response_rexml.rb