[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
DTD
A DTD defines the members of an XML document. There are four members which may be defined in the DTD: elements, entities, attributes, and ?notations.
This could then be reused in other definitions:
Used together, these four members completely define a valid XML document.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
DTD
Document Type Definition (DTD)
A '''Document Type Definition''' is a construction in an XML document which defines the terms for the document. A DTD may be embedded directly in the XML document itself, or it may be a standalone document to which the XML document makes reference.A DTD defines the members of an XML document. There are four members which may be defined in the DTD: elements, entities, attributes, and ?notations.
Elements
Elements are the data-containing constructs which actually format the XML document. An example of an element may be the <title> element or the <body> element. Note that elements correspond to the tags used in the creation of the XML document. An element definition would appear as follows:<!ELEMENT body (#PCDATA,section,paragraph)*>
Entities
Entities are like constants which may be reused throughout the XML document, or within the DTD itself. An example of an entity definition would be as follows:<!ENTITY % inline "bold,italic,underline,strikethru,sub,super">
This could then be reused in other definitions:
<!ELEMENT body (#PCDATA,&inline;)*>
Attributes
Attributes are like ?properties which can be added to tags in order to provide more information about the structure of the information. At attribute definition might be as follows:<!ATTLIST link id IDREF #REQUIRED href CDATA #REQUIRED>
?Notations
?Notations contain information about an attribute or entity which required accessing an external application to process data. An example of a ?notation declaration would be as follows:<!NOTATION tiff SYSTEM "/usr/local/bin/display.exe">
Used together, these four members completely define a valid XML document.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
