Index: /trunk/gsdl3/interfaces/default/transform/basicquery.xsl
===================================================================
--- /trunk/gsdl3/interfaces/default/transform/basicquery.xsl	(revision 3751)
+++ /trunk/gsdl3/interfaces/default/transform/basicquery.xsl	(revision 3752)
@@ -10,9 +10,16 @@
 <xsl:template match="page">
 
-<xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='c']/@value"/></xsl:variable>
+<xsl:variable name="collName">
+  <xsl:value-of select="request/paramList/param[@name='c']/@value"/>
+</xsl:variable>
 
 <html>
 <xsl:call-template name="greenstoneHead"/>
 <body xsl:use-attribute-sets="body-style">
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr/><td valign="top" width="65"><img src="interfaces/default/images/spacer.gif" width="65" height="1" alt="" border="0"></img></td>
+<td/><center><table width="537"><tr/><td/>
+
 <center>
 <xsl:call-template name="collectionPageBanner">
@@ -22,9 +29,13 @@
 <xsl:with-param name="collName" select="$collName"/>
 </xsl:apply-templates>
+</center>
 <xsl:apply-templates select="response">
 <xsl:with-param name="collName" select="$collName"/>
 </xsl:apply-templates>
-</center>
+<xsl:call-template name="greenBar"/>
 <xsl:call-template name="greenstoneFooter"/>
+
+</table></center>
+</table>
 </body>
 </html>
@@ -45,22 +56,21 @@
 <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
 </form>
-<xsl:call-template name="greenBar"/>
 </xsl:template>
 
 <xsl:template match="paramList">
-<p/><table width="537">
-<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>
+  <p/><table width="537">
+  <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>
 
@@ -88,24 +98,68 @@
 -->
 
+
+<!-- Process the query response -->
 <xsl:template match="response">
-<xsl:param name="collName">coll-name</xsl:param>
-<table width="537">
-<xsl:for-each select="content/documentList/document">
-<tr><xsl:apply-templates select="."><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates></tr>
-</xsl:for-each>
-</table>
-<xsl:call-template name="greenBar"/>
+  <xsl:param name="collName">coll-name</xsl:param>
+  <xsl:call-template name="greenBarResults"/>
+
+  <!-- If query term information is available, display it -->
+  <br/>
+  <xsl:if test="count(content/metadataList/metadata[@type='term']) > 0">
+    <small>
+    Word count:
+    <xsl:for-each select="content/metadataList/metadata[@type='term']">
+      <xsl:if test="position() > 1">, </xsl:if>
+      <xsl:value-of select="@name"/>: <xsl:value-of select="@value"/> 
+    </xsl:for-each>
+    </small><br/>
+  </xsl:if>
+
+  <!-- If the number of matching documents is known, display it -->
+  <xsl:variable name="numMatchingDocs" select="content/metadataList/metadata[@name='numMatchingDocs']"/>
+  <xsl:if test="$numMatchingDocs">
+    <xsl:choose>
+      <xsl:when test="$numMatchingDocs='0'">
+        No documents matched the query.
+      </xsl:when>
+      <xsl:when test="$numMatchingDocs='1'">
+        1 document matched the query.
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$numMatchingDocs"/> documents matched the query.
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:if>
+
+  <!-- Display the matching documents -->
+  <table>
+  <tr valign="top">
+  <xsl:for-each select="content/documentList/document">
+    <tr>
+    <xsl:apply-templates select=".">
+      <xsl:with-param name="collName" select="$collName"/>
+    </xsl:apply-templates>
+    </tr>
+  </xsl:for-each>
+  </tr>
+  </table>
 </xsl:template>
 
+
 <xsl:template match="document">
-<xsl:param name="collName">coll-name</xsl:param>
-<xsl:variable name="library" select="ancestor::page/config/library_name"/>
-<td><a href="{$library}?a=d&amp;c={$collName}&amp;d={@name}">link</a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
+  <xsl:param name="collName">coll-name</xsl:param>
+  <xsl:variable name="library" select="ancestor::page/config/library_name"/>
+
+  <td><a href="{$library}?a=d&amp;c={$collName}&amp;d={@name}">link</a></td>
+  <td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
+</xsl:template>
+
+
+<xsl:template name="greenBarResults">
+  <p/>
+  <center>
+  <img src="interfaces/default/images/qryresb.gif" width="537" height="17"/>
+  </center>
 </xsl:template>
 
 </xsl:stylesheet>  
-
-
-
-
-
