[xml] Validation with xmllint, parser errors
- From: Umut Emin <js_bach freenet de>
- To: xml gnome org
- Subject: [xml] Validation with xmllint, parser errors
- Date: Thu, 16 Jul 2009 10:35:33 +0200
Hello,
i have a plain horizontal external dtd file which i want xmllint to
validate it. I get errors even though i follow the general xml rules on
dtd decleration and definition (see
http://xmlwriter.net/xml_guide/doctype_declaration.shtml) .
Here is my plain dtd from file.dtd:
<!ELEMENT document (postal_data,main_data)>
<!ELEMENT postal_data (p_name, p_addr, p_hno, p_pcode, p_city, p_ctry)>
<!ELEMENT main_data (subj, opening, main_text, closing)>
<!ELEMENT p_name (#PCDATA)>
<!ELEMENT p_addr (#PCDATA)>
<!ELEMENT p_hno (#PCDATA)>
<!ELEMENT p_pcode (#PCDATA)>
<!ELEMENT p_city (#PCDATA)>
<!ELEMENT p_ctry (#PCDATA)>
<!ELEMENT subj (#PCDATA)>
<!ELEMENT opening (#PCDATA)>
<!ELEMENT main_text (#PCDATA)>
<!ELEMENT closing (#PCDATA)>
and the command:
xmllint --valid --noout file.dtd
file.dtd:1: parser error : StartTag: invalid element name
<!ELEMENT document (postal_data,main_data)>
^
file.dtd:1: parser error : Extra content at the end of the document
<!ELEMENT document (postal_data,main_data)>
^
I am using libxml2-2.7.3 on a linux(distro gentoo). I am not sure if
this is a parser bug or not for the release. Btw: should xmllint also
not validate an empty dtd with no elements (empty file)? This would be
also an universally valid dtd.
Many thanks,
Umut
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]