Exemple de DTD

ExempleDTD (inspirée de DITA)

1
<!-- topic-like.dtd -->
2
<!ELEMENT topic (title,body)>
3
<!ATTLIST topic
4
id NMTOKEN #REQUIRED>
5
<!ELEMENT title (#PCDATA)>
6
<!ELEMENT body (p)+>
7
<!ELEMENT p (#PCDATA|term)*>
8
<!ELEMENT term (#PCDATA)>

ExempleContenu valide par rapport à topic-like.dtd

1
<?xml version='1.0' encoding='UTF-8'?>
2
<!DOCTYPE topic SYSTEM "topic-like.dtd">
3
<topic id="topic-1">
4
    <title>Topic title</title>
5
    <body>
6
        <p>This is un exemple of DITA <term>topic</term>.</p>
7
        <p>...</p>
8
    </body>
9
</topic>