mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
Fixed a test for duplicate attributes: Non-prefixed attributes were
* parser.c: Fixed a test for duplicate attributes: Non-prefixed attributes were treated as being bound to the default namespace.
This commit is contained in:
20
parser.c
20
parser.c
@@ -7787,13 +7787,19 @@ failed:
|
||||
* The attributes checkings
|
||||
*/
|
||||
for (i = 0; i < nbatts;i += 5) {
|
||||
nsname = xmlGetNamespace(ctxt, atts[i + 1]);
|
||||
if ((atts[i + 1] != NULL) && (nsname == NULL)) {
|
||||
xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
|
||||
"Namespace prefix %s for %s on %s is not defined\n",
|
||||
atts[i + 1], atts[i], localname);
|
||||
}
|
||||
atts[i + 2] = nsname;
|
||||
/*
|
||||
* The default namespace does not apply to attribute names.
|
||||
*/
|
||||
if (atts[i + 1] != NULL) {
|
||||
nsname = xmlGetNamespace(ctxt, atts[i + 1]);
|
||||
if (nsname == NULL) {
|
||||
xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
|
||||
"Namespace prefix %s for %s on %s is not defined\n",
|
||||
atts[i + 1], atts[i], localname);
|
||||
}
|
||||
atts[i + 2] = nsname;
|
||||
} else
|
||||
nsname = NULL;
|
||||
/*
|
||||
* [ WFC: Unique Att Spec ]
|
||||
* No attribute name may appear more than once in the same
|
||||
|
Reference in New Issue
Block a user