Ορισμός τύπου εγγράφων

Υποστηρίζονται οι παρακάτω ορισμοί:
Απλοί χαρακτήρες (parsed character data)
<!ELEMENT name (#PCDATA)>
Ένα στοιχείο
<!ELEMENT student (person_data)>
Ακολουθία στοιχείων
<!ELEMENT person_data (name, surname)>
Κανένα ή ένα στοιχείο
<!ELEMENT person_name (given_name, initial?, last_name)>
Μηδέν ή περισσότερα στοιχεία
<!ELEMENT owned_cars (car*)>
Ένα ή περισσότερα στοιχεία
<!ELEMENT course_lecturer (person_data+)>
Επιλογή στοιχείων
<!ELEMENT engine (two_stroke | four_stroke | wankel | rotary)>
Χρήση παρενθέσεων
<!ELEMENT person_details (name, surname, (vat_number | id_number))>
Κενό περιεχόμενο
<!ELEMENT alumnus EMPTY>
Τυχαίο περιεχόμενο
<!ELEMENT text ANY>

Παράδειγμα - DTD

<!--
 -
 - Document Type Description for the projects
 -
 - $Id: project.dtd,v 1.2 2004/01/24 20:20:04 bkarak Exp $
 -
-->
<!ELEMENT project (
        shortname, 
        projtitle, 
        startdate?, 
        enddate, 
        web_site?, 
        our_budget?, 
        total_budget?, 
        funding_agency?, 
        funding_programme?, 
        project_code?, 
        partner*, 
        logo?, 
        description
)>

<!ELEMENT projtitle (#PCDATA)>
<!ELEMENT our_budget (#PCDATA)>
<!ELEMENT total_budget (#PCDATA)>
<!ELEMENT funding_agency (#PCDATA)>
<!ELEMENT funding_programme (#PCDATA)>
<!ELEMENT project_code (#PCDATA)>
<!ELEMENT web_site (#PCDATA)>
<!ELEMENT startdate (#PCDATA)>
<!ELEMENT enddate (#PCDATA)>
<!ELEMENT shortname (#PCDATA)>
<!ELEMENT logo (#PCDATA)>
<!ELEMENT description (#PCDATA)>

<!ELEMENT partner (shortname, country, web_site?)>
<!ELEMENT shortname (#PCDATA)>
<!ELEMENT country (#PCDATA)>

Παράδειγμα - αντίστοιχη XML

<?xml version="1.0"?>
<project>
        <shortname>mExpress</shortname>
        <projtitle>mobile in-EXhibition PRovision of Electronic Support Services</projtitle>
        <startdate>20020305</startdate>
        <enddate>20040401</enddate>
        <web_site>http://mexpress.intranet.gr/</web_site>
        <our_budget>328 EUR</our_budget>
        <total_budget>3,493 EUR</total_budget>
        <funding_agency>European Commission</funding_agency>
        <funding_programme>IST</funding_programme>
        <project_code>IST-2001-33432</project_code>
        <partner>
                <shortname>Intracom</shortname>
                <country>EL</country>
                <web_site>http://www.intracom.gr</web_site>
        </partner>
        <partner>
                <shortname>Ericsson</shortname>
                <country>DK</country>
                <web_site>http://www.ericsson.com/</web_site>
        </partner>
        <partner>
                <shortname>ELISA</shortname>
                <country>FIN</country>
                <web_site>http://www.elisa.com</web_site>
        </partner>
        <partner>
                <shortname>POULIADIS</shortname>
                <country>EL</country>
                <web_site>http://www.pouliadis.gr</web_site>
        </partner>
        <partner>
                <shortname>SSF</shortname>
                <country>FIN</country>
                <web_site>http://www.ssf.fi/</web_site>
        </partner>
        <partner>
                <shortname>HUT</shortname>
                <country>FIN</country>
                <web_site>http://www.hut.fi</web_site>
        </partner>
        <partner>
                <shortname>FFC</shortname>
                <country>FIN</country>
        </partner>
        <partner>
                <shortname>ROTA</shortname>
                <country>EL</country>
                <web_site>http://www.rota.gr</web_site>
        </partner>
        <logo>../images/p_mexpress.gif</logo>
        <description>
mEXPRESS aims to exploit the technological opportunities arising from
evolution in the areas of wireless networks and positioning mechanisms in
order to support and facilitate the professional exhibition industry in
a context-aware manner. It will contribute to the economic development of
the Community by providing means for efficient operation and interaction
in information-rich environments such as exhibitions, and significantly
enhancing promotional activities and business communications. The mEXPRESS
project will provide an integrated mediation platform (mEXPRESS Service
Provider) oriented to exhibition shows and events.
        </description>
</project>