Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java	(revision 23332)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java	(revision 23333)
@@ -12,4 +12,9 @@
 import java.io.File;
 import java.util.HashMap;
+import java.util.*;
+import java.io.StringReader;
+import org.xml.sax.InputSource;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.apache.log4j.*;
@@ -55,5 +60,34 @@
 	    String info = (String)params.get(GSParams.SYSTEM_SUBSET);
 	    system.setAttribute(GSXML.SYSTEM_SUBSET_ATT, info);
-	
+    }
+    else if(subaction.equals("s")) { // save format statement
+         logger.error("Initiate save");
+         String format_string = (String)params.get("data");
+         logger.error("data="+format_string);
+         Iterator it = params.keySet().iterator();
+         while(it.hasNext())
+         {
+            logger.error("Param: "+it.next());
+         }	
+        Element page_response = this.doc.createElement(GSXML.RESPONSE_ELEM);
+
+        try {
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder builder = factory.newDocumentBuilder();
+            InputSource is = new InputSource( new StringReader( format_string ) );
+            Document d = builder.parse( is );
+            page_response.appendChild(d);
+        }
+        catch( Exception ex ) {
+            logger.error("There was an exception "+ex);
+        }
+
+        //Element child = this.doc.createElement("div"); //format_string);
+        //Node text = this.doc.createTextNode(format_string); //"<h1>Hi there and greetings!</h1>");
+        //child.innerHTML = "<h1>Hi there and greetings!</h1>";
+        //child.setNodeValue(format_string);
+        //child.appendChild(text);
+        result.appendChild(page_response);
+        return result;
 	} else {
 	    String name = (String)params.get(GSParams.SYSTEM_MODULE_NAME);
Index: /main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 23332)
+++ /main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 23333)
@@ -7,10 +7,44 @@
 {
 
-    var formatStatement = document.getElementById('formatStatement');
-    console.log(formatStatement);
-    if(formatStatement.hasChildNodes())
-    {
-        var formatstring = traverse(formatStatement, "");
-        console.log(formatstring);
+    var formatStatement = document.getElementById('formatStatement').innerHTML;
+    //console.log(formatStatement);
+
+    //var myurl = 'http://localhost:8080/greenstone3/format?a=s&sa=s&t='+formatStatement;
+
+    //jQuery.post( url, [ data ], [ success(data, textStatus, XMLHttpRequest) ], [ dataType ] )
+
+    $.post("http://localhost:8080/greenstone3/format?a=s&sa=s", {data: formatStatement}, function(data) {
+        $('.result').innerHTML = data; //html(data);
+        console.log("Success, we have received data");
+        console.log(data);
+        }, 'html');
+
+/*
+    $.ajax({
+        type: "POST",
+        url: "http://localhost:8080/greenstone3/format?a=s&sa=s",
+        data: formatStatement,
+        processData: false,
+        success: function(data) {
+            //$('.result').html(data);
+            console.log("Success, we have received data");
+            //console.log(data);
+        }
+     });
+*/
+    /*
+    $.ajax({
+        url: myurl,
+        success: function(data) {
+            //$('.result').html(data);
+            console.log("Success, we have received data");
+            console.log(data);
+        }
+    });
+    */
+    //if(formatStatement.hasChildNodes())
+    //{
+        //var formatstring = traverse(formatStatement, "");
+        //console.log(formatstring);
 
         // var children = $(formatStatement).children('div');
@@ -35,5 +69,5 @@
         }
         */
-    }
+    //}
 }
 
Index: /main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl	(revision 23332)
+++ /main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl	(revision 23333)
@@ -262,4 +262,8 @@
                     </script>
 
+                    <div id="result">
+                    Here
+                    </div>
+
 					<div id="gs_footer">
 						<xsl:call-template name="poweredByGS3TextBar"/>
Index: /main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl	(revision 23332)
+++ /main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl	(revision 23333)
@@ -236,10 +236,10 @@
             <xsl:variable name="mode">
                 <xsl:choose>
-                    <xsl:when test="not(@mode)">MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="vertical"/></xsl:when>
-                    <xsl:otherwise>MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="{@mode}"/></xsl:otherwise>
+                    <xsl:when test="not(@mode)">MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="vertical"></input></xsl:when>
+                    <xsl:otherwise>MODE=<input class="mode" type="text" name="rawtextinput" size="10" value="{@mode}"></input></xsl:otherwise>
                 </xsl:choose>
             </xsl:variable>
     
-            <table class="header"><tbody><tr><td class="header">MATCH=<input class="match" type="text" name="rawtextinput" size="10" value="{@match}"/></td><td class="header"><xsl:copy-of select="$mode"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-plusthick" title="Click me to expand">[+]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table>
+            <table class="header"><tbody><tr><td class="header">MATCH=<input class="match" type="text" name="rawtextinput" size="10" value="{@match}"></input></td><td class="header"><xsl:copy-of select="$mode"/></td><td class="header"><a href="#" class="minmax ui-icon ui-icon-plusthick" title="Click me to expand">[+]</a></td><td class="header"><a href="#" class="remove ui-icon ui-icon-closethick" title="Click me to remove"/></td></tr></tbody></table>
 
                 <table class="table" border="1">
@@ -356,5 +356,5 @@
         <div class="block leaf gsf_text" title="gsf:text">
                 <xsl:variable name="rawtext"><xsl:value-of select="."/></xsl:variable>
-                <table class="header"><tbody><tr><td class="header"><input type="text" name="rawtextinput" size="10" value="{$rawtext}"/></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
+                <table class="header"><tbody><tr><td class="header"><input type="text" name="rawtextinput" size="10" value="{$rawtext}"></input></td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
         </div>
     </xsl:template>
