diff --git a/parser.c b/parser.c index 3bc237b8d..3bd2ccc1a 100644 --- a/parser.c +++ b/parser.c @@ -7600,8 +7600,8 @@ xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) { xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY, "Entity '%s' not defined\n", name); } else { - xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY, - "Entity '%s' not defined\n", name); + xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY, + "Entity '%s' not defined\n", name, NULL); if ((ctxt->inSubset == 0) && (ctxt->sax != NULL) && (ctxt->disableSAX == 0) && @@ -7844,7 +7844,7 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) * precede any reference to it... */ if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) { - xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY, + xmlValidityError(ctxt, XML_ERR_UNDECLARED_ENTITY, "PEReference: %%%s; not found\n", name, NULL); } else diff --git a/python/tests/input_callback.py b/python/tests/input_callback.py index 6d5ec0da0..c1ba0859b 100755 --- a/python/tests/input_callback.py +++ b/python/tests/input_callback.py @@ -101,7 +101,7 @@ def my_ctx_error_cb(arg, msg, severity, reserved): exp_status="loaded", exp_err=[ ( 3, 'failed to load "http://example.com/dtds/sample.dtd": Attempt to load network entity\n'), ( -1, "Attempt to load network entity: http://example.com/dtds/sample.dtd"), - ( 4, "Entity 'sample.entity' not defined\n") + ( 3, "Entity 'sample.entity' not defined\n") ]) # Register a catalog (also accessible via pystr://) and retry @@ -114,7 +114,7 @@ def my_ctx_error_cb(arg, msg, severity, reserved): test_callback=lambda: libxml2.popInputCallbacks(), exp_status="loaded", exp_err=[ ( 3, "failed to load \"py://strings/dtds/sample.dtd\": No such file or directory\n"), - ( 4, "Entity 'sample.entity' not defined\n") + ( 3, "Entity 'sample.entity' not defined\n") ]) # Try to load the document again diff --git a/result/ent7.sax b/result/ent7.sax index 7a298d70b..934610068 100644 --- a/result/ent7.sax +++ b/result/ent7.sax @@ -1,4 +1,4 @@ -xmlSAXUserParseFile returned error 27 +xmlParseDocument returned error 26 SAX.setDocumentLocator() SAX.startDocument() SAX.internalSubset(item, , ) diff --git a/result/ent7.sax2 b/result/ent7.sax2 index 2a5319888..4654c3df8 100644 --- a/result/ent7.sax2 +++ b/result/ent7.sax2 @@ -1,4 +1,4 @@ -xmlSAXUserParseFile returned error 27 +xmlParseDocument returned error 26 SAX.setDocumentLocator() SAX.startDocument() SAX.internalSubset(item, , ) diff --git a/result/errors/rec_att_default.xml.ent b/result/errors/rec_att_default.xml.ent index 375a0d651..345058419 100644 --- a/result/errors/rec_att_default.xml.ent +++ b/result/errors/rec_att_default.xml.ent @@ -1,4 +1,4 @@ -./test/errors/rec_att_default.xml:3: parser error : Entity 'b' not defined +./test/errors/rec_att_default.xml:3: parser warning : Entity 'b' not defined ^ ./test/errors/rec_att_default.xml:6: parser error : Detected an entity reference loop diff --git a/result/errors/rec_att_default.xml.err b/result/errors/rec_att_default.xml.err index 375a0d651..345058419 100644 --- a/result/errors/rec_att_default.xml.err +++ b/result/errors/rec_att_default.xml.err @@ -1,4 +1,4 @@ -./test/errors/rec_att_default.xml:3: parser error : Entity 'b' not defined +./test/errors/rec_att_default.xml:3: parser warning : Entity 'b' not defined ^ ./test/errors/rec_att_default.xml:6: parser error : Detected an entity reference loop diff --git a/result/errors/rec_att_default.xml.str b/result/errors/rec_att_default.xml.str index 11e6556b3..f8cdd3df6 100644 --- a/result/errors/rec_att_default.xml.str +++ b/result/errors/rec_att_default.xml.str @@ -1,4 +1,4 @@ -./test/errors/rec_att_default.xml:3: parser error : Entity 'b' not defined +./test/errors/rec_att_default.xml:3: parser warning : Entity 'b' not defined ^ ./test/errors/rec_att_default.xml:6: parser error : Detected an entity reference loop diff --git a/result/noent/ent7.sax2 b/result/noent/ent7.sax2 index 3d0e6348d..77dd7fff5 100644 --- a/result/noent/ent7.sax2 +++ b/result/noent/ent7.sax2 @@ -1,4 +1,4 @@ -xmlSAXUserParseFile returned error 27 +xmlParseDocument returned error 26 SAX.setDocumentLocator() SAX.startDocument() SAX.internalSubset(item, , ) diff --git a/result/noent/xml2.sax2 b/result/noent/xml2.sax2 index 8932f99a8..dae52c894 100644 --- a/result/noent/xml2.sax2 +++ b/result/noent/xml2.sax2 @@ -1,4 +1,4 @@ -xmlSAXUserParseFile returned error 27 +xmlParseDocument returned error 26 SAX.setDocumentLocator() SAX.startDocument() SAX.internalSubset(test, , ) diff --git a/result/xml2.sax b/result/xml2.sax index ced4c731a..52c0e6bf3 100644 --- a/result/xml2.sax +++ b/result/xml2.sax @@ -1,4 +1,4 @@ -xmlSAXUserParseFile returned error 27 +xmlParseDocument returned error 26 SAX.setDocumentLocator() SAX.startDocument() SAX.internalSubset(test, , ) diff --git a/result/xml2.sax2 b/result/xml2.sax2 index f66b9e020..52a8b1fe9 100644 --- a/result/xml2.sax2 +++ b/result/xml2.sax2 @@ -1,4 +1,4 @@ -xmlSAXUserParseFile returned error 27 +xmlParseDocument returned error 26 SAX.setDocumentLocator() SAX.startDocument() SAX.internalSubset(test, , ) diff --git a/runtest.c b/runtest.c index ba7f16d58..97ae53090 100644 --- a/runtest.c +++ b/runtest.c @@ -1515,8 +1515,8 @@ saxParseTest(const char *filename, const char *result, xmlFreeDoc(ctxt->myDoc); xmlFreeParserCtxt(ctxt); } - if (ret == XML_WAR_UNDECLARED_ENTITY) { - fprintf(SAXdebug, "xmlSAXUserParseFile returned error %d\n", ret); + if (ret == XML_ERR_UNDECLARED_ENTITY) { + fprintf(SAXdebug, "xmlParseDocument returned error %d\n", ret); ret = 0; } if (ret != 0) { @@ -1556,10 +1556,6 @@ saxParseTest(const char *filename, const char *result, xmlFreeDoc(ctxt->myDoc); xmlFreeParserCtxt(ctxt); } - if (ret == XML_WAR_UNDECLARED_ENTITY) { - fprintf(SAXdebug, "xmlSAXUserParseFile returned error %d\n", ret); - ret = 0; - } fclose(SAXdebug); if (compareFiles(temp, result)) { fprintf(stderr, "Got a difference for %s\n", filename);