Validation of an XML and DTD
Posted: Mon Aug 21, 2017 12:26 pm
I have a problem with my XML and DTD and I can't understand what it is. Normally, my xml is well formed:
My DTD:
My validation: xmllint CONTRE.xml --dtdvalid CONTRE.dtd --noout
Errors:
Can anybody help me? Thank you! 
Code: Select all
<?xml version='1.0' encoding='UTF-8' standalone="no"?>
<!DOCTYPE corpus SYSTEM "POUR.dtd">
<corpus>
<position type="contre">
<discours auteur="AƩcio Neves" id="1" date="25/08/2016" lieu="Senado Federal">
blablabla
</discours>
</position>
</corpus>
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<!ELEMENT corpus (position, discours)>
<!ELEMENT position (type)>
<!ATTLIST contre (#CDATA)>
<!ELEMENT discours (auteur, id, date, lieu)>
<!ATTLIST auteur (#CDATA)>
<!ATTLIST id (#CDATA)>
<!ATTLIST date (#CDATA)>
<!ATTLIST lieu (#CDATA)>
Errors:
Code: Select all
CONTRE.dtd:5: parser error : ATTLIST: no name for Attribute
<!ATTLIST contre (#CDATA)>
^
CONTRE.dtd:5: parser error : Content error in the external subset
<!ATTLIST contre (#CDATA)>
^
