Index: gli/trunk/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
===================================================================
--- gli/trunk/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java	(revision 17843)
+++ gli/trunk/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java	(revision 17844)
@@ -440,11 +440,11 @@
         int option_elements_length = option_elements.getLength ();
         for(int j = 0; j < option_elements_length; j++) {
-            Element option_element = (Element) option_elements.item (j);
+	  Element option_element = (Element) option_elements.item (j);
             if(option_element.getAttribute (StaticStrings.ASSIGNED_ATTRIBUTE).equals (StaticStrings.TRUE_STR)) {
-                text.append (StaticStrings.SPACE_CHARACTER);
-                text.append (StaticStrings.MINUS_CHARACTER);
-                text.append (option_element.getAttribute (StaticStrings.NAME_ATTRIBUTE));
-                String value_str = XMLTools.getValue (option_element);
-                
+	      text.append (StaticStrings.SPACE_CHARACTER);
+	      text.append (StaticStrings.MINUS_CHARACTER);
+	      text.append (option_element.getAttribute (StaticStrings.NAME_ATTRIBUTE));
+	      String value_str = XMLTools.getValue (option_element);
+              
                 // Convert metadata element names to internal names, and remove extracted metadata namespaces
                 if (value_str.length () > 0) {
@@ -1531,43 +1531,68 @@
     
     static private String pluginToString (Element command_element, boolean show_extracted_namespace) {
-        StringBuffer text = new StringBuffer ();
-        if(!command_element.getAttribute (StaticStrings.SEPARATOR_ATTRIBUTE).equals (StaticStrings.TRUE_STR)) {
-            text.append (StaticStrings.PLUGIN_STR);
-            text.append (StaticStrings.TAB_CHARACTER);
-            text.append (StaticStrings.TAB_CHARACTER);
-            text.append (command_element.getAttribute (StaticStrings.TYPE_ATTRIBUTE));
-            // Retrieve, and output, the arguments
-            NodeList option_elements = command_element.getElementsByTagName (StaticStrings.OPTION_ELEMENT);
-            int option_elements_length = option_elements.getLength ();
-            if(option_elements_length > 0) {
-                for(int j = 0; j < option_elements_length; j++) {
-                    Element option_element = (Element) option_elements.item (j);
-                    if(option_element.getAttribute (StaticStrings.ASSIGNED_ATTRIBUTE).equals (StaticStrings.TRUE_STR)) {
-                        text.append (StaticStrings.SPACE_CHARACTER);
-                        text.append (StaticStrings.MINUS_CHARACTER);
-                        text.append (option_element.getAttribute (StaticStrings.NAME_ATTRIBUTE));
-                        String value_str = XMLTools.getValue (option_element);
-                        if(!show_extracted_namespace && value_str.startsWith (StaticStrings.EXTRACTED_NAMESPACE)) {
-                            value_str = value_str.substring (StaticStrings.EXTRACTED_NAMESPACE.length ());
-                        }
-                        if(value_str.length () > 0) {
-                            text.append (StaticStrings.SPACE_CHARACTER);
-                            if(value_str.indexOf (StaticStrings.SPACE_CHARACTER) == -1) {
-                                text.append (value_str);
-                            }
-                            else {
-                                text.append (StaticStrings.SPEECH_CHARACTER);
-                                text.append (value_str);
-                                text.append (StaticStrings.SPEECH_CHARACTER);
-                            }
-                        }
-                        value_str = null;
-                    }
-                    option_element = null;
-                }
-            }
-            option_elements = null;
-        }
-        return text.toString ();
+        if(command_element.getAttribute (StaticStrings.SEPARATOR_ATTRIBUTE).equals (StaticStrings.TRUE_STR)) { 
+	  return "";
+	}
+        StringBuffer text = new StringBuffer (StaticStrings.PLUGIN_STR);
+	text.append (StaticStrings.TAB_CHARACTER);
+	text.append (command_element.getAttribute (StaticStrings.TYPE_ATTRIBUTE));
+	// Retrieve, and output, the arguments
+	NodeList option_elements = command_element.getElementsByTagName (StaticStrings.OPTION_ELEMENT);
+	int option_elements_length = option_elements.getLength ();
+	if(option_elements_length > 0) {
+	  for(int j = 0; j < option_elements_length; j++) {
+	    Element option_element = (Element) option_elements.item (j);
+	    if(option_element.getAttribute (StaticStrings.ASSIGNED_ATTRIBUTE).equals (StaticStrings.TRUE_STR)) {
+	      text.append (StaticStrings.SPACE_CHARACTER);
+	      text.append (StaticStrings.MINUS_CHARACTER);
+	      text.append (option_element.getAttribute (StaticStrings.NAME_ATTRIBUTE));
+	      String value_str = XMLTools.getValue (option_element);
+
+	      
+	      // Convert metadata element names to internal names, and remove extracted metadata namespaces
+	      if (value_str.length () > 0) {
+		StringTokenizer string_tokenizer = new StringTokenizer (value_str, ",");
+		StringBuffer value_buffer = new StringBuffer ();
+		while (string_tokenizer.hasMoreElements ()) {
+		  String raw_token = (String) string_tokenizer.nextElement ();
+		  String token = raw_token.trim ();
+		  MetadataElement metadata_element = MetadataTools.getMetadataElementWithDisplayName (token);
+		  if (metadata_element != null) {
+		    token = metadata_element.getFullName ();
+		  }
+                        
+		  if (token.startsWith (StaticStrings.EXTRACTED_NAMESPACE)) {
+		    token = token.substring (StaticStrings.EXTRACTED_NAMESPACE.length ());
+		  }
+		  value_buffer.append (token);
+		  if (string_tokenizer.hasMoreElements ()) {
+		    value_buffer.append (",");
+		  }
+		}
+		value_str = value_buffer.toString ();
+	      }
+
+	      // if(!show_extracted_namespace && value_str.startsWith (StaticStrings.EXTRACTED_NAMESPACE)) {
+	      //            value_str = value_str.substring (StaticStrings.EXTRACTED_NAMESPACE.length ());
+	      //        }
+	      if(value_str.length () > 0) {
+		text.append (StaticStrings.SPACE_CHARACTER);
+		if(value_str.indexOf (StaticStrings.SPACE_CHARACTER) == -1) {
+		  text.append (value_str);
+		}
+		else {
+		  text.append (StaticStrings.SPEECH_CHARACTER);
+		  text.append (value_str);
+		  text.append (StaticStrings.SPEECH_CHARACTER);
+		}
+	      }
+	      value_str = null;
+	    }
+	    option_element = null;
+	  }
+	}
+	option_elements = null;
+	
+	return text.toString ();
     }
     
