1) Create a small XML file of courses in a university. Each course should be an
ID: 3759550 • Letter: 1
Question
1) Create a small XML file of courses in a university. Each course should be an element, like this:1
...
Each course element should have child elements department, course_name, course_number, instructor, course_type, time, and room. The course_type element must have attributes lab and lecture, each of which may have values true or false. Don't forget that you will need a root element, too. You could name your root element something like "catalog" or "schedule." Create an XML document with the root element and at least three instances of the "course" element. At least one of the courses must have a lab component.
2)Create an XML Schemas definition for your course structure. Put reasonable constraints on the various values. (You don't need to go overboard, though. If you're unsure about something, make itxsd:text.) Name your schema l6p2.xsd and put it on the server.
It is not necessary to link your schema to your XML document. Instead, use the Validome link (as in part 1) and put it on your index document as "L6P2."
Explanation / Answer
XML file of courses in a university:
<university>
<department deptname=“Comp. Sci.”building=“Dickson”
budget=“100000”>
</department>
<department deptname=“Biology”building=“Charles"
budget=“90000”>
</department>
<course courseid=“CS-101”title=“Intro. to Computer Science”
deptname=“Comp. Sci.”credits=“4”>
</course>
<course courseid=“BIO-301”title=“Genetics”
deptname=“Biology.”credits=“4”>
</course>
<instructor IID=“10101”name=“Padmanabhan”
deptname=“Comp. Sci.”salary=“65000”>
</instructor>
<instructor IID=“83821”name=“Brandt”
deptname=“Comp. Sci”salary=“92000”>
</instructor>
<instructor IID=“76766”name=“James”
deptname=“Biology”salary=“72000”>
</instructor>
<teaches IID=“10101”courseid=“CS-101”>
</teaches>
<teaches IID=“83821”courseid=“CS-101”>
</teaches>
<teaches IID=“76766”courseid=“BIO-301”>
</teaches>
</university>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.