w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
  • References
  • Ruby on Rails
  • Ruby
  • Classes
  • REXML
  • REXML::Parsers
  • REXML::Parsers::PullParser
×
Type:
Class

Using the Pull Parser

This API is experimental, and subject to change.

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

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 = PullParser.new( "<a>BAD DOCUMENT" )
while parser.has_next?
  res = parser.next
  raise res[1] if res.error?
end

Nat Price gave me some good ideas for the API.

new
  • References/Ruby on Rails/Ruby/Classes/REXML/REXML::Parsers/REXML::Parsers::PullParser

new(stream) Class Public methods

2025-01-10 15:47:30
unshift
  • References/Ruby on Rails/Ruby/Classes/REXML/REXML::Parsers/REXML::Parsers::PullParser

unshift(token) Instance Public methods

2025-01-10 15:47:30
each
  • References/Ruby on Rails/Ruby/Classes/REXML/REXML::Parsers/REXML::Parsers::PullParser

each() Instance Public methods

2025-01-10 15:47:30
pull
  • References/Ruby on Rails/Ruby/Classes/REXML/REXML::Parsers/REXML::Parsers::PullParser

pull() Instance Public methods

2025-01-10 15:47:30
peek
  • References/Ruby on Rails/Ruby/Classes/REXML/REXML::Parsers/REXML::Parsers::PullParser

peek(depth=0) Instance Public methods

2025-01-10 15:47:30
add_listener
  • References/Ruby on Rails/Ruby/Classes/REXML/REXML::Parsers/REXML::Parsers::PullParser

add_listener( listener ) Instance Public methods

2025-01-10 15:47:30
Popular Articles
pyplot pyplot matplotlib.pyplot Provides a MATLAB-like plotting framework. pylab combines pyplot with numpy into a single namespace. This is convenient for
Ion.RangeSlider - jQuery range slider with skin support Ion.RangeSlider is an easily customizable jQuery range slider. It has flexible settings and can be completely altered with CSS.   Ion.RangeSlider - 
Types Types JavaScript provides several built-in datatypes. In addition to those, this page documents virtual types like Selectors, enhanced pseudo-types
perlapi - autogenerated documentation for the perl public API NAME DESCRIPTION "Gimme" Values Array Manipulation Functions xsubpp variables and internal functions Callback Functions Character case changing Char
1. Overview This is a practical guide to Angular for experienced programmers who are building client applications in HTML and TypeScript. Organization The docu


  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions