Event-Based Vs Tree-Based Parsers

Event-Based Vs Tree-Based Parsers

 API in XML Parser

Learn XML - XML tutorial - API in XML Parser - XML examples - XML programs

Event Based Parser Tree Based Parser
An event-based API reports parsing events
(such as the start and end of elements) directly
to the application through callbacks.
These map an XML document into an internal tree structure, and then allow an application to navigate that tree.
The application implements handlers to deal with the
different events.
Tree based parser is an Ideal for browsers, editors, XSL processors.
Used for large documents. Used for small documents.
More complex and give hard time for the programmer. Easier to implement.
Example for Event based parser - SAX Model . Example for tree based parser- DOM Model .
Less Expensive because it doesn't create
data structures for entire documents.
More Expensive because of random access of document element

Read Also

SAX Parser

Structural differnece between tree and event based parser

 Structural difference between tree and event based parser

Learn XML - XML tutorial - Structural difference between tree and event based parser - XML examples - XML programs

Related Searches to Event-Based Vs Tree-Based Parsers