Home >>XML Tutorial >XML Parsers
An XML parser is a software library or package that provides interfaces for an XML text to interact for client applications. The XML Parser is designed to interpret the XML and create a way to use XML in programs.
XML parser validates the text and verifies that it is well-formatted.
Let's understand XML parser feature by the following figure:
These are the two main types of XML Parsers:
A DOM document is an entity that comprises all of the XML document information. It is constructed like the structure of a tree. A DOM API is introduced by the DOM Parser. This API is incredibly easy to use.
A DOM Parser generates an internal memory representation and is an entity of a DOM document and the client applications obtain information regarding the initial XML document by executing methods on this entity.
DOM Parser has structure centered on a tree.
A SAX Parser implements SAX API. This API is an event based API and less intuitive.
This has no internal structure.
Clients don't know which methods to call, they simply override the API methods and put their own application within the method.
It is an event-based parser, it functions like a Java event handler.
Several commercial products are accessible to ease the parsing process, which facilitate the breakdown of XML document and yield more reliable outcomes.
The following lists some commonly used parsers −