Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
Website builder

Internal DTD

Whether you use an external or internal DTD, the actual syntax for the DTD is the same - the same code could just as easily be part of an internal DTD or an external one. The only difference between internal and external is in the way it's declared with DOCTYPE.

Using an internal DTD, the code is placed between the DOCTYPE tags (i.e. <!DOCTYPE tutorials [ and ]>.

Example Internal DTD

This is an example of an internal DTD. It's internal because the DTD is included in the target XML document:

<?xml version="1.0" standalone="yes"?>
<!DOCTYPE tutorials [
<!ELEMENT tutorials (tutorial)+>
<!ELEMENT tutorial (name,url)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT url (#PCDATA)>
<!ATTLIST tutorials type CDATA #REQUIRED>
]>
<tutorials type="web">
  <tutorial>
    <name>XML Tutorial</name>
    <url>http://www.quackit.com/xml/tutorial</url>
  </tutorial>
  <tutorial>
    <name>HTML Tutorial</name>
    <url>http://www.quackit.com/html/tutorial</url>
  </tutorial>
</tutorials>

Enjoy this page?

  1. Add this page to your Favorites
  2. Link to this page (copy/paste into your own website or blog):
  3. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!