Parent

Files

Class Index [+]

Quicksearch

XSD::XMLParser::Parser

Attributes

charset[RW]

Public Class Methods

add_factory(factory) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 40
40:   def self.add_factory(factory)
41:     if $DEBUG
42:       puts "Set #{ factory } as XML processor."
43:     end
44:     @@parser_factory = factory
45:   end
create_parser(host, opt = {}) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 33
33:   def self.create_parser(host, opt = {})
34:     unless @@parser_factory
35:       raise ParserError.new("illegal XML parser configuration")
36:     end
37:     @@parser_factory.new(host, opt)
38:   end
factory() click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 29
29:   def self.factory
30:     @@parser_factory
31:   end
new(host, opt = {}) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 51
51:   def initialize(host, opt = {})
52:     @host = host
53:     @charset = opt[:charset] || nil
54:   end

Public Instance Methods

parse(string_or_readable) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 56
56:   def parse(string_or_readable)
57:     @textbuf = ''
58:     prologue
59:     do_parse(string_or_readable)
60:     epilogue
61:   end

Private Instance Methods

characters(text) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 74
74:   def characters(text)
75:     @host.characters(text)
76:   end
do_parse(string_or_readable) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 65
65:   def do_parse(string_or_readable)
66:     raise ParserError.new(
67:       'Method do_parse must be defined in derived class.')
68:   end
end_element(name) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 78
78:   def end_element(name)
79:     @host.end_element(name)
80:   end
epilogue() click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 85
85:   def epilogue
86:   end
prologue() click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 82
82:   def prologue
83:   end
start_element(name, attrs) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 70
70:   def start_element(name, attrs)
71:     @host.start_element(name, attrs)
72:   end
xmldecl_encoding=(charset) click to toggle source
    # File lib/xsd/xmlparser/parser.rb, line 88
88:   def xmldecl_encoding=(charset)
89:     if @charset.nil?
90:       @charset = charset
91:     else
92:       # Definition in a stream (like HTTP) has a priority.
93:       p "encoding definition: #{ charset } is ignored." if $DEBUG
94:     end
95:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.