Remove code to support libxml2 < 2.6.

Enable LIBXML_DOCB_ENABLED independently of the presence
of 'libxml/DOCBparser.h' because from libxml2 >= 2.6 for
docbook files are not used deprecated functions from
DOCBparser, so 'libxml/DOCBparser.h' is not needed.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/18/head
Slávek Banko 2 years ago
parent aecfb2bff4
commit f4859ad13c
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -64,19 +64,10 @@ if( (BUILD_QUANTA) OR (BUILD_KXSLDBG) OR (BUILD_KLINKSTATUS) )
##### check for libxml-2.0
pkg_search_module( LIBXML libxml-2.0 )
pkg_search_module( LIBXML libxml-2.0>=2.6 )
if( NOT LIBXML_FOUND )
tde_message_fatal( "libxml-2.0 is required but was not found on your system" )
elseif( ${LIBXML_VERSION} VERSION_LESS "2.6" )
tde_message_fatal( "libxml-2.0 version must be, at least, up to 2.6" )
else()
set( LIBXML_2_5 1 )
tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
set( CMAKE_REQUIRED_INCLUDES ${LIBXML_INCLUDE_DIRS} )
set( CMAKE_REQUIRED_LIBRARIES ${LIBXML_LIBRARIES} )
check_function_exists( xmlSetEntityReferenceFunc HAVE_INCLUDE_FIX )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
tde_message_fatal( "libxml-2.0 version >= 2.6 is required but was not found on your system" )
endif( NOT LIBXML_FOUND )
@ -128,7 +119,7 @@ if( (BUILD_QUANTA) OR (BUILD_KXSLDBG) OR (BUILD_KLINKSTATUS) )
tde_save( CMAKE_REQUIRED_INCLUDES )
set( CMAKE_REQUIRED_INCLUDES ${LIBXML_INCLUDE_DIRS} )
check_include_file( "libxml/DOCBparser.h" LIBXML_DOCB_ENABLED )
set( LIBXML_DOCB_ENABLED 1 CACHE BOOL "Enable docbook input files" )
check_include_file( "libxml/xinclude.h" LIBXML_XINCLUDE_ENABLED )
tde_restore( CMAKE_REQUIRED_INCLUDES )

@ -58,18 +58,12 @@
/* Defined if you build with cvsservice */
#cmakedefine ENABLE_CVSSERVICE 1
/* Defined if libxml-2.0 is up to 2.6 */
#cmakedefine LIBXML_2_5 1
/* Defined if you have <libxml/DOCBparser.h> header file */
/* Defined if you build with enabled docbook input files */
#cmakedefine LIBXML_DOCB_ENABLED
/* Defined if you have <libxml/xinclude.h> header file */
#cmakedefine LIBXML_XINCLUDE_ENABLED
/* Defined if you have xmlSetEntityReferenceFunc within libxml2 */
#cmakedefine HAVE_INCLUDE_FIX 1
/* Define the kmdr-executor executable path */
#cmakedefine KMDR_EXECUTOR_PATH "@KMDR_EXECUTOR_PATH@"

@ -743,9 +743,6 @@ filesInit(void)
tempDocument = NULL;
topStylesheet = NULL;
entityNameList = arrayListNew(4, (freeItemFunc) filesFreeEntityInfo);
#if defined(HAVE_INCLUDE_FIX) && (LIBXML_VERSION < 20508)
xmlSetEntityReferenceFunc(filesEntityRef);
#endif
/* setup the encoding */
encodeInBuff = xmlBufferCreate();

@ -82,9 +82,6 @@
#include <libxml/xmlerror.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlIO.h>
#ifdef LIBXML_DOCB_ENABLED
#include <libxml/DOCBparser.h>
#endif
#ifdef LIBXML_XINCLUDE_ENABLED
#include <libxml/xinclude.h>
#endif
@ -975,22 +972,11 @@ xsldbgLoadXmlData(void)
#endif
#ifdef LIBXML_DOCB_ENABLED
if (optionsGetIntOption(OPTIONS_DOCBOOK))
# if LIBXML_VERSION >= 20600
doc = xmlParseFile((char *) optionsGetStringOption(OPTIONS_DATA_FILE_NAME));
# else
doc = docbParseFile((char *)
optionsGetStringOption(OPTIONS_DATA_FILE_NAME),
NULL);
# endif
else
#endif
#if LIBXML_VERSION >= 20600
doc = xmlSAXParseFile(&mySAXHandler,
(char *) optionsGetStringOption(OPTIONS_DATA_FILE_NAME), 0);
#else
doc = xmlParseFile((char *) optionsGetStringOption(OPTIONS_DATA_FILE_NAME));
#endif
if (doc == NULL) {
xsldbgGenericErrorFunc(i18n("Error: Unable to parse file %1.\n").arg(xsldbgUrl(optionsGetStringOption(OPTIONS_DATA_FILE_NAME))));
if (!optionsGetIntOption(OPTIONS_SHELL)) {
@ -1031,11 +1017,7 @@ xsldbgLoadXmlTemporary(const xmlChar * path)
#endif
#ifdef LIBXML_DOCB_ENABLED
if (optionsGetIntOption(OPTIONS_DOCBOOK))
# if LIBXML_VERSION >= 20600
doc = xmlParseFile((char *) path);
# else
doc = docbParseFile((char *) path, NULL);
# endif
else
#endif
doc = xmlSAXParseFile(&mySAXhdlr, (char *) path, 0);
@ -1100,7 +1082,7 @@ handler_routine(DWORD dwCtrlType)
#endif
#if LIBXML_VERSION >= 2006000
#if 0
/* libxml/ handlers */
void xsldbgStructErrorHandler(void * userData, xmlErrorPtr error)
{
@ -1230,13 +1212,8 @@ xsldbgInit()
/* set up the parser */
xmlInitParser();
#if 0
#if LIBXML_VERSION >= 20600
xmlSetGenericErrorFunc(NULL, NULL);
xmlSetStructuredErrorFunc(NULL , (xmlStructuredErrorFunc)xsldbgStructErrorHandler);
#else
xmlSetGenericErrorFunc(0, xsldbgGenericErrorFunc);
xsltSetGenericErrorFunc(0, xsldbgGenericErrorFunc);
#endif
#else
xmlSetGenericErrorFunc(0, xsldbgGenericErrorFunc);
xsltSetGenericErrorFunc(0, xsldbgGenericErrorFunc);

@ -36,10 +36,6 @@
#include <tdeio/netaccess.h>
//other includes
#ifdef LIBXML_2_5
#include <libxml/hash.h>
#endif
#include <libxml/parser.h>
#include <libxml/valid.h>
@ -86,7 +82,6 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly)
if( DTD::dtd_ptr == NULL )
{
TQString errorStr = i18n("Unknown");
#ifndef LIBXML_2_5
xmlErrorPtr errorPtr = xmlGetLastError();
if (errorPtr != NULL)
{
@ -105,7 +100,6 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly)
errorStr += TQString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2);
xmlResetError(errorPtr);
}
#endif
KMessageBox::error(0, i18n("<qt>Error while parsing the DTD.<br>The error message is:<br><i>%1</i></qt>").arg(errorStr));
return false;
}

Loading…
Cancel
Save