我真的是这个XML和Web世界的新手。如果有人能帮助我,我真的很感激。这可能只是一个小错误,但我找不到解决方法。它。我写了一个XML文档,但我收到一条错误消息,说:
此页面包含以下错误:
在第1列第6行上的错误:文档末尾的额外内容
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="student_faculty_directory.css"?>
<haccdirectory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="student_faculty_directory_Schema.xsd" />
<haccdirectory> <!--this is where the ERROR occurs-->
<s:student xmlns:s="http://www.hacc.info.edu/student=dir">
<class101>
<s:name>Austin Tang</s:name>
<s:info>
<s:age>28</s:age>
<s:gender>Male</s:gender>
<s:major>Web Development</s:major>
<s:enrollment>SPR12</s:enrollment>
<s:transferstudent>No</s:transferstudent>
<s:id>H01179944</s:id>
</s:info>
<s:name>Jeremy Riddle</s:name>
<s:info>
<s:age>21</s:age>
<s:gender>Male</s:gender>
<s:major>Web Design</s:major>
<s:enrollment>SPR13</s:enrollment>
<s:transferstudent>Yes</s:transferstudent>
<s:id>H01539441</s:id>
</s:info>
<s:name>Debbie Scissors</s:name>
<s:info>
<s:age>19</s:age>
<s:gender>Male</s:gender>
<s:major>Web Development</s:major>
<s:enrollment>FAL14</s:enrollment>
<s:transferstudent>No</s:transferstudent>
<s:id>H01570984</s:id>
</s:info>
<s:name>Craig Davidson</s:name>
<s:info>
<s:age>22</s:age>
<s:gender>Male</s:gender>
<s:major>Web Development</s:major>
<s:enrollment>SPR14</s:enrollment>
<s:transferstudent>Yes</s:transferstudent>
<s:id>H01578433</s:id>
</s:info>
<s:name>Justin Beer</s:name>
<s:info>
<s:age>24</s:age>
<s:gender>Male</s:gender>
<s:major>Web Design</s:major>
<s:enrollment>SPR13</s:enrollment>
<s:transferstudent>No</s:transferstudent>
<s:id>H01091349</s:id>
</s:info>
<s:name>Melody Herman</s:name>
<s:info>
<s:age>19</s:age>
<s:gender>Female</s:gender>
<s:major>Web Design</s:major>
<s:enrollment>SPR12</s:enrollment>
<s:transferstudent>No</s:transferstudent>
<s:id>H01992341</s:id>
</s:info>
</class101>
</s:student>
<f:faculty xmlns:f="http://www.hacc.info.edu/faculty-dir">
<teacher>
<f:name>Andre Miller</f:name>
<f:information>
<f:age>39</f:age>
<f:gender>Male</f:gender>
<f:hiredate>2003-05-23</f:hiredate>
<f:id>H01908314</f:id>
<f:campus>Lancaster</f:campus>
</f:information>
<f:name>Melody Wright</f:name>
<f:information>
<f:age>32</f:age>
<f:gender>Female</f:gender>
<f:hiredate>2002-07-12</f:hiredate>
<f:id>H01809312</f:id>
<f:campus>Gettysburg</f:campus>
</f:information>
<f:name>Andrew Yoder</f:name>
<f:information>
<f:age>44</f:age>
<f:gender>Male</f:gender>
<f:hiredate>2001-08-12</f:hiredate>
<f:id>H01782354</f:id>
<f:campus>Harrisburg</f:campus>
</f:information>
<f:name>Heather Miller</f:name>
<f:information>
<f:age>50</f:age>
<f:gender>Female</f:gender>
<f:hiredate>2001-07-31</f:hiredate>
<f:id>H01742121</f:id>
<f:campus>Harrisburg</f:campus>
</f:information>
<f:name>Stephanie King</f:name>
<f:information>
<f:age>37</f:age>
<f:gender>Female</f:gender>
<f:hiredate>2012-09-01</f:hiredate>
<f:id>H01922111</f:id>
<f:campus>Lancaster</f:campus>
</f:information>
<f:name>Robert Freeman</f:name>
<f:information>
<f:age>31</f:age>
<f:gender>Male</f:gender>
<f:hiredate>2014-09-10</f:hiredate>
<f:id>H01801154</f:id>
<f:campus>Gettysburg</f:campus>
</f:information>
<f:name>Casey Stevenson</f:name>
<f:information>
<f:age>31</f:age>
<f:gender>Female</f:gender>
<f:hiredate>2014-05-30</f:hiredate>
<f:id>H01642029</f:id>
<f:campus>Harrisburg</f:campus>
</f:information>
</teacher>
</f:faculty>
</haccdirectory>
第3行上的落后斜线意味着您在同一声明中打开并关闭了根元素。
XML解析器告诉您,此文档在顶部有一个非常简单的文档,这是:
<haccdirectory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="student_faculty_directory_Schema.xsd" />
之后的其他所有内容都只是额外的垃圾。
我认为不应该在那里拖延。