New from Hedzer Westra <hedzer@NL.ADLIBSOFT.COM>
authormike <mike>
Mon, 13 Dec 2004 16:35:11 +0000 (16:35 +0000)
committermike <mike>
Mon, 13 Dec 2004 16:35:11 +0000 (16:35 +0000)
etc/xslt/README [new file with mode: 0644]
etc/xslt/dublinCoreRecord.xsl [new file with mode: 0644]
etc/xslt/explainResponse.xsl [new file with mode: 0644]
etc/xslt/scanResponse.xsl [new file with mode: 0644]
etc/xslt/searchRetrieveResponse.xsl [new file with mode: 0644]
etc/xslt/stdiface.xsl [new file with mode: 0644]

diff --git a/etc/xslt/README b/etc/xslt/README
new file mode 100644 (file)
index 0000000..42fd180
--- /dev/null
@@ -0,0 +1,13 @@
+$Id: README,v 1.1 2004-12-13 16:35:11 mike Exp $
+
+The XSLT files in this directory are supposed to allow you to make
+a thin-client for SRU using only an XSLT-enabled web browser.  It
+looks like an HTML file is also required to get you started, though.
+
+These were sent to the ZNG mailing list by
+       Hedzer Westra <hedzer@NL.ADLIBSOFT.COM>
+in a message entitled
+       "Re: CQL implementation details"
+on Monday 13th December 2004.  They are modified versions of files
+that he says he get in the CQL-Java distributed he downloaded from
+OCLC.  I know (as yet) of no such distribution.
diff --git a/etc/xslt/dublinCoreRecord.xsl b/etc/xslt/dublinCoreRecord.xsl
new file mode 100644 (file)
index 0000000..6b96092
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version='1.0'?>\r
+\r
+<xsl:stylesheet version="1.0"\r
+     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
+     xmlns:srw_dc="info:srw/schema/1/dc-v1.1" xmlns:dc="http://purl.org/dc/elements/1.1/">\r
+\r
+<!-- Dublin Core -->\r
+\r
+<xsl:template match="srw_dc:dc">\r
+    <xsl:apply-templates/>\r
+</xsl:template>\r
+\r
+<xsl:template match="dc:*">\r
+  <xsl:if test="not(name()=dc)">\r
+    <tr><td align="right" width="25%" valign="top">\r
+          <b><xsl:value-of select="name()"/></b>:<xsl:text> </xsl:text> </td>\r
+        <td><xsl:text> </xsl:text> <xsl:value-of select="."/></td>\r
+    </tr>\r
+  </xsl:if>\r
+</xsl:template>\r
+\r
+</xsl:stylesheet>\r
diff --git a/etc/xslt/explainResponse.xsl b/etc/xslt/explainResponse.xsl
new file mode 100644 (file)
index 0000000..865902a
--- /dev/null
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<xsl:stylesheet version="1.0"\r
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
+    xmlns:srw="http://www.loc.gov/zing/srw/"\r
+    xmlns:zr="http://explain.z3950.org/dtd/2.0/"\r
+    xmlns:diag="http://www.loc.gov/zing/srw/diagnostic/">\r
+\r
+  <!--      Author: Rob Sanderson (azaroth@liv.ac.uk)\r
+           Version:  0.6\r
+      Last Updated:  27/11/2003\r
+           Licence:  GPL \r
+    \r
+    Updated by Hedzer Westra (Adlib Information Systems) on 07-12-2004\r
+    \r
+    -->\r
+\r
+  <xsl:output method="html"/>\r
+\r
+  <xsl:template match="/srw:explainResponse">\r
+    <html>\r
+      <head>\r
+        <title>\r
+          <xsl:value-of select="srw:record/srw:recordData/zr:explain/zr:databaseInfo/zr:title"/>\r
+          </title>\r
+        <style>\r
+          H2 {font-family: sans-serif; color: #FF5500; background-color: #eeeeff; padding-top: 10px; padding-bottom: 10px; border: 1px solid #3333FF}\r
+          H3 { font-family: sans-serif; color: #F65500; text-indent: 20px; border-left: solid 1px #3333FF; border-top: solid 1px #3333FF; padding-top: 5px }\r
+          .paramTable { vertical-align: top; border: 1px solid; padding: 3px; border-collapse: collapse }\r
+          .exampleTable { vertical-align: top; border: 1px solid; padding: 3px; border-collapse: collapse; background-color: #eeeeff}\r
+          \r
+          .paramTable TD {border: 1px solid}\r
+          .exampleTable TD {border: 1px solid}\r
+          TH {border: 1px solid; background-color: #eeeeff}\r
+\r
+        </style>\r
+\r
+        <script>\r
+          <xsl:text>\r
+            function mungeForm() {\r
+            inform = document.CQLForm;\r
+            outform = document.SRUForm;\r
+            max = inform.maxIndex.value;\r
+            cql = "";\r
+            prevIdx = 0;\r
+            // Step through elements in form to create CQL\r
+            for (var idx = 1; idx &lt;= max; idx++) {\r
+              term = inform["term"+idx].value;\r
+              if (term) {\r
+                if (prevIdx) {\r
+                  cql += " " + inform["bool" + prevIdx].value + " "\r
+                }\r
+                if (term.indexOf(' ')) {\r
+                  term = '"' + term + '"';\r
+                }\r
+                cql += inform["index" + idx].value + " " + inform["relat" + idx].value + " " + term\r
+                prevIdx = idx\r
+             }\r
+            }\r
+            if (!cql) {\r
+            alert("At least one term is required to search.");\r
+            return false;\r
+            }\r
+            outform.query.value = cql\r
+            outform.submit();\r
+            return false;\r
+            }\r
+\r
+            function mungeScanForm() {\r
+            inform = document.ScanIndexes;\r
+            outform = document.ScanSubmit;\r
+            index = inform.scanIndex.value;\r
+            term = inform.term.value;\r
+            relat = inform.relat.value;\r
+            outform.scanClause.value = index + " " + relat +" \"" + term + "\""\r
+            outform.submit();\r
+            return false;\r
+            }\r
+\r
+          </xsl:text>\r
+        </script>\r
+      </head>\r
+      <body bgcolor="#FFFFFF">\r
+        <center>\r
+          <h2>\r
+            <xsl:value-of select="srw:record/srw:recordData/zr:explain/zr:databaseInfo/zr:title"/>\r
+          <br/>\r
+            <xsl:value-of select="srw:record/srw:recordData/zr:explain/zr:databaseInfo/zr:implementation/zr:title"/>\r
+          </h2>\r
+        </center>\r
+\r
+        <p>\r
+          <xsl:value-of select="srw:record/srw:recordData/zr:explain/zr:databaseInfo/zr:description"/>\r
+        </p>\r
+\r
+       <xsl:apply-templates select="srw:diagnostics"/>\r
+\r
+<table width="100%" cellspacing="5">\r
+<tr><td>\r
+\r
+        <h3>Search</h3>\r
+\r
+        <p>\r
+        <form name="CQLForm" onSubmit="return mungeForm();">\r
+          <input type="submit" value="Search" onClick="return mungeForm();"/>\r
+        <table class="paramTable">\r
+          <tr><th>Index</th><th>Relation</th><th>Term</th><th>Boolean</th></tr>\r
+          <input type="hidden" name="maxIndex">\r
+            <xsl:attribute name="value">\r
+              <xsl:value-of select="count(srw:record/srw:recordData/zr:explain/zr:indexInfo/zr:index)"/>\r
+            </xsl:attribute>\r
+          </input>\r
+          <xsl:for-each select="srw:record/srw:recordData/zr:explain/zr:indexInfo/zr:index">\r
+            <xsl:sort select="."/>\r
+            <tr>\r
+              <td align="right">\r
+                <b><xsl:value-of select="zr:title"/></b>\r
+                <input type="hidden">\r
+                  <xsl:attribute name="name">index<xsl:value-of select="position()"/></xsl:attribute>\r
+                  <xsl:attribute name="value"><xsl:value-of select="zr:map[1]/zr:name/@set"/>.<xsl:value-of select="zr:map[1]/zr:name"/></xsl:attribute>\r
+                </input>\r
+              </td>\r
+              <td>\r
+                <select>\r
+                  <xsl:attribute name="name">relat<xsl:value-of select="position()"/></xsl:attribute>\r
+                  <option value="=">=</option>\r
+                  <option value="exact">exact</option>\r
+                  <option value="any">any</option>\r
+                  <option value="all">all</option>\r
+                  <option value="&lt;">&lt;</option>\r
+                  <option value="&gt;">&gt;</option>\r
+                  <option value="&lt;=">&lt;=</option>\r
+                  <option value="&gt;=">&gt;=</option>\r
+                  <option value="&lt;&gt;">not</option>\r
+                  <option value="broader">broader</option>\r
+                  <option value="narrower">narrower</option>\r
+                  <option value="generic">generic</option>\r
+                  <option value="realted">related</option>\r
+                  <option value="topterm">topterm</option>\r
+                  <option value="parents">parents</option>\r
+                </select>\r
+              </td>\r
+              <td>\r
+                <input type="text" value="">\r
+                  <xsl:attribute name="name">term<xsl:value-of select="position()"/></xsl:attribute>\r
+                </input>\r
+              </td>\r
+              <td>\r
+                <select>\r
+                  <xsl:attribute name="name">bool<xsl:value-of select="position()"/></xsl:attribute>\r
+                  <option value="and">and</option>\r
+                  <option value="or">or</option>\r
+                  <option value="not">not</option>\r
+                </select>\r
+              </td>\r
+            </tr>\r
+          </xsl:for-each>\r
+        </table>\r
+      </form>\r
+\r
+        <form method="GET" name="SRUForm" onSubmit="mungeForm()">\r
+        \r
+        <input type="hidden" name="query" value=""/>\r
+        <input type="hidden" name="version" value="1.1"/>\r
+        <input type="hidden" name="operation" value="searchRetrieve"/>\r
+        <input type="hidden" name="stylesheet" value="searchRetrieveResponse.xsl"/>\r
+        \r
+        <table>\r
+          <tr>\r
+            <td><b>Record Schema:</b>\r
+          </td>\r
+          <td>\r
+            <select name="recordSchema">\r
+              <xsl:for-each select="srw:record/srw:recordData/zr:explain/zr:schemaInfo/zr:schema">\r
+                <option>\r
+                  <xsl:attribute name="value">\r
+                    <xsl:value-of select="@identifier"/>\r
+                  </xsl:attribute>\r
+                  <xsl:value-of select="zr:title"/>\r
+                </option>\r
+              </xsl:for-each>\r
+            </select>\r
+          </td>\r
+        </tr>\r
+        <tr>\r
+          <td><b>Number of Records:</b></td>\r
+          <td>\r
+            <input type="text" name="maximumRecords">\r
+              <xsl:attribute name="value">\r
+              <xsl:choose>\r
+                <xsl:when test='srw:record/srw:recordData/zr:explain/zr:configInfo/zr:default[@type="numberOfRecords"]'>\r
+                  <xsl:value-of select='srw:record/srw:recordData/zr:explain/zr:configInfo/zr:default[@type="numberOfRecords"]'/>\r
+                  </xsl:when>\r
+                <xsl:otherwise>\r
+                  <xsl:text>1</xsl:text>\r
+                  </xsl:otherwise>\r
+                </xsl:choose>\r
+              </xsl:attribute>\r
+            </input>\r
+          </td>\r
+        </tr>\r
+\r
+        <tr>\r
+          <td><b>Record Position:</b></td>\r
+          <td>\r
+            <input type="text" name="startRecord" value="1"/>\r
+          </td>\r
+        </tr>\r
+        <tr>\r
+          <td><b>Result Set TTL:</b></td>\r
+          <td>\r
+            <input type="text" name="resultSetTTL" value="0"/>\r
+          </td>\r
+        </tr>\r
+\r
+        <tr>\r
+          <td><b>Record Packing:</b></td>\r
+          <td>\r
+            <select name="recordPacking">\r
+              <option value="xml">XML</option>\r
+              <option value="string">String</option>\r
+            </select>\r
+          </td>\r
+        </tr>\r
+\r
+       <tr>\r
+       <td><b>Record XPath:</b></td>\r
+       <td><input type="text" name="recordXPath" value = ""/></td>\r
+       </tr>   \r
+       <tr>\r
+\r
+       <td><b>Sort Keys:</b></td>\r
+       <td><input type="text" name="sortKeys" value = ""/></td>\r
+       </tr>   \r
+\r
+      </table>\r
+\r
+          <input type="submit" value="Search" onClick="return mungeForm();"/>\r
+        </form>\r
+      </p>\r
+\r
+</td><td valign="top">\r
+\r
+  <h3>Browse</h3>\r
+     <!-- Some browsers won't display when forms inside tables :( -->\r
+\r
+     <form name="ScanIndexes" onSubmit="return mungeScanForm();">\r
+   <table>\r
+          <tr><th>Index</th><th>Relation</th><th>Term</th><th>Boolean</th></tr>\r
+     <tr>\r
+       <td><select name="scanIndex">\r
+         <xsl:for-each select="srw:record/srw:recordData/zr:explain/zr:indexInfo/zr:index">\r
+           <xsl:sort select="."/>\r
+           <option>\r
+             <xsl:attribute name="value"><xsl:value-of select="zr:map[1]/zr:name/@set"/>.<xsl:value-of select="zr:map[1]/zr:name"/></xsl:attribute>\r
+                <xsl:value-of select="zr:title"/>\r
+            </option>\r
+         </xsl:for-each>\r
+         </select>\r
+      </td>\r
+      <td><select name="relat">\r
+          <option value="=">=</option>\r
+          <option value="exact">exact</option>\r
+          <option value="any">any</option>\r
+          <option value="all">all</option>\r
+          <option value="&lt;">&lt;</option>\r
+          <option value="&gt;">&gt;</option>\r
+          <option value="&lt;=">&lt;=</option>\r
+          <option value="&gt;=">&gt;=</option>\r
+          <option value="&lt;&gt;">not</option>\r
+        </select>\r
+      </td>\r
+      <td><input name="term" type="text" value = ""/>\r
+      </td>\r
+    </tr>\r
+    </table>\r
+    </form>\r
+\r
+    <form name="ScanSubmit" method="GET">\r
+          <xsl:attribute name="action">http://<xsl:value-of select="srw:record/srw:recordData/zr:explain/zr:serverInfo/zr:host"/>:<xsl:value-of select="srw:record/srw:recordData/zr:explain/zr:serverInfo/zr:port"/>/<xsl:value-of select="srw:record/srw:recordData/zr:explain/zr:serverInfo/zr:database"/>\r
+        </xsl:attribute>\r
+    <table>\r
+    <tr>\r
+      <td>Response Position:</td>\r
+      <td>\r
+        <input type="text" name="responsePosition" value="1" size="5"/>\r
+      </td>\r
+    </tr>\r
+    <tr>\r
+      <td>Maximum Terms:</td>\r
+      <td>\r
+        <input type="text" name="maximumTerms" value="20" size="5"/>\r
+      </td>\r
+    </tr>\r
+    <tr>\r
+      <td colspan="2">\r
+         <input type="submit" value="Browse" onClick="return mungeScanForm();"/>\r
+      </td>\r
+    </tr>\r
+    </table>\r
+    <input type="hidden" name="operation" value="scan"/>\r
+    <input type="hidden" name="scanClause" value=""/>\r
+    <input type="hidden" name="version" value="1.1"/>\r
+    <input type="hidden" name="stylesheet" value="scanResponse.xsl"/>\r
+    </form>\r
+\r
+</td></tr>\r
+</table>            \r
+\r
+\r
+      </body>\r
+    </html>\r
+  </xsl:template>\r
+\r
+  <xsl:template match="srw:diagnostics">\r
+     <h3>Diagnostics</h3>\r
+     <xsl:apply-templates/>\r
+  </xsl:template>\r
+\r
+<xsl:template match="diag:diagnostic">\r
+<table>\r
+<xsl:apply-templates/>\r
+</table>\r
+</xsl:template>\r
+<xsl:template match="diag:code">\r
+<tr><td><b>Code:</b></td><td> <xsl:value-of select="."/></td></tr>\r
+</xsl:template>\r
+<xsl:template match="diag:message">\r
+<tr><td><b>Message:</b></td><td><xsl:value-of select="."/></td></tr>\r
+</xsl:template>\r
+<xsl:template match="diag:details">\r
+<tr><td><b>Details:</b></td><td><xsl:value-of select="."/></td></tr>\r
+</xsl:template>\r
+\r
+</xsl:stylesheet>\r
diff --git a/etc/xslt/scanResponse.xsl b/etc/xslt/scanResponse.xsl
new file mode 100644 (file)
index 0000000..42c0a02
--- /dev/null
@@ -0,0 +1,86 @@
+<?xml version='1.0'?>\r
+\r
+<xsl:stylesheet version="1.0"\r
+     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
+     xmlns:srw="http://www.loc.gov/zing/srw/"\r
+     xmlns:xcql="http://www.loc.gov/zing/cql/xcql/">\r
+\r
+<xsl:import href="stdiface.xsl"/>\r
+\r
+<xsl:variable name="title">Result of scan for term: <xsl:value-of select="/srw:scanResponse/srw:echoedScanRequest/srw:scanClause"/></xsl:variable>\r
+<xsl:variable name="maximumTerms"><xsl:value-of select="/srw:scanResponse/srw:echoedScanRequest/srw:maximumTerms"/></xsl:variable>\r
+<xsl:variable name="indexRelation"> <xsl:value-of select="/srw:scanResponse/srw:echoedScanRequest/srw:xScanClause/xcql:index"/><xsl:text> </xsl:text><xsl:value-of select="/srw:scanResponse/srw:echoedScanRequest/srw:xScanClause/xcql:relation/xcql:value"/><xsl:text> </xsl:text></xsl:variable>\r
+\r
+<xsl:template match="/">\r
+<xsl:call-template name="stdiface">\r
+</xsl:call-template>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:scanResponse">\r
+<xsl:apply-templates/>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:terms">\r
+  <xsl:call-template name="prev-nextTerms"/>\r
+\r
+  <h3 style="font-family: sans-serif; color: #F65500; text-indent: 20px; border-left: solid 1px #3333FF; border-top: solid 1px #3333FF; padding-top: 5px">Terms</h3>\r
+  <table width="50%" border="1" cellpadding="3" cellspacing="0">\r
+  <tr bgcolor="#eeeeff"><th>Term</th><th>Frequency</th></tr>\r
+  <xsl:apply-templates/>\r
+  </table>\r
+\r
+  <xsl:call-template name="prev-nextTerms"/>\r
+\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:term">\r
+<tr>\r
+  <xsl:apply-templates/>\r
+</tr>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:value">\r
+<td>\r
+  <a>\r
+    <xsl:attribute name="href">?operation=searchRetrieve&amp;version=1.1&amp;query=<xsl:value-of select="$indexRelation"/>"<xsl:value-of select="."/>"&amp;maximumRecords=1&amp;startRecord=1</xsl:attribute>\r
+    <xsl:value-of select="."/>\r
+  </a> \r
+</td>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:term/srw:numberOfRecords">\r
+<td><xsl:value-of select="."/></td>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:echoedScanRequest"/>\r
+\r
+<xsl:template name="prev-nextTerms">\r
+<p>\r
+&lt;--\r
+<a>\r
+<xsl:attribute name="href">\r
+?operation=scan&amp;scanClause=\r
+<xsl:value-of select="$indexRelation"/>"<xsl:value-of select ="./srw:term[1]/srw:value"/>"\r
+&amp;responsePosition=<xsl:value-of select="$maximumTerms"/>\r
+&amp;version=1.1\r
+&amp;maximumTerms=<xsl:value-of select="$maximumTerms"/>\r
+</xsl:attribute>\r
+Previous\r
+</a>\r
+\r
+|\r
+\r
+<a>\r
+<xsl:attribute name="href">\r
+?operation=scan&amp;scanClause=\r
+<xsl:value-of select="$indexRelation"/>"<xsl:value-of select ="./srw:term[count(//srw:scanResponse/srw:terms/srw:term)]/srw:value"/>"\r
+&amp;responsePosition=1&amp;version=1.1\r
+&amp;maximumTerms=<xsl:value-of select="$maximumTerms"/>\r
+</xsl:attribute>\r
+Next \r
+</a>\r
+--&gt;\r
+</p>\r
+</xsl:template>\r
+\r
+</xsl:stylesheet>\r
diff --git a/etc/xslt/searchRetrieveResponse.xsl b/etc/xslt/searchRetrieveResponse.xsl
new file mode 100644 (file)
index 0000000..08c3168
--- /dev/null
@@ -0,0 +1,128 @@
+<?xml version='1.0'?>\r
+\r
+<xsl:stylesheet version="1.0"\r
+     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
+     xmlns:srw="http://www.loc.gov/zing/srw/"\r
+     xmlns:dc="info:srw/schema/1/dc-v1.1"\r
+     xmlns:card="http://srw.o-r-g.org/schemas/ccg/1.0/">\r
+\r
+<xsl:import href="stdiface.xsl"/>\r
+<xsl:import href="dublinCoreRecord.xsl"/>\r
+<xsl:import href="adlibRecord.xsl"/>\r
+\r
+<xsl:variable name="title">Result of search: <xsl:value-of select="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:query"/></xsl:variable>\r
+\r
+<xsl:template match="/">\r
+<xsl:call-template name="stdiface">\r
+<xsl:with-param name="title" select="$title"/>\r
+</xsl:call-template>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:searchRetrieveResponse">\r
+<xsl:apply-templates/>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:numberOfRecords">\r
+  <p><b>Matches:</b><xsl:text> </xsl:text><xsl:value-of select="."/></p>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:resultSetId">\r
+  Result Set Identifier:<xsl:text> </xsl:text><xsl:value-of select="."/>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:resultSetIdleTime">\r
+  <xsl:text> </xsl:text>(Will last for<xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text>seconds)\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:records">\r
+  <h3 style="font-family: sans-serif; color: #F65500; text-indent: 20px; border-left: solid 1px #3333FF; border-top: solid 1px #3333FF; padding-top: 5px">Records</h3>\r
+  <xsl:call-template name="prev-nextRecord"/>\r
+  <xsl:apply-templates/>\r
+  <xsl:call-template name="prev-nextRecord"/>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:record">\r
+  <p>\r
+    <xsl:apply-templates select="child::srw:recordPosition"/>\r
+    <xsl:apply-templates select="child::srw:recordSchema"/>\r
+    <xsl:apply-templates select="child::srw:recordData"/>\r
+  </p>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:record/srw:recordSchema">\r
+  <b>Schema: </b>\r
+  <xsl:variable name="schema" select="."/> \r
+  <xsl:choose>\r
+      <xsl:when test="$schema = 'info:srw/schema/1/dc-v1.1'">\r
+             Dublin Core\r
+      </xsl:when>\r
+      <xsl:when test="$schema = 'info:srw/schema/1/marcxml-v1.1'">\r
+             MARC XML\r
+      </xsl:when>\r
+      <xsl:when test="$schema = 'info:srw/schema/1/mods-v3.0'">\r
+             MODS\r
+      </xsl:when>\r
+      <xsl:when test="$schema = 'http://srw.o-r-g.org/schemas/ccg/1.0/'">\r
+             Collectable Card Schema\r
+      </xsl:when>\r
+      <xsl:when test="$schema = 'http://www.adlibsoft.com/adlibXML'">\r
+             adlibXML\r
+      </xsl:when>\r
+      <xsl:otherwise>\r
+             <xsl:value-of select="$schema"/>\r
+      </xsl:otherwise>\r
+  </xsl:choose>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:recordPosition">\r
+  <b>Position: </b> <xsl:value-of select="."/> <xsl:text> </xsl:text>\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:nextRecordPosition">\r
+  <!-- Not used -->\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:recordData">\r
+  <table width="100%" style="vertical-align: top; border: 1px solid; padding: 3px; border-collapse: collapse; background-color: #eefdff">\r
+\r
+<xsl:choose>\r
+<xsl:when test="../srw:recordPacking = 'string'">\r
+<tr><td style="border: 1px solid">\r
+<pre><xsl:value-of select="."/></pre>\r
+</td></tr>\r
+</xsl:when>\r
+<xsl:otherwise>\r
+<xsl:apply-templates/>\r
+</xsl:otherwise>\r
+</xsl:choose>\r
+\r
+</table>\r
+</xsl:template>\r
+\r
+\r
+<xsl:template match="srw:echoedSearchRetrieveRequest"/>\r
+<xsl:template match="srw:extraResponseData"/>\r
+\r
+\r
+<xsl:template name="prev-nextRecord">\r
+  <xsl:variable name="startRecord"\r
+    select="number(/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:startRecord)"/>\r
+  <xsl:variable name="maximumRecords">\r
+    <xsl:value-of select="number(/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:maximumRecords)"/>\r
+    </xsl:variable>\r
+  <xsl:variable name="prev" select="$startRecord - $maximumRecords"/>\r
+  <xsl:variable name="recordSchema"><xsl:if test="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:recordSchema">&amp;recordSchema=<xsl:value-of select="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:recordSchema"/></xsl:if></xsl:variable>\r
+  <xsl:variable name="sortKeys" select="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:sortKeys"/>\r
+\r
+  <xsl:if test="$prev>0">\r
+  <a>\r
+    <xsl:attribute name="href">?operation=searchRetrieve&amp;version=1.1&amp;sortKeys=<xsl:value-of select="$sortKeys"/>&amp;stylesheet=searchRetrieveResponse.xsl&amp;startRecord=<xsl:value-of select="$prev"/>&amp;maximumRecords=<xsl:value-of select="$maximumRecords"/>&amp;resultSetTTL=<xsl:value-of select="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:resultSetTTL"/><xsl:value-of select="$recordSchema"/>&amp;query=<xsl:value-of select="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:query"/></xsl:attribute>Previous Record(s)</a>\r
+  </xsl:if>\r
+<xsl:text> </xsl:text>\r
+  <xsl:if test="/srw:searchRetrieveResponse/srw:nextRecordPosition">\r
+  <a>\r
+    <xsl:attribute name="href">?operation=searchRetrieve&amp;version=1.1&amp;sortKeys=<xsl:value-of select="$sortKeys"/>&amp;stylesheet=searchRetrieveResponse.xsl&amp;startRecord=<xsl:value-of select="/srw:searchRetrieveResponse/srw:nextRecordPosition"/>&amp;maximumRecords=<xsl:value-of select="$maximumRecords"/>&amp;resultSetTTL=<xsl:value-of select="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:resultSetTTL"/><xsl:value-of select="$recordSchema"/>&amp;query=<xsl:value-of select="/srw:searchRetrieveResponse/srw:echoedSearchRetrieveRequest/srw:query"/></xsl:attribute>Next Record(s)</a>\r
+  </xsl:if>\r
+</xsl:template>\r
+\r
+</xsl:stylesheet>\r
diff --git a/etc/xslt/stdiface.xsl b/etc/xslt/stdiface.xsl
new file mode 100644 (file)
index 0000000..ed70acf
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version='1.0'?>\r
+\r
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:srw="http://www.loc.gov/zing/srw/" xmlns:diag="http://www.loc.gov/zing/srw/diagnostic/"  xmlns:xcql="http://www.loc.gov/zing/srw/xcql/" version="1.0"> \r
+\r
+<xsl:output method="html"/>\r
+\r
+<xsl:template name="stdiface">\r
+<html><head><title><xsl:value-of select="$title"/></title>\r
+</head><body bgcolor="white"><center><h2 style="font-family: sans-serif; color: #FF5500; background-color: #eeeeff; padding-top: 10px; padding-bottom: 10px; border: 1px solid #3333FF"><xsl:value-of select="$title"/></h2></center>\r
+<p><xsl:apply-templates/></p>\r
+<p>\r
+<a href="?operation=explain&amp;version=1.1&amp;stylesheet=explainResponse.xsl">Home</a>\r
+</p>\r
+</body>\r
+</html>\r
+\r
+</xsl:template>\r
+\r
+<xsl:template match="srw:version"/>\r
+\r
+<xsl:template match="srw:diagnostics">\r
+  <h3 style="font-family: sans-serif; color: #F65500; text-indent: 20px; border-left: solid 1px #3333FF; border-top: solid 1px #3333FF; padding-top: 5px">Diagnostics</h3>\r
+  <xsl:apply-templates/>\r
+</xsl:template>\r
+\r
+<xsl:template match="diag:diagnostic">\r
+  <!-- Just feed down -->\r
+  <table>\r
+    <xsl:apply-templates/>\r
+  </table>\r
+</xsl:template>\r
+\r
+<xsl:template match="diag:uri">\r
+<tr>\r
+<td><b>Identifier:</b></td>\r
+<td><xsl:value-of select="."/></td>\r
+</tr>\r
+</xsl:template>\r
+\r
+<xsl:template match="diag:code">\r
+<tr>\r
+<td><b>Code:</b></td>\r
+<td><xsl:value-of select="."/></td>\r
+</tr>\r
+<tr>\r
+<td><b>Meaning:</b></td>\r
+<xsl:variable name="diag" select="."/>\r
+<td>\r
+<xsl:choose>\r
+  <xsl:when test="$diag='1'">\r
+    <xsl:text>General System Error</xsl:text>\r
+    </xsl:when>\r
+  <xsl:when test="$diag='10'">\r
+    <xsl:text>Query Syntax Error</xsl:text>\r
+    </xsl:when>\r
+  <xsl:when test="$diag='16'">\r
+    <xsl:text>Unsupported Index</xsl:text>\r
+    </xsl:when>\r
+  <xsl:when test="$diag='51'">\r
+    <xsl:text>Result Set Does Not Exist</xsl:text>\r
+    </xsl:when>\r
+  <xsl:when test="$diag='61'">\r
+    <xsl:text>First Record Position Out Of Range</xsl:text>\r
+    </xsl:when>\r
+  <xsl:when test="$diag='66'">\r
+    <xsl:text>Unknown Schema For Retrieval</xsl:text>\r
+    </xsl:when>\r
+  </xsl:choose>\r
+</td>\r
+</tr>\r
+</xsl:template>\r
+\r
+<xsl:template match="diag:details"><tr><td><b>Details:</b></td><td><xsl:value-of select="."/></td></tr></xsl:template>\r
+<xsl:template match="diag:message"><tr><td><b>Message:</b></td><td><xsl:value-of select="."/></td></tr></xsl:template>\r
+\r
+</xsl:stylesheet>\r