XML Prolog

In this tutorial you will learn about the XML Prolog and its application with practical example.

XML Prolog

This is first and most important part of an XML Document. It tells the browser that this document is marked up in XML.The prolog contains an XML declaration, possibly followed by a document type declaration (DTD).

XML Declaration

When we look at the XML Document we notice first line as below –

It is used as the XML declaration it tell the browser that the document is written in XML and specifies which version of XML. It also specify the language of character encoding.

Although XML declaration is not necessary but it is best practice to include it in your XML documents.

Document Type Definition (DTD)

Document Type Declaration is used to specify the set of rules for current XML Document structure as per the requirement. Set of rules or instructions can be defined in a separate file and this file can be used to validate XML document in which it is included and application stops to process the XML Document further if the document doesn’t adhere to the DTD.

Example

In this tutorial we have learn about the XML Prolog and its application with practical example. I hope you will like this tutorial.