[mapserver-commits] r8168 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Dec 2 12:14:05 EST 2008


Author: tomkralidis
Date: 2008-12-02 12:14:05 -0500 (Tue, 02 Dec 2008)
New Revision: 8168

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapowscommon.c
Log:
output version string correctly (#2821)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-12-02 16:35:39 UTC (rev 8167)
+++ trunk/mapserver/HISTORY.TXT	2008-12-02 17:14:05 UTC (rev 8168)
@@ -12,6 +12,8 @@
 Current Version (5.3-dev, SVN trunk):
 ------------------------------------
 
+- mapowscommon.c: output version string correctly (#2821)
+
 - Added removeLayer function to mapObj in PHP/MapScript. (#762)
 
 - Exposed PIXELS value via URL configuration

Modified: trunk/mapserver/mapowscommon.c
===================================================================
--- trunk/mapserver/mapowscommon.c	2008-12-02 16:35:39 UTC (rev 8167)
+++ trunk/mapserver/mapowscommon.c	2008-12-02 17:14:05 UTC (rev 8168)
@@ -479,7 +479,7 @@
 
 xmlNodePtr msOWSCommonExceptionReport(xmlNsPtr psNsOws, int ows_version, const char *schemas_location, const char *version, const char *language, const char *exceptionCode, const char *locator, const char *ExceptionText) {
   char *xsi_schemaLocation = NULL;
-  char *ows_version_string = NULL;
+  char szVersionBuf[OWS_VERSION_MAXLEN];
 
   xmlNsPtr     psNsXsi     = NULL;
   xmlNodePtr   psRootNode  = NULL;
@@ -493,22 +493,18 @@
   /* add attributes to root element */
   xmlNewProp(psRootNode, BAD_CAST "version", BAD_CAST version);
 
-  if (strcasecmp(language, "undefined") == 0) {
-    if (ows_version == OWS_1_0_0) {
-      ows_version_string = strdup("1.0.0");
-      xmlNewProp(psRootNode, BAD_CAST "language", BAD_CAST language);
-    }
-    if (ows_version == OWS_1_1_0) {
-      ows_version_string = strdup("1.1.0");
-      xmlNewProp(psRootNode, BAD_CAST "xml:lang", BAD_CAST language);
-    }
+  if (ows_version == OWS_1_0_0) {
+    xmlNewProp(psRootNode, BAD_CAST "language", BAD_CAST language);
   }
+  if (ows_version == OWS_1_1_0) {
+    xmlNewProp(psRootNode, BAD_CAST "xml:lang", BAD_CAST language);
+  }
 
   xsi_schemaLocation = strdup((char *)psNsOws->href);
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, " ");
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, (char *)schemas_location);
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, "/ows/");
-  xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, (char *)ows_version_string);
+  xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, (char *)msOWSGetVersionString(ows_version, szVersionBuf));
   xsi_schemaLocation = msStringConcatenate(xsi_schemaLocation, "/owsExceptionReport.xsd");
 
   /* add namespace'd attributes to root element */
@@ -528,7 +524,6 @@
     psNode = xmlNewChild(psMainNode, NULL, BAD_CAST "ExceptionText", BAD_CAST ExceptionText);
   }
 
-  free(ows_version_string);
   free(xsi_schemaLocation);
   return psRootNode;
 }



More information about the mapserver-commits mailing list