Extended maintenance of Ruby versions 1.8.7 and 1.9.2 ended on July 31, 2014. Read more

In Files

  • wsdl/parser.rb
  • wsdl/soap/binding.rb
  • wsdl/soap/operation.rb
  • wsdl/xmlSchema/complexContent.rb
  • wsdl/xmlSchema/element.rb

Class/Module Index [+]

Quicksearch

WSDL::Parser

Public Class Methods

new(opt = {}) click to toggle source
 
               # File wsdl/parser.rb, line 52
def initialize(opt = {})
  @parser = XSD::XMLParser.create_parser(self, opt)
  @parsestack = nil
  @lastnode = nil
  @ignored = {}
  @location = opt[:location]
  @originalroot = opt[:originalroot]
end
            

Public Instance Methods

characters(text) click to toggle source
 
               # File wsdl/parser.rb, line 88
def characters(text)
  lastframe = @parsestack.last
  if lastframe
    # Need not to be cloned because character does not have attr.
    ns = lastframe.ns
    decode_text(ns, text)
  else
    p text if $DEBUG
  end
end
            
charset() click to toggle source
 
               # File wsdl/parser.rb, line 69
def charset
  @parser.charset
end
            
end_element(name) click to toggle source
 
               # File wsdl/parser.rb, line 99
def end_element(name)
  lastframe = @parsestack.pop
  unless name == lastframe.name
    raise UnexpectedElementError.new("closing element name '#{name}' does not match with opening element '#{lastframe.name}'")
  end
  decode_tag_end(lastframe.ns, lastframe.node)
  @lastnode = lastframe.node
end
            
parse(string_or_readable) click to toggle source
 
               # File wsdl/parser.rb, line 61
def parse(string_or_readable)
  @parsestack = []
  @lastnode = nil
  @textbuf = ''
  @parser.do_parse(string_or_readable)
  @lastnode
end
            
start_element(name, attrs) click to toggle source
 
               # File wsdl/parser.rb, line 73
def start_element(name, attrs)
  lastframe = @parsestack.last
  ns = parent = nil
  if lastframe
    ns = lastframe.ns.clone_ns
    parent = lastframe.node
  else
    ns = XSD::NS.new
    parent = nil
  end
  attrs = XSD::XMLParser.filter_ns(ns, attrs)
  node = decode_tag(ns, name, attrs, parent)
  @parsestack << ParseFrame.new(ns, name, node)
end