为什么在dtd文件中定义的元素,在编写xml时却说该元素未声明?
请教一个xml得问题:
我的dtd文件定义如下:
<?xml version="1.0" encoding="GB2312"?>
<!ELEMENT ScoreState (Player+)>
<!ELEMENT Player (Morethan50, Morethan100, Effictive)>
<!ATTLIST Player Sex (男|女) "女">
<!ATTLIST Player Age (PCDATA) #IMPLIED>
可是xml文件这样写却通不过,不知道为什么:
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE ScoreState SYSTEM "H:\xml\EXercise1\Page36_1.dtd">
<ScoreState>
<Player Sex="男">
<Morethan50>55</Morethan50>
<Morethan100>200</Morethan100>
<Effictive>32</Effictive>
</Player>
</ScoreState>
当我点击保存按钮的时候,xmlSpy报告错误:
The file is not valid:
Element "Morethan50" has not been declared.