What Is a DTD?

A document type definition (DTD) describes the structure of a document. It specifies which elements can contain which other elements, which elements are optional and which are required, and which elements contain data. For example, a DTD might specify that a book element

To use a DTD, you must associate it with an XML document. A DTD can be internal or external. An internal DTD is inside the XML document that uses it. It appears in the DOCTYPE element, which immediately follows the XML declaration at the beginning of the document. An external DTD is in a separate file. An XML document that uses an external DTD specifies the path for the DTD in its DOCTYPE element. For example, the following DOCTYPE element specifies that bookstore is the root element in this XML document, and that the DTD that this document uses is stored in the file system at C:\mydir\bookstore.dtd:

<!DOCTYPE bookstore SYSTEM "file://C:\mydir\bookstore.dtd"> 

A document instance is an XML document that uses a particular DTD. In other words, the contents of a document instance have been tagged according to the structure defined in the DTD it is associated with. For example, if the contents of the bookstore.xml file follow the structure defined in the bookstore.dtd file, bookstore.xml is a document instance of the bookstore DTD.

Internet & eBusiness

Internet & eBusiness

Automotive Companies That Use Stylus Studio

Top automotive companies get their wheels spinning with Stylus Studio 2006. Come see which companies put Stylus Studio in their drivers seat today!

Editing XSL Stylesheets

Learn how our powerful XSL stylesheet editor with built-in preview capabilities and synchronized visual and text-based stylesheet editors simplifies XSL and XSLT stylesheet development.

Using the Stylus Studio XML Grid View

This free onlince video tutorial shows how to use the Stylus Studio XML Grid View.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member