Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 23360)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java	(revision 23360)
@@ -0,0 +1,114 @@
+package org.greenstone.gsdl3.action;
+
+import org.greenstone.gsdl3.core.ModuleInterface;
+import org.greenstone.gsdl3.util.*;
+
+// XML classes
+import org.w3c.dom.Node; 
+import org.w3c.dom.Element; 
+import org.w3c.dom.Document; 
+
+// other java stuff
+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 java.io.*;
+import org.xml.sax.*;
+import javax.xml.parsers.SAXParserFactory; 
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.apache.log4j.*;
+
+public class FormatAction extends Action {
+    
+      static Logger logger = Logger.getLogger(org.greenstone.gsdl3.action.FormatAction.class.getName());
+
+    String tempVal = "";
+
+    /** process a request */
+    public Node process (Node message_node) {
+	
+	Element message = this.converter.nodeToElement(message_node);
+
+	// assume only one request
+	Element request = (Element)GSXML.getChildByTagName(message, GSXML.REQUEST_ELEM);
+	
+	String subaction = request.getAttribute(GSXML.SUBACTION_ATT);
+	String lang = request.getAttribute(GSXML.LANG_ATT);
+	String uid = request.getAttribute(GSXML.USER_ID_ATT);
+	// get the param list
+	Element cgi_param_list = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
+	HashMap params = GSXML.extractParams(cgi_param_list, false);
+
+	Element result = this.doc.createElement(GSXML.MESSAGE_ELEM);
+	
+	String coll = (String)params.get(GSParams.COLLECTION); //SYSTEM_CLUSTER);
+
+	String to = "";
+	if (coll!=null && !coll.equals("")) {
+	    to = coll;
+	}
+
+	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);
+	mr_request_message.appendChild(mr_request);
+	
+	Element format = this.doc.createElement(GSXML.FORMAT_STRING_ELEM);
+	mr_request.appendChild(format);
+
+    String format_string = (String)params.get("data");
+    
+    Element page_response = this.doc.createElement(GSXML.RESPONSE_ELEM);
+
+    Iterator it = params.keySet().iterator();
+    while(it.hasNext())
+    {
+        logger.error("Param: "+it.next());
+    }      
+
+    try {
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder builder = factory.newDocumentBuilder();
+            //String input = "<html><head><title></title></head><body>" + format_string + "</body></html>";
+            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));
+    } catch( Exception ex ) {
+            logger.error("There was an exception "+ex);
+            
+            StringWriter sw = new StringWriter();
+            PrintWriter pw = new PrintWriter(sw, true);
+            ex.printStackTrace(pw);
+            pw.flush();
+            sw.flush();
+            logger.error(sw.toString());
+    }
+
+
+    // Call XSLT to transform document to xml format string
+    this.transformer = new XMLTransformer();
+
+    // not sure what to do here - some code from Transforming Receptionist
+
+    // create a mesage to send to the collection object via the message router
+
+	Node response_message = this.mr.process(mr_request_message);
+	
+	result.appendChild(GSXML.duplicateWithNewName(this.doc, (Element)GSXML.getChildByTagName(response_message, GSXML.RESPONSE_ELEM), GSXML.RESPONSE_ELEM, true));
+	return result;
+	
+    }
+
+}
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java	(revision 23359)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/SystemAction.java	(revision 23360)
@@ -72,56 +72,5 @@
 	    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);
-
-         //SamParser sam = new SamParser();
-         //String format_statement = sam.parse(input);
-         //logger.error("format string="+format_statement);
-    
-        Element page_response = this.doc.createElement(GSXML.RESPONSE_ELEM);
-
-         Iterator it = params.keySet().iterator();
-         while(it.hasNext())
-         {
-            logger.error("Param: "+it.next());
-         }	
-
-        //Node text = this.doc.createTextNode(format_string);
-        //page_response.appendChild(text);
-    
-        
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            //String input = "<html><head><title></title></head><body>" + format_string + "</body></html>";
-            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));
-        }
-        catch( Exception ex ) {
-            logger.error("There was an exception "+ex);
-            
-            StringWriter sw = new StringWriter();
-            PrintWriter pw = new PrintWriter(sw, true);
-            ex.printStackTrace(pw);
-            pw.flush();
-            sw.flush();
-            logger.error(sw.toString());
-        }
-        
-    
-        //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 {
+	else {
 	    String name = (String)params.get(GSParams.SYSTEM_MODULE_NAME);
 	    String type = (String)params.get(GSParams.SYSTEM_MODULE_TYPE);
@@ -153,63 +102,3 @@
     }
 
-    /*
-    public void parse (String message) {
-        //get a factory
-        SAXParserFactory spf = SAXParserFactory.newInstance();
-        try {
-
-            //get a new instance of parser
-            SAXParser sp = spf.newSAXParser();
-            InputSource is = new InputSource( new StringReader( message ) );
-            //parse the file and also register this class for call backs
-            sp.parse(is, new SamParser());
-
-        }catch(SAXException se) {
-            se.printStackTrace();
-        }catch(ParserConfigurationException pce) {
-            pce.printStackTrace();
-        }catch (IOException ie) {
-            ie.printStackTrace();
-        }
-    }
-    */
-
-    //Event Handlers
-/*    public void startElement(String uri, String localName, String qName,
-        Attributes attributes) throws SAXException {
-        //reset
-        logger.error("Start Element: "+qName);
-        //if(qName.equalsIgnoreCase("Template")) {
-            //create a new instance of employee
-            //tempEmp = new Employee();
-            //tempEmp.setType(attributes.getValue("type"));
-            
-        //}
-    }
-
-
-    public void characters(char[] ch, int start, int length) throws SAXException {
-        tempVal = new String(ch,start,length);
-    }
-
-    public void endElement(String uri, String localName,
-        String qName) throws SAXException {
-
-        logger.error("Characters: "+tempVal);
-        logger.error("End Element: "+qName);
-        /*
-        if(qName.equalsIgnoreCase("Employee")) {
-            //add it to the list
-            myEmpls.add(tempEmp);
-
-        }else if (qName.equalsIgnoreCase("Name")) {
-            tempEmp.setName(tempVal);
-        }else if (qName.equalsIgnoreCase("Id")) {
-            tempEmp.setId(Integer.parseInt(tempVal));
-        }else if (qName.equalsIgnoreCase("Age")) {
-            tempEmp.setAge(Integer.parseInt(tempVal));
-        } */
-
-    //}
-
 }
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 23359)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 23360)
@@ -234,5 +234,7 @@
 
 	logger.debug("receptionist returned response");
+	logger.error("receptionist returned response");
 	logger.debug(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/util/GSXML.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 23359)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 23360)
@@ -75,4 +75,5 @@
   public static final String TERM_ELEM = "term";
   public static final String SYSTEM_ELEM = "system";
+  public static final String FORMAT_STRING_ELEM = "formatString";
   
   //config file elems
@@ -198,4 +199,6 @@
   // modify the requests
   public static final String REQUEST_TYPE_MESSAGING = "messaging";
+  // save the format string
+  public static final String REQUEST_TYPE_FORMAT_STRING = "formatString";
   
   // service types
Index: /main/trunk/greenstone3/web/interfaces/oran/interfaceConfig.xml
===================================================================
--- /main/trunk/greenstone3/web/interfaces/oran/interfaceConfig.xml	(revision 23359)
+++ /main/trunk/greenstone3/web/interfaces/oran/interfaceConfig.xml	(revision 23360)
@@ -21,4 +21,7 @@
     <action name='pr' class='ProcessAction' xslt='process.xsl'/>
     <action name='s' class='SystemAction' xslt='system.xsl'/>
+
+    <action name='f' class='FormatAction' xslt='formatString.xsl'/>
+
     <action name='g' class='GeneralAction'>
       <subaction name="authen" xslt='pages/authen.xsl'/>
Index: /main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 23359)
+++ /main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 23360)
@@ -16,5 +16,7 @@
     //jQuery.post( url, [ data ], [ success(data, textStatus, XMLHttpRequest) ], [ dataType ] )
 
-    $.post("http://localhost:8080/greenstone3/format?a=s&sa=s", {data: formatStatement}, function(data) {
+    // How do I find out my collection name?
+
+    $.post("http://localhost:8080/greenstone3/format?a=f", {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 23360)
+++ /main/trunk/greenstone3/web/interfaces/oran/transform/formatString.xsl	(revision 23360)
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<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">
+
+  <xsl:strip-space elements="*"/>
+  
+  <!-- style includes global params interface_name, library_name -->
+  
+  <!-- the main page layout template is here -->
+<!--
+  <xsl:template name="xml">
+        <xsl:param name="fmt" select="."/>
+
+        <xsl:apply-templates select="$fmt" mode="xml"/>
+    </xsl:template>
+
+  <xsl:template match="/">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="div">
+    <h1>a div</h1>
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="*">
+        <xsl:apply-templates/> 
+  </xsl:template>
+-->
+ 
+    <xsl:template name="xml">
+        <xsl:param name="fmt" select="."/>
+        <xsl:apply-templates select="$fmt" mode="xml"/>
+    </xsl:template>
+
+  <xsl:template match="td" mode="xml">
+    <xsl:choose>
+      <xsl:when test="@title">
+        <xsl:choose>
+          <xsl:when test="@title='td'">
+             <xsl:text disable-output-escaping="yes">&lt;td valign="</xsl:text>
+             <xsl:value-of select="@valign"/>
+             <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
+             <xsl:apply-templates mode="xml"/> 
+             <xsl:text disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates mode="xml"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="xml"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>    
+
+  <xsl:template match="div" mode="xml">
+    <xsl:choose>
+      <xsl:when test="@title">
+        <xsl:choose>
+
+          <!-- GSF TEMPLATE -->
+          <xsl:when test="@title='gsf:template'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:template</xsl:text>
+            <xsl:apply-templates mode="input"/>  
+            <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+            <xsl:apply-templates mode="xml"/> 
+            <xsl:text disable-output-escaping="yes">&lt;/gsf:template&gt;</xsl:text>
+          </xsl:when>
+
+          <!-- GSF METADATA -->
+          <xsl:when test="@title='gsf:metadata'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:metadata name="</xsl:text>
+            <!-- if combo is successful then don't do text - probably need to put combo in variable and test it -->
+            <xsl:variable name="metadata_test">
+              <xsl:apply-templates mode="combo"/>
+            </xsl:variable>
+            <xsl:choose>
+              <xsl:when test="$metadata_test=''">
+                <xsl:apply-templates mode="text"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$metadata_test"/>
+              </xsl:otherwise>
+            </xsl:choose>
+            <xsl:text disable-output-escaping="yes">"/&gt;</xsl:text>
+          </xsl:when>
+
+          <!-- GSF LINK -->
+          <xsl:when test="@title='gsf:link'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:link type="</xsl:text>
+            <xsl:apply-templates mode="combo"/>
+            <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
+            <xsl:apply-templates mode="xml"/>
+            <xsl:text disable-output-escaping="yes">&lt;/gsf:link&gt;</xsl:text>
+          </xsl:when>
+
+          <!-- GSF ICON -->
+          <xsl:when test="@title='gsf:icon'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:icon type="</xsl:text>  
+            <xsl:apply-templates mode="combo"/>
+            <xsl:text disable-output-escaping="yes">"&gt;&lt;/gsf:icon&gt;</xsl:text>  
+          </xsl:when>
+
+          <!-- GSF CHOOSE -->
+          <xsl:when test="@title='gsf:choose-metadata'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:choose-metadata&gt;</xsl:text>
+            <xsl:apply-templates mode="xml"/>
+            <xsl:text disable-output-escaping="yes">&lt;/gsf:choose-metadata&gt;</xsl:text>  
+          </xsl:when>
+         
+          <!-- GSF SWITCH -->
+          <xsl:when test="@title='gsf:switch'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:switch&gt;</xsl:text>
+            <xsl:apply-templates mode="xml"/>
+            <xsl:text disable-output-escaping="yes">&lt;/gsf:switch&gt;</xsl:text>
+          </xsl:when> 
+
+          <xsl:when test="@title='gsf:when'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:when test="exists"&gt;</xsl:text>
+            <xsl:apply-templates mode="xml"/>
+            <xsl:text disable-output-escaping="yes">&lt;/gsf:when&gt;</xsl:text>
+          </xsl:when>
+
+          <xsl:when test="@title='gsf:text'">
+            <xsl:apply-templates mode="text"/>  
+          </xsl:when>
+
+          <xsl:when test="@title='gsf:otherwise'">
+            <xsl:apply-templates mode="xml"/>
+          </xsl:when>
+
+          <xsl:when test="@title='gsf:default'">
+            <xsl:text disable-output-escaping="yes">&lt;gsf:default&gt;</xsl:text>
+            <xsl:apply-templates mode="xml"/>
+            <xsl:text disable-output-escaping="yes">&lt;/gsf:default&gt;</xsl:text>
+          </xsl:when>
+
+          <xsl:otherwise>
+            <xsl:apply-templates mode="xml"/>
+          </xsl:otherwise>
+
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-templates mode="xml"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+    
+  <!-- Strip out any plain text -->
+  <xsl:template match="text()" mode="xml">
+    <xsl:apply-templates mode="xml"/>
+  </xsl:template>
+ 
+  <!-- Catch all -->
+  <xsl:template match="*" mode="xml">
+    <xsl:apply-templates mode="xml"/> 
+  </xsl:template> 
+
+  <!-- ********************************************************************************************* -->
+
+  <!-- KEEP TEXT mode -->
+
+  <!-- Strip out any plain text -->
+  <xsl:template match="text()" mode="text">
+    <xsl:text></xsl:text><xsl:value-of select="." disable-output-escaping="yes"/><xsl:text></xsl:text>
+    <xsl:apply-templates mode="text"/>
+  </xsl:template>
+
+  <!-- Catch all -->
+  <xsl:template match="*" mode="text">
+    <xsl:apply-templates mode="text"/>
+  </xsl:template>
+
+  <!-- ********************************************************************************************* -->
+
+  <!-- INPUT mode - responsible for finding text in input tags -->
+  
+  <xsl:template match="*" mode="input">
+    <xsl:apply-templates mode="input"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="input">
+    <xsl:apply-templates mode="input"/>
+  </xsl:template>
+
+  <xsl:template match="input" mode="input">
+    <xsl:choose>
+    <xsl:when test="@class='match'">
+        <xsl:text disable-output-escaping="yes"> match="</xsl:text><xsl:value-of select="@value"/><xsl:text disable-output-escaping="yes">"</xsl:text>
+    </xsl:when>
+    <xsl:when test="@class='mode'">
+        <xsl:text disable-output-escaping="yes"> mode="</xsl:text><xsl:value-of select="@value"/><xsl:text disable-output-escaping="yes">"</xsl:text>
+    </xsl:when>
+    </xsl:choose>
+  </xsl:template>    
+  
+  <!-- ********************************************************************************************* -->
+
+  <!-- RAW TEXT mode -->
+ 
+  <xsl:template match="*" mode="text">
+    <xsl:apply-templates mode="text"/>
+  </xsl:template>
+
+  <xsl:template match="input" mode="text">
+    <xsl:choose>
+    <xsl:when test="@class='text'">
+        <xsl:value-of select="@value"/>
+    </xsl:when>
+    </xsl:choose>
+  </xsl:template> 
+
+  <!-- COMBO mode - responsible for extracting value from combo box -->
+
+  <xsl:template match="*" mode="combo">
+    <xsl:apply-templates mode="combo"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="combo">
+    <xsl:apply-templates mode="combo"/>
+  </xsl:template>
+
+  <xsl:template match="div" mode="combo">
+  </xsl:template>  
+
+  <xsl:template match="option" mode="combo">
+    <xsl:if test="@selected">
+      <xsl:value-of select="@value"/>
+    </xsl:if>
+  </xsl:template>
+
+
+  <!-- ********************************************************************************************* -->
+
+  <!-- Main page generation -->
+
+  <xsl:template match="page">
+    <html>
+      <head>
+	<title>
+	  <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
+	</title>
+      </head>
+      <body>
+        <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:call-template><xsl:text> </xsl:text>
+        <!-- <xsl:apply-templates select="/page/pageResponse" mode="xml"/> -->
+      </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:stylesheet>
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 23359)
+++ /main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl	(revision 23360)
@@ -391,6 +391,6 @@
         <!-- <xsl:text>&lt;br/&gt;</xsl:text> <br/> -->
         <div class="block leaf gsf_text" title="gsf:text">
-                <xsl:variable name="rawtext"><xsl:text disable-output-escaping='no'>&lt;br/&gt;</xsl:text></xsl:variable>
-                <table class="header"><tbody><tr><td class="header"><input class="text" 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>
+                <!-- <xsl:variable name="rawtext"><xsl:text disable-output-escaping='no'>br/</xsl:text></xsl:variable> -->
+                <table class="header"><tbody><tr><td class="header">&lt;<input class="text" type="text" name="rawtextinput" size="10" value="br/"></input>&gt;</td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
         </div>
     
@@ -408,6 +408,6 @@
         <!-- <xsl:text>&lt;br/&gt;</xsl:text> <br/> -->
         <div class="block leaf gsf_text" title="gsf:text">
-                <xsl:variable name="rawtext"><xsl:text disable-output-escaping='no'>&lt;i&gt;</xsl:text></xsl:variable>
-                <table class="header"><tbody><tr><td class="header"><input class="text" 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>
+                <!-- <xsl:variable name="rawtext"><xsl:text disable-output-escaping='no'>i</xsl:text></xsl:variable> -->
+                <table class="header"><tbody><tr><td class="header">&lt;<input class="text" type="text" name="rawtextinput" size="10" value="i"></input>&gt;</td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
         </div>
     
@@ -418,6 +418,6 @@
 
         <div class="block leaf gsf_text" title="gsf:text">
-                <xsl:variable name="rawtext"><xsl:text disable-output-escaping='no'>&lt;/i&gt;</xsl:text></xsl:variable>
-                <table class="header"><tbody><tr><td class="header"><input class="text" 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>
+                <xsl:variable name="rawtext"><xsl:text disable-output-escaping='no'>/i</xsl:text></xsl:variable>
+                <table class="header"><tbody><tr><td class="header">&lt;<input class="text" type="text" name="rawtextinput" size="10" value="{$rawtext}"></input>&gt;</td><td class="header"><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
         </div>
 
Index: /main/trunk/greenstone3/web/interfaces/oran/transform/system.xsl
===================================================================
--- /main/trunk/greenstone3/web/interfaces/oran/transform/system.xsl	(revision 23359)
+++ /main/trunk/greenstone3/web/interfaces/oran/transform/system.xsl	(revision 23360)
@@ -169,5 +169,5 @@
   <!-- Strip out any plain text -->
   <xsl:template match="text()" mode="text">
-    <xsl:text></xsl:text> <xsl:value-of select="."/><xsl:text></xsl:text>
+    <xsl:text></xsl:text><xsl:value-of select="." disable-output-escaping="yes"/><xsl:text></xsl:text>
     <xsl:apply-templates mode="text"/>
   </xsl:template>
