[mapserver-commits] r8170 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Dec 2 12:28:34 EST 2008


Author: tomkralidis
Date: 2008-12-02 12:28:34 -0500 (Tue, 02 Dec 2008)
New Revision: 8170

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapowscommon.c
Log:
use msLibXml2GenerateList to generate listed XML elements


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-12-02 17:14:39 UTC (rev 8169)
+++ trunk/mapserver/HISTORY.TXT	2008-12-02 17:28:34 UTC (rev 8170)
@@ -12,6 +12,8 @@
 Current Version (5.3-dev, SVN trunk):
 ------------------------------------
 
+- mapowscommon.c: use msLibXml2GenerateList to generate listed XML elements
+
 - mapowscommon.c: output version string correctly (#2821)
 
 - Added removeLayer function to mapObj in PHP/MapScript. (#762)

Modified: trunk/mapserver/mapowscommon.c
===================================================================
--- trunk/mapserver/mapowscommon.c	2008-12-02 17:14:39 UTC (rev 8169)
+++ trunk/mapserver/mapowscommon.c	2008-12-02 17:28:34 UTC (rev 8170)
@@ -96,7 +96,6 @@
 
   xmlNodePtr   psRootNode = NULL;
   xmlNodePtr   psNode     = NULL;
-  xmlNodePtr   psSubNode  = NULL;
 
   if (_validateNamespace(psNsOws) == MS_FAILURE)
     psNsOws = xmlNewNs(psRootNode, BAD_CAST MS_OWSCOMMON_OWS_NAMESPACE_URI, BAD_CAST MS_OWSCOMMON_OWS_NAMESPACE_PREFIX);
@@ -125,20 +124,8 @@
   value = msOWSLookupMetadata(&(map->web.metadata), namespaces, "keywordlist");
 
   if (value) {
-    char **tokens = NULL;
-    int n = 0;
-    int i = 0;
-
     psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "Keywords", NULL);
-
-    tokens = msStringSplit(value, ',', &n);
-    if (tokens && n > 0) {
-      for (i=0; i<n; i++) {
-        psSubNode = xmlNewChild(psNode, NULL, BAD_CAST "Keyword", BAD_CAST tokens[i]);
-        xmlSetNs(psSubNode, psNsOws);
-      }
-      msFreeCharArray(tokens, n);
-    }
+    msLibXml2GenerateList(psNode, psNsOws, "Keyword", value, ',');
   }
 
   else {



More information about the mapserver-commits mailing list