Document Type Declaration are information for the parser, upon which the validity of XML documents are checked. Document Type Declaration is a XML mechanism, that defines the constraints of the logical structure and supports the use of predefined storage units. A large percentage of XML specifications deals with various sorts of declarations that are allowed in XML. One of the greatest strengths of XML is that it allows you to create your own tag names. But for any given application, it is probably not meaningful for tags to occur in a completely arbitrary order. If the document is to have meaning, and certainly if you're writing a stylesheet to present it, there must be some constraint on the sequence and nesting of tags. Declarations are where these constraints can be expressed. More generally, declarations allow a document to communicate meta-information to the parser about its content. Meta-information includes the allowed sequence and nesting of tags, attribute values and their types and defaults, the names of external files that may be referenced and whether or not they contain XML, the formats of some external (non-XML) data that may be included, and entities that may be encountered. The document Type declaration can contain the following: - document name
- reference to an external DTD (Document Type Definition)
- markup declaration (internal DTD)
- parameter entity references
DTD and Document Type Declarations are often mixed up, so remember that Document Type Definition (DTD) ist part of the Document Type Declaration. |