XML DTD External

 

- Info:

- This tutorial shows how to define DTD & XML in a separate files.

- Example:

- In this example DTD states that there is a root element called "family".

- It can contain two possible elementst: "parent" and "child".

 

Test.dtd

<!DOCTYPE family [

<!ELEMENT parent (#PCDATA)>

<!ELEMENT child (#PCDATA)>

]>

Test.xml

<?xml version="1.0" standalone="yes"?>

<!DOCTYPE family SYSTEM "Test.dtd">

<family>

<parent>Judy</parent>

<parent>Layard</parent>

<child>Jennifer</child>

<child>Brendan</child>

</family>