1 require 'rexml/parsers/streamparser'
2 require 'rexml/parsers/baseparser'
9 @parser = REXML::Parsers::BaseParser.new( stream )
12 def add_listener( listener )
13 @parser.add_listener( listener )
18 @parser.stream = @stream
30 when :start_element, :doctype
32 event[1,0] = [context]
44 # An element is an array. The array contains:
45 # 0 The parent element
47 # 2 A hash of attributes
48 # 3..-1 The child elements
49 # An element is an array of size > 3
51 # PIs are [ :processing_instruction, target, data ]
52 # Comments are [ :comment, data ]
53 # DocTypes are DocType structs
54 # The root is an array with XMLDecls, Text, DocType, Array, Text