这个 dtd 适合 xml 文件吗?
我有这个 xml 文件:
data_out.xml
<?xml version="1.0" ?>
<!DOCTYPE allproperty SYSTEM "data_out.dtd">
<allproperty>
<aproperty>
<postcode>ha15rs</postcode>
<price>250</price>
<imagefilename>home2.gif</imagefilename>
<visits>2</visits>
</aproperty>
<aproperty>
<postcode>ha36gs</postcode>
<price>150</price>
<imagefilename>home3.gif</imagefilename>
<visits>1</visits>
</aproperty>
<aproperty>
<postcode>ha27se</postcode>
<price>300</price>
<imagefilename>home4.gif</imagefilename>
<visits>4</visits>
</aproperty>
<aproperty>
<postcode>ha4678</postcode>
<price>200</price>
<imagefilename>home5.gif</imagefilename>
<visits>5</visits>
</aproperty>
</allproperty>
DTD 文件
data_out.dtd
<!ELEMENT aproperty (postcode,price,imagefilename,visits)>
<!ELEMENT postcode (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT imagefilename (#PCDATA)>
<!ELEMENT visits (#PCDATA)>
当我检查“说 allproperty
未声明”时,我不断收到错误
I have this xml file:
data_out.xml
<?xml version="1.0" ?>
<!DOCTYPE allproperty SYSTEM "data_out.dtd">
<allproperty>
<aproperty>
<postcode>ha15rs</postcode>
<price>250</price>
<imagefilename>home2.gif</imagefilename>
<visits>2</visits>
</aproperty>
<aproperty>
<postcode>ha36gs</postcode>
<price>150</price>
<imagefilename>home3.gif</imagefilename>
<visits>1</visits>
</aproperty>
<aproperty>
<postcode>ha27se</postcode>
<price>300</price>
<imagefilename>home4.gif</imagefilename>
<visits>4</visits>
</aproperty>
<aproperty>
<postcode>ha4678</postcode>
<price>200</price>
<imagefilename>home5.gif</imagefilename>
<visits>5</visits>
</aproperty>
</allproperty>
a DTD file
data_out.dtd
<!ELEMENT aproperty (postcode,price,imagefilename,visits)>
<!ELEMENT postcode (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT imagefilename (#PCDATA)>
<!ELEMENT visits (#PCDATA)>
I keep getting a error when I do check "saying the allproperty
is not declared"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还必须在 DTD 中声明 allproperly
You have to declare allproperly in the DTD as well