Objectives create an external DTD that dictates a relational model-like data structure for XML documents.
Assignment 1
Description
We are going to continue on with the previous assignment's suggested context: courses. In addition to recording information for courses, the model is now broadened to include students, Course Registration Number (CRN), and prerequisites. You are going to use DTD to enforce certain data requirements in order to model the following transaction processing:
1. A Student which contains:
a) email address
b) first name
c) ID (primary key, so should be an attribute, ID)
d) last name
e) phone number
2. A Course which contains:
a) credits
b) description
c) number (primary key, so should be an attribute, e.g. COMP 2899, ID)
d) name
e) a grouped list of prerequisite courses (references to other courses, IDREFS)
3. CRN which contains:
a) ID (primary key, so should be an attribute, e.g. 78645, ID)
b) course number (foreign key, so should be an attribute, IDREF)
c) total number of students
d) end date
e) start date
f) cost
g) instructor name
4. Student-CRN which contains
a) student ID (foreign key, so should be an attribute, IDREF)
b) CRN (foreign key, so should be an attribute, IDREF)
Assignment 2
The entity relationships are shown in figure.
Additional Details
1. Create an external DTD that enforces the previous rules in your DTD
2. Create an XML document (or use the one from the previous assignment) that contains at least three elements for each of the types specified above
3. Use element pools in order to put all of these different types of elements into one XML document
i.) So have a school root element that contains:
a) A courses element
b) A students element
c) An CRNs element
d) A student-CRNs element
ii.) Where each of the above elements contains their respective child type elements (e.g. customers element contains customer elements, students contains student elements, etc.)
a) Your XML document will validate successfully against your DTD
b) Your XML document will be well-formed
c) Follow the rules listed in this assignment
d) Create at least three records inside of each of the courses, students, CRNs, student-CRNs elements
Create the following documents for submission:
1. An external DTD with rules (listed above)
2. A separate XML document that conforms to those rules
Hints:
a) Refer to the web sites found at the back of slides for week one
b) Use the examples that are posted on share out. Many of them demonstrate very similar (or even the same) data models as what you are being ask to do for this assignment
c) Remember the notion of "element pools" and use them
d) Validate often and save your work
e) Note that because of the data type for ID and IDREF, you'll have to prepend an alphabetic character to the CRN id values