~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/rexml/parsers/sax2parser.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2006-05-08 22:23:12 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060508222312-w2wqeaz030ifi59j
Tags: 1.9.0+20060423-3ubuntu1
* Resynchronized with Debian.
* Only change from Debian is the addition of
  debian/patches/903_sparc_fix_define.patch to fix illegal instructions
  at runtime on sparc. (change from 1.9.0+20050921-1ubuntu1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
require 'rexml/parsers/baseparser'
2
2
require 'rexml/parseexception'
3
3
require 'rexml/namespace'
 
4
require 'rexml/text'
4
5
 
5
6
module REXML
6
7
        module Parsers
 
8
    # SAX2Parser
7
9
                class SAX2Parser
8
10
                        def initialize source
9
11
                                @parser = BaseParser.new(source)
36
38
                        # :start_prefix_mapping, :end_prefix_mapping, :characters,
37
39
                        # :processing_instruction, :doctype, :attlistdecl, :elementdecl,
38
40
                        # :entitydecl, :notationdecl, :cdata, :xmldecl, :comment
 
41
      #
 
42
      # There is an additional symbol that can be listened for: :progress.
 
43
      # This will be called for every event generated, passing in the current 
 
44
      # stream position.
39
45
                        #
40
46
                        # Array contains regular expressions or strings which will be matched
41
47
                        # against fully qualified element names.
161
167
                                                :elementdecl, :cdata, :notationdecl, :xmldecl
162
168
                                                handle( *event )
163
169
                                        end
 
170
          handle( :progress, @parser.position )
164
171
                                end
165
172
                        end
166
173