Index: /trunk/gli/src/org/greenstone/gatherer/metadata/DocXMLFile.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/metadata/DocXMLFile.java	(revision 8130)
+++ /trunk/gli/src/org/greenstone/gatherer/metadata/DocXMLFile.java	(revision 8131)
@@ -25,101 +25,83 @@
 	super(doc_xml_file_path);
 
-	// Parse the doc.xml file
-	System.err.println("Loading doc.xml file " + doc_xml_file_path + "...");
-	Document document = XMLTools.parseXMLFile(this);
-	if (document == null) {
-	    System.err.println("Error: Could not parse doc.xml file " + getAbsolutePath());
-	    return;
-	}
-
 	MetadataSet extracted_metadata_set = MetadataSetManager.getMetadataSet(MetadataSetManager.EXTRACTED_METADATA_NAMESPACE);
 
-	// Read all the Archive elements in the file
-	NodeList archive_elements_nodelist = document.getElementsByTagName(ARCHIVE_ELEMENT);
-	for (int i = 0; i < archive_elements_nodelist.getLength(); i++) {
-	    Element current_archive_element = (Element) archive_elements_nodelist.item(i);
+	// Skim the doc.xml file as quickly as possible (don't parse as XML), looking at the Metadata elements
+	System.err.println("Skimming doc.xml file " + this + "...");
+	try {
+	    BufferedReader buffered_reader = new BufferedReader(new FileReader(this));
+	    String line = null;
+	    while ((line = buffered_reader.readLine()) != null) {
+		// This line doesn't contain a metadata element
+		if (line.indexOf("<Metadata ") == -1) {
+		    continue;
+		}
 
-	    // Read the child Section elements of the archive (but not all descendants)
-	    ArrayList child_section_elements = XMLTools.getChildElementsByTagName(current_archive_element, SECTION_ELEMENT);
-	    for (int j = 0; j < child_section_elements.size(); j++) {
-		Element current_section_element = (Element) child_section_elements.get(j);
+		// Extract the metadata element name
+		int name_index = line.indexOf(" name=\"") + " name=\"".length();
+		String metadata_element_name_full = line.substring(name_index, line.indexOf("\"", name_index));
 
-		// Read the Description elements of this section only (not child sections as well)
-		ArrayList child_description_elements = XMLTools.getChildElementsByTagName(current_section_element, DESCRIPTION_ELEMENT);
-		for (int k = 0; k < child_description_elements.size(); k++) {
-		    Element current_description_element = (Element) child_description_elements.get(k);
+		// If the metadata has a namespace it isn't extracted metadata, so we're not interested
+		String metadata_set_namespace = MetadataTools.getMetadataSetNamespace(metadata_element_name_full);
+		if (!metadata_set_namespace.equals("")) {
+		    continue;
+		}
 
-		    String gsdlsourcefilename_value = null;
-		    boolean bibliographic_data = false;
+		// Extracted metadata!
+		String metadata_element_name = metadata_element_name_full;
 
-		    // Read all the Metadata elements in this description element
-		    NodeList metadata_elements_nodelist = current_description_element.getElementsByTagName(METADATA_ELEMENT);
-		    for (int l = 0; l < metadata_elements_nodelist.getLength(); l++) {
-			Element current_metadata_element = (Element) metadata_elements_nodelist.item(l);
-			String metadata_element_name_full = current_metadata_element.getAttribute("name");
+		// Note which file this doc.xml is for
+		if (metadata_element_name.equals("gsdlsourcefilename")) {
+		    // Extract the gsdlsourcefilename element value
+		    int value_index = line.indexOf(">", name_index) + ">".length();
+		    String gsdlsourcefilename_value = line.substring(value_index, line.indexOf("<", value_index));
 
-			// If the metadata has a namespace it isn't extracted metadata, so we're not interested
-			String metadata_set_namespace = MetadataTools.getMetadataSetNamespace(metadata_element_name_full);
-			if (!metadata_set_namespace.equals("")) {
-			    continue;
+		    // We're only interested in the path relative to the import folder
+		    int import_index = gsdlsourcefilename_value.indexOf("import");
+		    if (import_index != -1) {
+			gsdlsourcefilename_value = gsdlsourcefilename_value.substring(import_index + "import".length());
+
+			boolean is_unix_path = gsdlsourcefilename_value.startsWith("/");
+			gsdlsourcefilename_value = gsdlsourcefilename_value.substring(1);
+
+			// Make sure the path matches the OS that is running
+			if (is_unix_path && Utility.isWindows()) {
+			    // Convert path from Unix to Windows
+			    gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("/", File.separator);
+			}
+			if (!is_unix_path && !Utility.isWindows()) {
+			    // Convert path from Windows to Unix
+			    gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("\\\\", File.separator);
 			}
 
-			// Extracted metadata!
-			String metadata_element_name = metadata_element_name_full;
-
-			// Note which file this Section is for
-			if (metadata_element_name.equals("gsdlsourcefilename")) {
-			    gsdlsourcefilename_value = XMLTools.getElementTextValue(current_metadata_element);
-
-			    // We're only interested in the path relative to the import folder
-			    int import_index = gsdlsourcefilename_value.indexOf("import");
-			    if (import_index != -1) {
-				gsdlsourcefilename_value = gsdlsourcefilename_value.substring(import_index + "import".length());
-
-				boolean is_unix_path = gsdlsourcefilename_value.startsWith("/");
-				gsdlsourcefilename_value = gsdlsourcefilename_value.substring(1);
-
-				// Make sure the path matches the OS that is running
-				if (is_unix_path && Utility.isWindows()) {
-				    // Convert path from Unix to Windows
-				    gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("/", File.separator);
-				}
-				if (!is_unix_path && !Utility.isWindows()) {
-				    // Convert path from Windows to Unix
-				    gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("\\\\", File.separator);
-				}
-			    }
-			    else {
-				// We don't really know what is going on...
-				System.err.println("Warning: Could not understand gsdlsourcefilename " + gsdlsourcefilename_value);
-			    }
-			}
-
-			// We don't do much with bibliographic data
-			if (metadata_element_name.equals("SourceSegment")) {
-			    bibliographic_data = true;
-			}
-
-			// Ignore lower-case metadata elements (gsdlsourcefilename, gsdlassocfile etc.)
-			//   and those starting with '/' (/srclink)
-			char first_character = metadata_element_name.charAt(0);
-			if (Character.isLowerCase(first_character) || first_character == '/') {
-			    continue;
-			}
-
-			MetadataElement metadata_element = extracted_metadata_set.getMetadataElement(metadata_element_name);
-			if (metadata_element == null) {
-			    // This element isn't defined in ex.mds, so create it for this session
-			    System.err.println("Extracted metadata element not defined: " + metadata_element_name);
-			    extracted_metadata_set.addMetadataElementForThisSession(metadata_element_name);
+			// Remember this for quick access later
+			if (gsdlsourcefilename_value != null) {
+			    files_in_doc_xml_file.add(gsdlsourcefilename_value);
 			}
 		    }
-
-		    // Remember this for quick access later
-		    if (gsdlsourcefilename_value != null && !bibliographic_data) {
-			files_in_doc_xml_file.add(gsdlsourcefilename_value);
+		    else {
+			// We don't really know what is going on...
+			System.err.println("Warning: Could not understand gsdlsourcefilename " + gsdlsourcefilename_value);
 		    }
 		}
+
+		// Ignore lower-case metadata elements (gsdlsourcefilename, gsdlassocfile etc.)
+		//   and those starting with '/' (/srclink)
+		char first_character = metadata_element_name.charAt(0);
+		if (Character.isLowerCase(first_character) || first_character == '/') {
+		    continue;
+		}
+
+		MetadataElement metadata_element = extracted_metadata_set.getMetadataElement(metadata_element_name);
+		if (metadata_element == null) {
+		    // This element isn't defined in ex.mds, so create it for this session
+		    System.err.println("Extracted metadata element not defined: " + metadata_element_name);
+		    extracted_metadata_set.addMetadataElementForThisSession(metadata_element_name);
+		}
 	    }
+	}
+	catch (Exception ex) {
+	    System.err.println("Exception: " + ex);
+	    ex.printStackTrace();
 	}
     }
Index: /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataElement.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataElement.java	(revision 8130)
+++ /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataElement.java	(revision 8131)
@@ -3,4 +3,5 @@
 
 import java.io.File;
+import org.greenstone.gatherer.Gatherer;
 import org.greenstone.gatherer.util.XMLTools;
 import org.w3c.dom.*;
@@ -72,4 +73,15 @@
 
 
+    public String getDisplayName()
+    {
+	String metadata_element_display_name = MetadataTools.getMetadataElementAttribute(this, "identifier", Gatherer.config.getLanguage(), "en");
+	if (metadata_element_display_name != null) {
+	    return getNamespace() + "." + metadata_element_display_name;
+	}
+
+	return metadata_element_name_full;
+    }
+
+
     public MetadataValueTreeModel getMetadataValueTreeModel()
     {
@@ -111,5 +123,5 @@
     public String toString()
     {
-	return metadata_element_name_full;
+	return getDisplayName();
     }
 
Index: /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java	(revision 8130)
+++ /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java	(revision 8131)
@@ -27,4 +27,5 @@
 
 	// Parse the metadata.xml file
+	System.err.println("Loading metadata.xml file " + metadata_xml_file_path + "...");
 	Document document = XMLTools.parseXMLFile(this);
 	if (document == null) {
@@ -45,5 +46,5 @@
 		// Check if we have an import mapping for this metadata element
 		String target_metadata_element_name_full = ProfileXMLFileManager.getMetadataElementFor(metadata_element_name_full);
-		if (target_metadata_element_name_full == null) {
+		if (target_metadata_element_name_full == null && MetadataSetManager.getMetadataSets().size() > 1) {
 		    // No, so ask the user how they want to deal with this element
 		    MetadataImportMappingPrompt metadata_import_mapping_prompt = new MetadataImportMappingPrompt(metadata_element_name_full);
Index: /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java	(revision 8130)
+++ /trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java	(revision 8131)
@@ -36,6 +36,4 @@
 		MetadataXMLFile metadata_xml_file = (MetadataXMLFile) metadata_xml_files.get(j);
 
-		// This metadata.xml file is only applicable if it is above or at the same level as the file
-		// if (current_file_directory.getAbsolutePath().startsWith(metadata_xml_file.getParentFile().getAbsolutePath())) {
 		// This metadata.xml file is only applicable if it is at the same level as the file
 		if (current_file_directory.getAbsolutePath().equals(metadata_xml_file.getParentFile().getAbsolutePath())) {
