给定以下 xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Clients SYSTEM "bank.dtd">
<Clients>
<account>
<number>323</number>
<client>
<address>
<street>Sliders</street>
<city>Tokyo</city>
</address>
<identity>1212</identity>
</client>
<client> // HERE IS THE PROBLEM
<address>
<street>Jason</street>
<city>Paris</city>
</address>
<identity>1313</identity>
</client>
<totoalSum>43333</totoalSum>
</account>
</Clients>
及其DTD文件:
<?xml version="1.0" encoding="utf-8"?>
<!ELEMENT Clients (account+)>
<!ELEMENT account (number,client,totoalSum)>
<!ELEMENT client (address,identity)>
<!ELEMENT address (street,city)>
<!ELEMENT number (#PCDATA)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT identity (#PCDATA)>
<!ELEMENT totoalSum (#PCDATA)>
我无法对其进行验证。XMLspy 说:
Content model of element 'account' disallows element 'client' at this position.
这样,有问题的行在上面用“HERE”标记。
知道是什么原因造成的吗?
问候