The doctype has several purposes in an xml document such as:
- It is used for validation purposes of the document.
- It helps the browser to tell which version of the markup language was used by the creator.
- The doctype helps in rendering a page properly in a browser that is standards compliant.
The doctypes can be differentiated into three major types:
strict doctype declaration : This declaration is used when css is being used to style a page.
transactional doctype declaration : This doctype specification is used if the document consists of any presentational markups.
frames doctype declaration : This is used id the document is present in form of frames.