Index: test/edu/ucsb/nceas/metacattest/QuerySpecificationTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/QuerySpecificationTest.java	(revision 3878)
+++ test/edu/ucsb/nceas/metacattest/QuerySpecificationTest.java	(revision 3879)
@@ -53,7 +53,7 @@
     private static String selectionQuery = "SELECT docid,docname,doctype,date_created, date_updated, rev " +
     		"FROM xml_documents WHERE docid IN (((((SELECT DISTINCT docid FROM xml_nodes " +
     		"WHERE UPPER(nodedata) LIKE '%JONES%' ) ))))";
-    private static String extendedQuery = "select xml_nodes.docid, 'dataset/title' as path, xml_nodes.nodedata, xml_nodes.parentnodeid from xml_nodes, xml_documents where parentnodeid IN (SELECT nodeid FROM xml_nodes WHERE nodename LIKE 'title' AND parentnodeid IN (SELECT nodeid FROM xml_nodes WHERE nodename LIKE 'dataset' ) )  AND xml_nodes.docid in " +
+    /*private static String extendedQuery = "select xml_nodes.docid, 'dataset/title' as path, xml_nodes.nodedata, xml_nodes.parentnodeid from xml_nodes, xml_documents where parentnodeid IN (SELECT nodeid FROM xml_nodes WHERE nodename LIKE 'title' AND parentnodeid IN (SELECT nodeid FROM xml_nodes WHERE nodename LIKE 'dataset' ) )  AND xml_nodes.docid in " +
     		"('obfs.45337', 'obfs.45338', 'obfs.45346') AND xml_nodes.nodetype = 'TEXT' AND " +
     		"xml_nodes.rootnodeid = xml_documents.rootnodeid UNION select xml_nodes.docid, 'originator/individualName/surName' as " +
     		"path, xml_nodes.nodedata, xml_nodes.parentnodeid from xml_nodes, xml_documents where parentnodeid IN " +
@@ -84,7 +84,11 @@
     		"parentnodeid IN (SELECT nodeid FROM xml_nodes WHERE nodename LIKE 'dataset' AND parentnodeid " +
     		"IN (SELECT nodeid FROM xml_nodes WHERE nodename LIKE 'eml' AND parentnodeid = rootnodeid ) ) ) )  " +
     		"AND xml_nodes.docid in ('obfs.45337', 'obfs.45338', 'obfs.45346') AND xml_nodes.nodetype = 'TEXT' " +
-    		"AND xml_nodes.rootnodeid = xml_documents.rootnodeid";
+    		"AND xml_nodes.rootnodeid = xml_documents.rootnodeid";*/
+    private static String extendedQuery ="select xml_nodes.docid, xml_index.path, xml_nodes.nodedata,  xml_nodes.parentnodeid, xml_nodes.nodetype FROM xml_index, xml_nodes WHERE"+
+                                    " ( (xml_index.nodeid=xml_nodes.parentnodeid AND xml_index.path IN ('dataset/title', 'originator/individualName/surName' , 'keyword' ) AND xml_nodes.nodetype = 'TEXT') "+
+                                    "OR  (xml_index.nodeid=xml_nodes.nodeid AND ( xml_index.path IN ( '/eml/@packageId', '/eml/dataset/access/@authSystem' , '/eml/dataset/access/@order' ) AND xml_nodes.nodetype = 'ATTRIBUTE'))) "+
+                                    "AND xml_nodes.docid in ('obfs.45337', 'obfs.45338', 'obfs.45346')";
     
     /* Initialize Options*/
     static
@@ -164,13 +168,14 @@
     public void testPrintExtendedSQL()
     {
         try {
-            System.out.println("---- EXT SQL ------------------");
+            System.out.println("---- orginal EXT SQL  ------------------\n"+extendedQuery);
             QuerySpecification qspec = new QuerySpecification(xml, 
                     MetaCatUtil.getOption("saxparser"), 
                     MetaCatUtil.getOption("accNumberSeparator"));
             String query = 
                     qspec.printExtendedSQL(
-                            "'obfs.45337', 'obfs.45338', 'obfs.45346'", false);
+                            "'obfs.45337', 'obfs.45338', 'obfs.45346'", true);
+            System.out.println("---- builded EXT SQL ------------------ \n"+query);
             assertTrue(extendedQuery.equals(query));
         } catch (IOException e) {
             fail(e.getMessage());
Index: test/edu/ucsb/nceas/metacattest/QueryResultBuilderTest.java
===================================================================
--- test/edu/ucsb/nceas/metacattest/QueryResultBuilderTest.java	(revision 3878)
+++ test/edu/ucsb/nceas/metacattest/QueryResultBuilderTest.java	(revision 3879)
@@ -77,7 +77,7 @@
     {
         TestSuite suite = new TestSuite();
         suite.addTest(new QueryResultBuilderTest("initialize"));
-        suite.addTest(new QueryResultBuilderTest("testBuildRecords"));
+        //suite.addTest(new QueryResultBuilderTest("testBuildRecords"));
         return suite;
     }
    
