From 455472f208e276bff9f67cac115c6564a0b5dcf5 Mon Sep 17 00:00:00 2001 From: "Kasimier T. Buchcik" Date: Fri, 29 Apr 2005 10:04:43 +0000 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ parser.c | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f139e4d..c94e972c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 29 11:27:37 CEST 2005 Kasimier Buchcik + + * parser.c: Fixed a test for duplicate attributes: Non-prefixed + attributes were treated as being bound to the default namespace. + Tue Apr 19 17:51:32 CEST 2005 Kasimier Buchcik * xmlschemastypes.c: Fixed date-time related validation diff --git a/parser.c b/parser.c index 84b58fe9..767d5731 100644 --- a/parser.c +++ b/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