diff options
Diffstat (limited to 'lib/rexml/parsers/baseparser.rb')
-rw-r--r-- | lib/rexml/parsers/baseparser.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb index cb33a64908..c898ba0b60 100644 --- a/lib/rexml/parsers/baseparser.rb +++ b/lib/rexml/parsers/baseparser.rb @@ -128,6 +128,8 @@ module REXML @source = source elsif defined? StringIO and source.kind_of? StringIO @source = IOSource.new(source) + elsif defined? Tempfile and source.kind_of? Tempfile + @source = IOSource.new(source) else raise "#{source.class} is not a valid input stream. It must be \n"+ "either a String, IO, StringIO or Source." @@ -139,6 +141,15 @@ module REXML @entities = [] end + def position + if @source.respond_to? :position + @source.position + else + # FIXME + 0 + end + end + # Returns true if there are no more events def empty? #puts "@source.empty? = #{@source.empty?}" |