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: 2007-11-02 17:16:04 -0700 (Fri, 02 Nov 2007) $'
11
	* '$Revision: 3564 $'
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/flow_mat/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" nowrap="nowrap">
131
										<xsl:for-each
132
											select="./param[@name='fieldlabel']">
133
											<xsl:value-of select="." />
134
											<br />
135
										</xsl:for-each>
136
									</td>
137
									
138
									<td class="text_plain" nowrap="nowrap">
139
										<xsl:for-each
140
											select="./param[@name='fieldentry']">
141
											<xsl:value-of select="." />
142
											<br />
143
										</xsl:for-each>
144
									</td>
145
								</tr>
146
							</table>
147
						</td>
148

    
149
					</tr>
150
					<!-- 
151
					<tr>
152
						<td class="text_plain">
153
							<xsl:for-each
154
								select="./param[@name='objectives/material/mattext']">
155
								<xsl:value-of select="." />
156
								<br />
157
							</xsl:for-each>
158
						</td>
159
					</tr>
160
					-->
161
					<tr class="searchresultsdivider">
162
						<td colspan="3">
163
							<img
164
								src="/knb/style/skins/default/images/transparent1x1.gif"
165
								width="1" height="1" />
166
						</td>
167
					</tr>
168

    
169
				</xsl:for-each>
170
			</table>
171

    
172
		</xsl:if>
173
	</xsl:template>
174

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