Add a forbidden variable error number and message to XPath
Related to https://bugzilla.gnome.org/show_bug.cgi?id=680938
When the XML_XPATH_NOVAR flags is being used it means that
variables are forbidden, not that they are missing
diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h
index ddd9dd8..3a5ca02 100644
--- a/include/libxml/xpath.h
+++ b/include/libxml/xpath.h
@@ -69,7 +69,8 @@
XPATH_ENCODING_ERROR,
XPATH_INVALID_CHAR_ERROR,
XPATH_INVALID_CTXT,
- XPATH_STACK_ERROR
+ XPATH_STACK_ERROR,
+ XPATH_FORBID_VARIABLE_ERROR
} xmlXPathError;
/*
diff --git a/xpath.c b/xpath.c
index 2bb6d34..6552e1b 100644
--- a/xpath.c
+++ b/xpath.c
@@ -328,6 +328,7 @@
"Char out of XML range\n",
"Invalid or incomplete context\n",
"Stack usage errror\n",
+ "Forbidden variable\n",
"?? Unknown error ??\n" /* Must be last in the list! */
};
#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) / \
@@ -10378,7 +10379,7 @@
name, prefix);
SKIP_BLANKS;
if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
- XP_ERROR(XPATH_UNDEF_VARIABLE_ERROR);
+ XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
}
}