Sunday, February 11, 2007

XML Parsers

XML Parsing in Java:

XML parser is a software module to read documents and a means to provide access to their content. XML parser generates a structured tree to return the results to the browser. An XML parser is similar to a processor that determines the structure and properties of the data. An XML parser can read a XML document to create an output to generate a display form.

Types of XML Parser:

1. SAX Parser
2. DOM Parser

SAX Parser:
Simple API for XML (SAX) was developed by the members of a public mailing list (XML-DEV).It gives an event based approach to XML parsing. It means that instead of going from node to node, it goes from event to event. SAX is an event driven interface. Events include XML tag, detecting errors etc,

DOM Parser:
DOM Parser stands for Document Object Model. This read the entire XML Files and puts in the memory. This makes traversal easy and efficient. This should only be used for small XML Files. This operates faster, but takes up more memory.

In the next post, we will see an example of DOM Parser in Java.

1 comment:

Anonymous said...

Hi Nice Blog.We are specializes in the implementation and management of high-volume, complex projects for xml data conversion. Using XML as a document representation format is of great benefit, and applies across industries.