mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-31 19:10:28 +08:00
fixing bug #79331 in one path the lookup for ID attributes on a namespaced
* valid.c: fixing bug #79331 in one path the lookup for ID attributes on a namespaced node wasn't handled correctly :-\ Daniel
This commit is contained in:
parent
8c9872ca2e
commit
37f961db6e
@ -1,3 +1,8 @@
|
||||
Sat Jul 6 19:44:56 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* valid.c: fixing bug #79331 in one path the lookup for
|
||||
ID attributes on a namespaced node wasn't handled correctly :-\
|
||||
|
||||
Fri Jul 5 20:07:43 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* HTMLparser.c: trying to fix 87235 about discarded white
|
||||
|
29
valid.c
29
valid.c
@ -1928,10 +1928,31 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
|
||||
xmlAttributePtr attrDecl;
|
||||
|
||||
if (elem == NULL) return(0);
|
||||
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, attr->name);
|
||||
if ((attrDecl == NULL) && (doc->extSubset != NULL))
|
||||
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name,
|
||||
attr->name);
|
||||
if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
|
||||
/*
|
||||
* TODO: this sucks ... recomputing this every time is stupid
|
||||
*/
|
||||
int len = xmlStrlen(elem->name) + xmlStrlen(elem->ns->prefix) + 2;
|
||||
xmlChar *fullname;
|
||||
|
||||
fullname = xmlMalloc(len);
|
||||
if (fullname == NULL)
|
||||
return(0);
|
||||
snprintf((char *) fullname, len, "%s:%s", (char *) elem->ns->prefix,
|
||||
(char *) elem->name);
|
||||
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, fullname,
|
||||
attr->name);
|
||||
if ((attrDecl == NULL) && (doc->extSubset != NULL))
|
||||
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, fullname,
|
||||
attr->name);
|
||||
xmlFree(fullname);
|
||||
} else {
|
||||
attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name,
|
||||
attr->name);
|
||||
if ((attrDecl == NULL) && (doc->extSubset != NULL))
|
||||
attrDecl = xmlGetDtdAttrDesc(doc->extSubset, elem->name,
|
||||
attr->name);
|
||||
}
|
||||
|
||||
if ((attrDecl != NULL) && (attrDecl->atype == XML_ATTRIBUTE_ID))
|
||||
return(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user