Class: XSD::XMLParser::OgaParser

Inherits:
Parser show all
Defined in:
lib/xsd/xmlparser/ogaparser.rb

Instance Attribute Summary

Attributes inherited from Parser

#charset

Instance Method Summary collapse

Methods inherited from Parser

add_factory, create_parser, factory, #initialize, #parse

Constructor Details

This class inherits a constructor from XSD::XMLParser::Parser

Instance Method Details

#after_element(namespace, name) ⇒ Object



27
28
29
# File 'lib/xsd/xmlparser/ogaparser.rb', line 27

def after_element(namespace, name)
  end_element(node_name(namespace, name))
end

#do_parse(string_or_readable) ⇒ Object



17
18
19
20
# File 'lib/xsd/xmlparser/ogaparser.rb', line 17

def do_parse(string_or_readable)
  $stderr.puts "XSD::XMLParser::OgaParser.do_parse" if $DEBUG    
  Oga.sax_parse_xml(self, string_or_readable)
end

#on_element(namespace, name, attrs) ⇒ Object



23
24
25
# File 'lib/xsd/xmlparser/ogaparser.rb', line 23

def on_element(namespace, name, attrs)
  start_element(node_name(namespace, name), attrs)
end

#on_text(t) ⇒ Object Also known as: on_cdata, on_comment



31
32
33
# File 'lib/xsd/xmlparser/ogaparser.rb', line 31

def on_text(t)
  characters(t)
end

#on_xml_decl(attr_hash) ⇒ Object



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

def on_xml_decl(attr_hash)
  send :xmldecl_encoding=,attr_hash['encoding'] 
end