是什么导致此xml文件出现此错误

时间:2019-02-25 03:00:14

标签: dtd

这是我收到的错误:

  

“联系人”元素类型的内容必须与“(名字,姓氏,电话,职位描述,职位,工作人员类型)”匹配。

我的代码:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE contacts  [

    <!ELEMENT contacts (contact+)>
<!ELEMENT contact (first_name,last_name,phone,position_description,position,worker_type)>
<!ATTLIST contact title CDATA ''>
<!ATTLIST contact gender CDATA  ''>
<!ELEMENT employee (#PCDATA)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT last_name (#PCDATA)>
<!ELEMENT address (street,city,state,zip_code)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip_code (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT position_description ANY>
<!ATTLIST position_description type (employee | manager) "manager">
<!ELEMENT worker_type (#PCDATA)>
<!ELEMENT position (#PCDATA)>
]>
<contacts>
  <contact title="Mr." gender="male">
    <first_name>Joseph</first_name>
    <last_name>Kyle</last_name>
    <address>
      <street>4654 Main Street</street>
      <city>Duluth</city>
      <state>Minnesota</state>
      <zip_code>78210-6778</zip_code>
    </address>
    <phone>123-215-21234</phone>
    <position_description>Field Officer, Department of Fisheries.</position_description>
    <position>employee/manager</position>
    <worker_type>employee</worker_type>
  </contact>
</contacts>

0 个答案:

没有答案