19.2. Data Models for XML Documents

A small example will illustrate the application of the different approaches. In Listing 19.1, we introduce the Document Type Definition (DTD) (W3C 1998b) for XML documents that contain personnel, a set of professor[s] with their name[s] and their course[s]. The name consists of a firstname and a lastname, and the courses have a title and a description. Both, professor and course, have an attribute—employeeNo and courseNo, respectively.

Listing 19.1. DTD for University Personnel
 <!ELEMENT personnel (professor+)> <!ELEMENT professor (name, course+)> <!ATTLIST professor employeeNo ID #REQUIRED> <!ELEMENT name (firstname, lastname)> <!ELEMENT course (title, description) <!ATTLIST course courseNo ID #REQUIRED> ...

Get XML Data Management: Native XML and XML-Enabled Database Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.