[mapserver-commits] r9780 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Feb 8 17:11:51 EST 2010


Author: assefa
Date: 2010-02-08 17:11:50 -0500 (Mon, 08 Feb 2010)
New Revision: 9780

Modified:
   trunk/mapserver/mapwfs.c
Log:
Correct wfs describefeature mimetype #3294

Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c	2010-02-04 19:35:32 UTC (rev 9779)
+++ trunk/mapserver/mapwfs.c	2010-02-08 22:11:50 UTC (rev 9780)
@@ -710,6 +710,7 @@
   int outputformat = OWS_DEFAULT_SCHEMA; /* default output is GML 2.1 compliant schema*/
 
   gmlNamespaceListObj *namespaceList=NULL; /* for external application schema support */
+  char *mimetype = NULL;
 
   if(paramsObj->pszTypeName && numlayers == 0) {
     /* Parse comma-delimited list of type names (layers) */
@@ -741,15 +742,24 @@
 
   /*set the output format to gml3 for wfs1.1*/
   if(paramsObj->pszVersion == NULL || strncmp(paramsObj->pszVersion,"1.1",3) == 0 )
-    outputformat = OWS_SFE_SCHEMA;
+  {
+      mimetype = msEncodeHTMLEntities("text/xml; subtype=gml/3.1.1");
+      outputformat = OWS_SFE_SCHEMA;
+  }
 
   if (paramsObj->pszOutputFormat) {
     if(strcasecmp(paramsObj->pszOutputFormat, "XMLSCHEMA") == 0 ||
        strstr(paramsObj->pszOutputFormat, "gml/2")!= NULL)
-      outputformat = OWS_DEFAULT_SCHEMA;
+    {
+	mimetype = msEncodeHTMLEntities("text/xml; subtype=gml/2.1.2");
+	outputformat = OWS_DEFAULT_SCHEMA;
+    }
     else if(strcasecmp(paramsObj->pszOutputFormat, "SFE_XMLSCHEMA") == 0 ||
             strstr(paramsObj->pszOutputFormat, "gml/3")!= NULL)
-      outputformat = OWS_SFE_SCHEMA;
+    {
+	mimetype = msEncodeHTMLEntities("text/xml; subtype=gml/3.1.1");
+	outputformat = OWS_SFE_SCHEMA;
+    }
     else {
       msSetError(MS_WFSERR, "Unsupported DescribeFeatureType outputFormat (%s).", "msWFSDescribeFeatureType()", paramsObj->pszOutputFormat);
       return msWFSException(map, "outputformat", "InvalidParameterValue", paramsObj->pszVersion);
@@ -775,11 +785,15 @@
   ** DescribeFeatureType response
   */
   value = msOWSLookupMetadata(&(map->web.metadata), "FO", "encoding");
+  
   if (value)
-      msIO_printf("Content-type: text/xml; charset=%s%c%c", value,10,10);
+    msIO_printf("Content-type: %s charset=%s%c%c", mimetype,value,10,10);
   else
-      msIO_printf("Content-type: text/xml%c%c",10,10);
+    msIO_printf("Content-type: %s%c%c",mimetype,10,10);
 
+  if (mimetype)
+    msFree(mimetype);
+
   msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "FO", "encoding", OWS_NOERR,
 			   "<?xml version='1.0' encoding=\"%s\" ?>\n",
 			   "ISO-8859-1");



More information about the mapserver-commits mailing list