Index: /trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java	(revision 11045)
+++ /trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java	(revision 11046)
@@ -349,11 +349,17 @@
 	    }
 
-	    document = CollectionDesignManager.XMLStringToDOM(xml,classifier);
-	}
-	catch (Exception error) {
-	    error.printStackTrace();
-	    ///ystem.err.println("Error: Cannot parse " + getClassifierName(classifier));
-	}
-	if(document != null) {
+	    if (xml.length() > 0) {
+		document = CollectionDesignManager.XMLStringToDOM(xml, classifier);
+	    }
+	    else {
+		JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.Classifier_XML_Parse_Failed", classifier), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
+	    }
+	}
+	catch (Exception exception) {
+	    DebugStream.println("Failed when trying to parse: " + classifier);
+	    DebugStream.printStackTrace(exception);
+	}
+
+	if (document != null) {
 	    parseXML(document.getDocumentElement());
 	}
Index: /trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java	(revision 11045)
+++ /trunk/gli/src/org/greenstone/gatherer/cdm/CollectionDesignManager.java	(revision 11046)
@@ -258,24 +258,15 @@
 	Document document = null;
 
-	// If something has gone horribly wrong then xml will be empty.
-	if(xml.length() > 0) {
-	    try {
-		// Then read the xml from the piped input stream.
-		StringReader xml_sr = new StringReader(xml.toString());
-		InputSource source = new InputSource(xml_sr);
-		DOMParser parser = new DOMParser();
-		parser.parse(source);
-		document = parser.getDocument();
-	    }
-	    catch (Exception error) {
-		System.err.println("Failed when trying to parse XML stream ");
-		error.printStackTrace();
-	    }
-	}
-	else {
-	    //DebugStream.println("Zero length argument xml detected for: " + form);
-	    String[] margs = new String[1];
-	    margs[0] = form;
-	    JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", margs), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);  // !! TO DO: This is bad -- this function is used for more than just plugins
+	try {
+	    // Read the xml from the piped input stream.
+	    StringReader xml_sr = new StringReader(xml.toString());
+	    InputSource source = new InputSource(xml_sr);
+	    DOMParser parser = new DOMParser();
+	    parser.parse(source);
+	    document = parser.getDocument();
+	}
+	catch (Exception error) {
+	    System.err.println("Failed when trying to parse XML stream ");
+	    error.printStackTrace();
 	}
 
Index: /trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java	(revision 11045)
+++ /trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java	(revision 11046)
@@ -481,11 +481,17 @@
 	    }
 
-	    document = CollectionDesignManager.XMLStringToDOM(xml,plugin);
-	}
-	catch (Exception error) {
-	    System.err.println("Failed when trying to parse: " + plugin);
-	    error.printStackTrace();
-	}
-	if(document != null) {
+	    if (xml.length() > 0) {
+		document = CollectionDesignManager.XMLStringToDOM(xml, plugin);
+	    }
+	    else {
+		JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
+	    }
+	}
+	catch (Exception exception) {
+	    DebugStream.println("Failed when trying to parse: " + plugin);
+	    DebugStream.printStackTrace(exception);
+	}
+
+	if (document != null) {
 	    parseXML(document.getDocumentElement());
 	}
@@ -522,5 +528,4 @@
 	}
     }
-
 
 
