[mapserver-commits] r9774 - in trunk: mapserver msautotest/wxs/expected

svn at osgeo.org svn at osgeo.org
Wed Feb 3 13:05:00 EST 2010


Author: tomkralidis
Date: 2010-02-03 13:04:59 -0500 (Wed, 03 Feb 2010)
New Revision: 9774

Modified:
   trunk/mapserver/mapwms.c
   trunk/msautotest/wxs/expected/wms_get_caps.xml
Log:
fix sequence of AuthorityURL and Identifier to ensure valid XML (#3251)


Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2010-02-03 17:34:31 UTC (rev 9773)
+++ trunk/mapserver/mapwms.c	2010-02-03 18:04:59 UTC (rev 9774)
@@ -1560,30 +1560,6 @@
     msWMSPrintAttribution(stdout, "    ", &(lp->metadata), "MO");
   }
 
-   if(nVersion >= OWS_1_1_0)
-       msOWSPrintURLType(stdout, &(lp->metadata), "MO", "metadataurl", 
-                         OWS_NOERR, NULL, "MetadataURL", " type=\"%s\"", 
-                         NULL, NULL, ">\n          <Format>%s</Format", 
-                         "\n          <OnlineResource xmlns:xlink=\""
-                         "http://www.w3.org/1999/xlink\" "
-                         "xlink:type=\"simple\" xlink:href=\"%s\"/>\n        ",
-                         MS_TRUE, MS_FALSE, MS_FALSE, MS_TRUE, MS_TRUE, 
-                         NULL, NULL, NULL, NULL, NULL, "        ");
-
-   if(nVersion < OWS_1_1_0)
-       msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "dataurl_href",
-                                OWS_NOERR, "        <DataURL>%s</DataURL>\n", 
-                                NULL);
-   else
-       msOWSPrintURLType(stdout, &(lp->metadata), "MO", "dataurl", 
-                         OWS_NOERR, NULL, "DataURL", NULL, NULL, NULL, 
-                         ">\n          <Format>%s</Format", 
-                         "\n          <OnlineResource xmlns:xlink=\""
-                         "http://www.w3.org/1999/xlink\" "
-                         "xlink:type=\"simple\" xlink:href=\"%s\"/>\n        ", 
-                         MS_FALSE, MS_FALSE, MS_FALSE, MS_TRUE, MS_TRUE, 
-                         NULL, NULL, NULL, NULL, NULL, "        ");
-
   /* AuthorityURL support and Identifier support, only available > WMS 1.1.0 */
   if(nVersion >= OWS_1_1_0)
   {
@@ -1596,14 +1572,14 @@
     if( pszWmsAuthorityName && pszWMSAuthorityHref )
     {
        msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "authorityurl_name",
-                                OWS_NOERR, "        <AuthorityURL name=\"%s\">\n", 
+                                OWS_NOERR, "        <AuthorityURL name=\"%s\">\n",
                                 NULL);
        msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "authorityurl_href",
-                                OWS_NOERR, "          <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"%s\"/>\n", 
+                                OWS_NOERR, "          <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"%s\"/>\n",
                                 NULL);
-       msIO_printf("        </AuthorityURL>\n");      
+       msIO_printf("        </AuthorityURL>\n");
     }
-    else if ( pszWmsAuthorityName || pszWMSAuthorityHref ) 
+    else if ( pszWmsAuthorityName || pszWMSAuthorityHref )
     {
        msIO_printf("        <!-- WARNING: Both wms_authorityurl_name and wms_authorityurl_href must be set to output an AuthorityURL -->\n");
     }
@@ -1611,20 +1587,43 @@
     if( pszWMSIdentifierAuthority && pszWMSIdentifierValue )
     {
       msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "identifier_authority",
-                               OWS_NOERR, "        <Identifier authority=\"%s\">", 
+                               OWS_NOERR, "        <Identifier authority=\"%s\">",
                                NULL);
       msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "identifier_value",
-                               OWS_NOERR, "%s</Identifier>\n", 
+                               OWS_NOERR, "%s</Identifier>\n",
                                NULL);
     }
     else if ( pszWMSIdentifierAuthority || pszWMSIdentifierValue )
     {
        msIO_printf("        <!-- WARNING: Both wms_identifier_authority and wms_identifier_value must be set to output an Identifier -->\n");
     }
-    
-  }                       
 
+  }
 
+   if(nVersion >= OWS_1_1_0)
+       msOWSPrintURLType(stdout, &(lp->metadata), "MO", "metadataurl", 
+                         OWS_NOERR, NULL, "MetadataURL", " type=\"%s\"", 
+                         NULL, NULL, ">\n          <Format>%s</Format", 
+                         "\n          <OnlineResource xmlns:xlink=\""
+                         "http://www.w3.org/1999/xlink\" "
+                         "xlink:type=\"simple\" xlink:href=\"%s\"/>\n        ",
+                         MS_TRUE, MS_FALSE, MS_FALSE, MS_TRUE, MS_TRUE, 
+                         NULL, NULL, NULL, NULL, NULL, "        ");
+
+   if(nVersion < OWS_1_1_0)
+       msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "dataurl_href",
+                                OWS_NOERR, "        <DataURL>%s</DataURL>\n", 
+                                NULL);
+   else
+       msOWSPrintURLType(stdout, &(lp->metadata), "MO", "dataurl", 
+                         OWS_NOERR, NULL, "DataURL", NULL, NULL, NULL, 
+                         ">\n          <Format>%s</Format", 
+                         "\n          <OnlineResource xmlns:xlink=\""
+                         "http://www.w3.org/1999/xlink\" "
+                         "xlink:type=\"simple\" xlink:href=\"%s\"/>\n        ", 
+                         MS_FALSE, MS_FALSE, MS_FALSE, MS_TRUE, MS_TRUE, 
+                         NULL, NULL, NULL, NULL, NULL, "        ");
+
    /* The LegendURL reside in a style. The Web Map Context spec already  */
    /* included the support on this in mapserver. However, it is not in the  */
    /* wms_legendurl_... metadatas it's in the styles metadata, */

Modified: trunk/msautotest/wxs/expected/wms_get_caps.xml
===================================================================
(Binary files differ)



More information about the mapserver-commits mailing list