summaryrefslogtreecommitdiff
path: root/other/ruby-libxml.rb
blob: b4af2dd73f926608bdc985d774f3b132f789e90b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/ruby -w
require 'libxml'

include LibXML

class PostCallbacks
  include XML::SaxParser::Callbacks

  def on_start_element(element, attributes)
    puts element
  end
end

parser = XML::SaxParser.file(ARGV[0])
parser.callbacks = PostCallbacks.new
parser.parse