XML Parser Paradigms

Now that we have discussed the low-level parser models, push and pull, let’s look at the more commonly discussed models that are built on top of the push and pull concepts. The two major types of parsers are event-driven and tree-based parsers.

Event-Driven XML Parsers

An event-driven parser is a model that can be closely associated with the push model. Event-driven parsers enable an application to define events for each recognized construct, and after that construct (event) is encountered, the parser calls the correct function in the application associated with that event. For example, we can define an event that is called whenever the opening tag (for example, <name>) of an element is encountered. Simple API for XML ...

Get XML and Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.