fixed bug #76168, attribute redeclared in the internal subset should not
* valid.c SAX.c: fixed bug #76168, attribute redeclared in
the internal subset should not raise duplicate ID errors,
also there was a small bug in conjunction to namespace
declarations defaulted and xml:xxx attributes DTD definitions.
Daniel
diff --git a/valid.c b/valid.c
index 36f2bec..1f1845d 100644
--- a/valid.c
+++ b/valid.c
@@ -1262,6 +1262,7 @@
xmlFreeEnumeration(tree);
return(NULL);
}
+
/*
* Check the type and possibly the default value.
*/
@@ -1301,6 +1302,18 @@
}
/*
+ * Check first that an attribute defined in the external subset wasn't
+ * already defined in the internal subset
+ */
+ if ((dtd->doc != NULL) && (dtd->doc->extSubset == dtd) &&
+ (dtd->doc->intSubset != NULL) &&
+ (dtd->doc->intSubset->attributes != NULL)) {
+ ret = xmlHashLookup3(dtd->doc->intSubset->attributes, name, ns, elem);
+ if (ret != NULL)
+ return(NULL);
+ }
+
+ /*
* Create the Attribute table if needed.
*/
table = (xmlAttributeTablePtr) dtd->attributes;
@@ -3369,6 +3382,9 @@
if ((elem == NULL) || (elem->name == NULL)) return(0);
if ((attr == NULL) || (attr->name == NULL)) return(0);
+ if (xmlStrEqual(attr->name, "lang")) {
+ printf("hello\n");
+ }
if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
xmlChar qname[500];
snprintf((char *) qname, sizeof(qname), "%s:%s",