diff --git a/ChangeLog b/ChangeLog index 77c0be48..34a6fedd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jan 10 14:13:03 CET 2003 Daniel Veillard + + * python/libxml.py python/libxml.c python/libxml2-python-api.xml: + fixed bug #102181 by applying the suggested change and fixing + the generation/registration problem. + Fri Jan 10 13:47:55 CET 2003 Daniel Veillard * HTMLparser.c: fixed bug #102960 by reusing the XML name parsing diff --git a/python/libxml.c b/python/libxml.c index b48389ba..b67c4ebe 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -2195,6 +2195,7 @@ static PyMethodDef libxmlMethods[] = { {(char *) "outputBufferCreate", libxml_xmlCreateOutputBuffer, METH_VARARGS, NULL}, {(char *) "inputBufferCreate", libxml_xmlCreateInputBuffer, METH_VARARGS, NULL}, {(char *) "setEntityLoader", libxml_xmlSetEntityLoader, METH_VARARGS, NULL}, + {(char *)"xmlRegisterErrorHandler", libxml_xmlRegisterErrorHandler, METH_VARARGS, NULL }, {NULL, NULL, 0, NULL} }; diff --git a/python/libxml.py b/python/libxml.py index a3d1bdd5..d6c782d8 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -462,6 +462,26 @@ PARSER_VALIDATE=3 PARSER_SUBST_ENTITIES=4 # -# Everything below this point is automatically generated +# register the libxml2 error handler # +def registerErrorHandler(f, ctx): + """Register a Python written function to for error reporting. + The function is called back as f(ctx, error). """ + import sys + if not sys.modules.has_key('libxslt'): + # normal behaviour when libxslt is not imported + ret = libxml2mod.xmlRegisterErrorHandler(f,ctx) + else: + # when libxslt is already imported, one must + # use libxst's error handler instead + import libxslt + ret = libxslt.registerErrorHandler(f,ctx) + return ret + +# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING +# +# Everything before this line comes from libxml.py +# Everything after this line is automatically generated +# +# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING diff --git a/python/libxml2-python-api.xml b/python/libxml2-python-api.xml index 739b0669..7e8e922c 100644 --- a/python/libxml2-python-api.xml +++ b/python/libxml2-python-api.xml @@ -14,12 +14,6 @@ - - Register a Python written function to for error reporting. The function is called back as f(ctx, error). - - - - Create a progressive XML parser context to build either an event flow if the SAX object is not None, or a DOM tree otherwise. diff --git a/python/libxml2class.txt b/python/libxml2class.txt index 2fbc7077..a96bd53c 100644 --- a/python/libxml2class.txt +++ b/python/libxml2class.txt @@ -124,7 +124,6 @@ dumpMemory() htmlCreatePushParser() htmlSAXParseFile() newNode() -registerErrorHandler() setEntityLoader() # functions from module tree