Types of XML parser: SAX (Simple API for XML), Document Object Model (DOM)

XML parser: XML parser is a software which translates the text format of the XML document to a program version. A database which supports XML uses a XML parser.

Types of XML parsers:

1) SAX (Simple API for XML): SAX is an API which is used for sequential access. It was developed by XML-DEV. By using this parser a XML document is converted to a sequence of callbacks to a program. For a particular element or an attribute an action is taken by the program. This is done in a sequential way. SAX is used with an event driven program. In SAX, parsing of XML documents is fast. It is usually used for large documents.

2) Document Object Model (DOM): In a DOM parser, XML document is converted to a hierarchical tree structure. This tree structure can be navigated by the program which makes call to the DOM API. Parsing of XML document is slower in a DOM parser. It is usually used for small documents.

Leave a Reply