source: trunk/gsdl3/interfaces/default/transform/basicquery.xsl@ 3686

Last change on this file since 3686 was 3686, checked in by kjdon, 21 years ago

tidy up, cgi args changes, other stuff

  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
5<xsl:include href="style.xsl"/>
6<xsl:include href="service-params.xsl"/>
7
8<xsl:output method="html"/>
9
10<xsl:template match="page">
11
12<xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='c']/@value"/></xsl:variable>
13
14<html>
15<xsl:call-template name="greenstoneHead"/>
16<body xsl:use-attribute-sets="body-style">
17<center>
18<xsl:call-template name="collectionPageBanner">
19<xsl:with-param name="collName" select="$collName"/>
20</xsl:call-template>
21<xsl:apply-templates select="service">
22<xsl:with-param name="collName" select="$collName"/>
23</xsl:apply-templates>
24<xsl:apply-templates select="response">
25<xsl:with-param name="collName" select="$collName"/>
26</xsl:apply-templates>
27</center>
28<xsl:call-template name="greenstoneFooter"/>
29</body>
30</html>
31</xsl:template>
32
33<xsl:template match="service">
34<xsl:param name="collName">coll-name</xsl:param>
35<xsl:variable name="subaction"><xsl:value-of select="../request/@subaction"/></xsl:variable>
36<xsl:variable name='library' select='ancestor::page/config/library_name'/>
37<h3><xsl:value-of select="display/name"/></h3><p/>
38<form name="QueryForm" method="get" action="/gsdl3/{$library}">
39<xsl:apply-templates select="paramList"/>
40<input type="hidden" name="a" value="q"/>
41<input type="hidden" name="sa" value="{$subaction}"/>
42<input type="hidden" name="rt" value="r"/>
43<input type="hidden" name="s" value="{@name}"/>
44<input type="hidden" name="c" value="{$collName}"/>
45<input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
46</form>
47<xsl:call-template name="greenBar"/>
48</xsl:template>
49
50<xsl:template match="paramList">
51<p/><table width="537">
52<xsl:for-each select="param">
53<xsl:choose>
54<xsl:when test="@type='multi'">
55<tr><td colspan='2'>
56<xsl:apply-templates select='.'/></td></tr>
57</xsl:when>
58<xsl:otherwise>
59<xsl:variable name="pname" select="@name"/>
60<tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr>
61</xsl:otherwise>
62</xsl:choose>
63</xsl:for-each>
64</table>
65</xsl:template>
66
67
68<!-- a param list that puts params in pairs- wont work as is with new
69param handling stuff -->
70<!--
71<xsl:template match="paramList">
72<p/><table width="537">
73<xsl:choose>
74<xsl:when test='count(param)>4'>
75<xsl:for-each select="param[position() mod 2 = 1]">
76<tr><xsl:apply-templates select="."/>
77<xsl:if test="following-sibling::param[1]"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr>
78</xsl:for-each>
79</xsl:when>
80<xsl:otherwise>
81<xsl:for-each select="param">
82<tr><xsl:apply-templates select='.'/></tr>
83</xsl:for-each>
84</xsl:otherwise>
85</xsl:choose>
86</table>
87</xsl:template>
88-->
89
90<xsl:template match="response">
91<xsl:param name="collName">coll-name</xsl:param>
92<table width="537">
93<xsl:for-each select="content/documentList/document">
94<tr><xsl:apply-templates select="."><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates></tr>
95</xsl:for-each>
96</table>
97<xsl:call-template name="greenBar"/>
98</xsl:template>
99
100<xsl:template match="document">
101<xsl:param name="collName">coll-name</xsl:param>
102<xsl:variable name="library" select="ancestor::page/config/library_name"/>
103<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>
104</xsl:template>
105
106</xsl:stylesheet>
107
108
109
110
111
Note: See TracBrowser for help on using the repository browser.