OK so I'm trying to validate the following XML file with the following DTD, but I keep getting the error Attribute "type" must be declared for element type "policy".
The XML file is shown as below:
<?xml version="1.0"?>
<!DOCTYPE policies SYSTEM "langs.dtd">
<policies>
<description>Policies taken out in January</description>
<policy type="contents">
<policy-number>1234557</policy-number>
<policy-holder>A. Liu</policy-holder>
</policy>
<policy type="buildings">
<policy-number>1234558</policy-number>
<policy-holder>C. Jones</policy-holder>
</policy>
<report-date>01/01/2008</report-date>
</policies>
The DTD file is below:
<!ELEMENT policies (description, policy+, report-date)>
<!ELEMENT policy (policy-number, policy-holder)>
<!ELEMENT policy-number (#PCDATA)>
<!ELEMENT policy-holder (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT report-date (#PCDATA)>