2014-01-05 33 views
0

我正在寫一個DTD文件,並在驗證我的xml文件時遇到了一個愚蠢的錯誤「描述標記丟失」,但是描述標記位於DTD中。即使我刪除了標籤,我也遇到了同樣的錯誤。所以我右鍵單擊問題選項卡中的錯誤行並將其刪除。現在,無論何時點擊驗證任何其他xml文件,它都不會顯示錯誤。我怎樣才能恢復已刪除的標記。如何在eclipse中恢復已刪除的xml驗證程序錯誤標記

請幫幫我。 感謝

MY DTD如果它讓SENCE

<?xml version="1.0" encoding="UTF-8"?> 
<!ELEMENT Course_Catalog (Department*)> 
<!ELEMENT Department (Title, Chair, Course*)> 
<!ATTLIST Department Code CDATA #REQUIRED> 
<!ELEMENT Title (#PCDATA)> 
<!ELEMENT Chair (Professor)> 
<!ELEMENT Professor (First_Name,Middle_Initial?, Last_Name)> 
<!ELEMENT First_Name (#PCDATA)> 
<!ELEMENT Middle_Initial (#PCDATA)> 
<!ELEMENT Last_Name (#PCDATA)> 
<!ELEMENT Course (Title*, Description*, Instructors*, Prerequisites*)> 
<!ATTLIST Course Number CDATA #IMPLIED 
       Enrollment CDATA #IMPLIED> 
<!ELEMENT Description (#PCDATA)> 
<!ELEMENT Instructors (Lecturer*, Professor*)*> 
<!ELEMENT Lecturer (First_Name, Middle_Initial?, Last_Name)> 
<!ELEMENT Prerequisites (Prereq*)> 
<!ELEMENT Prereq (#PCDATA)> 

和這纔是我的XML文件

<?xml version="1.0" ?> 
<!DOCTYPE Q1_1 SYSTEM "Q1_1.dtd"> 
<Course_Catalog> 

    <Department Code="CS"> 

    <Title>Computer Science</Title> 
    <Chair> 
     <Professor> 
     <First_Name>Jennifer</First_Name> 
     <Last_Name>Widom</Last_Name> 
     </Professor> 
    </Chair> 

    <Course Number="CS106A" Enrollment="1070"> 
     <Title>Programming Methodology</Title> 
     <Description>Introduction to the engineering of computer applications emphasizing modern software engineering principles.</Description> 
     <Instructors> 
     <Lecturer> 
      <First_Name>Jerry</First_Name> 
      <Middle_Initial>R.</Middle_Initial> 
      <Last_Name>Cain</Last_Name> 
     </Lecturer> 
     <Professor> 
      <First_Name>Eric</First_Name> 
      <Last_Name>Roberts</Last_Name> 
     </Professor> 
     <Professor> 
      <First_Name>Mehran</First_Name> 
      <Last_Name>Sahami</Last_Name> 
     </Professor> 
     </Instructors> 
    </Course> 

    <Course Number="CS106B" Enrollment="620"> 
     <Title>Programming Abstractions</Title> 
     <Description>Abstraction and its relation to programming.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Eric</First_Name> 
      <Last_Name>Roberts</Last_Name> 
     </Professor> 
     <Lecturer> 
      <First_Name>Jerry</First_Name> 
      <Middle_Initial>R.</Middle_Initial> 
      <Last_Name>Cain</Last_Name> 
     </Lecturer> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>CS106A</Prereq> 
     </Prerequisites> 
    </Course> 

    <Course Number="CS107" Enrollment="500"> 
     <Title>Computer Organization and Systems</Title> 
     <Description>Introduction to the fundamental concepts of computer systems.</Description> 
     <Instructors> 
     <Lecturer> 
      <First_Name>Julie</First_Name> 
      <Last_Name>Zelenski</Last_Name> 
     </Lecturer> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>CS106B</Prereq> 
     </Prerequisites> 
    </Course>  

    <Course Number="CS109" Enrollment="280"> 
     <Title>Introduction to Probability for Computer Scientists</Title> 
     <Instructors> 
     <Professor> 
      <First_Name>Mehran</First_Name> 
      <Last_Name>Sahami</Last_Name> 
     </Professor> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>CS106B</Prereq> 
     </Prerequisites>  
    </Course> 

    <Course Number="CS124" Enrollment="60"> 
     <Title>From Languages to Information</Title> 
     <Description>Natural language processing. Cross-listed as LING180.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Dan</First_Name> 
      <Last_Name>Jurafsky</Last_Name>  
     </Professor> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>CS107</Prereq> 
     <Prereq>CS109</Prereq> 
     </Prerequisites> 
    </Course> 

    <Course Number="CS143" Enrollment="90"> 
     <Title>Compilers</Title> 
     <Description>Principles and practices for design and implementation of compilers and interpreters.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Alex</First_Name> 
      <Middle_Initial>S.</Middle_Initial> 
      <Last_Name>Aiken</Last_Name>  
     </Professor> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>CS107</Prereq> 
     </Prerequisites> 
    </Course> 

    <Course Number="CS145" Enrollment="130"> 
     <Title>Introduction to Databases</Title> 
     <Description>Database design and use of database management systems for applications.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Jennifer</First_Name> 
      <Last_Name>Widom</Last_Name>  
     </Professor> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>CS107</Prereq> 
     </Prerequisites> 
    </Course> 

    <Course Number="CS221" Enrollment="180"> 
     <Title>Artificial Intelligence: Principles and Techniques</Title> 
     <Instructors> 
     <Professor> 
      <First_Name>Andrew</First_Name> 
      <Last_Name>Ng</Last_Name>  
     </Professor> 
     <Professor> 
      <First_Name>Sebastian</First_Name> 
      <Last_Name>Thrun</Last_Name>  
     </Professor>   
     </Instructors> 
    </Course> 

    <Course Number="CS228" Enrollment="110"> 
     <Title>Structured Probabilistic Models: Principles and Techniques</Title> 
     <Description>Using probabilistic modeling languages to represent complex domains.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Daphne</First_Name> 
      <Last_Name>Koller</Last_Name>  
     </Professor> 
     </Instructors> 
    </Course> 

    <Course Number="CS229" Enrollment="320"> 
     <Title>Machine Learning</Title> 
     <Description>A broad introduction to machine learning and statistical pattern recognition.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Andrew</First_Name> 
      <Last_Name>Ng</Last_Name>  
     </Professor> 
     </Instructors> 
    </Course> 

    </Department> 

    <Department Code="EE"> 

    <Title>Electrical Engineering</Title> 

    <Chair> 
     <Professor> 
     <First_Name>Mark</First_Name> 
     <Middle_Initial>A.</Middle_Initial> 
     <Last_Name>Horowitz</Last_Name> 
     </Professor>  
    </Chair> 

    <Course Number="EE108A"> 
     <Title>Digital Systems I</Title> 
     <Description>Digital circuit, logic, and system design.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Subhasish</First_Name> 
      <Last_Name>Mitra</Last_Name> 
     </Professor> 
     </Instructors> 
    </Course> 

    <Course Number="EE108B"> 
     <Title>Digital Systems II</Title> 
     <Description>The design of processor-based digital systems.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>William</First_Name> 
      <Middle_Initial>J.</Middle_Initial> 
      <Last_Name>Dally</Last_Name> 
     </Professor>  
     <Professor> 
      <First_Name>Oyekunle</First_Name> 
      <Last_Name>Olukotun</Last_Name> 
     </Professor> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>EE108A</Prereq> 
     <Prereq>CS106B</Prereq> 
     </Prerequisites> 
    </Course>  

    </Department> 

    <Department Code="LING"> 

    <Title>Linguistics</Title> 

    <Chair>  
     <Professor> 
     <First_Name>Beth</First_Name> 
     <Last_Name>Levin</Last_Name>  
     </Professor> 
    </Chair> 

    <Course Number="LING180" Enrollment="60"> 
     <Title>From Languages to Information</Title> 
     <Description>Natural language processing. Cross-listed as CS124.</Description> 
     <Instructors> 
     <Professor> 
      <First_Name>Dan</First_Name> 
      <Last_Name>Jurafsky</Last_Name>  
     </Professor> 
     </Instructors> 
     <Prerequisites> 
     <Prereq>CS107</Prereq> 
     <Prereq>CS109</Prereq> 
     </Prerequisites> 
    </Course> 
    </Department> 
</Course_Catalog> 
+0

發佈您的XML文件和您的DTD,否則它只是完成猜測。 – splrs

回答

0

如果有一個 'lint.xml' 文件。打開它並刪除包含要撤消的忽略標記。如果不是,請忽略此。

+0

我是初學者,請詳細描述如何做到這一點。 – Tosh

相關問題