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

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

Constant Summary collapse

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

#method_missing(*a) ⇒ Object



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

def method_missing(*a)
end

Instance Method Details

#on_cdata(str) ⇒ Object



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

def on_cdata(str)
  character(str)
end

#on_chardata(str) ⇒ Object



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

def on_chardata(str)
  character(str)
end

#on_charref(code) ⇒ Object



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

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

#on_charref_hex(code) ⇒ Object



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

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

#on_entityref(ent) ⇒ Object



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

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

#on_stag_end(name) ⇒ Object



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

def on_stag_end(name); end

#on_stag_end_empty(name) ⇒ Object



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

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

#parse(str) ⇒ Object



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

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