mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-31 19:10:28 +08:00
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
This commit is contained in:
parent
ac97f6e056
commit
d85f4f437c
@ -1,3 +1,10 @@
|
||||
Mon Mar 25 11:46:05 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* 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.
|
||||
|
||||
Fri Mar 22 15:13:49 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xpath.c: Richard Jinks also raised some rounding problems
|
||||
|
9
SAX.c
9
SAX.c
@ -520,8 +520,8 @@ attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
|
||||
}
|
||||
if (ctxt->vctxt.valid == 0)
|
||||
ctxt->valid = 0;
|
||||
if (ctxt->validate && ctxt->wellFormed &&
|
||||
ctxt->myDoc && ctxt->myDoc->intSubset)
|
||||
if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
|
||||
(ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset != NULL))
|
||||
ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
|
||||
attr);
|
||||
if (prefix != NULL)
|
||||
@ -1248,7 +1248,7 @@ startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
|
||||
}
|
||||
|
||||
/*
|
||||
* process all the attributes whose name start with "xml"
|
||||
* process all the attributes whose name start with "xmlns"
|
||||
*/
|
||||
if (atts != NULL) {
|
||||
i = 0;
|
||||
@ -1256,7 +1256,8 @@ startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
|
||||
value = atts[i++];
|
||||
if (!ctxt->html) {
|
||||
while ((att != NULL) && (value != NULL)) {
|
||||
if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l'))
|
||||
if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
|
||||
(att[3] == 'n') && (att[4] == 's'))
|
||||
attribute(ctxt, att, value);
|
||||
|
||||
att = atts[i++];
|
||||
|
@ -87,7 +87,7 @@ AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h ansidecl.h)
|
||||
AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
|
||||
AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
|
||||
AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h)
|
||||
AC_CHECK_HEADERS(sys/timeb.h signal.h)
|
||||
AC_CHECK_HEADERS(sys/timeb.h signal.h resolv.h)
|
||||
|
||||
dnl Specific dir for HTML output ?
|
||||
if test "x$with_html_dir" = "x" ; then
|
||||
|
@ -1,7 +1,7 @@
|
||||
Summary: Library providing XML and HTML support
|
||||
Name: libxml2
|
||||
Version: @VERSION@
|
||||
Release: 1
|
||||
Release: 4
|
||||
License: MIT
|
||||
Group: Development/Libraries
|
||||
Source: ftp://xmlsoft.org/libxml2-%{version}.tar.gz
|
||||
|
@ -39,6 +39,9 @@
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_RESOLV_H
|
||||
#include <resolv.h>
|
||||
#endif
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
16
valid.c
16
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.
|
||||
*/
|
||||
@ -1300,6 +1301,18 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
|
||||
ctxt->valid = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user