[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
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.

last edited (December 29, 2002) by towercpu, Number of views: 3133, Current Rev: 5 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.