GNOME Bugzilla – Bug 724903
valid.c erroneously ignores a validation error if no error callback set
Last modified: 2015-09-10 11:53:01 UTC
valid.c contains this code: 2636 if ((ctxt != NULL) && (ctxt->error != NULL)) { 2637 xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED, 2638 "ID %s already defined\n", 2639 value, NULL, NULL); 2640 } It prevents the error from being reported if ctxt->error is not set, although simply calling xmlErrValifNode() would properly report the error to the global error callback if the NULL checks above didn't exist.
okay, indeed, fix commited in master: https://git.gnome.org/browse/libxml2/commit/?id=a16eb968075a82ec33b2c1e77db8909a35b44620 thanks ! Daniel
This suddenly causes validity errors "ID ... already defined" even if the id is only defined once. Please see https://mail.gnome.org/archives/xml/2014-September/msg00013.html as well.
I should have mentioned that probably the follow-up (https://mail.gnome.org/archives/xml/2014-September/msg00014.html) is the more intersting one. Creation of HTML docs (like MPlayer's doc for example) prints lots of the aboved mentioned errors now. It used to work OK before.
(In reply to jb999 from comment #3) > Creation of HTML docs (like MPlayer's doc for example) prints lots of the > aboved mentioned errors now. It used to work OK before. This is due to ctxt being NULL.
It seems that checking if (ctxt != NULL)(In reply to jb999 from comment #4) > This is due to ctxt being NULL. So checking "if (ctxt != NULL)" prior to calling xmlErrValidNode() eliminates the validity errors "ID ... already defined".
Okay indeed I had to revert part of it, for https://bugzilla.gnome.org/show_bug.cgi?id=737840 thanks ! Daniel