1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-20 03:52:25 +03:00

tried to fix the problems reported in bug #126735 fixed again some problem

* python/libxml.py: tried to fix the problems reported in
  bug #126735
* xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h:
  fixed again some problem trying to use the structured error
  handlers, c.f. bug #126735
* result/VC/ElementValid: tiny change due to the fix
Daniel
This commit is contained in:
Daniel Veillard
2003-12-08 10:25:02 +00:00
parent fded7bf91b
commit f88d8cf9f1
9 changed files with 83 additions and 39 deletions

15
xpath.c
View File

@@ -271,9 +271,7 @@ xmlXPathPErrMemory(xmlXPathParserContextPtr ctxt, const char *extra)
void
xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
{
if (ctxt != NULL)
ctxt->error = error;
if ((ctxt == NULL) || (ctxt->context == NULL)) {
if (ctxt == NULL) {
__xmlRaiseError(NULL, NULL, NULL,
NULL, NULL, XML_FROM_XPATH,
error + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
@@ -282,6 +280,17 @@ xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
xmlXPathErrorMessages[error]);
return;
}
ctxt->error = error;
if (ctxt->context == NULL) {
__xmlRaiseError(NULL, NULL, NULL,
NULL, NULL, XML_FROM_XPATH,
error + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
XML_ERR_ERROR, NULL, 0,
(const char *) ctxt->base, NULL, NULL,
ctxt->cur - ctxt->base, 0,
xmlXPathErrorMessages[error]);
return;
}
ctxt->context->lastError.domain = XML_FROM_XPATH;
ctxt->context->lastError.code = error + XML_XPATH_EXPRESSION_OK -
XPATH_EXPRESSION_OK;