Class: KXML::SAXParser

Inherits:
Object
  • Object
show all
Defined in:
lib/xml/xml_parser.rb

Constant Summary collapse

START_TAG =
'START_TAG'
END_TAG =
'END_TAG'
COMMENTS =
'COMMENTS'
SELF_CLOSE_TAG =
'SELF_COLSE_TAG'
DOCUMENT_STATEMENT =
'DOCUMENT_STATEMENT'
CONTENT =
'CONTENT'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSAXParser

Returns a new instance of SAXParser.



11
12
13
# File 'lib/xml/xml_parser.rb', line 11

def initialize
    reset()
end

Instance Attribute Details

#handlerObject

Returns the value of attribute handler.



10
11
12
# File 'lib/xml/xml_parser.rb', line 10

def handler
  @handler
end

Instance Method Details

#<<(data) ⇒ Object



21
22
23
# File 'lib/xml/xml_parser.rb', line 21

def <<(data)
    push(data)
end

#finishObject



30
31
32
33
# File 'lib/xml/xml_parser.rb', line 30

def finish
    @finish = true
    parse()
end

#push(data) ⇒ Object



25
26
27
28
# File 'lib/xml/xml_parser.rb', line 25

def push(data)
    @data += data
    parse()
end

#resetObject



15
16
17
18
19
# File 'lib/xml/xml_parser.rb', line 15

def reset
    @state = :NONE
    @data = ''
    @finish = false
end