diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-07-24 16:08:28 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-07-24 16:08:28 +0000 |
commit | 597bc48bab455d2ed0b7896b28066de2f962a0a0 (patch) | |
tree | b445c5e287cfbf6a004b002936c0e8aa8b63a823 /SAX.c | |
parent | 5373ea124f9aae7dbcb8dc92f3d419b0856f3558 (diff) | |
download | libxml2-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.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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, |