Hy everybody. I've a problem with a simple xml file esercitation. This is the XML file called "Newfile.xml"
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="students.xsl"?> <!DOCTYPE students SYSTEM "student.dtd"> <student id="100026"> <name>Joe Average</name> <age>21</age> <major>Biology</major> <results> <result course="Math 101" grade="C-"/> <result course="Biology 101" grade="C+"/> <result course="Statistics 101" grade="D"/> </results> </student> <student id="100078"> <name>Jack Doe</name> <age>18</age> <major>Physics</major> <major>XML Science</major> <results> <result course="Math 101" grade="A"/> <result course="XML 101" grade="A-"/> <result course="Physics 101" grade="B+"/> <result course="XML 102" grade="A"/> </results> </student> </students>
And this is the relative dtd file called "student.dtd" and placed in the same directory
<?xml version="1.0" encoding="UTF-8"?> <!ELEMENT students (student+)> <!ELEMENT student (name,age,major,results)> <!ATTLIST student id CDATA #REQUIRED> <!ELEMENT name (#PCDATA)> <!ELEMENT age (#PCDATA)> <!ELEMENT major (#PCDATA)> <!ELEMENT results (result+)> <!-- <!ELEMENT result (grade,course)> --> <!ELEMENT result (#PCDATA)> <!ATTLIST result grade CDATA #REQUIRED> <!ATTLIST result course CDATA #REQUIRED>
When i try to run Newfile.xml with Eclipse it say: "Error line 14: The markup in the document following the root element must be well-formed."
Where is the error? Can you help me?
No comments:
Post a Comment