Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
	*  '$RCSfile$'
4
	*      Authors: Matt Jones, CHad Berkley
5
	*    Copyright: 2000 Regents of the University of California and the
6
	*               National Center for Ecological Analysis and Synthesis
7
	*  For Details: http://www.nceas.ucsb.edu/
8
	*
9
	*   '$Author: leinfelder $'
10
	*     '$Date: 2008-06-02 17:19:34 -0700 (Mon, 02 Jun 2008) $'
11
	* '$Revision: 3927 $'
12
	*
13
	* This program is free software; you can redistribute it and/or modify
14
	* it under the terms of the GNU General Public License as published by
15
	* the Free Software Foundation; either version 2 of the License, or
16
	* (at your option) any later version.
17
	*
18
	* This program is distributed in the hope that it will be useful,
19
	* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
	* GNU General Public License for more details.
22
	*
23
	* You should have received a copy of the GNU General Public License
24
	* along with this program; if not, write to the Free Software
25
	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
	*
27
	* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
	* convert an XML file showing the resultset of a query
29
	* into an HTML format suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32

    
33
	<xsl:output method="html" />
34
	<xsl:param name="sessid" />
35
	<xsl:param name="qformat">default</xsl:param>
36
	<xsl:param name="enableediting">false</xsl:param>
37
	<xsl:template match="/">
38
		<script language="JavaScript">
39
          <![CDATA[
40
          submitform = function(action,form_ref) {
41
              form_ref.action.value=action;
42
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
43
              //form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
44
              form_ref.submit();
45
          }
46

    
47
          ]]>
48
        </script>
49
        
50
        <p class="emphasis">
51
			<xsl:number value="count(resultset/document)" /> items found
52
		</p>
53

    
54
		<!-- This tests to see if there are returned documents,
55
			if there are not then don't show the query results -->
56
		<xsl:if test="count(resultset/document) &gt; 0">
57

    
58
			<table width="95%" align="left" border="0" cellpadding="0"
59
				cellspacing="0">
60

    
61
				<xsl:for-each select="resultset/document">
62
					<xsl:sort select="./param[@name='item/@title']" />
63
					<tr valign="top">
64
						<xsl:attribute name="class">
65
							<xsl:choose>
66
								<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
67
								<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
68
							</xsl:choose>
69
						</xsl:attribute>
70

    
71
						<td class="text_plain">
72
							<a>
73
								<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
74
								<xsl:text>&#187;&#160;</xsl:text>
75
								<xsl:value-of select="./param[@name='item/@title']" />
76
								<!-- <xsl:value-of select="./param[@name='item/@ident']" />-->
77
							</a>
78
							(<xsl:value-of select="./docid" />)
79
							<form action="/knb/metacat" method="POST">
80
								<xsl:attribute name="name">
81
									<xsl:value-of select="translate(./docid, '()-.', '____')" />
82
								</xsl:attribute>
83

    
84
								<input type="hidden" name="qformat" value="first"/>
85
								<input type="hidden" name="sessionid" />
86
								<xsl:if	test="$enableediting = 'true'">
87
									<input type="hidden"
88
										name="enableediting" value="{$enableediting}" />
89
								</xsl:if>
90
								<input type="hidden" name="action" value="read" />
91
								<input type="hidden" name="docid">
92
									<xsl:attribute name="value">
93
										<xsl:value-of select="./docid" />
94
									</xsl:attribute>
95
								</input>
96
								<xsl:for-each select="./relation">
97
									<input type="hidden" name="docid">
98
										<xsl:attribute name="value">
99
											<xsl:value-of select="./relationdoc" />
100
										</xsl:attribute>
101
									</input>
102
								</xsl:for-each>
103
							</form>	
104
						</td>
105
						
106
						<td class="text_plain">
107
							<xsl:for-each select="./param[@name='presentation/flow/material/mattext']">
108
								<xsl:value-of select="."/>
109
								<br/>
110
							</xsl:for-each>	
111
							
112
							<ul>
113
							<xsl:for-each
114
								select="./param[@name='response_label/material/mattext']">
115
								<li>
116
									<xsl:value-of select="." />
117
								</li>	
118
							</xsl:for-each>
119
							</ul>
120
						</td>
121
						
122
						<td>
123
							<table>
124
								<tr valign="top">
125
									<td class="text_plain" colspan="2">
126
										Metadata
127
									</td>
128
								</tr>
129
								<tr valign="top">
130
									<td class="text_plain" colspan="2">
131
										Vocabulary:
132
										<xsl:for-each
133
											select="./param[@name='vocabulary']">
134
											<xsl:value-of select="." />
135
											<br />
136
										</xsl:for-each>
137
									</td>
138
								</tr>
139
								<tr valign="top">
140
									<td class="text_plain" nowrap="nowrap">
141
										<xsl:for-each
142
											select="./param[@name='fieldlabel']">
143
											<xsl:value-of select="." />:
144
											<br />
145
										</xsl:for-each>
146
									</td>
147
									
148
									<td class="text_plain" nowrap="nowrap">
149
										<xsl:for-each
150
											select="./param[@name='fieldentry']">
151
											<xsl:value-of select="." />
152
											<br />
153
										</xsl:for-each>
154
									</td>
155
								</tr>
156
							</table>
157
						</td>
158

    
159
					</tr>
160
					<!-- 
161
					<tr>
162
						<td class="text_plain">
163
							<xsl:for-each
164
								select="./param[@name='objectives/material/mattext']">
165
								<xsl:value-of select="." />
166
								<br />
167
							</xsl:for-each>
168
						</td>
169
					</tr>
170
					-->
171
					<tr class="searchresultsdivider">
172
						<td colspan="3">
173
							<img
174
								src="/knb/style/skins/default/images/transparent1x1.gif"
175
								width="1" height="1" />
176
						</td>
177
					</tr>
178

    
179
				</xsl:for-each>
180
			</table>
181

    
182
		</xsl:if>
183
	</xsl:template>
184

    
185
</xsl:stylesheet>
(3-3/10)