Example of XML File and Associated Ruleset

XML file for a simple note (n.b. reference to a ruleset file):

<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "simple_note.dtd">
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note> 
		

Ruleset file specifying what elements are allowed where in a note:

<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
		

Example based on http://w3schools.com/dtd/dtd_intro.asp