Class REXML::Parsers::PullParser
In: temp/parsers/pullparser.rb
Parent: Object

Using the Pull Parser

This API is experimental, and subject to change.

 parser = "<a>text<b att='val'/>txet</a>" )
 while parser.has_next?
   res =
   puts res[1]['att'] if res.start_tag? and res[0] == 'b'

See the PullEvent class for information on the content of the results. The data is identical to the arguments passed for the various events to the StreamListener API.

Notice that:

 parser = "<a>BAD DOCUMENT" )
 while parser.has_next?
   res =
   raise res[1] if res.error?

Nat Price gave me some good ideas for the API.


add_listener   each   new   peek   pull   unshift  

Included Modules


Public Class methods

Public Instance methods