aboutsummaryrefslogtreecommitdiffstats
path: root/valid.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-03-25 10:48:46 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-03-25 10:48:46 +0000
commitd85f4f437c9d54a658b229a77426e693bd328787 (patch)
treeabaa03453c1a644d131ef42e30e542598a633b30 /valid.c
parentac97f6e05657a569143811f6e92214faef9a150a (diff)
downloadandroid_external_libxml2-d85f4f437c9d54a658b229a77426e693bd328787.tar.gz
android_external_libxml2-d85f4f437c9d54a658b229a77426e693bd328787.tar.bz2
android_external_libxml2-d85f4f437c9d54a658b229a77426e693bd328787.zip
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
Diffstat (limited to 'valid.c')
-rw-r--r--valid.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/valid.c b/valid.c
index 36f2bec5..1f1845d1 100644
--- a/valid.c
+++ b/valid.c
@@ -1262,6 +1262,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
xmlFreeEnumeration(tree);
return(NULL);
}
+
/*
* Check the type and possibly the default value.
*/
@@ -1301,6 +1302,18 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
}
/*
+ * 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 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
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",