Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 23404)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 23405)
@@ -3,4 +3,5 @@
 import org.greenstone.gsdl3.core.ModuleInterface;
 import org.greenstone.gsdl3.util.*;
+import org.greenstone.util.GlobalProperties;
 
 // XML classes
@@ -54,4 +55,12 @@
 	
 	String coll = (String)params.get(GSParams.COLLECTION); //SYSTEM_CLUSTER);
+    String service = (String)params.get(GSParams.SERVICE);
+    String classifier = (String)params.get("cl");
+
+
+    logger.error("Collection="+coll);
+    logger.error("Service="+service);
+    logger.error("Classifier="+classifier);
+
 
 	String to = "";
@@ -62,8 +71,13 @@
 	Element mr_request_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
 	Element mr_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_FORMAT_STRING, to, lang, uid);
+
+    request.setAttribute("service", service);
+    if(classifier != null)
+        request.setAttribute("classifier", classifier);
+
 	mr_request_message.appendChild(mr_request);
 	
-	Element format = this.doc.createElement(GSXML.FORMAT_STRING_ELEM);
-	mr_request.appendChild(format);
+	//Element format = this.doc.createElement(GSXML.FORMAT_STRING_ELEM);
+	//mr_request.appendChild(format);
 
     String format_string = (String)params.get("data");
@@ -72,8 +86,8 @@
 
     Iterator it = params.keySet().iterator();
-    while(it.hasNext())
-    {
-        logger.error("Param: "+it.next());
-    }      
+    //while(it.hasNext())
+    //{
+    //    logger.error("Param: "+it.next());
+    //}      
 
     try {
@@ -83,8 +97,46 @@
             String input = format_string;
             InputSource is = new InputSource( new StringReader( input ) );
-            Document d = builder.parse( is );
-            Element e = d.getDocumentElement();
-            
-            page_response.appendChild(this.doc.importNode(e, true));
+            Document d = (Document) builder.parse( is );
+            //Element e = d.getDocumentElement();
+            //Node d2 = this.doc.importNode(e,true); 
+
+            //Document format_doc = this.converter.newDOM();
+            //doc.appendChild(d2);
+
+            //File interface_config_file = new File(GSFile.interfaceConfigFile(GSFile.interfaceHome(GlobalProperties.getGSDL3Home(), (String)this.config_params.get(GSConstants.INTERFACE_NAME))));
+            //if (!interface_config_file.exists()) {
+            //  logger.error(" interface config file: "+interface_config_file.getPath()+" not found!");
+            //}
+            //Document config_doc = this.converter.getDOM(interface_config_file, "utf-8");
+            //if (config_doc == null) {
+            //  logger.error(" could not parse interface config file: "+interface_config_file.getPath());
+            //}
+        
+            //Element config_elem = config_doc.getDocumentElement();
+            //String base_interface = config_elem.getAttribute("baseInterface");
+
+
+            // Call XSLT to transform document to xml format string
+            XMLTransformer transformer = new XMLTransformer();
+            //String stylesheet = GSFile.stylesheetFile(GlobalProperties.getGSDL3Home(), (String)this.config_params.get(GSConstants.SITE_NAME), coll, (String)this.config_params.get(GSConstants.INTERFACE_NAME), "oran", "FormatAction");
+            //logger.error(stylesheet);
+            Document style_doc = this.converter.getDOM(new File("/home/sam/greenstone3/web/interfaces/oran/transform/formatString.xsl"), "UTF-8");
+
+            if(style_doc == null)
+                logger.error("style_doc is null");
+
+            // not sure what to do here - some code from Transforming Receptionist
+            String transformed = transformer.transformToString(style_doc, d);
+            //Node transformed = transformer.transform(style_doc, d);
+           
+            Element format = this.doc.createElement(GSXML.FORMAT_STRING_ELEM);
+            GSXML.setNodeText(format, transformed);
+            //format.appendChild(this.doc.createTextNode(transformed));
+            //format.setNodeValue(transformed);
+            mr_request.appendChild(format); 
+            logger.error("Transformed: "+transformed);
+
+
+            //page_response.appendChild(this.doc.importNode(e, true));
     } catch( Exception ex ) {
             logger.error("There was an exception "+ex);
@@ -100,7 +152,8 @@
 
     // Call XSLT to transform document to xml format string
-    this.transformer = new XMLTransformer();
+    //XMLTransformer transformer = new XMLTransformer();
 
     // not sure what to do here - some code from Transforming Receptionist
+    //transformer.transformToString(Document stylesheet, Document source);
 
     // create a mesage to send to the collection object via the message router
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 23404)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 23405)
@@ -509,5 +509,20 @@
 	    return response;
 	}
-	
+
+    if (type.equals(GSXML.REQUEST_TYPE_FORMAT_STRING)) {
+        logger.error("Received format string request");
+        String service = request.getAttribute("service");
+        logger.error("Service is " + service);
+        String classifier = null;
+        if(service.equals("ClassifierBrowse"))
+        {
+            classifier = request.getAttribute("classifier");
+            logger.error("Classifier is " + classifier);
+        }
+        Element format_element = (Element) GSXML.getChildByTagName(request, GSXML.FORMAT_STRING_ELEM);
+        String format_string = GSXML.getNodeText(format_element);
+        logger.error("Format string: " + format_string);
+        logger.error("Config file location = " + GSFile.collectionConfigFile(this.site_home, this.cluster_name));
+	}
 	if (type.equals(GSXML.REQUEST_TYPE_SYSTEM)) {
 	    response = processSystemRequest(request);
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 23404)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 23405)
@@ -234,7 +234,7 @@
 
 	logger.debug("receptionist returned response");
-	logger.error("receptionist returned response");
+	//logger.error("receptionist returned response");
 	logger.debug(this.converter.getString(resulting_page));
-	logger.error(this.converter.getString(resulting_page));
+	//logger.error(this.converter.getString(resulting_page));
 //    logger.info("receptionist returned response");
 //    logger.info(this.converter.getString(resulting_page));
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 23404)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 23405)
@@ -659,4 +659,5 @@
       logger.info(" cant find stylesheet for "+name);
     }
+    logger.error("stylesheet:"+stylesheet);
     return stylesheet;
   }
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XMLTransformer.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XMLTransformer.java	(revision 23404)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XMLTransformer.java	(revision 23405)
@@ -98,5 +98,5 @@
 	    //this.t_factory = TransformerFactory.newInstance();
 	} catch (Exception e) {
-	    logger.error("exception "+e.getMessage());
+	    logger.error("exception creating t_factory "+e.getMessage());
 	}
     }
Index: main/trunk/greenstone3/web/interfaces/oran/interfaceConfig.xml
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/interfaceConfig.xml	(revision 23404)
+++ main/trunk/greenstone3/web/interfaces/oran/interfaceConfig.xml	(revision 23405)
@@ -22,5 +22,5 @@
     <action name='s' class='SystemAction' xslt='system.xsl'/>
 
-    <action name='f' class='FormatAction' xslt='formatString.xsl'/>
+    <action name='f' class='FormatAction'/> <!-- xslt='formatString.xsl'/> -->
 
     <action name='g' class='GeneralAction'>
Index: main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 23404)
+++ main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 23405)
@@ -11,4 +11,30 @@
     //console.log(formatStatement);
 
+    // find collection name
+
+    var myurl = document.URL;
+    console.log(myurl);
+    var first = myurl.indexOf("&c")+3;
+    var last = myurl.indexOf("&", first);
+    
+    var collection_name = myurl.substring(first,last); ///&c=(.*)&/.exec(myurl);
+    console.log(collection_name);
+
+    first = myurl.indexOf("&s")+3;
+    last = myurl.indexOf("&", first);
+
+    var service_name = myurl.substring(first,last);
+    console.log(service_name);
+
+    var classifier_name = null;
+
+    if(service_name == "ClassifierBrowse")
+    {
+        first = myurl.indexOf("&cl")+4;
+        last = myurl.indexOf("&", first);
+
+        classifier_name = myurl.substring(first,last);
+        console.log(classifier_name);
+    }
 
     //var myurl = 'http://localhost:8080/greenstone3/format?a=s&sa=s&t='+formatStatement;
@@ -17,6 +43,10 @@
 
     // How do I find out my collection name?
-
-    $.post("http://localhost:8080/greenstone3/format?a=f", {data: formatStatement}, function(data) {
+    var post_url = "http://localhost:8080/greenstone3/format?a=f&c=" + collection_name +"&s=" + service_name;
+
+    if(classifier_name != null)
+        post_url = post_url + "&cl=" + classifier_name;
+
+    $.post(post_url, {data: formatStatement}, function(data) {
         //$('.result').innerHTML = data; //html(data);
         console.log("Success, we have received data");
Index: main/trunk/greenstone3/web/interfaces/oran/transform/formatString.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/formatString.xsl	(revision 23404)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/formatString.xsl	(revision 23405)
@@ -1,7 +1,12 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-  xmlns:java="http://xml.apache.org/xslt/java"
-  extension-element-prefixes="java">
+  xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+  xmlns:gslib="http://www.greenstone.org/XSL/Library"
+  xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
+  xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
+  exclude-result-prefixes="util gslib gsf xslt">
+
+  <!-- extension-element-prefixes="java"> -->
 
   <xsl:strip-space elements="*"/>
@@ -241,6 +246,6 @@
   <!-- Main page generation -->
 
-  <xsl:template match="page">
-    <html>
+  <xsl:template match="/">
+    <!-- <html>
       <head>
 	<title>
@@ -249,17 +254,18 @@
       </head>
       <body>
-        <h2> This should be the format string (unmodified and html version) </h2>
+        <h2> This should be the format string (unmodified and html version) </h2> -->
         <!-- <xsl:value-of select="/page/pageResponse" disable-output-escaping="yes"/> -->
         <xsl:call-template name="xml">
-            <xsl:with-param name="fmt" select="/page/pageResponse"/>
+            <xsl:with-param name="fmt" select="."/>
         </xsl:call-template><xsl:text> </xsl:text>
         <!-- <xsl:apply-templates select="/page/pageResponse" mode="xml"/> -->
-      </body>
-    </html>
-  </xsl:template>
-  
+      <!-- </body>
+    </html> -->
+  </xsl:template>
+  
+  <!--
   <xsl:template name="pageTitle">
     <xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
-  </xsl:template>
+  </xsl:template> -->
   
 </xsl:stylesheet>
