XML - Document Type (Definition|Declaration) (DTD)

1 - About

XML provides a mechanism, the document type declaration:

Document Type Definition (DTD) is a set of markup declarations that define a document type for SGML-family markup languages (SGML, XML, HTML). DTDs were a precursor to XML schemas and have a similar function, although different capabilities.

A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list of legal elements and attributes.

A DTD can be declared inline inside an XML document, or as an external reference.

The document type declaration MUST appear before the first element in the document.

The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents.

This grammar is known as a document type definition, or DTD.

The document type declaration can point to an external subset (a special kind of external entity) containing:

  • markup declarations,
  • or can contain the markup declarations directly in an internal subset,
  • or can do both.

The DTD for a document consists of both subsets taken together.

DTD are context-free grammars

3 - Markup Declaration

A markup declaration is:

These declarations may be contained in whole or in part within parameter entities

4 - Element Relation Ship

Declaration Relationship (Cardinality)
<!ELEMENT master (sub)> One and only once
<!ELEMENT master (sub+)> One or more
<!ELEMENT master (sub*)> Zero or more
<!ELEMENT master (sub?)> Zero or one

5 - Documentation / Reference

  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at del.icio.us
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Digg
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Ask
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Google
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at StumbleUpon
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Technorati
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Live Bookmarks
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Yahoo! Myweb
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Facebook
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Yahoo! Bookmarks
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at Twitter
  • Bookmark "XML - Document Type (Definition|Declaration) (DTD)" at myAOL
markup/xml/dtd.txt ยท Last modified: 2017/05/14 15:56 by gerardnico