Document Type Definition (DTD)

Some XML languages also use a Document Type Definition (DTD) that defines each element allowed in the document along with its attributes and rules for use. An XML-compliant application may check the document against its DTD to “decode” the markup and make sure that it follows its own rules. A document that conforms to its DTD is said to be valid . DTDs are discussed in detail later in this chapter.

An updated method for defining XML elements and document structure is XML Schemas . A particular instance of an XML Schema is called an XML Schema Definition (XSD) . The difference is that XSDs are XML-based, while DTDs (an older form of schema) are created according to the rules of SGML. XSDs are more powerful in describing XML languages, but the price is that they also tend to be more complicated and difficult to read and write. XML Schemas are outside the scope of this introductory chapter, but you can find information on the W3C site at http://www.w3c.org/XML/Schema.

Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.