2 require 'rexml/document'
3 require 'rexml/streamlistener'
6 include REXML::StreamListener
8 attr_accessor :callback
9 def initialize(callback)
11 @is_csproj_file = false
14 def tag_start(name, attrs)
17 @is_csproj_file = true
18 if attrs['xmlns'] and attrs['xmlns'] !~ /^http:\/\/schemas\.microsoft\.com\/developer\//
19 # False alarm -- it contains a project element, but of another namespace
20 @is_csproj_file = false
23 if @is_csproj_file && attrs['Project']
24 @callback.call(attrs['Project'])