fixed a XML Namespace compliance bug reported by Alexander Grimalovsky
* parser.c: fixed a XML Namespace compliance bug reported by
Alexander Grimalovsky
Daniel
diff --git a/parser.c b/parser.c
index 2c57954..f734a3c 100644
--- a/parser.c
+++ b/parser.c
@@ -1688,11 +1688,30 @@
if (c == ':') {
- c = *cur++;
+ c = *cur;
if (c == 0) return(ret);
*prefix = ret;
len = 0;
+ /*
+ * Check that the first character is proper to start
+ * a new name
+ */
+ if (!(((c >= 0x61) && (c <= 0x7A)) ||
+ ((c >= 0x41) && (c <= 0x5A)) ||
+ (c == '_') || (c == ':'))) {
+ int l;
+ int first = CUR_SCHAR(cur, l);
+
+ if (!IS_LETTER(first) && (first != '_')) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Name %s is not XML Namespace compliant\n",
+ name);
+ }
+ }
+ cur++;
+
while ((c != 0) && (len < max)) { /* tested bigname2.xml */
buf[len++] = c;
c = *cur++;