Cleanup and testing with the KDE help center files:
- valid.c: cleanup, more useful debugging
- parserInternals.c: cleanup vctxt.nodeTab (de)allocation
- xmlIO.c: entity loading is printed as an error when validating
Daniel
diff --git a/xmlIO.c b/xmlIO.c
index 2f3257b..9560fb8 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -1598,14 +1598,22 @@
 	    "xmlDefaultExternalEntityLoader(%s, xxx)\n", URL);
 #endif
     if (URL == NULL) {
-        if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+	if ((ctxt->validate) && (ctxt->sax != NULL) && 
+            (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt,
+		    "failed to load external entity \"%s\"\n", ID);
+	else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
 	    ctxt->sax->warning(ctxt,
 		    "failed to load external entity \"%s\"\n", ID);
         return(NULL);
     }
     ret = xmlNewInputFromFile(ctxt, URL);
     if (ret == NULL) {
-        if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+	if ((ctxt->validate) && (ctxt->sax != NULL) && 
+            (ctxt->sax->error != NULL))
+	    ctxt->sax->error(ctxt,
+		    "failed to load external entity \"%s\"\n", URL);
+	else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
 	    ctxt->sax->warning(ctxt,
 		    "failed to load external entity \"%s\"\n", URL);
     }