diff --git a/python/tests/reader2.py b/python/tests/reader2.py
index 59141a88..0857c232 100755
--- a/python/tests/reader2.py
+++ b/python/tests/reader2.py
@@ -42,9 +42,6 @@ value
"""{0}/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got
^
-{0}/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more children
-
-^
""".format(dir_prefix),
'cond_sect2':
"""{0}/dtds/cond_sect2.dtd:15: parser error : All markup of the conditional section is not in the same entity
diff --git a/result/VC/ElementValid2.rdr b/result/VC/ElementValid2.rdr
index cae331b5..db47c897 100644
--- a/result/VC/ElementValid2.rdr
+++ b/result/VC/ElementValid2.rdr
@@ -1,6 +1,3 @@
./test/VC/ElementValid2:4: element p: validity error : No declaration for element p
^
-./test/VC/ElementValid2:5: element p: validity error : No declaration for element p
-
-^
diff --git a/result/VC/ElementValid3.rdr b/result/VC/ElementValid3.rdr
index 5f4e03e2..2fc236d5 100644
--- a/result/VC/ElementValid3.rdr
+++ b/result/VC/ElementValid3.rdr
@@ -1,6 +1,3 @@
./test/VC/ElementValid3:4: element doc: validity error : Element doc was declared EMPTY this one has content
Oops, this element was declared EMPTY
^
-./test/VC/ElementValid3:5: element doc: validity error : Element doc was declared EMPTY this one has content
-
-^
diff --git a/result/VC/ElementValid4.rdr b/result/VC/ElementValid4.rdr
index 289a527e..4791db5d 100644
--- a/result/VC/ElementValid4.rdr
+++ b/result/VC/ElementValid4.rdr
@@ -1,6 +1,3 @@
./test/VC/ElementValid4:7: element doc: validity error : Element c is not declared in doc list of possible children
This seems Ok but this was not declared
^
-./test/VC/ElementValid4:8: element doc: validity error : Element c is not declared in doc list of possible children
-
-^
diff --git a/result/VC/ElementValid5.rdr b/result/VC/ElementValid5.rdr
index 91eef9c6..bd064f6b 100644
--- a/result/VC/ElementValid5.rdr
+++ b/result/VC/ElementValid5.rdr
@@ -1,9 +1,3 @@
./test/VC/ElementValid5:7: element doc: validity error : Element doc content does not follow the DTD, expecting (a , b* , c+), got (a b c b)
but thiswas not declaredseems
^
-./test/VC/ElementValid5:8: element doc: validity error : Element doc content does not follow the DTD, Misplaced b
-
-^
-./test/VC/ElementValid5:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more children
-
-^
diff --git a/result/VC/ElementValid6.rdr b/result/VC/ElementValid6.rdr
index 3b51d1a1..1cbf8fdb 100644
--- a/result/VC/ElementValid6.rdr
+++ b/result/VC/ElementValid6.rdr
@@ -1,6 +1,3 @@
./test/VC/ElementValid6:7: element doc: validity error : Element doc content does not follow the DTD, expecting (a , b? , c+)?, got (a b)
lacks c
^
-./test/VC/ElementValid6:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more children
-
-^
diff --git a/result/VC/ElementValid7.rdr b/result/VC/ElementValid7.rdr
index ecafd1db..4ce9dbfe 100644
--- a/result/VC/ElementValid7.rdr
+++ b/result/VC/ElementValid7.rdr
@@ -1,6 +1,3 @@
./test/VC/ElementValid7:7: element doc: validity error : Element doc content does not follow the DTD, expecting ((a | b)* , c+ , a , b? , c , a?), got (a b a c c a)
^
-./test/VC/ElementValid7:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more children
-
-^
diff --git a/result/valid/781333.xml.err.rdr b/result/valid/781333.xml.err.rdr
index dd9df08f..b401b49a 100644
--- a/result/valid/781333.xml.err.rdr
+++ b/result/valid/781333.xml.err.rdr
@@ -1,6 +1,3 @@
./test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got
^
-./test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more children
-
-^
diff --git a/valid.c b/valid.c
index 3d6827e1..bb941a50 100644
--- a/valid.c
+++ b/valid.c
@@ -5548,12 +5548,6 @@ xmlValidGetElemDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
*extsubset = 1;
}
}
- if (elemDecl == NULL) {
- xmlErrValidNode(ctxt, elem,
- XML_DTD_UNKNOWN_ELEM,
- "No declaration for element %s\n",
- elem->name, NULL, NULL);
- }
return(elemDecl);
}
@@ -5596,10 +5590,6 @@ xmlValidatePushElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
ret = 0;
break;
case XML_ELEMENT_TYPE_EMPTY:
- xmlErrValidNode(ctxt, state->node,
- XML_DTD_NOT_EMPTY,
- "Element %s was declared EMPTY this one has content\n",
- state->node->name, NULL, NULL);
ret = 0;
break;
case XML_ELEMENT_TYPE_ANY:
@@ -5610,20 +5600,10 @@ xmlValidatePushElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
if ((elemDecl->content != NULL) &&
(elemDecl->content->type ==
XML_ELEMENT_CONTENT_PCDATA)) {
- xmlErrValidNode(ctxt, state->node,
- XML_DTD_NOT_PCDATA,
- "Element %s was declared #PCDATA but contains non text nodes\n",
- state->node->name, NULL, NULL);
ret = 0;
} else {
ret = xmlValidateCheckMixed(ctxt, elemDecl->content,
qname);
- if (ret != 1) {
- xmlErrValidNode(ctxt, state->node,
- XML_DTD_INVALID_CHILD,
- "Element %s is not declared in %s list of possible children\n",
- qname, state->node->name, NULL);
- }
}
break;
case XML_ELEMENT_TYPE_ELEMENT:
@@ -5640,10 +5620,6 @@ xmlValidatePushElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
return(0);
}
if (ret < 0) {
- xmlErrValidNode(ctxt, state->node,
- XML_DTD_CONTENT_MODEL,
- "Element %s content does not follow the DTD, Misplaced %s\n",
- state->node->name, qname, NULL);
ret = 0;
} else {
ret = 1;
@@ -5693,10 +5669,6 @@ xmlValidatePushCData(xmlValidCtxtPtr ctxt, const xmlChar *data, int len) {
ret = 0;
break;
case XML_ELEMENT_TYPE_EMPTY:
- xmlErrValidNode(ctxt, state->node,
- XML_DTD_NOT_EMPTY,
- "Element %s was declared EMPTY this one has content\n",
- state->node->name, NULL, NULL);
ret = 0;
break;
case XML_ELEMENT_TYPE_ANY:
@@ -5769,11 +5741,6 @@ xmlValidatePopElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc ATTRIBUTE_UNUSED,
if (ret <= 0) {
if (ret == XML_REGEXP_OUT_OF_MEMORY)
xmlVErrMemory(ctxt);
- else
- xmlErrValidNode(ctxt, state->node,
- XML_DTD_CONTENT_MODEL,
- "Element %s content does not follow the DTD, Expecting more children\n",
- state->node->name, NULL,NULL);
ret = 0;
} else {
/*
@@ -5846,8 +5813,13 @@ xmlValidateOneElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
* Fetch the declaration
*/
elemDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
- if (elemDecl == NULL)
+ if (elemDecl == NULL) {
+ xmlErrValidNode(ctxt, elem,
+ XML_DTD_UNKNOWN_ELEM,
+ "No declaration for element %s\n",
+ elem->name, NULL, NULL);
return(0);
+ }
/*
* If vstateNr is not zero that means continuous validation is