中级农民
- 积分
- 114
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2014-11-13
- 最后登录
- 1970-1-1
|
Sorry to reply to this old theme, but I really got in trouble. Because I use the library's computer, I don't know how to change the language to Chinese. Anyway, I have a problem for exercise one.
The exercise one is:
In this question, you are to create a DTD for a small XML data set drawn from the Stanford course catalog. There are multiple departments, each with a department chair, some courses, and professors and/or lecturers who teach courses. The XML data is here.
Write a DTD for the XML data set.
Important: Do not include <!DOCTYPE Course_Catalog [...]> in your DTD. Your DTD should start with <!ELEMENT Course_Catalog (Department*)>.
What I wrote is:
<!ELEMENT Course_Catalog (Department*)>
<!ELEMENT Department (Title, Chair, Course*)>
<!ELEMENT Department Code (#PCDATA) #REQUIRED>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Chair (Professor)>
<!ELEMENT Professor (First_Name, Last_Name)>
<!ELEMENT First_Name (#PCDATA)>
<!ELEMENT Last_Name (#PCDATA)>
<!ELEMENT Course (Title, Description?, Instructors, Prerequisites?)>
<!ELEMENT Course Number PCDATA #REQUIRED
Enrollment CDATA #REQUIRED>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Description (#PCDATA)>
<!ELEMENT Instructors (Lecturer | Professor)*>
<!ELEMENT Lecturer (First_Name, Middle_Initial, Last_Name)>
<!ELEMENT Middle_Initial (#PCDATA)>
<!ELEMENT Prerequisites (Prereq)>
<!ELEMENT Prereq (#PCDATA)>
The error is:
Incorrect
Error messages from xmllint: /tmp/tmpdPII0D.dtd:3: parser error : xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected
<!ELEMENT Department Code (#PCDATA) #REQUIRED>
^
/tmp/tmpdPII0D.dtd:3: parser error : Content error in the external subset
<!ELEMENT Department Code (#PCDATA) #REQUIRED>
^
Could not parse DTD /tmp/tmpdPII0D.dtd
Did anyone know the reason for this error? Thank you so much! |
|