Class: XMLRPC::XMLParser::XMLScanStreamParser::XMLScanParser

Inherits:
Object
  • Object
show all
Includes:
StreamParserMixin
Defined in:
lib/xmlrpc/parser.rb

Constant Summary

Entities =
{
  "lt"   => "<",
  "gt"   => ">",
  "amp"  => "&",
  "quot" => '"',
  "apos" => "'"
}

Instance Attribute Summary

Attributes included from StreamParserMixin

#fault, #method_name, #params

Instance Method Summary (collapse)

Methods included from StreamParserMixin

#character, #endElement, #initialize, #startElement

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(*a)



780
781
# File 'lib/xmlrpc/parser.rb', line 780

def method_missing(*a)
end

Instance Method Details

- (Object) on_cdata(str)



759
760
761
# File 'lib/xmlrpc/parser.rb', line 759

def on_cdata(str)
  character(str)
end

- (Object) on_chardata(str)



755
756
757
# File 'lib/xmlrpc/parser.rb', line 755

def on_chardata(str)
  character(str)
end

- (Object) on_charref(code)



772
773
774
# File 'lib/xmlrpc/parser.rb', line 772

def on_charref(code)
  character(code.chr)
end

- (Object) on_charref_hex(code)



776
777
778
# File 'lib/xmlrpc/parser.rb', line 776

def on_charref_hex(code)
  character(code.chr)
end

- (Object) on_entityref(ent)



763
764
765
766
767
768
769
770
# File 'lib/xmlrpc/parser.rb', line 763

def on_entityref(ent)
  str = Entities[ent]
  if str
    character(str)
  else
    raise "unknown entity"
  end
end

- (Object) on_stag_end(name)



748
# File 'lib/xmlrpc/parser.rb', line 748

def on_stag_end(name); end

- (Object) on_stag_end_empty(name)



750
751
752
753
# File 'lib/xmlrpc/parser.rb', line 750

def on_stag_end_empty(name)
  startElement(name)
  endElement(name)
end

- (Object) parse(str)



740
741
742
743
# File 'lib/xmlrpc/parser.rb', line 740

def parse(str)
  parser  = XMLScan::XMLParser.new(self)
  parser.parse(str)
end