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



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

def <<(data)
    push(data)
end

#endObject



33
34
35
36
# File 'lib/xml/xml_parser.rb', line 33

def end
    @end = true
    parse()
end

#push(data) ⇒ Object



28
29
30
31
# File 'lib/xml/xml_parser.rb', line 28

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

#resetObject



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

def reset
    @state = :NONE
    @temp_str = nil
    @is_start_tag = true
    @quote_state = nil
    @data = ''
    @end = false
end