Model structured documents with elements, attributes, namespaces, schemas, parsing, and transformations.
Lessons
Define allowed structure with a DTD.
Document Type Definition (DTD) is easiest to learn by reading the example, changing it, and observing the result.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note [
<!ELEMENT note (to, from, body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT body (#PCDATA)>
<!ATTLIST note priority (low|high) "low">
]>
<note priority="high">
<to>Student</to>
<from>Teacher</from>
<body>Validate against the DTD above.</body>
</note>Practice the Document Type Definition (DTD) example in a small scratch file, then explain what changed and why.