DTD:
<!ELEMENT memories (memory)* > <!ELEMENT memory (media | subdate | donor?| subject+| location)* > <!ATTLIST memory tapeid IDREF #REQUIRED > <!ELEMENT subdate (#PCDATA) > <!ELEMENT donor (#PCDATA) > <!ELEMENT subject (#PCDATA) > <!ELEMENT location (place|description) > <!ELEMENT description (#PCDATA) > <!ELEMENT place (#PCDATA) > <!ELEMENT media EMPTY > <!ATTLIST media mediaid ID #REQUIRED status CDATA #IMPLIED>
Документ:
<?xml version="1.0"?> <!DOCTYPE memories SYSTEM "memory.dtd"> <memories> <memory tapeid="T1"> <media mediaid="T1" status="vhs" /> <subdate>2001-05-23</subdate> <donor>John Baker</donor> <subject>Fishing off Pier 60</subject> <location><description>Outside in the woods</description></location> </memory> <memory tapeid="T2"> <media mediaid="T2" status="vhs"/> <subdate>2001-05-18</subdate> <donor>Elizabeth Davison</donor> <subject>Beach volleyball</subject> <location><place>Clearwater beach</place></location> </memory> </memories>