Data Exchange through XML

Elucidate the difference between DTD & XML schema.

XMLDTD
XML is namespace aware.DTD is not namespace aware.
It is written in the XML language.It is not written in XML language nor does it have a significant DTD language.
It eliminates the need to learn any other language.It allows to learn another language.
XML implements strong typing.DTD lacks strong typing.
It has derived and built in data type.It does not have derived and built in data type.
The XML schema cannot be defined inline.DTD is defined inline.

Explain XML Parsers.

XML Parsers
  • It refers to going through the XML document to access the data or to modify the data in one or another way.
  • It provides a way for accessing or modifying the data that is present in an XML document.
The various types of parsers are as follows:

1. Dom Parser : It helps the document by loading the complete content of the document and create its complete hierarchical tree in the memory.
2. SAX Parser : It parses the document on the event based triggers. The complete document is not loaded in the memory.
3. JDOM Parser : It parses the document in the same manner as the DOM but in an easier manner.
4. StAX Parser : It parses the document in the same manner as the SAX but in an efficient way.
5. Xpath Parser : It parses the XML that is based on the expression and is used extensively in the conjunction with XSLT.
6. DOM4J Parser : A java library parses XML, Xpath and XSLT by using the Java Collections Framework that provides support for DOM, SAX and JAXP.