From 597bc48bab455d2ed0b7896b28066de2f962a0a0 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 24 Jul 2003 16:08:28 +0000 Subject: 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 --- SAX.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'SAX.c') 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, -- cgit v1.2.1