XML on TPF: A Short Tutorial Page 3 of 10
Create a Sample DTD
A Document Type Definition (DTD) is one method of defining the acceptable tags for an XML document. A DTD has a
strict syntax and can be either inside the XML document itself or in a separate file. When it is in a separate file,
the XML document has specific coding to reference the location of the DTD. Paul wants his DTD to reside in its own file.
Paul decides to create a DTD that might be used to represent a passenger name record (PNR) in the airline industry. He
knows that the organization of data in an XML document is the key to its success. However, Paul is less focused on
an actual implementation of this DTD and more focused on demonstrating the various ways to write XML data:
Note: When you are using a DTD on your TPF 4.1 system, you will need to include a
declaration statement at the top of the document to indicate in which encoding the DTD is
written. For example:
<?xml version="1.0" encoding="ISO-8859-1"?>
When this line is included, some browsers will attempt to parse the DTD as an XML document.
We have omitted this line from Paul's DTD to ensure that you can view the DTD in your
browser.
For More Information
See the TPF XML User's Guide for the following:
A list of books and Web sites for learning about DTDs and their syntax
More information about DTDs and
specifying the encoding of your documents on the TPF 4.1 system.