Chapter 6. Creating a DTD
In Part 1 of the book, you learned XML’s underlying grammar, which forms the rules for writing an XML document. In Part 2, you learned how to transform an XML document into another form, in this case HTML. Now, in Part 3, you’ll learn how to define a custom markup language in XML.
To define such a language, you will first identify its elements and their attributes, declaring which are required, and which are not. This information is called a schema. For example, an historian might create WowML, the (fictitious) Wonders of the World Markup Language, as a system for cataloging data about the wonders of the world. WowML might have elements like wonder
, name
, year_built
, and story
.
Schemas, while not required, are exceptionally ...
Get XML: Visual QuickStart Guide, Second 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.