Index: /trunk/zoo-project/zoo-kernel/request_parser.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 956)
+++ /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 957)
@@ -416,5 +416,5 @@
       while (pToken != NULL)
 	{
-	  outputs_as_text[i] =
+/* 	  outputs_as_text[i] =
 	    (char *) malloc ((strlen (pToken) + 1) * sizeof (char));
 	  if (outputs_as_text[i] == NULL)
@@ -427,5 +427,25 @@
 		    pToken);
 	  pToken = strtok (NULL, ";");
-	  i++;
+	  i++; */
+	  
+	  // knut : rewrite above fragment to enable parsing of mimetype;subtype strings in key-value pairs:
+	  
+	  char* _token = zStrdup(pToken); 
+	  pToken = strtok (NULL, ";");
+	  
+	  if (pToken != NULL && strncmp(pToken, "subtype=", 8) == 0)
+	  {
+		 size_t _length = strlen(pToken) + strlen(_token) + 2; 
+		 outputs_as_text[i] = (char *) malloc(_length * sizeof (char));
+		 snprintf(outputs_as_text[i], _length, "%s;%s", _token, pToken);
+		 pToken = strtok (NULL, ";");
+	  }
+	  else
+	  {
+		 outputs_as_text[i] = (char *) malloc((strlen(_token) + 1) * sizeof (char));
+		 snprintf (outputs_as_text[i], strlen(_token) + 1, "%s", _token);		 
+	  }
+	  free(_token);
+	  i++;	  
 	}
       for (j = 0; j < i; j++)
@@ -862,5 +882,6 @@
 		    for (l = 0; l < 3; l++){
 		      xmlChar *val =
-			  xmlGetProp (cur4, BAD_CAST coms[l]);
+			  //xmlGetProp (cur4, BAD_CAST coms[l]);
+			  xmlGetProp (cur2, BAD_CAST coms[l]);   // knut : get attributes from the Data xml element, not it's children (the content)
 			if (val != NULL && strlen ((char *) val) > 0){
 			  if (tmpmaps->content != NULL)
Index: /trunk/zoo-project/zoo-kernel/service.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service.c	(revision 956)
+++ /trunk/zoo-project/zoo-kernel/service.c	(revision 957)
@@ -1829,2 +1829,26 @@
 #endif
 #endif
+
+/*
+ * Dynamically allocate memory for a map value 
+ *
+ * @param node the map for which the value buffer should be allocated
+ * @param num_bytes the number of bytes to allocate
+ * @return pointer to the allocated memory buffer
+ *
+ * This function will free, and hence delete, any existing value in the map.
+ * The memory should be deallocated by calling freeMap.
+ */
+char* allocateMapValue(map* node, size_t num_bytes)
+{
+	if (node == NULL) {
+		return NULL;
+	}
+
+	if (node->value != NULL) {
+		free(node->value);
+	}
+	node->value = (char*) malloc(num_bytes);
+		
+	return node->value;
+}
Index: /trunk/zoo-project/zoo-kernel/service.h
===================================================================
--- /trunk/zoo-project/zoo-kernel/service.h	(revision 956)
+++ /trunk/zoo-project/zoo-kernel/service.h	(revision 957)
@@ -481,5 +481,9 @@
   #define zooLogMsg(file,message) logMessage(__FILE__, __func__, __LINE__, (file), (message)) 
   #define zooLog logMessage(__FILE__, __func__, __LINE__)  
-
+  
+  // knut : function for pre-allocated memory for a map value;
+  // processing algorithms may be able to write directly to this space, thereby avoiding unneccesary copying of data
+  ZOO_DLL_EXPORT char* allocateMapValue(map* node, size_t num_bytes);  
+  
 #ifdef __cplusplus
 }
