diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-01-10 13:14:40 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-01-10 13:14:40 +0000 |
commit | 3e20a2921373677d1cf54fcf6081b3492e0c7558 (patch) | |
tree | cdc655129f31c6684c9555576eca30500fec47c3 | |
parent | e55e8e4833c84c3272333f9fc17e81002463eb76 (diff) | |
download | libxml2-3e20a2921373677d1cf54fcf6081b3492e0c7558.tar.gz |
fixed bug #102181 by applying the suggested change and fixing the
* 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.
Daniel
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | python/libxml.c | 1 | ||||
-rw-r--r-- | python/libxml.py | 22 | ||||
-rw-r--r-- | python/libxml2-python-api.xml | 6 | ||||
-rw-r--r-- | python/libxml2class.txt | 1 |
5 files changed, 28 insertions, 8 deletions
@@ -1,3 +1,9 @@ +Fri Jan 10 14:13:03 CET 2003 Daniel Veillard <daniel@veillard.com> + + * 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 <daniel@veillard.com> * 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 @@ <return type='xmlNodePtr' info="A new element node"/> <arg name='name' type='xmlChar *' info='the node name'/> </function> - <function name='xmlRegisterErrorHandler' file='python'> - <info>Register a Python written function to for error reporting. The function is called back as f(ctx, error).</info> - <return type='int' info="1 in case of success, 0 or -1 in case of error"/> - <arg name='f' type='pythonObject' info='the python function'/> - <arg name='ctx' type='pythonObject' info='a context for the callback'/> - </function> <function name='xmlCreatePushParser' file='python'> <info>Create a progressive XML parser context to build either an event flow if the SAX object is not None, or a DOM tree otherwise.</info> <return type='xmlParserCtxtPtr' info="the parser context or None in case of error"/> 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 |