On Tue, Oct 10, 2006 at 05:00:00PM -0700, Bob Stayton wrote:
> I've noticed that when I used xmllint --valid to validate a document, if I
> don't use the --nowarning option I get a full description of an invalid
> element that helps me find the error:
>
> ch01.xml:125: element chapter: validity error : Element chapter content
> does
> not follow the DTD, expecting (title , (((itemizedlist | orderedlist |
> caution |
> note | tip | programlisting | para | blockquote | informalexample |
> graphic | i
> nformaltable | example | figure | table | procedure | bridgehead | remark)+
> , se
> ction*) | section+)), got (title indexterm para section section section )
> </chapter>
> ^
>
> When I add the --nowarning option to xmllint, I get only this output:
>
> ch01.xml:125: element chapter: validity error : Element chapter content
> does
> not follow the DTD
> </chapter>
> ^
>
> This is not a warning, this is a validation error. Why would --nowarning
> suppress this useful information?
> In this case, I need to use --nowarning because the DTD in question is
> structured to specify the same attribute more than once. That generates a
> warning (not an error) that I want to suppress.
>
> Is there any way to use --nowarning and still get the full error output?
> My version is on Windows XP:
>
> xmllint.exe: using libxml version 20626CVS2823
I can't reproduce this:
paphio:~/XML -> xmllint --valid test/VC/ElementValid4
test/VC/ElementValid4:7: element doc: validity error : Element c is not
declared in doc list of possible children
<doc> This <b>seems</b> Ok <a/> but this <c>was not declared</c></doc>
^
<?xml version="1.0"?>
<!DOCTYPE doc [
<!ELEMENT doc (#PCDATA | a | b)*>
<!ELEMENT a EMPTY>
<!ELEMENT b (#PCDATA)>
<!ELEMENT c (#PCDATA)>
]>
<doc> This <b>seems</b> Ok <a/> but this <c>was not declared</c></doc>
paphio:~/XML -> xmllint --valid --nowarning test/VC/ElementValid4
test/VC/ElementValid4:7: element doc: validity error : Element c is not
declared in doc list of possible children
<doc> This <b>seems</b> Ok <a/> but this <c>was not declared</c></doc>
^
<?xml version="1.0"?>
<!DOCTYPE doc [
<!ELEMENT doc (#PCDATA | a | b)*>
<!ELEMENT a EMPTY>
<!ELEMENT b (#PCDATA)>
<!ELEMENT c (#PCDATA)>
]>
<doc> This <b>seems</b> Ok <a/> but this <c>was not declared</c></doc>
paphio:~/XML ->
Can you reproduce this with a small test ?
thanks,
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
[EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml