summaryrefslogtreecommitdiff
path: root/SAX.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-07-24 16:08:28 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-07-24 16:08:28 +0000
commit597bc48bab455d2ed0b7896b28066de2f962a0a0 (patch)
treeb445c5e287cfbf6a004b002936c0e8aa8b63a823 /SAX.c
parent5373ea124f9aae7dbcb8dc92f3d419b0856f3558 (diff)
downloadlibxml2-597bc48bab455d2ed0b7896b28066de2f962a0a0.tar.gz
fixing a bug about a special case of namespace handling, this closes bug
* SAX.c parser.c: fixing a bug about a special case of namespace handling, this closes bug #116841 Daniel
Diffstat (limited to 'SAX.c')
-rw-r--r--SAX.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/SAX.c b/SAX.c
index df30c625..3f628942 100644
--- a/SAX.c
+++ b/SAX.c
@@ -862,6 +862,22 @@ my_attribute(void *ctx, const xmlChar *fullname, const xmlChar *value,
* Split the full name into a namespace prefix and the tag name
*/
name = xmlSplitQName(ctxt, fullname, &ns);
+ if ((name != NULL) && (name[0] == 0)) {
+ if (xmlStrEqual(ns, BAD_CAST "xmlns")) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "invalid namespace declaration '%s'\n", fullname);
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "Avoid attribute ending with ':' like '%s'\n", fullname);
+ }
+ if (ns != NULL)
+ xmlFree(ns);
+ ns = NULL;
+ xmlFree(name);
+ name = xmlStrdup(fullname);
+ }
if (name == NULL) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,