Skip to content

Instantly share code, notes, and snippets.

@clhenrick
Last active December 11, 2015 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clhenrick/4616607 to your computer and use it in GitHub Desktop.
Save clhenrick/4616607 to your computer and use it in GitHub Desktop.
XML DTD exercise 3 for Stanford's intro to databases class
<!--DTD exercise 3 for Stanford's Intro to Databases
https://prod-c2g.s3.amazonaws.com/db/Winter2013/files/courses-ID.xml-->
<!ELEMENT Course_Catalog (Department*)>
<!ELEMENT Department (Title, Course+, (Professor | Lecturer)*)>
<!ATTLIST Department Code CDATA #REQUIRED Chair CDATA #REQUIRED>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Course (Title, Description?)>
<!ATTLIST Course Number CDATA #REQUIRED Prerequisites CDATA #IMPLIED Instructors CDATA #REQUIRED Enrollment CDATA #IMPLIED>
<!ELEMENT Professor (First_Name, Middle_Initial?, Last_Name)>
<!ATTLIST Professor InstrID CDATA #REQUIRED>
<!ELEMENT Lecturer (First_Name, Middle_Initial?, Last_Name)>
<!ATTLIST Lecturer InstrID CDATA #REQUIRED>
<!ELEMENT First_Name (#PCDATA)>
<!ELEMENT Middle_Initial (#PCDATA)>
<!ELEMENT Last_Name (#PCDATA)>
<!ELEMENT Description (#PCDATA | Courseref)*>
<!ELEMENT Prerequisites (#PCDATA)>
<!ELEMENT Courseref (#PCDATA)>
<!ATTLIST Courseref Number CDATA #REQUIRED>
@clhenrick
Copy link
Author

in progress, not finished yet.

@clhenrick
Copy link
Author

finished, marked as correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment