Class: VTD::Xml::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/vtd/xml/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Parser

Returns a new instance of Parser.



4
5
6
7
8
9
# File 'lib/vtd/xml/parser.rb', line 4

def initialize(path)
  @path = path

  @gen = com.ximpleware.VTDGen.new
  @gen.parse_file(@path, false)
end

Instance Method Details

#find(xpath) ⇒ Object



11
12
13
# File 'lib/vtd/xml/parser.rb', line 11

def find(xpath)
  VTD::Xml::Finder.new(@gen.get_nav, xpath).enum_for(:each)
end