XML DTD's ID and IDREF pointers

Davra

New Member
i have been up like all night with this one. i am getting an error that i cant seem to find much documentation on.this is a snippet of the XML.\[code\]<Department Code="LING" Chair="BL"> <Title>Linguistics</Title> <Course Number="LING180" Prerequisites="CS107 CS109" Instructors="DJ" Enrollment="60"> <Title>From Languages to Information</Title> <Description> Natural language processing. Cross-listed as <Courseref Number="CS124"/> </Description> </Course> <Lecturer InstrID="DJ"> <First_Name>Dan</First_Name> <Middle_Init>D.</Middle_Init> <Last_Name>Jurafsky</Last_Name> </Lecturer> <Professor InstrID="BL"> <First_Name>Beth</First_Name> <Last_Name>Levin</Last_Name> </Professor> <Lecturer InstrID="FZ"> <First_Name>Frank</First_Name> <Last_Name>Zoidberg</Last_Name> </Lecturer></Department>\[/code\]and here is my DTD\[code\]<!ELEMENT Course_Catalog (Department*)><!ELEMENT Department (Title, Course+, Professor+, Lecturer?)><!ATTLIST Department Code CDATA #REQUIRED Chair IDREFS #REQUIRED><!ELEMENT Course (Title, Description)><!ATTLIST Course Number ID #REQUIRED Prerequisites IDREFS #IMPLIED Instructors IDREFS #REQUIRED Enrollment CDATA #IMPLIED><!ELEMENT Title (#PCDATA)><!ELEMENT Description (#PCDATA | Courseref)*><!ELEMENT Courseref EMPTY><!ELEMENT Courseref Course IDREF #REQUIRED><!ELEMENT Professor (First_Name, Middle_Initial?, Last_Name)><!ATTLIST Professor InstrID ID #REQUIRED><!ELEMENT Lecturer (First_Name, Middle_Initial?, Last_Name)><!ATTLIST Lecturer InstrID ID #REQUIRED><!ELEMENT First_Name (#PCDATA)><!ELEMENT Middle_Initial (#PCDATA)><!ELEMENT Last_Name (#PCDATA)>\[/code\]the error that i am getting two errors that have to do with each other the first is\[code\] parser error : xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\[/code\]and the next\[code\] parser error : Content error in the external subset\[/code\]which are a little vague but i think it has to do with the ID's and IDREFS. as you can see that lecturers and professors both have the same ID pointer reference . the Department attribute Chair and Course attribute Instructors both point to the InstrID. and the Course ELEMENT both references to other Courses through Prerequisites and are referenced to via Courseref with in the Description . as you can see there is a lot being passed around. even though i know through DTD's you cant really restrict what ID is being refferenced as long as there is something there.but i cant figure out this error am i placing them in a wrong order or are my ID-IDREFS wrong?? any help would be great
 
Back
Top