ICT-4540
3a
This exercise provides the opportunity to explore Document Type Definitions (DTD).
You will learn about its types, and what kind of structure you can compel in documents validated with a DTD.
Hand in an updated USPresidents.xml document, with a president.dtd DTD, with DOCTYPE provided.
Also, hand in a screenshot confirming that each of your document was successfully validated.
Validating the Presidents with a DTD
Create the file president.dtd and create the elements (and attributes, if any) to represent the content of the file.
Your DTD should represent both the content types, order, and required or optional nature of the elements and attributes.
Make your DTD as prescriptive as possible (i.e., enforce a correct order and presence of the elements and attributes).
Add the DOCTYPE declaration to the XML file to associate the DTD with the XML document.
Validate the document against the schema, saving a screenshot of your successful result.
You will find USPresidents.xml in the HWstarters ZIP file
When you validate against the DTD, you will find one or more missing data items!
Identify them and correct them.
It is easier to do validation in an IDE, where this is usually done with one button click.
You can use xmlvalidation.com to perform DTD (or schema) validation if you have no IDE or desktop tool.
- Creation of president.dtd DTD which represents the USPresidents.xml data60%
- Updated USPresidents.xml file which associates DOCTYPE president.dtd30%
- Evidence of successful validation of the XML file with the DTD10%