The best Introduction to DTD Tutorial In 2024, In this tutorial you can learn Internal DOCTYPE declaration,External document declaration,Why use a DTD?,
Document Type Definition (DTD) to define the legal building blocks of an XML document. It uses a series of legal elements to define the structure of the document.
DTD can be declared in rows in an XML document, or as an external reference.
If the DTD is included in your XML source file, it should adopt the following syntax wrapped in a DOCTYPE declaration:
XML document instance with the DTD (please IE5 and higher versions of Open and select view source):
Open this XML file in your browser, and select "View Source" command.
The DTD above is interpreted like this:
If the DTD is located in an external XML source files, then it should be wrapped in a DOCTYPE definition with the following syntax:
This is the same XML documents and XML document above, but does have an external DTD: ( click to open the file and select "View Source" command.)
This is the "note.dtd" file contains the DTD:
By DTD, each of your XML files can carry a description of its own format.
By DTD, independent groups can consistently use a standard DTD to exchange data.
And your application can also use a standard DTD to verify the data received from the outside.
You can also use a DTD to verify your own data.