| You are here: | About>Computing & Technology>Web Design / HTML> XML> DTDs> What is a DTD |
![]() | Web Design / HTML |
Other DTD Articles and InformationWhat is a DTDPart 1: Document Type Definitions and Valid XMLAs you learned in another article, a DTD is the grammar of an XML page. It is an acronym that stands for Document Type Definition. It contains the elements, attributes, entities, and notations used in the XML document. Valid XMLXML is really a markup language to create other markup languages, and the DTD is the tool you use to create and describe your language. Once a DTD is created and a document written based on that DTD, the document is then compared to the DTD. This is called validation. If your XML document follows the rules listed in the DTD, then the document is said to be valid. XML documents that don't follow the rules in their DTDs are called invalid. For example, while we haven't gone over the structure of a DTD yet, here is part of a simple one. It states that there is a root element called "family" that has two possible elements within it: "parent" and "child": <!DOCTYPE family [ If you were to write an XML document based upon that DTD, you could write: <?xml version="1.0" standalone="yes"?> This would be a valid XML document. But if I added extra text outside of the <parent> or <child> tags, the document would be invalid until I changed the DTD: ... Next Page > Elements, Entities, Attributes, and Notations > Page 1, 2, 3 Other DTD Articles and Information |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |


