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
diff --git a/python/libxml.py b/python/libxml.py
index a3d1bdd..d6c782d 100644
--- a/python/libxml.py
+++ b/python/libxml.py
@@ -462,6 +462,26 @@
 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