Re: Odd DTD validation problem



I made some tests with the small test case and xml and dtd files at
http://git.gnome.org/browse/libxml++/tree/examples/dom_parser

The file example_invalid.xml does not validate against example.dtd (deliberate errors).

xmllint example_invalid.xml --dtdvalid
does not print error messages.

xmllint example_invalid.xml --dtdvalid example.dtd
and
xmllint --dtdvalid example.dtd example_invalid.xml
do print error messages.

It seems that xmllint does not validate unless you specify the name of the dtd file on the command line. What happens if you try

xmllint test.xml --dtdvalid myapp.dtd
or
xmllint --dtdvalid myapp.dtd test.xml
?

Kjell

2012-10-03 02:16, Sanne Graaf skrev:
Hello everybody,

Lately my Fedora 16 auto-upgraded libxml2 from a previous version to the latest rpm libxml2-2.7.8-8.fc16.i686, and suddenly the dtd validation starts to complain about missing declarations in the DTD file. Before this upgrade everything worked fine. And of course when I disable the validation it also works fine, but that is not the idea. I don't use libxml2 directly, I use libxml++.

When I use tools like xmllint the xml message also doesn't have any problems, so my conclusion is that the problem is not in libxml2, but libxml++ keeps on insisting the message is wrong.

Example message:

<?xml version="1.0"?><!DOCTYPE MYAPP SYSTEM "myapp.dtd"><MYAPP><Command type="Connect"/></MYAPP>

Gives these errors:

Validity error:
Line 1, column 76 (error):
No declaration for attribute type of element Command
Line 1, column 78 (error):
No declaration for element Command
Line 1, column 87 (error):
No declaration for element MYAPP

All the needed elements are in the dtd file, and like said before a command like:

xmllint test.xml -dtdvalid

doesn't give any problems.

I tried recompiling the latest versions of libxml2 and libxml++ and use these in my app, but the result is the same (only the Line and column numbers of the error are now added)

Does anybody have a clue why this is suddenly happening?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]