1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:srw="http://www.loc.gov/zing/srw/"
4 xmlns:dc="http://www.loc.gov/zing/srw/dcschema/v1.0/"
5 xmlns:zr="http://explain.z3950.org/dtd/2.0/"
6 xmlns:diag="http://www.loc.gov/zing/srw/diagnostic/"
9 <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
11 <xsl:template match="text()"/>
13 <xsl:template match="/">
14 <xsl:call-template name="html"/>
17 <xsl:template name="html">
21 <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:title"/>
23 <link href="css.css" rel="stylesheet"
24 type="text/css" media="screen, all"/>
28 <xsl:apply-templates/>
35 <xsl:template match="//zr:explain">
36 <xsl:call-template name="dbinfo"/>
37 <xsl:call-template name="diagnostic"/>
38 <xsl:call-template name="indexinfo"/>
39 <xsl:call-template name="relationinfo"/>
40 <xsl:call-template name="searchform"/>
41 <xsl:call-template name="scanform"/>
45 <!-- searchRetrieveResponse -->
46 <xsl:template match="//srw:searchRetrieveResponse">
47 <h2>Search Results</h2>
48 <xsl:call-template name="diagnostic"/>
49 <xsl:call-template name="displaysearch"/>
53 <xsl:template match="//srw:scanResponse">
55 <xsl:call-template name="diagnostic"/>
56 <xsl:call-template name="displayscan"/>
60 <xsl:template name="dbinfo">
62 <h1><xsl:value-of select="//zr:explain/zr:databaseInfo/zr:title"/>
64 <h2><xsl:value-of select="//zr:explain/zr:databaseInfo/zr:description"/>
67 <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:author"/>
69 <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:history"/>
75 <xsl:template name="searchform">
76 <div class="searchform">
77 <form name="searchform" method="get"> <!-- action=".." -->
78 <input type="hidden" name="version" value="1.1"/>
79 <input type="hidden" name="operation" value="searchRetrieve"/>
81 <input type="text" name="query"/>
83 <div class="parameters">
84 <xsl:text>startRecord: </xsl:text>
85 <input type="text" name="startRecord" value="1"/>
86 <xsl:text> maximumRecords: </xsl:text>
87 <input type="text" name="maximumRecords" value="0"/>
88 <xsl:text> recordSchema: </xsl:text>
89 <select name="recordSchema">
90 <xsl:for-each select="//zr:schemaInfo/zr:schema">
91 <option value="{@name}">
92 <xsl:value-of select="zr:title"/>
96 <xsl:text> recordPacking: </xsl:text>
97 <select name="recordPacking">
98 <option value="string">string</option>
99 <option value="xml">XML</option>
101 <xsl:text> stylesheet: </xsl:text>
102 <select name="stylesheet">
103 <option value="/etc/sru.xsl">SRU</option>
104 <option value="">NONE</option>
109 <input type="submit" value="Send Search Request"/>
115 <xsl:template name="scanform">
116 <div class="scanform">
117 <form name="scanform" method="get"> <!-- action=".." -->
118 <input type="hidden" name="version" value="1.1"/>
119 <input type="hidden" name="operation" value="scan"/>
120 <div class="scanClause">
121 <input type="text" name="scanClause"/>
123 <div class="parameters">
124 <xsl:text>responsePosition: </xsl:text>
125 <input type="text" name="responsePosition" value="1"/>
126 <xsl:text> maximumTerms: </xsl:text>
127 <input type="text" name="maximumTerms" value="15"/>
128 <xsl:text> stylesheet: </xsl:text>
129 <select name="stylesheet">
130 <option value="sru.xsl">SRU</option>
131 <option value="">NONE</option>
136 <input type="submit" value="Send Scan Request"/>
143 <xsl:template name="indexinfo">
146 select="//zr:indexInfo/zr:index[zr:map/zr:name/@set]">
147 <xsl:variable name="index">
148 <xsl:value-of select="zr:map/zr:name/@set"/>
149 <xsl:text>.</xsl:text>
150 <xsl:value-of select="zr:map/zr:name/text()"/>
152 <b><xsl:value-of select="$index"/><br/></b>
158 <xsl:template name="relationinfo">
160 <xsl:variable name="defrel"
161 select="//zr:configInfo/zr:default[@type='relation']"/>
162 <b><xsl:value-of select="$defrel"/><br/></b>
164 <xsl:for-each select="//zr:configInfo/zr:supports[@type='relation']">
165 <xsl:variable name="rel" select="text()"/>
166 <b><xsl:value-of select="$rel"/><br/></b>
172 <xsl:template name="diagnostic">
173 <xsl:for-each select="//diag:diagnostic">
174 <div class="diagnostic">
175 <!-- <xsl:value-of select="diag:uri"/> -->
176 <xsl:text> </xsl:text>
177 <xsl:value-of select="diag:message"/>
178 <xsl:text>: </xsl:text>
179 <xsl:value-of select="diag:details"/>
184 <xsl:template name="displaysearch">
185 <div class="searchresults">
186 <xsl:for-each select="srw:numberOfRecords">
188 <xsl:text>Number of Records: </xsl:text>
189 <xsl:value-of select="."/>
192 <xsl:for-each select="srw:nextRecordPosition">
194 <xsl:text>Next Record Position: </xsl:text>
195 <xsl:value-of select="."/>
199 <xsl:for-each select="srw:records">
200 <xsl:for-each select="srw:record">
203 <xsl:text>Record: </xsl:text>
204 <xsl:value-of select="srw:recordPosition"/>
205 <xsl:text> : </xsl:text>
206 <xsl:value-of select="srw:recordSchema"/>
207 <xsl:text> : </xsl:text>
208 <xsl:value-of select="srw:recordPacking"/>
212 <xsl:value-of select="srw:recordData"/>
221 <xsl:template name="displayscan">
222 <div class="scanresults">
224 <xsl:for-each select="srw:terms">
225 <xsl:for-each select="srw:term">
228 <!-- <xsl:text>Term: </xsl:text> -->
229 <xsl:for-each select="srw:displayTerm">
230 <xsl:value-of select="."/>
231 <xsl:text> : </xsl:text>
234 <xsl:for-each select="srw:value">
235 <xsl:value-of select="."/>
238 <xsl:for-each select="srw:numberOfRecords">
239 <xsl:text> (</xsl:text>
240 <xsl:value-of select="."/>
241 <xsl:text>)</xsl:text>
244 <xsl:for-each select="srw:extraTermData">
245 <xsl:text> - </xsl:text>
246 <xsl:value-of select="."/>