Class: DataActive::SaxDocument

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/data_active/sax_document.rb

Instance Method Summary collapse

Constructor Details

#initialize(first_element_name, options = {}) ⇒ SaxDocument

Returns a new instance of SaxDocument.



5
6
7
# File 'lib/data_active/sax_document.rb', line 5

def initialize(first_element_name, options = {})
  @parser = DataActive::Parser.new(first_element_name, options)
end

Instance Method Details

#cdata_block(value) ⇒ Object



17
18
19
# File 'lib/data_active/sax_document.rb', line 17

def cdata_block(value)
  @parser.content(value)
end

#characters(value) ⇒ Object



21
22
23
# File 'lib/data_active/sax_document.rb', line 21

def characters(value)
  @parser.content(value)
end

#end_documentObject



25
26
27
# File 'lib/data_active/sax_document.rb', line 25

def end_document
  @parser.destroy
end

#end_element(name) ⇒ Object



13
14
15
# File 'lib/data_active/sax_document.rb', line 13

def end_element(name)
  @parser.end(name)
end

#start_element(name, attr) ⇒ Object



9
10
11
# File 'lib/data_active/sax_document.rb', line 9

def start_element(name, attr)
  @parser.begin(name)
end