Updated footer comment
[yaz-moved-to-github.git] / src / libxml2_error.c
index 41d9284..fe1f978 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2009 Index Data
  * See the file LICENSE for details.
  */
 /**
@@ -23,6 +23,7 @@
 
 static int libxml2_error_level = 0;
 
+#if YAZ_HAVE_XML2
 static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
 {
     char buf[1024];
@@ -35,15 +36,16 @@ static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
 
     va_end (ap);
 }
+#endif
 
 int libxml2_error_to_yazlog(int level, const char *lead_msg)
 {
     libxml2_error_level = level;
+#if YAZ_HAVE_XML2
+    xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
 #if YAZ_HAVE_XSLT
     xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
 #endif
-#if YAZ_HAVE_XML2
-    xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
     return 0;
 #else
     return -1;
@@ -53,6 +55,7 @@ int libxml2_error_to_yazlog(int level, const char *lead_msg)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab