Every well-formed XML document is neatly arranged as a tree, with names for element nodes and all their attributes. This is enough for basic tools to correctly transmit and process XML; but for many applications it is useful to add more precise domain-specific constraints that we expect documents to satisfy. For this we have XML schema languages: specialised languages for describing types of XML document. This lecture covered one in particular, the Document Type Definition language DTD.
A DTD is a little like a type from a programming language: we can check that a value has a certain type, and a function may require arguments of a certain type; similarly we can validate an XML document against a schema, and some processing operation may require as input an XML document matching a certain schema. However, a single XML document may routinely match more than one schema — there is no concept of “the” schema for a document — and XML schema languages often appear more complex than familiar type systems.
This lecture set out the details and usage of XML DTDs, and also how the content of a relational database can be transmitted through XML (and why). There were also announcements about the EUSA Teaching Awards, the Festival of Creative Learning, and a mid-course survey.
1. Read This
Find out about Postel’s Law: what it says, what that means for computer languages and protocols. Do you think it’s a sensible rule? When is it helpful?
2. Do This
Find something in the Festival of Creative Learning next week on a topic that interests you. Book and go along to that thing.