Class: XSD::XMLParser::NokoDocHandler

Inherits:
Nokogiri::XML::SAX::Document
  • Object
show all
Defined in:
lib/xsd/xmlparser/nokogiriparser.rb

Instance Method Summary collapse

Constructor Details

#initialize(owner) ⇒ NokoDocHandler

Returns a new instance of NokoDocHandler.



26
27
28
# File 'lib/xsd/xmlparser/nokogiriparser.rb', line 26

def initialize(owner)
  @owner = (owner)
end

Instance Method Details

#cdata_block(t) ⇒ Object



43
44
45
# File 'lib/xsd/xmlparser/nokogiriparser.rb', line 43

def cdata_block(t)
  @owner.send(:characters, t)
end

#characters(t) ⇒ Object



47
48
49
# File 'lib/xsd/xmlparser/nokogiriparser.rb', line 47

def characters(t)
  @owner.send(:characters, t)
end

#comment(t) ⇒ Object



51
52
53
# File 'lib/xsd/xmlparser/nokogiriparser.rb', line 51

def comment(t)
  @owner.send(:characters,t)
end

#end_element(name) ⇒ Object



38
39
40
# File 'lib/xsd/xmlparser/nokogiriparser.rb', line 38

def end_element(name)
  @owner.send(:end_element, name)
end

#start_element(name, attrs) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/xsd/xmlparser/nokogiriparser.rb', line 30

def start_element(name,attrs)
  attr_hash = Hash.new
  attrs.each do |kv_array|
    attr_hash[kv_array[0]] = kv_array[1]
  end
  @owner.send(:start_element, name, attr_hash)
end