Now that we’ve emerged from the gory details of XML DTDs, let’s see how they work by creating a simple example. You can create a DTD with any text editor and a clear idea of how you want to mark up your XML documents. You’ll need an XML parser and processing application to actually interpret and use your DTD, as well as a style sheet to permit XML-capable browsers to display your document.
Let’s create a simple XML DTD that defines a markup
language for specifying documents containing names and
addresses. We start with an
address
element, which contains other elements
that tag the address contents. Our address
element
has a single attribute indicating whether it is a work or home
address: