Class: Itonoko::Parser::XmlParser

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

Instance Method Summary collapse

Instance Method Details

#parse(xml) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/itonoko/parser/xml_parser.rb', line 14

def parse(xml)
  @doc        = XML::Document.new
  @doc.errors = []
  @open_stack = [@doc]
  @buf        = +""
  tokenize_and_build(StringScanner.new(xml.to_s))
  @doc
end