[mapserver-commits] r7685 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Jun 17 12:01:49 EDT 2008


Author: tomkralidis
Date: 2008-06-17 12:01:49 -0400 (Tue, 17 Jun 2008)
New Revision: 7685

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/maplibxml2.c
   trunk/mapserver/maplibxml2.h
Log:
helper functions XML POST fix (#2379)



Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-06-16 23:22:39 UTC (rev 7684)
+++ trunk/mapserver/HISTORY.TXT	2008-06-17 16:01:49 UTC (rev 7685)
@@ -13,6 +13,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- maplibxml2.c: helper functions XML POST fix (#2379)
+
 - mapwfs.c: fix segfault when srsName is not passed on BBOX Filter (#2644)
 
 - mapwfs.c: do not return error for empty query results (#2444)

Modified: trunk/mapserver/maplibxml2.c
===================================================================
--- trunk/mapserver/maplibxml2.c	2008-06-16 23:22:39 UTC (rev 7684)
+++ trunk/mapserver/maplibxml2.c	2008-06-17 16:01:49 UTC (rev 7685)
@@ -75,10 +75,9 @@
  *
  * @return result xmlXPathObjectPtr pointer
  *
- *
  */
 
-xmlXPathObjectPtr msLibXml2GetXPath(xmlDocPtr doc, xmlXPathContextPtr context, xmlChar *xpath){
+xmlXPathObjectPtr msLibXml2GetXPath(xmlDocPtr doc, xmlXPathContextPtr context, xmlChar *xpath) {
   xmlXPathObjectPtr result;
   result = xmlXPathEval(xpath, context);
   if (result == NULL) {
@@ -91,4 +90,32 @@
   return result;
 }
 
+/**
+ * msLibXml2GetXPathTree
+ *
+ * Convenience function to fetch an XPath and children
+ *
+ * @param xmlDocPtr doc the XML doc pointer
+ * @param xmlXPathObjectPtr the xpath object
+ *
+ * @return result string
+ *
+ */
+
+const char *msLibXml2GetXPathTree(xmlDocPtr doc, xmlXPathObjectPtr xpath) {
+  xmlBufferPtr xbuf;
+  const char *result = NULL;
+
+  xbuf = xmlBufferCreate();
+
+  if (xpath) {
+    if (xmlNodeDump(xbuf, doc, xpath->nodesetval->nodeTab[0], 0, 0) == -1) {
+      return NULL;
+    }
+    result = strdup((char *)xbuf->content);
+  }
+  xmlBufferFree(xbuf);
+  return result;
+}
+
 #endif /* defined(USE_LIBXML2) */

Modified: trunk/mapserver/maplibxml2.h
===================================================================
--- trunk/mapserver/maplibxml2.h	2008-06-16 23:22:39 UTC (rev 7684)
+++ trunk/mapserver/maplibxml2.h	2008-06-17 16:01:49 UTC (rev 7685)
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id:$
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  libxml2 convenience wrapper functions include file
@@ -41,6 +41,8 @@
 
 void msLibXml2GenerateList(xmlNodePtr psParent, xmlNsPtr psNs, const char *elname, const char *values, char delim);
 
+const char *msLibXml2GetXPathTree(xmlDocPtr doc, xmlXPathObjectPtr xpath);
+
 #endif /* defined(USE_LIBXML2) */
 
 #endif /* MAPLIBXML2_H */



More information about the mapserver-commits mailing list