the a-posteriori DTD validation code was not validating the namespace
* valid.c: the a-posteriori DTD validation code was not validating
the namespace declarations, this fixes #124110
Daniel
diff --git a/valid.c b/valid.c
index 4853cc7..d2eea46 100644
--- a/valid.c
+++ b/valid.c
@@ -6038,6 +6038,7 @@
xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem) {
xmlNodePtr child;
xmlAttrPtr attr;
+ xmlNsPtr ns;
xmlChar *value;
int ret = 1;
@@ -6062,13 +6063,20 @@
ret &= xmlValidateOneElement(ctxt, doc, elem);
attr = elem->properties;
- while(attr != NULL) {
+ while (attr != NULL) {
value = xmlNodeListGetString(doc, attr->children, 0);
ret &= xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
if (value != NULL)
xmlFree(value);
attr= attr->next;
}
+ ns = elem->nsDef;
+ while (ns != NULL) {
+ value = ns->href;
+ ret &= xmlValidateOneNamespace(ctxt, doc, elem, ns->prefix,
+ ns, ns->href);
+ ns = ns->next;
+ }
child = elem->children;
while (child != NULL) {
ret &= xmlValidateElement(ctxt, doc, child);