Index: trunk/gsdl3/web/interfaces/default/transform/about.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/about.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/about.xsl	(revision 4712)
@@ -3,6 +3,9 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:java="http://xml.apache.org/xslt/java"
-  extension-element-prefixes="java">
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
   
+  <!-- style includes global params interface_name, page_lang, library_name -->
   <xsl:include href="style.xsl"/>
   
@@ -11,68 +14,68 @@
   <xsl:template name="pageHead">
     <head>
-      <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
+      <title>
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+      </title>
     </head>
   </xsl:template>
 
   <xsl:template match="pageResponse">
-    <xsl:variable name="collName" select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/>
+    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
     <xsl:apply-templates select="collection|serviceCluster"><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>
   </xsl:template>
-
-<xsl:template match="collection|serviceCluster">
-<xsl:param name="collName">coll-name</xsl:param>
-<xsl:if test='name()="collection"'>
-  <xsl:call-template name="collectionPageBanner">
-    <xsl:with-param name="collName" select="$collName"/>
-  </xsl:call-template>
-</xsl:if>
-<xsl:if test='name()="serviceCluster"'>
-<xsl:call-template name="clusterPageBanner">
-<xsl:with-param name="clusterName" select="$collName"/>
-</xsl:call-template>
-</xsl:if>
-<p/><xsl:apply-templates select="metadataList">
-<xsl:with-param name="collName" select="$collName"/>
-</xsl:apply-templates>
-<p/><xsl:apply-templates select="serviceList">
-<xsl:with-param name="collName" select="$collName"/>
-</xsl:apply-templates>
-</xsl:template>
-
-
-<xsl:template match="metadataList">
-<xsl:param name="collName">coll-name</xsl:param>
-<h2><xsl:call-template name="text"><xsl:with-param name="key">about.description</xsl:with-param></xsl:call-template></h2>
-<p/>
-<table width='537'>
-<xsl:for-each select="metadata">
-<tr valign='top'><td><b><xsl:value-of select="@name"/></b></td><td><xsl:value-of select="."/></td></tr>
-</xsl:for-each>
-</table>
-</xsl:template>
-
-<xsl:template match="serviceList">
-<xsl:param name="collName">coll-name</xsl:param>
-<xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
-<h2><xsl:call-template name="text"><xsl:with-param name="key">about.services</xsl:with-param></xsl:call-template></h2>
-<xsl:if test="count(service) > 0">
-<table>
-<xsl:for-each select="service">
-<xsl:variable name="action"><xsl:choose>
-	    <xsl:when test="@type='query'">q</xsl:when>
-	    <xsl:when test="@type='browse'">b</xsl:when>
-	    <xsl:when test="@type='process'">pr</xsl:when>
-	    <xsl:when test="@type='applet'">a</xsl:when>
-	    <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
-</xsl:choose></xsl:variable>
-<xsl:if test="$action !='DO_NOT_DISPLAY'">
-<tr><td><a href="{$library}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="@name"/></a></td></tr>
-</xsl:if>
-</xsl:for-each>
-</table>
-</xsl:if>
-<xsl:call-template name="greenBar"/>
-</xsl:template>
-
+  
+  <xsl:template match="collection|serviceCluster">
+    <xsl:param name="collName"/>
+    <xsl:if test='name()="collection"'>
+      <xsl:call-template name="collectionPageBanner">
+	<xsl:with-param name="collName" select="$collName"/>
+      </xsl:call-template>
+    </xsl:if>
+    <xsl:if test='name()="serviceCluster"'>
+      <xsl:call-template name="clusterPageBanner">
+	<xsl:with-param name="clusterName" select="$collName"/>
+      </xsl:call-template>
+    </xsl:if>
+    <p/><xsl:apply-templates select="metadataList">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:apply-templates>
+    <p/><xsl:apply-templates select="serviceList">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:apply-templates>
+  </xsl:template>
+  
+  
+  <xsl:template match="metadataList">
+    <xsl:param name="collName"/>
+    <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.description')"/></h2>
+    <p/>
+    <table width='537'>
+      <xsl:for-each select="metadata">
+	<tr valign='top'><td><b><xsl:value-of select="@name"/></b></td><td><xsl:value-of select="."/></td></tr>
+      </xsl:for-each>
+    </table>
+  </xsl:template>
+  
+  <xsl:template match="serviceList">
+    <xsl:param name="collName"/>
+    <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h2>
+    <xsl:if test="count(service) > 0">
+      <table>
+	<xsl:for-each select="service">
+	  <xsl:variable name="action"><xsl:choose>
+	      <xsl:when test="@type='query'">q</xsl:when>
+	      <xsl:when test="@type='browse'">b</xsl:when>
+	      <xsl:when test="@type='process'">pr</xsl:when>
+	      <xsl:when test="@type='applet'">a</xsl:when>
+	      <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
+	    </xsl:choose></xsl:variable>
+	  <xsl:if test="$action !='DO_NOT_DISPLAY'">
+	    <tr><td><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="@name"/></a></td></tr>
+	  </xsl:if>
+	</xsl:for-each>
+      </table>
+    </xsl:if>
+    <xsl:call-template name="greenBar"/>
+  </xsl:template>
 
 
Index: trunk/gsdl3/web/interfaces/default/transform/applet.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/applet.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/applet.xsl	(revision 4712)
@@ -1,5 +1,9 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
   
   <xsl:include href="style.xsl"/>
@@ -10,5 +14,5 @@
     <head>
       <title>
-	<xsl:value-of select="ancestor-or-self::page/pageResponse/applet"/>
+	<xsl:value-of select="pageResponse/applet"/>
       </title>
     </head>
Index: trunk/gsdl3/web/interfaces/default/transform/basicquery.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/basicquery.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/basicquery.xsl	(revision 4712)
@@ -1,6 +1,11 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
   
+  <!-- style includes global params interface_name, library_name -->
   <xsl:include href="style.xsl"/>
   <xsl:include href="service-params.xsl"/>
@@ -11,11 +16,12 @@
   <xsl:template name="pageHead">
     <head>
-      <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
+      <title>
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+      </title>
     </head>
   </xsl:template>
 
   <xsl:template match="pageResponse">
-    <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
-    <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
     <center>
       <xsl:call-template name="collectionPageBanner">
@@ -29,5 +35,4 @@
     <xsl:if test="documentNodeList">
       <xsl:call-template name="query-response">
-	<xsl:with-param name="library" select="$library"/>
 	<xsl:with-param name="collName" select="$collName"/>
       </xsl:call-template>
@@ -35,7 +40,7 @@
     <xsl:call-template name="greenBar"/>
   </xsl:template>
+
   
   <xsl:template name="query-response">
-    <xsl:param name="library"/>
     <xsl:param name="collName"/>
     <xsl:call-template name="greenBarResults"/>
@@ -45,5 +50,5 @@
     <xsl:if test="count(termList/term) > 0">
       <small>
-	<xsl:call-template name="text"><xsl:with-param name="key">query.wordcount</xsl:with-param></xsl:call-template> 
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.wordcount')"/>
 	<xsl:for-each select="termList/term">
 	  <xsl:if test="position() > 1">, </xsl:if>
@@ -59,11 +64,11 @@
       <xsl:choose>
 	<xsl:when test="$numDocsMatched='0'">
-	  <xsl:call-template name="text"><xsl:with-param name="key">query.nodocsmatch</xsl:with-param></xsl:call-template>
+	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
 	</xsl:when>
 	<xsl:when test="$numDocsMatched='1'">
-	  <xsl:call-template name="text"><xsl:with-param name="key">query.onedocsmatch</xsl:with-param></xsl:call-template>
+	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch')"/>
 	</xsl:when>
 	<xsl:otherwise>
-	  <xsl:value-of select="$numDocsMatched"/> documents matched the query.
+	  <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $numDocsMatched)"/>
 	</xsl:otherwise>
       </xsl:choose>
@@ -71,8 +76,8 @@
     
     <!-- next and prev links at top of results-->
-    <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library"/></xsl:call-template>
+    <xsl:call-template name="result-navigation"/>
     <!-- Display the matching documents -->
-    <xsl:variable name="hp"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
-    <xsl:variable name="hn" select="ancestor::page/pageRequest/paramList/param[@name='hn']/@value"/>      
+    <xsl:variable name="hp"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
+    <xsl:variable name="hn" select="/page/pageRequest/paramList/param[@name='hn']/@value"/>      
     <table>
       <tr valign="top">
@@ -89,5 +94,5 @@
     </table>
     <!-- next and prev links at bottom of page -->
-    <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library"/></xsl:call-template>
+    <xsl:call-template name="result-navigation"/>
   </xsl:template>
 
@@ -97,7 +102,6 @@
     <xsl:param name="collName"/>
     <xsl:variable name="subaction" select="../pageRequest/@subaction"/>
-    <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
     <h3><xsl:value-of select="display/name"/></h3><p/>
-    <form name="QueryForm" method="get" action="/gsdl3/{$library}">
+    <form name="QueryForm" method="get" action="/gsdl3/{$library_name}">
       <input type="hidden" name="a" value="q"/>
       <input type="hidden" name="sa" value="{$subaction}"/>
@@ -122,5 +126,5 @@
 	  <xsl:otherwise>
 	    <xsl:variable name="pname" select="@name"/>
-	    <xsl:variable name="pvalue"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:variable>
+	    <xsl:variable name="pvalue"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:variable>
 	    <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/></xsl:apply-templates></td></tr>
 	  </xsl:otherwise>
@@ -157,8 +161,6 @@
   <xsl:template match="documentNode">
     <xsl:param name="collName"/>
-    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
-    
     <td>
-      <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if></xsl:attribute>
+      <a><xsl:attribute name="href"><xsl:value-of select='/page/pageExtra/config/library_name'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@documentType'/></xsl:attribute>
 	<xsl:apply-templates select="." mode="displayNodeIcon"/>
       </a>
Index: trunk/gsdl3/web/interfaces/default/transform/classifier.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/classifier.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/classifier.xsl	(revision 4712)
@@ -3,18 +3,21 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:java="http://xml.apache.org/xslt/java"
-  extension-element-prefixes="java">
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
   
   <xsl:include href="style.xsl"/>
 
   <xsl:output method="html"/>  
-
+  
+  
   <xsl:template name="pageHead">
     <head>
-      <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
+      <title><xsl:value-of select="util:getInterfaceText($interface_name, page/@lang, 'gsdl')"/></title>
     </head>
   </xsl:template>
 
   <xsl:template match="pageResponse">
-    <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
     <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
     <center>
@@ -37,6 +40,5 @@
     <xsl:param name="collName"/>
     <xsl:param name="serviceName"/>
-    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
-    <xsl:variable name="selected" select="ancestor::page/pageResponse/classifier/@name"/>
+    <xsl:variable name="selected" select="/page/pageResponse/classifier/@name"/>
     <table width='537'><tr>
 	<xsl:for-each select="classifier">
@@ -47,6 +49,6 @@
 	    </xsl:when>
 	    <xsl:otherwise>
-	      <td align='center'><a href="{$library}?a=b&amp;rt=r&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="ancestor::service/display/classifier[@name=$cname]/name"/></a></td></xsl:otherwise></xsl:choose>
-	</xsl:for-each>
+	      <td align='center'><a href="{$library_name}?a=b&amp;rt=r&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="ancestor::service/display/classifier[@name=$cname]/name"/></a></td></xsl:otherwise></xsl:choose>
+ 	</xsl:for-each>
       </tr></table>
     <xsl:call-template name="greenBar"/>
@@ -59,6 +61,6 @@
     <xsl:param name="serviceName"/>
     <xsl:variable name="cl_name"><xsl:value-of select="@name"/></xsl:variable>
-    <xsl:variable name="interleave"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@documentInterleave"/></xsl:variable>
-    <xsl:variable name="orientation"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable>
+    <xsl:variable name="interleave"><xsl:value-of select="/page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@documentInterleave"/></xsl:variable>
+    <xsl:variable name="orientation"><xsl:value-of select="/page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable>
     <xsl:variable name='mode'><xsl:value-of select='$orientation'/>-<xsl:value-of select='$interleave'/></xsl:variable>
     <!-- cant seem to do this any other way, ie mode='{$mode}' doesn't work -->
@@ -165,6 +167,5 @@
   <xsl:template match="documentNode">
     <xsl:param name="collName"/>
-    <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
-    <td><a href="{$library}?a=d&amp;c={$collName}&amp;d={@nodeID}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
+    <td><a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
   </xsl:template>
   
@@ -173,6 +174,5 @@
     <xsl:param name="collName"/>
     <xsl:param name="serviceName"/>
-    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
-    <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><img src='interfaces/default/images/bshelf.gif' border='0' width='20' height='16' /></a></td><td align='left'><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
+    <td><a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><img src='interfaces/default/images/bshelf.gif' border='0' width='20' height='16' /></a></td><td align='left'><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
   </xsl:template>
   
@@ -180,8 +180,7 @@
   <!--
   <xsl:template match="classifierNode">
-    <xsl:param name="collName"/>
-    <xsl:param name="serviceName"/>
-    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
-    <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></td>
+  <xsl:param name="collName"/>
+  <xsl:param name="serviceName"/>
+  <td><a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></td>
   </xsl:template>
   -->
Index: trunk/gsdl3/web/interfaces/default/transform/config_format.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/config_format.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/config_format.xsl	(revision 4712)
@@ -11,5 +11,4 @@
     stylesheet-prefix="xslt" result-prefix="xsl"/>
 
-
   <xsl:template match="format">
     <format hello="yes">
@@ -23,9 +22,8 @@
       <xsl:attribute name="priority">2</xsl:attribute> 
       <xsl:if test=".//gsf:link/@type">
-	<xslt:param name="serviceName">service-name</xslt:param>
+	<xslt:param name="serviceName"/>
       </xsl:if>
       <xsl:if test=".//gsf:link">
-	<xslt:param name="collName">coll-name</xslt:param>
-	<xslt:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
+	<xslt:param name="collName"/>
       </xsl:if>
       <xsl:apply-templates/>
@@ -36,12 +34,17 @@
     <xsl:choose>
       <xsl:when test="@type='classifier'">
-	<a><xslt:attribute name='href'><xslt:value-of select='$library'/>?a=b&amp;rt=r&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if><xslt:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</xslt:if></xslt:attribute>
+	<a><xslt:attribute name='href'><xslt:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if><xslt:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</xslt:if></xslt:attribute>
 	  <xsl:apply-templates/>
 	</a>
       </xsl:when>
       <xsl:otherwise> <!-- a document link -->
-	<a><xsl:attribute name="href">{$library}?a=d&amp;c={$collName}&amp;d={@nodeID}</xsl:attribute>
-	  <xsl:apply-templates/>
-	</a>
+	<xsl:choose>
+	  <xsl:when test="/format/@type = 'search'">
+	    <a><xsl:attribute name="href">{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}&amp;dt={@documentType}</xsl:attribute><xsl:apply-templates/></a>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <a><xsl:attribute name="href">{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}</xsl:attribute><xsl:apply-templates/></a>
+	  </xsl:otherwise>
+	</xsl:choose>
       </xsl:otherwise>
     </xsl:choose>
Index: trunk/gsdl3/web/interfaces/default/transform/document.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/document.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/document.xsl	(revision 4712)
@@ -1,19 +1,21 @@
 <?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:include href="style.xsl"/>
-<xsl:include href="service-params.xsl"/>
-<xsl:output method="html"/>
-<!--
-<xsl:output method="xml"/>
--->
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <xsl:include href="style.xsl"/>
+  <xsl:include href="service-params.xsl"/>
+  <xsl:output method="html"/>
+  <!--
+  <xsl:output method="xml"/>
+  -->
 
   <xsl:template name="pageHead">
-    <xsl:variable name="docID" select="ancestor::page/pageResponse/document/@selectedNode"/>
+    <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/>
     <head>
-      <title><xsl:for-each select='ancestor::page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode'><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each></title>
+      <title><xsl:for-each select='/page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode'><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each></title>
       <xsl:call-template name="css-style"/>
     </head>
@@ -34,5 +36,5 @@
   
   <xsl:template match="pageResponse">
-    <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
     <center>
       <xsl:call-template name="collectionPageBanner">
@@ -41,7 +43,7 @@
       
       <!-- display the document -->
-      <xsl:call-template name="display-document">
+      <xsl:apply-templates select="document">
 	<xsl:with-param name="collName" select="$collName"/>
-      </xsl:call-template>
+      </xsl:apply-templates>
     </center>
     
@@ -49,21 +51,115 @@
   </xsl:template>
 	
-  <xsl:template name="display-document">
-    <xsl:param name="collName"/>
-    <!-- Display table of contents -->
+  <xsl:template match="document">
+    <xsl:param name="collName"/>
     <p/>
+    <xsl:call-template name="documentHeading">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+    <p/>
+    <xsl:call-template name="documentContent">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <!-- hierarchical document -->
+  <xsl:template name="documentHeading">
+    <xsl:param name="collName"/>
     <table width="537" cellpadding="0" cellspacing="0">
       <tr>
-	<!--  modes are table-of-contents and  paged-naviagtion-->
-	<!--<xsl:apply-templates select="document" mode='paged-navigation'>-->
-	<xsl:apply-templates select="document" mode='table-of-contents'>
+	<td valign="top" align="left" width="200">
+	  <xsl:call-template name="coverImage"/>
+	  <p/>
+	  <xsl:call-template name="enrichServices">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>
+	</td>
+	<td valign="top">
+	  <xsl:call-template name="TOC">
+	    <xsl:with-param name="collName" select="$collName"/>
+	  </xsl:call-template>
+	</td>
+      </tr>
+    </table>
+  </xsl:template>
+
+  <xsl:template name="coverImage">
+    <img><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
+  </xsl:template>
+
+  <xsl:template name="TOC">
+    <xsl:param name="collName"/>
+    <xsl:choose>
+      <xsl:when test="@documentType='hierarchy'">
+	<xsl:call-template name="hierarchicalContents">
 	  <xsl:with-param name="collName" select="$collName"/>
-	</xsl:apply-templates>
-      </tr>
-    </table>
+	</xsl:call-template>
+      </xsl:when>
+      <xsl:when test="@documentType='paged'">
+	<xsl:call-template name="pagedContents">
+	  <xsl:with-param name="collName" select="$collName"/>
+	</xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+	<!-- just print the title of teh one and only docNode -->
+	<xsl:value-of select="documentNode/metadataList/metadata[@name='Title']"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="hierarchicalContents">
+    <xsl:param name="collName"/>
+    <xsl:apply-templates select="documentNode[@nodeID]">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="depth" select="0"/>
+    </xsl:apply-templates>
+  </xsl:template>
+  
+  <xsl:template match="documentNode">
+    <xsl:param name="collName"/>
+    <xsl:param name="depth"/>
+    <xsl:variable name="space" select="$depth * 25"/>
     
-    <!-- Display document content -->
+    <table>
+      <tr valign="top">
+	<td>
+	  <xsl:if test="not($depth = '0')">
+	    <img src="interfaces/default/images/space.gif" width="{$space}"/>
+	  </xsl:if>
+	</td>
+	
+	<!-- Display the appropriate image, depending on the node type -->
+	<td valign="top">
+	  <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if></xsl:attribute>
+	    <xsl:apply-templates select="." mode="displayNodeIcon"/>
+	  </a>
+	</td>
+	
+	<!-- Display associated title, bolded if the node has content -->
+	<td valign="top">
+	  <xsl:choose>
+	    <xsl:when test="nodeContent">
+	      <b><xsl:value-of select="metadataList/metadata[@name='Title']"/></b>
+	    </xsl:when>
+	    <xsl:otherwise>
+	      <xsl:value-of select="metadataList/metadata[@name='Title']"/>
+	    </xsl:otherwise>
+	  </xsl:choose>
+	</td>
+      </tr>
+    </table>    
+    <!-- Apply recursively to the children of this node -->
+    <xsl:apply-templates select="documentNode[@nodeID]">
+      <xsl:with-param name="collName" select="$collName"/>
+      <xsl:with-param name="depth" select="$depth + 1"/>
+    </xsl:apply-templates>
+  </xsl:template>
+  
+
+  <!-- default content is to process any nodeContent elements and print out their text -->
+  <xsl:template name="documentContent">
     <xsl:apply-templates select="descendant::documentNode/nodeContent"/>
   </xsl:template>
+  
 
   <!-- the actual text/content -->
@@ -84,154 +180,76 @@
   </xsl:template>
 
-
-  <xsl:template match="annotation"><span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span></xsl:template>
-  
-  <xsl:template match="document" mode="table-of-contents">
-    <xsl:param name="collName"/>
-    <xsl:variable name="httpPath" select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
-    <xsl:variable name="archivedir" select="metadataList/metadata[@name='archivedir']"/>
-    <!-- Display cover image -->
-    <td valign="top" align="left" width="200">
-      <img><xsl:attribute name='src'><xsl:value-of select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
-      <p />
-      <!-- display the enrich service options here -->
-      <xsl:apply-templates select="../serviceList">
-	<xsl:with-param name="collName" select="$collName"/>
-      </xsl:apply-templates>
-
-    </td>
-    <!-- Display the hierarchical structure -->
-    <td valign="top">
-      <xsl:apply-templates select="documentNode[@nodeID]">
-	<xsl:with-param name="collName" select="$collName"/>
-	<xsl:with-param name="depth" select="0"/>
-      </xsl:apply-templates>
-    </td>
-    
-  </xsl:template>
-
+  <!-- match any annotations and make them span elements -->
+  <xsl:template match="annotation">
+    <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span>
+  </xsl:template>
+
+
+ 
   <!-- paged naviagtion : INCOMPLETE!!-->
-  <xsl:template match="document" mode="paged-navigation">
-    <xsl:param name="collName"/>
-    <xsl:variable name="library" select="ancestor::page/config/library_name"/>
+  <xsl:template name="pagedContents">
+    <xsl:param name="collName"/>
     <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/>
     <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/>
     <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/>
-    <td valign="left">
-      <table>
-	<xsl:choose>
-	  <xsl:when test="$pos=-1"><!-- a doc -->
-	    <tr valign="top">
-	      <td align="left">
-	      </td>
-	      <td align="center"><center>
-		  <b><xsl:value-of select="$children"/> pages.</b>
-		</center></td>
-	      <td align="right">
-		<a href="{$library}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
-	      </td>
-	    </tr>
-	  </xsl:when>
-	  
-	  <xsl:otherwise> <!-- an internal node -->	  
-	    <tr valign="top">
-	      <td align="left">
-		<xsl:if test=" not ( $pos = 1 )">
-		  <a href="{$library}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/nzdl/images/less.gif" border="0" align="absbottom" /></a>
-		</xsl:if>
-	      </td>
-	      <td align="center"><center>
-		  <b>Page <xsl:value-of select="$pos"/> of <xsl:value-of select="$length"/>.</b>
-		</center></td>
-	      <td align="right">
-		<xsl:if test=" not($pos = $length)">
-		  <a href="{$library}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
-		</xsl:if>
-	      </td>
-	    </tr>
-	  </xsl:otherwise>
-	</xsl:choose>
-	<tr valign="middle">
-	  <td align='center' valign='top' colspan='3'> goto form
-	  </td>
-	</tr>
+    <table>
+      <xsl:choose>
+	<xsl:when test="$pos=-1"><!-- a doc -->
+	  <tr valign="top">
+	    <td align="left">
+	    </td>
+	    <td align="center"><center>
+		<b><xsl:value-of select="$children"/> pages.</b>
+	      </center></td>
+	    <td align="right">
+	      <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
+	    </td>
+	  </tr>
+	</xsl:when>
+	
+	<xsl:otherwise> <!-- an internal node -->	  
+	  <tr valign="top">
+	    <td align="left">
+	      <xsl:if test=" not ( $pos = 1 )">
+		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/nzdl/images/less.gif" border="0" align="absbottom" /></a>
+	      </xsl:if>
+	    </td>
+	    <td align="center"><center>
+		<b>Page <xsl:value-of select="$pos"/> of <xsl:value-of select="$length"/>.</b>
+	      </center></td>
+	    <td align="right">
+	      <xsl:if test=" not($pos = $length)">
+		<a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
+	      </xsl:if>
+	    </td>
+	  </tr>
+	</xsl:otherwise>
+      </xsl:choose>
+      <tr valign="middle">
+	<td align='center' valign='top' colspan='3'> goto form
+	</td>
+      </tr>
+    </table>
+  </xsl:template>
+  
+  <xsl:template name="enrichServices">
+    <xsl:param name="collName"/>
+    <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
+    <xsl:for-each select="../serviceList/service">
+      <table border='1' cellspacing='0'>
+	<tr><td>
+	    <p /><xsl:value-of select="display/name"/><p/>
+	    <form name="EnrichForm" method="get" action="/gsdl3/{$library_name}">
+	      <xsl:apply-templates select="paramList"/>
+	      <input type='hidden' name='a' value='d'/>
+	      <input type='hidden' name='d' value='{$docID}'/>
+	      <input type='hidden' name='c' value='{$collName}'/>
+	      <xsl:if test='/page/pageRequest/paramList/param[@name="sib"]'>
+		<input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='/page/pageRequest/paramList/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
+	      <input type='hidden' name='s' value='{@name}'/>
+	      <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
+	    </form>
+	  </td></tr>
       </table>
-    </td>
-    <td valign="top" align="right" width="200">
-    <img><xsl:attribute name='src'><xsl:value-of select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
-      <p />
-      <!-- display the enrich service options here -->
-      <xsl:apply-templates select="../serviceList">
-	<xsl:with-param name="collName" select="$collName"/>
-      </xsl:apply-templates>
-      
-    </td>
-  </xsl:template>
-  
-
-
-  <xsl:template match="documentNode">
-    <xsl:param name="collName"/>
-    <xsl:param name="depth"/>
-    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
-    <xsl:variable name="space" select="$depth * 25"/>
-    
-    <table>
-      <tr valign="top">
-	<td>
-	  <xsl:if test="not($depth = '0')">
-	    <img src="interfaces/default/images/space.gif" width="{$space}"/>
-	  </xsl:if>
-	</td>
-	
-	<!-- Display the appropriate image, depending on the node type -->
-	<td valign="top">
-	  <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if></xsl:attribute>
-	    <xsl:apply-templates select="." mode="displayNodeIcon"/>
-	  </a>
-	</td>
-	
-	<!-- Display associated title, bolded if the node has content -->
-	<td valign="top">
-	  <xsl:choose>
-	    <xsl:when test="nodeContent">
-	      <b><xsl:value-of select="metadataList/metadata[@name='Title']"/></b>
-	    </xsl:when>
-	    <xsl:otherwise>
-	      <xsl:value-of select="metadataList/metadata[@name='Title']"/>
-	    </xsl:otherwise>
-	  </xsl:choose>
-	</td>
-      </tr>
-    </table>
-
-    
-    <!-- Apply recursively to the children of this node -->
-    <xsl:apply-templates select="documentNode[@nodeID]">
-      <xsl:with-param name="collName" select="$collName"/>
-      <xsl:with-param name="depth" select="$depth + 1"/>
-    </xsl:apply-templates>
-  </xsl:template>
-  
-
-
-  <xsl:template match="serviceList">
-    <xsl:param name="collName"/>
-    <xsl:variable name="docID" select="ancestor::page/pageRequest/paramList/param[@name='d']/@value"/>
-    <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
-    <xsl:for-each select="service">
-      <table border='1' cellspacing='0'><tr><td>
-      <p /><xsl:value-of select="display/name"/><p/>
-      <form name="EnrichForm" method="get" action="/gsdl3/{$library}">
-	<xsl:apply-templates select="paramList"/>
-	<input type='hidden' name='a' value='d'/>
-	<input type='hidden' name='d' value='{$docID}'/>
-	<input type='hidden' name='c' value='{$collName}'/>
-	<xsl:if test='ancestor::page/pageRequest/paramList/param[@name="sib"]'>
-	<input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='ancestor::page/pageRequest/paramList/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
-	      <input type='hidden' name='s' value='{@name}'/>
-	<input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
-      </form>
-	  </td></tr></table>
     </xsl:for-each>
   </xsl:template>
@@ -240,25 +258,25 @@
     <xsl:for-each select="param">
       <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
-	</xsl:text>
+      </xsl:text>
     </xsl:for-each>
   </xsl:template>
-
+  
   <xsl:template match="paramList">
-  <p/><table>
-  <xsl:for-each select="param">
-    <xsl:choose>
-      <xsl:when test="@type='multi'">
-        <tr><td colspan='2'>
-        <xsl:apply-templates select='.'/></td></tr>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:variable name="pname" select="@name"/>
-        <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:for-each>
-  </table>
-</xsl:template>
-
+    <p/><table>
+      <xsl:for-each select="param">
+	<xsl:choose>
+	  <xsl:when test="@type='multi'">
+	    <tr><td colspan='2'>
+		<xsl:apply-templates select='.'/></td></tr>
+	  </xsl:when>
+	  <xsl:otherwise>
+	    <xsl:variable name="pname" select="@name"/>
+	    <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr>
+	  </xsl:otherwise>
+	</xsl:choose>
+      </xsl:for-each>
+    </table>
+  </xsl:template>
+  
 </xsl:stylesheet>
 
Index: trunk/gsdl3/web/interfaces/default/transform/home.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/home.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/home.xsl	(revision 4712)
@@ -1,16 +1,23 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
-xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
 
-<xsl:include href="style.xsl"/>
+  <!-- style includes global params interface_name, page_lang, library_name -->
+  <xsl:include href="style.xsl"/>
 
-<xsl:output method="html"/>  
+  <xsl:output method="html"/>  
 
   <xsl:template name="pageHead">
     <head>
-      <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
+      <title>
+	<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
+      </title>
     </head>
   </xsl:template>
-
+  
   <xsl:template match="pageResponse">
     <xsl:call-template name="greenstonePageBanner"/> 
@@ -27,8 +34,5 @@
     <xsl:for-each select="collection"> 
       <p>
-	<a>
-	  <xsl:attribute name='href'>
-	    <xsl:value-of select="ancestor::page/pageExtra/config/library_name"/>?a=p&amp;sa=about&amp;c=<xsl:value-of select='@name'/>
-	  </xsl:attribute>
+	<a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
 	  <img width="150" border="1">
 	    <xsl:attribute name="src">
@@ -51,10 +55,10 @@
   </xsl:template>
   
-<xsl:template match="serviceClusterList">
-<xsl:for-each select="serviceCluster"> 
-<p/><a><xsl:attribute name='href'><xsl:value-of select="ancestor::page/pageExtra/config/library_name"/>?a=p&amp;sa=about&amp;c=<xsl:value-of select='@name'/></xsl:attribute><xsl:value-of select='@name'/></a>
-</xsl:for-each>
-<xsl:call-template name="greenBar"/>
-</xsl:template>
+  <xsl:template match="serviceClusterList">
+    <xsl:for-each select="serviceCluster"> 
+      <p/><a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/></a>
+    </xsl:for-each>
+    <xsl:call-template name="greenBar"/>
+  </xsl:template>
 
 </xsl:stylesheet>  
Index: trunk/gsdl3/web/interfaces/default/transform/process.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/process.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/process.xsl	(revision 4712)
@@ -1,5 +1,9 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
 
   <xsl:include href="style.xsl"/>
@@ -11,10 +15,10 @@
   <xsl:template name="pageHead">
     <head>
-      <title><xsl:value-of select="ancestor-or-self::page/pageResponse/serviceCluster/metadataList/metadata[@name='Titles']"/><xsl:text> </xsl:text></title>
+      <title><xsl:value-of select="/page/pageResponse/serviceCluster/metadataList/metadata[@name='Title']"/><xsl:text> </xsl:text></title>
     </head>
   </xsl:template>
 
   <xsl:template match="pageResponse">
-    <xsl:variable name="clusterName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
+    <xsl:variable name="clusterName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
     <center>
       <xsl:call-template name="clusterPageBanner">
@@ -32,10 +36,9 @@
   <xsl:template match="service">
     <xsl:param name="clusterName"/>
-    <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
-    <xsl:variable name='subaction' select="ancestor::page/pageRequest/@subaction"/>
-    <xsl:variable name='action' select="ancestor::page/pageRequest/@action"/>
-    <xsl:variable name='lang' select="ancestor::page/pageRequest/@lang"/>
+    <xsl:variable name='subaction' select="/page/pageRequest/@subaction"/>
+    <xsl:variable name='action' select="/page/pageRequest/@action"/>
+    <xsl:variable name='lang' select="/page/@lang"/>
     <h3><xsl:value-of select="display/name"/></h3><p/>
-    <form name="BuildForm" method="get" action="/gsdl3/{$library}">
+    <form name="BuildForm" method="get" action="/gsdl3/{$library_name}">
       <xsl:apply-templates select="paramList"/>
       <input type="hidden" name="a" value="{$action}"/>
@@ -61,5 +64,5 @@
 	  <xsl:otherwise>
 	    <xsl:variable name="pname" select="@name"/>
-	    <xsl:variable name="pvalue"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:variable>
+	    <xsl:variable name="pvalue"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:variable>
 	    <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/></xsl:apply-templates></td></tr>
 	  </xsl:otherwise>
@@ -73,5 +76,5 @@
     <center/>
     <applet code="org.greenstone.gsdl3.build.StatusDisplay.class" codebase='lib/java' archive='gsdl3.jar, xercesImpl.jar, jaxp.jar, xml-apis.jar' width='537' height='100'>The status display applet.
-      <param name='library'><xsl:attribute name="value"><xsl:value-of select='ancestor::page/pageExtra/config/library_name'/>?a=pr&amp;rt=s&amp;c=<xsl:value-of select='$clusterName'/>&amp;s=<xsl:value-of select='ancestor::page/pageResponse/service/@name'/>&amp;o=xml&amp;ro=1&amp;l=<xsl:value-of select='ancestor::page/pageRequest/@lang'/>&amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="ancestor::page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
+      <param name='library'><xsl:attribute name="value"><xsl:value-of select='$library_name'/>?a=pr&amp;rt=s&amp;c=<xsl:value-of select='$clusterName'/>&amp;s=<xsl:value-of select='/page/pageResponse/service/@name'/>&amp;o=xml&amp;ro=1&amp;l=<xsl:value-of select='/page/@lang'/>&amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="/page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
       <param name='initial_text'><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></param>
       <param name='initial_code'><xsl:attribute name="value"><xsl:value-of  select="@code"/></xsl:attribute></param></applet>
@@ -84,5 +87,5 @@
     <xsl:for-each select="param">
       <xsl:variable name='pname' select="@name"/>
-      <xsl:text>&amp;</xsl:text><xsl:value-of select="@shortname"/>=<xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:for-each>
+      <xsl:text>&amp;</xsl:text><xsl:value-of select="@shortname"/>=<xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:for-each>
   </xsl:template>
   
Index: trunk/gsdl3/web/interfaces/default/transform/querytools.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/querytools.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/querytools.xsl	(revision 4712)
@@ -1,12 +1,16 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
-xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
 
   <xsl:template name="result-navigation">
-    <xsl:param name="library"/>
-    <xsl:variable name="hp"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
+   <!-- <xsl:param name="library_name"/>-->
+    <xsl:variable name="hp"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
     <xsl:if test="not($hp=-1)">
-      <xsl:variable name="hn"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hn']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hn']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
-      <xsl:variable name="sa" select="ancestor::page/pageRequest/@subaction"/>
+      <xsl:variable name="hn"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hn']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hn']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
+      <xsl:variable name="sa" select="/page/pageRequest/@subaction"/>
       <xsl:variable name="prev" select="$hn - 1"/>
       <xsl:variable name="next" select="$hn + 1"/>
@@ -17,5 +21,5 @@
 	  <tr>
 	    <td align='left'>
-	      <xsl:if test="$hn &gt; 1"><a href="{$library}?a=q&amp;rt=r&amp;hn={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hp + 1)"/> - <xsl:value-of select="number(($prev * $hp))"/></a></xsl:if>
+	      <xsl:if test="$hn &gt; 1"><a href="{$library_name}?a=q&amp;rt=r&amp;hn={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hp + 1)"/> - <xsl:value-of select="number(($prev * $hp))"/></a></xsl:if>
 	    </td>
 	    <td align='right'>
@@ -23,5 +27,5 @@
 		<xsl:variable name='m' select="number($next * $hp)"/>
 		<xsl:variable name='mm'><xsl:choose><xsl:when test="$m &lt; $count"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$count'/></xsl:otherwise></xsl:choose></xsl:variable>
-		<a href="{$library}?a=q&amp;sa={$sa}&amp;rt=r&amp;hn={$next}"><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr>
+		<a href="{$library_name}?a=q&amp;sa={$sa}&amp;rt=r&amp;hn={$next}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr>
 	</table>
       </center>
Index: trunk/gsdl3/web/interfaces/default/transform/service-params.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/service-params.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/service-params.xsl	(revision 4712)
@@ -1,7 +1,7 @@
 <?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">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  extension-element-prefixes="java">
 
 <!-- handling of the different types of params on a service form 
@@ -33,4 +33,5 @@
       <xsl:when test="count(option) = 1">
 	<xsl:value-of select='$pdisplay/option'/>
+	<input type='hidden' name='{@shortname}'><xsl:attribute name='value'><xsl:value-of  select='option/@name'/></xsl:attribute></input>
       </xsl:when>
       <xsl:otherwise>
@@ -92,5 +93,5 @@
     <tr><xsl:for-each select="param">
 	<xsl:variable name="pname" select="@name"/>
-	<xsl:variable name="values" select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/>
+	<xsl:variable name="values" select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
 	<td><xsl:choose>
 	    <xsl:when test="not(@ignore) or  @ignore != $pos">      
@@ -98,5 +99,5 @@
 	    </xsl:when>
 	    <xsl:otherwise><!-- put in a hidden placeholder -->
-	      <input type="hidden" name='{$pname}' value=''/>
+	      <input type="hidden" name='{@shortname}' value=''/>
 	    </xsl:otherwise>
 	  </xsl:choose></td>
Index: trunk/gsdl3/web/interfaces/default/transform/style.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/style.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/style.xsl	(revision 4712)
@@ -3,10 +3,12 @@
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:java="http://xml.apache.org/xslt/java"
-  extension-element-prefixes="java">
-  
-  <!--
-  <xsl:output method="html"/>  
-  -->
-  
+  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
+  extension-element-prefixes="java util"
+  exclude-result-prefixes="java util">
+
+  <!-- some global parameters - these are set by whoever is invoking the transformation -->
+  <xsl:param name="interface_name"/>
+  <xsl:param name="library_name"/>
+
   <!-- the main page layout template is here -->
   <xsl:template match="page">
@@ -46,5 +48,5 @@
       <table width="537" cellspacing="0" cellpadding="0">
 	<tr valign="top">
-	  <td rowspan="2" align="left"><center><img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></xsl:attribute></img></center></td>
+	  <td rowspan="2" align="left"><center><img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:attribute></img></center></td>
 	  <td align="right"></td>
 	</tr>
@@ -76,11 +78,10 @@
   <xsl:template name="collectionPageBanner">
     <xsl:param name="collName"/>
-    <xsl:variable name="httpPath" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
-    <xsl:variable name="colIcon" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
-    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
+    <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
+    <xsl:variable name="colIcon" select="/page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
     <table width="537">
       <tr>
 	<td align="left">
-	  <a href="{$library}?a=p&amp;sa=about&amp;c={$collName}">
+	  <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
 	    <img width="150" border="0">
 	      <xsl:attribute name="src">
@@ -88,7 +89,5 @@
 	      </xsl:attribute>	
 	      <xsl:attribute name="alt">
-		<xsl:call-template name="text">
-		  <xsl:with-param name="key">aboutpage</xsl:with-param>
-		</xsl:call-template>
+		<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
 	      </xsl:attribute>
 	    </img>
@@ -96,8 +95,6 @@
 	</td>
 	<td align="right">
-	  <a href="{$library}?a=p&amp;sa=home">
-	    <xsl:call-template name="text">
-	      <xsl:with-param name="key">home</xsl:with-param>
-	    </xsl:call-template>
+	  <a href="{$library_name}?a=p&amp;sa=home">
+	    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home')"/>
 	  </a>
 	</td>
@@ -112,7 +109,6 @@
   <xsl:template name="clusterPageBanner">
     <xsl:param name="clusterName"/>
-    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
     <table width="537">
-      <tr><td align="left"><a href="{$library}?a=p&amp;sa=about&amp;c={$clusterName}"><xsl:value-of select="$clusterName"/></a></td><td align="right"><a href="{$library}?a=p&amp;sa=home"><xsl:call-template name="text"><xsl:with-param name="key">home</xsl:with-param></xsl:call-template></a></td></tr></table>
+      <tr><td align="left"><a href="{$library_name}?a=p&amp;sa=about&amp;c={$clusterName}"><xsl:value-of select="$clusterName"/></a></td><td align="right"><a href="{$library_name}?a=p&amp;sa=home"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home')"/></a></td></tr></table>
     
     <xsl:call-template name="greenBar"/>
@@ -166,33 +162,5 @@
 	 alt="View the document"/>
   </xsl:if>
-</xsl:template>
+  </xsl:template>
 
-
-
-
-<!-- text stuff. can be called via xsl:call-template:  
-
-<xsl:call-template name="text"><xsl:with-param name="key">your text name here</xsl:with-param></xsl:call-template>
-
-otherwise can be selected by :
-
-<xsl:apply-templates select="text"/>  
-
-the text elem to be processed must be in the form
-<text name="query.about"/>
-
--->
-
-  <!-- should we look in the display element, or dynamically get from resource bundles - would  this mean they are reloaded everytime??-->
-  <xsl:template name="text" match="text">
-    <xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
-    <xsl:variable name="path">ancestor::page/pageExtra/display/<xsl:value-of select='$key'/></xsl:variable>
-    <xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path)"/></xsl:variable>
-    <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
-      <xsl:otherwise>
-	<!-- no match found, output the name of the text string -->
-	_<xsl:value-of select="$key"/>_</xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
 </xsl:stylesheet>  
Index: trunk/gsdl3/web/interfaces/default/transform/system.xsl
===================================================================
--- trunk/gsdl3/web/interfaces/default/transform/system.xsl	(revision 4711)
+++ trunk/gsdl3/web/interfaces/default/transform/system.xsl	(revision 4712)
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <xsl:stylesheet version="1.0"
-  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:java="http://xml.apache.org/xslt/java"
+  extension-element-prefixes="java">
   
   <xsl:include href="style.xsl"/>
@@ -7,5 +9,6 @@
     <xsl:template name="pageHead">
     <head>
-      <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
+      <title>
+	<xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></title>
     </head>
   </xsl:template>
