diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 055a23a8..1b228dfa 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -16791,7 +16791,7 @@ Could we use @subtypes for this?'/>
- defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+ defined(LIBXML_VALID_ENABLED)
DEPRECATED: Internal function, don't use. Validate that the given name match a notation declaration. - [ VC: Notation Declared ]
diff --git a/include/libxml/valid.h b/include/libxml/valid.h
index bcba213f..75789b14 100644
--- a/include/libxml/valid.h
+++ b/include/libxml/valid.h
@@ -378,15 +378,12 @@ XML_DEPRECATED
XMLPUBFUN int
xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
xmlDocPtr doc);
-#endif /* LIBXML_VALID_ENABLED */
-
-#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
XML_DEPRECATED
XMLPUBFUN int
xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
xmlDocPtr doc,
const xmlChar *notationName);
-#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
+#endif /* LIBXML_VALID_ENABLED */
XMLPUBFUN int
xmlIsMixedElement (xmlDocPtr doc,
diff --git a/testapi.c b/testapi.c
index 205bd185..02f34c12 100644
--- a/testapi.c
+++ b/testapi.c
@@ -27445,7 +27445,7 @@ static int
test_xmlValidateNotationUse(void) {
int test_ret = 0;
-#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+#if defined(LIBXML_VALID_ENABLED)
int mem_base;
int ret_val;
xmlValidCtxtPtr ctxt; /* the validation context */
diff --git a/valid.c b/valid.c
index 832e839f..cdd31fba 100644
--- a/valid.c
+++ b/valid.c
@@ -119,7 +119,7 @@ xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error,
NULL, NULL, 0, msg, extra);
}
-#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+#ifdef LIBXML_VALID_ENABLED
/**
* xmlErrValidNode:
* @ctxt: an XML validation parser context
@@ -140,9 +140,7 @@ xmlErrValidNode(xmlValidCtxtPtr ctxt,
xmlDoErrValid(ctxt, node, error, XML_ERR_ERROR, str1, str2, str3, 0,
msg, str1, str2, str3);
}
-#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
-#ifdef LIBXML_VALID_ENABLED
/**
* xmlErrValidNodeNr:
* @ctxt: an XML validation parser context
@@ -3149,7 +3147,7 @@ xmlGetDtdNotationDesc(xmlDtdPtr dtd, const xmlChar *name) {
return(xmlHashLookup(table, name));
}
-#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+#ifdef LIBXML_VALID_ENABLED
/**
* xmlValidateNotationUse:
* @ctxt: the validation context
@@ -3175,7 +3173,7 @@ xmlValidateNotationUse(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
if ((notaDecl == NULL) && (doc->extSubset != NULL))
notaDecl = xmlGetDtdNotationDesc(doc->extSubset, notationName);
- if ((notaDecl == NULL) && (ctxt != NULL)) {
+ if (notaDecl == NULL) {
xmlErrValidNode(ctxt, (xmlNodePtr) doc, XML_DTD_UNKNOWN_NOTATION,
"NOTATION %s is not declared\n",
notationName, NULL, NULL);
@@ -3183,7 +3181,7 @@ xmlValidateNotationUse(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
}
return(1);
}
-#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
+#endif /* LIBXML_VALID_ENABLED */
/**
* xmlIsMixedElement:
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 7e3db829..3f3fd271 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -3196,8 +3196,13 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
if ((node == NULL) || (node->doc == NULL))
ret = 3;
if (ret == 0) {
- ret = xmlValidateNotationUse(NULL, node->doc, value);
- if (ret == 1)
+ xmlNotationPtr nota;
+
+ nota = xmlGetDtdNotationDesc(node->doc->intSubset, value);
+ if ((nota == NULL) && (node->doc->extSubset != NULL))
+ nota = xmlGetDtdNotationDesc(node->doc->extSubset,
+ value);
+ if (nota != NULL)
ret = 0;
else
ret = 1;