diff options
Diffstat (limited to 'lib/rexml/parsers/sax2parser.rb')
-rw-r--r-- | lib/rexml/parsers/sax2parser.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rexml/parsers/sax2parser.rb b/lib/rexml/parsers/sax2parser.rb index d5ee1bcfcd..f1b8246902 100644 --- a/lib/rexml/parsers/sax2parser.rb +++ b/lib/rexml/parsers/sax2parser.rb @@ -1,9 +1,11 @@ require 'rexml/parsers/baseparser' require 'rexml/parseexception' require 'rexml/namespace' +require 'rexml/text' module REXML module Parsers + # SAX2Parser class SAX2Parser def initialize source @parser = BaseParser.new(source) @@ -36,6 +38,10 @@ module REXML # :start_prefix_mapping, :end_prefix_mapping, :characters, # :processing_instruction, :doctype, :attlistdecl, :elementdecl, # :entitydecl, :notationdecl, :cdata, :xmldecl, :comment + # + # There is an additional symbol that can be listened for: :progress. + # This will be called for every event generated, passing in the current + # stream position. # # Array contains regular expressions or strings which will be matched # against fully qualified element names. @@ -161,6 +167,7 @@ module REXML :elementdecl, :cdata, :notationdecl, :xmldecl handle( *event ) end + handle( :progress, @parser.source.position ) end end |