本帖最后由 べPNヤ 于 2013-10-12 13:10 编辑
dtd 内容
<!ELEMENT students (student+)>
<!ELEMENT student (name,age,语文成绩,数学成绩)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT age (#PCDATA)>
<!ELEMENT 语文成绩 (#PCDATA)>
<!ELEMENT 数学成绩 (#PCDATA)>
<!ATTLIST sutdent classID ID #REQUIRED>
<!ATTLIST 语文成绩 teacher CDATA #REQUIRED>
<!ATTLIST 数学成绩 teacher CDATA #IMPLIED>
xml 文件内容
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE students SYSTEM "student.dtd">
<students>
<student classID="itcast_1009">
<name>zhangsan</name>
<age>18</age>
<语文成绩 teacher="lisir">98</语文成绩>
<数学成绩 teacher="cuisir">100</数学成绩>
</student>
<student classID="itcast_1001">
<name>pn</name>
<age>26</age>
<语文成绩 teacher="shiSir">130</语文成绩>
<数学成绩 teacher="cuiSir">150</数学成绩>
</student>
<student classID="itcast_1002">
<name>wangwu</name>
<age>22</age>
<语文成绩 teacher="zhangSir">100</语文成绩>
</student>
</students>
错误提示:
warning: Element 'sutdent' was referenced in an attlist but never declared
Attribute 'classID' is not declared for element 'student'
Not enough elements to match content model : '(name,age,语文成绩,数学成绩)'
求解!!!!!! |
|