diff options
Diffstat (limited to 'other/ruby-libxml.rb')
-rwxr-xr-x | other/ruby-libxml.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/other/ruby-libxml.rb b/other/ruby-libxml.rb new file mode 100755 index 0000000..b4af2dd --- /dev/null +++ b/other/ruby-libxml.rb @@ -0,0 +1,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 + |