Part I. Well-Formedness

Create a well-formed XML document for a mock Fall 2025 computer science courses listed in Table 1. The requirements and structure of the document is defined as follows.

  • The document should begin with the XML declaration. The version is 1.0, and the encoding UTF-8.
  • The document should be well-formed.
  • Define your own namespace and declare it as your default namespace.
  • The child elements of an element must appear in the order as described in the following.
  • The root element is courses, and it has one or more child element course.
  • Each course consists of one subject, one title, and one or more section child elements, and has attributes course number and number of credits. For example, the title of the Data Structures course is Data Structures, its subject is CS, and its number is 341.
  • If a course has multiple sections, only one course element should be created for the course.
  • Each section consists of one enrollment, one date, zero or one days, zero or one time, zero or one room, and at least one instructor child elements.
  • When storing the room element's value, do not include "Room: " as shown in Table 1.
  • The room element has a campus attribute.
  • Each section also has a section number, an id, and a type of delivery attributes. The value of the delivery attribute is one of Classroom, Online, or ITV.
  • An Online section should not have the days, time, and room child elements.
  • The date element consists of two child elements, startDate and endDate.
  • The time element consists of two child elements, startTime and endTime.
  • Each instructor has a first name and last name. That is, the instructor element has two child elements first and last.
  • Include documentation (i.e., comments) in your XML file.
    • At the beginning, include the basic information of this document, including file name, description, author, and date.
    • Inside the document, add comments wherever needed.
  • The words in bold face constitute our vocabulary. You should not modify them.
  • Do not invent elements and attributes not mentioned above.

Tip: It helps to first draw the hierarchy of information for the document.

At this point, make sure your XML document is well-formed before starting Part II.

Part II. Validation with DTD

The objective of Part II is to learn how to validate the XML document using DTD. The XML document is based on the one in Part I.

The requirements and structure of the document is defined as follows.

  • In the XML file, use the relative path, not full path, to declare the location of the DTD file.
  • Include documentation (i.e., comments) in your files.
    • At the beginning, include the basic information of this document, including file name, description, author, and date.
    • Inside the document, add comments wherever needed.
  • DTD requirements
    • Use external DTD.
    • Follow the cardinality requirements specified in Part I.
    • Every attribute is required.
    • id of a section has the type ID.
    • The value of delivery is one of Classroom, Online, or ITV.
    • Declare an internal general entity for the instructor element for Chi-Cheng Lin and reference it in the XML file. You need to modify the XML file.
    • Define the type of date element (including its child elements) in another DTD file. Declare an external parameter entity for the date element type and reference it in your main DTD file.
    • You might need to "cheat" in the DTD by defining the default namespace as an attribute although it is not.

Table 1. Fall 2025 Computer Science Courses

Course Title/Enrollment ID/Credits Dates/Time/Room Instructor(s)
CS 341 - 01
Campus: Rochester
Delivery: Classroom
Data Structures
Enrollment 15
X0011780
Credits: 4.0
08/25/2025 - 12/4/2025
T Th
4:00pm - 5:50pm
Room: EA244
Mark Funk
CS 341 - 02
Campus: Rochester
Delivery: Online
Data Structures
Enrollment 10
X001784
Credits: 4.0
08/24/2025 - 12/4/2025 Mark Funk
Chi-Cheng Lin
CS 341 - 03
Campus: Rochester
Delivery: Classroom
Data Structures Enrollment 12 X001788
Credits: 4.0
08/25/2025 - 12/4/2025
T Th
6:00pm - 7:50pm
Room: SH102
Dennis Martin
CS 368 - 01
Campus: Rochester
Delivery: ITV
Introduction to Bioinformatics
Enrollment 9
X001781
Credits: 4.0
08/26/2025 - 12/4/2025
W
6:00pm - 8:40pm
Room: AT102
Chi-Cheng Lin
Mingrui Zhang
CS 375 - 01
Campus: Rochester
Delivery: Classroom
Computer Systems
Enrollment 18
X001782
Credits: 4.0
08/24/2025 - 12/4/2025
M W
4:00pm - 5:50pm
Room: EA244
Chi-Cheng Lin
CS 385 - 01
Campus: Rochester
Delivery: Classroom
Applied Database Management Systems
Enrollment 25
X001783
Credits: 4.0
08/25/2025 - 12/4/2025
T Th
11:00am - 12:20pm
Room: ST108
Mark Funk
CS 440 - 01
Campus: Rochester
Delivery: Online
Theory of Algorithms
Enrollment 15
X001786
Credits: 3.0
08/24/2025 - 12/4/2025 Chi-Cheng Lin

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.