Index: /gsdl/trunk/runtime-src/src/oaiservr/dublincore.cpp
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/dublincore.cpp	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/dublincore.cpp	(revision 18895)
@@ -1,4 +1,26 @@
 
 #include "dublincore.h"
+
+dublin_core::dublin_core() : metaformat() {
+  // These element names taken from the schema
+  // http://www.openarchives.org/OAI/2.0/oai_dc.xsd
+  elementSet.insert("contributor");
+  elementSet.insert("coverage");
+  elementSet.insert("creator");
+  elementSet.insert("date");
+  elementSet.insert("description");
+  elementSet.insert("format");
+  elementSet.insert("identifier");
+  elementSet.insert("language");
+  elementSet.insert("publisher");
+  elementSet.insert("relation");
+  elementSet.insert("rights");
+  elementSet.insert("source");
+  elementSet.insert("subject");
+  elementSet.insert("title");
+  elementSet.insert("type");
+ 
+
+}
 
 const text_t dublin_core::formatName() {
Index: /gsdl/trunk/runtime-src/src/oaiservr/dublincore.h
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/dublincore.h	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/dublincore.h	(revision 18895)
@@ -6,6 +6,7 @@
   virtual void output_metadata_header(ostream &output);
   virtual void output_metadata_footer(ostream &output);
+
  public:
-  dublin_core() : metaformat(){};
+  dublin_core(); 
   virtual const text_t formatName();
   virtual const text_t formatPrefix();
Index: /gsdl/trunk/runtime-src/src/oaiservr/metaformat.cpp
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/metaformat.cpp	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/metaformat.cpp	(revision 18895)
@@ -69,8 +69,10 @@
     if (metaItem == this->formatPrefix()) {
       metaItem = substr(last+1, here->first.end()); // Get the rest of the metadata tag (it's name) but without the '.'
-      lc(metaItem); // Convert it to lowercase for putting in the xml tags
-
+      lc(metaItem.begin(),metaItem.begin()+1); // We want lowercase, but some of the fields in qualified dublin core have internal upper case, eg instructionalMethod. So we assume that lowercasing the first letter is enough
       if (doOutput) {
-	this->output_item(output, utf8convert, headerDone, metaItem, here->second.values);
+	if (this->is_valid_element(metaItem)) {
+	  
+	  this->output_item(output, utf8convert, headerDone, metaItem, here->second.values);
+	}
       }
       else {
@@ -86,5 +88,7 @@
 	// particular metadata is stuff we don't want?
 	if (doOutput) {
-	  this->output_item(output, utf8convert, headerDone, mapTo, here->second.values);
+	  if (this->is_valid_element(mapTo)) {
+	    this->output_item(output, utf8convert, headerDone, mapTo, here->second.values);
+	  }
 	}
 	else {
@@ -115,4 +119,11 @@
   ofstream o("dummy", ios::out);
   return this->scan_metadata(o, collection, docInfo, false);
+}
+
+bool metaformat::is_valid_element(text_t &meta_name)
+{
+  if (elementSet.count(meta_name)==1) return true;
+  return false;
+  
 }
 
Index: /gsdl/trunk/runtime-src/src/oaiservr/metaformat.h
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/metaformat.h	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/metaformat.h	(revision 18895)
@@ -19,10 +19,16 @@
  protected:
   virtual void output_metadata_header(ostream &output) = 0;
-  virtual void output_item(ostream &output, outconvertclass &outconvert, bool &headerDone, const text_t &label, 
+  virtual void output_item(ostream &output, outconvertclass &outconvert, 
+			   bool &headerDone, const text_t &label, 
 			   const text_tarray &values);
   virtual void output_metadata_footer(ostream &output) = 0;
-  virtual bool scan_metadata(ostream &output, const text_t &collection,  ResultDocInfo_t &docInfo, 
-			     bool doOutput);
+  virtual bool is_valid_element(text_t &meta_name);
+  virtual bool scan_metadata(ostream &output, const text_t &collection,  
+			     ResultDocInfo_t &docInfo, bool doOutput);
   oaiconfig *    oaiConfigure;
+
+  // a set containing all the valid element names for the set. Must be 
+  // initialized by each metadata class
+  text_tset elementSet; 
 
  public:
@@ -30,8 +36,10 @@
   virtual const text_t formatName() = 0;
   virtual const text_t formatPrefix() = 0;
-  virtual bool output_record(ostream &output, recptproto *protocol, const text_t &collection, 
+  virtual bool output_record(ostream &output, recptproto *protocol, 
+			     const text_t &collection, 
 			     const text_t &record_OID);
   virtual bool is_available(const text_t &collection, ResultDocInfo_t &docInfo);
-  virtual bool output_metadata(ostream &output, const text_t &collection,  ResultDocInfo_t &docInfo);
+  virtual bool output_metadata(ostream &output, const text_t &collection,  
+			       ResultDocInfo_t &docInfo);
   virtual bool output_formatdata(ostream &output) = 0;
   void    set_configuration(oaiconfig *config) { this->oaiConfigure = config; }
Index: /gsdl/trunk/runtime-src/src/oaiservr/qualified_dublincore.cpp
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/qualified_dublincore.cpp	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/qualified_dublincore.cpp	(revision 18895)
@@ -2,4 +2,64 @@
 #include "qualified_dublincore.h"
 
+qualified_dublin_core::qualified_dublin_core() : metaformat() {
+  // These element names taken from the schema
+  //http://www.greenstone.org/namespace/gsdl_qdc/1.0/gsdl_qdc.xsd
+
+  elementSet.insert("title");
+   elementSet.insert("creator");
+   elementSet.insert("subject");
+   elementSet.insert("description");
+   elementSet.insert("publisher");
+   elementSet.insert("contributor");
+   elementSet.insert("date");
+   elementSet.insert("type");
+   elementSet.insert("format");
+   elementSet.insert("identifier");
+   elementSet.insert("source");
+   elementSet.insert("language");
+   elementSet.insert("relation");
+   elementSet.insert("coverage");
+   elementSet.insert("rights");
+   elementSet.insert("alternative");
+   elementSet.insert("tableOfContents");
+   elementSet.insert("abstract");
+   elementSet.insert("created");
+   elementSet.insert("valid");
+   elementSet.insert("available");
+   elementSet.insert("issued"); 
+   elementSet.insert("modified");
+   elementSet.insert("dateAccepted");
+   elementSet.insert("dateCopyrighted");
+   elementSet.insert("dateSubmitted");
+   elementSet.insert("extent");
+   elementSet.insert("medium");
+   elementSet.insert("isVersionOf");
+   elementSet.insert("hasVersion");
+   elementSet.insert("isReplacedBy");
+   elementSet.insert("replaces"); 
+   elementSet.insert("isRequiredBy");
+   elementSet.insert("requires"); 
+   elementSet.insert("isPartOf");
+   elementSet.insert("hasPart"); 
+   elementSet.insert("isReferencedBy");
+   elementSet.insert("references");
+   elementSet.insert("isFormatOf");
+   elementSet.insert("hasFormat");
+   elementSet.insert("conformsTo");
+   elementSet.insert("spatial");
+   elementSet.insert("temporal");
+   elementSet.insert("audience");
+   elementSet.insert("accrualMethod");
+   elementSet.insert("accrualPeriodicity");
+   elementSet.insert("accrualPolicy");
+   elementSet.insert("instructionalMethod");
+   elementSet.insert("provenance");
+   elementSet.insert("rightsHolder");
+   elementSet.insert("mediator");
+   elementSet.insert("educationLevel");
+   elementSet.insert("accessRights");
+   elementSet.insert("license"); 
+   elementSet.insert("bibliographicCitation");
+}
 const text_t qualified_dublin_core::formatName() {
   return "gsdl_qdc";
Index: /gsdl/trunk/runtime-src/src/oaiservr/qualified_dublincore.h
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/qualified_dublincore.h	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/qualified_dublincore.h	(revision 18895)
@@ -7,5 +7,5 @@
   virtual void output_metadata_footer(ostream &output);
  public:
-  qualified_dublin_core() : metaformat(){}
+  qualified_dublin_core();
   virtual const text_t formatName();
   virtual const text_t formatPrefix();
Index: /gsdl/trunk/runtime-src/src/oaiservr/rfc1807.cpp
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/rfc1807.cpp	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/rfc1807.cpp	(revision 18895)
@@ -1,3 +1,37 @@
 #include "rfc1807.h"
+
+rfc1807::rfc1807() : metaformat(){
+  // These element names taken from the schema
+  // http://www.openarchives.org/OAI/1.1/rfc1807.xsd
+  elementSet.insert("bib-version");
+  elementSet.insert("id");
+  elementSet.insert("entry"); 
+  elementSet.insert("organization");
+  elementSet.insert("title");
+  elementSet.insert("type");
+  elementSet.insert("revision");
+  elementSet.insert("withdraw");
+  elementSet.insert("author"); 
+  elementSet.insert("corp-author");
+  elementSet.insert("contact"); 
+  elementSet.insert("date");
+  elementSet.insert("pages");
+  elementSet.insert("copyright");
+  elementSet.insert("handle"); 
+  elementSet.insert("other_access");
+  elementSet.insert("retrieval");
+  elementSet.insert("keyword"); 
+  elementSet.insert("cr-category");
+  elementSet.insert("period"); 
+  elementSet.insert("series"); 
+  elementSet.insert("monitoring");
+  elementSet.insert("funding");
+  elementSet.insert("contract");
+  elementSet.insert("grant");
+  elementSet.insert("language");
+  elementSet.insert("notes"); 
+  elementSet.insert("abstract");
+ 
+}; 
 
 const text_t rfc1807::formatName() 
@@ -56,2 +90,4 @@
   return true;
 }
+
+
Index: /gsdl/trunk/runtime-src/src/oaiservr/rfc1807.h
===================================================================
--- /gsdl/trunk/runtime-src/src/oaiservr/rfc1807.h	(revision 18894)
+++ /gsdl/trunk/runtime-src/src/oaiservr/rfc1807.h	(revision 18895)
@@ -6,5 +6,5 @@
   virtual void output_metadata_footer(ostream &output);
  public:
-  rfc1807() : metaformat(){}; // call parent constructor
+  rfc1807(); 
   virtual const text_t formatName();
   virtual const text_t formatPrefix();
