From 2c1d4f928b9657dbb4517ecbfc8cac30cc73ae9f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 18 Nov 2023 22:13:46 +0100 Subject: [PATCH 1/2] Fix compilation errors with libxml2 2.12 --- mapows.c | 2 +- mapwcs.cpp | 2 +- mapwcs20.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mapows.c b/mapows.c index c2fa55521..294a64fb4 100644 --- a/mapows.c +++ b/mapows.c @@ -162,7 +162,7 @@ static int msOWSPreParseRequest(cgiRequestObj *request, #endif if (ows_request->document == NULL || (root = xmlDocGetRootElement(ows_request->document)) == NULL) { - xmlErrorPtr error = xmlGetLastError(); + const xmlError *error = xmlGetLastError(); msSetError(MS_OWSERR, "XML parsing error: %s", "msOWSPreParseRequest()", error->message); return MS_FAILURE; diff --git a/mapwcs.cpp b/mapwcs.cpp index 5459f5bb1..817c8a784 100644 --- a/mapwcs.cpp +++ b/mapwcs.cpp @@ -383,7 +383,7 @@ static int msWCSParseRequest(cgiRequestObj *request, wcsParamsObj *params, /* parse to DOM-Structure and get root element */ if((doc = xmlParseMemory(request->postrequest, strlen(request->postrequest))) == NULL) { - xmlErrorPtr error = xmlGetLastError(); + const xmlError *error = xmlGetLastError(); msSetError(MS_WCSERR, "XML parsing error: %s", "msWCSParseRequest()", error->message); return MS_FAILURE; diff --git a/mapwcs20.cpp b/mapwcs20.cpp index 355a00a80..5febbb9d6 100644 --- a/mapwcs20.cpp +++ b/mapwcs20.cpp @@ -1459,7 +1459,7 @@ int msWCSParseRequest20(mapObj *map, cgiRequestObj *request, /* parse to DOM-Structure and get root element */ if(doc == NULL) { - xmlErrorPtr error = xmlGetLastError(); + const xmlError *error = xmlGetLastError(); msSetError(MS_WCSERR, "XML parsing error: %s", "msWCSParseRequest20()", error->message); return MS_FAILURE; } From a1dd7a851b620be9bf72426f70d82aab21ef4661 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 18 Nov 2023 22:13:57 +0100 Subject: [PATCH 2/2] Fix compile-time deprecation warnings with libxml2 2.12 --- mapxml.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mapxml.c b/mapxml.c index cb96acc3b..c065619aa 100644 --- a/mapxml.c +++ b/mapxml.c @@ -48,9 +48,6 @@ int msTransformXmlMapfile(const char *stylesheet, const char *xmlMapfile, exsltRegisterAll(); xsltRegisterTestModule(); - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile((const xmlChar *)stylesheet); if (cur == NULL) { msSetError(MS_MISCERR, "Failed to load xslt stylesheet", "msTransformXmlMapfile()"); @@ -58,7 +55,7 @@ int msTransformXmlMapfile(const char *stylesheet, const char *xmlMapfile, goto done; } - doc = xmlParseFile(xmlMapfile); + doc = xmlReadFile(xmlMapfile, NULL, XML_PARSE_NOENT | XML_PARSE_DTDLOAD); if (doc == NULL) { msSetError(MS_MISCERR, "Failed to load xml mapfile", "msTransformXmlMapfile()"); goto done;