Project

General

Profile

1 5385 leinfelder
<?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$'
10
	*     '$Date$'
11
	* '$Revision$'
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 5536 leinfelder
<xsl:stylesheet
32
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
33
	xmlns:sms="http://ecoinformatics.org/sms/annotation.0.9"
34 5385 leinfelder
	version="1.0">
35 5541 leinfelder
	<xsl:import href="annotation-root.xsl"/>
36 5385 leinfelder
37
	<xsl:output method="html" />
38
	<xsl:param name="sessid" />
39
	<xsl:param name="qformat">semtools</xsl:param>
40
	<xsl:param name="enableediting">false</xsl:param>
41
	<xsl:param name="contextURL"/>
42
	<xsl:template match="/">
43
		<html>
44
			<head>
45
				<title>Search Results</title>
46
				<link rel="stylesheet" type="text/css"
47
					href="/knb/style/skins/{$qformat}/{$qformat}.css" />
48
				<script language="Javascript" type="text/JavaScript"
49
					src="/knb/style/skins/{$qformat}/{$qformat}.js" />
50
				<script language="Javascript" type="text/JavaScript"
51
					src="/knb/style/common/branding.js" />
52
			</head>
53
54 5574 leinfelder
			<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
55 5385 leinfelder
				<script language="JavaScript">
56
					insertTemplateOpening('<xsl:value-of select="$contextURL" />'); insertSearchBox('<xsl:value-of select="$contextURL" />');
57
				</script>
58 5574 leinfelder
59
				<div id="content_wrapper">
60
61 5385 leinfelder
				<table style="width:100%;" align="center" border="0"
62
					cellpadding="5" cellspacing="0">
63
					<tr>
64
						<td align="left">
65
							<p class="emphasis">
66
								<xsl:number
67
									value="count(resultset/document)" />
68
								total records found
69
							</p>
70
						</td>
71
					</tr>
72
				</table>
73
74 5536 leinfelder
				<table align="left" border="0" cellpadding="0" cellspacing="5" width="100%">
75 5385 leinfelder
					<tr valign="top">
76
77
						<!-- EML HERE  -->
78
						<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
79 5533 leinfelder
							<td>
80 5385 leinfelder
								<xsl:call-template name="emlResults"/>
81
							</td>
82
						</xsl:if>
83
84
					</tr>
85
				</table>
86
87 5574 leinfelder
				</div>
88
89 5385 leinfelder
				<script language="JavaScript">
90
					insertTemplateClosing('<xsl:value-of select="$contextURL" />');
91
				</script>
92
			</body>
93
		</html>
94
	</xsl:template>
95
96
	<xsl:template name="emlResults">
97 5536 leinfelder
		<table align="center" border="0" cellpadding="5" cellspacing="0" width="100%">
98 5675 leinfelder
99
			<!--
100 5536 leinfelder
			<tr class="subpanel">
101 5385 leinfelder
				<th	style="text-align: left">
102
					Title
103
				</th>
104
				<th	style="text-align: left">
105
					Owners[s]
106
				</th>
107
				<th	style="text-align: left">
108
					Organization[s]
109
				</th>
110
				<th	style="text-align: left">
111
					Keywords
112
				</th>
113
			</tr>
114 5675 leinfelder
			-->
115 5385 leinfelder
116
			<xsl:for-each
117
				select="resultset/document[docname='eml']">
118
				<xsl:sort
119
					select="./param[@name='dataset/title']" />
120 5675 leinfelder
121
				<!-- the header portion of the result -->
122
				<tr valign="top">
123 5385 leinfelder
					<xsl:attribute name="class">
124
	              			<xsl:choose>
125 5675 leinfelder
						    <xsl:when test="position() mod 2 = 1">rowodd accordian</xsl:when>
126
						    <xsl:when test="position() mod 2 = 0">roweven accordian</xsl:when>
127 5385 leinfelder
						</xsl:choose>
128
					</xsl:attribute>
129
130 5675 leinfelder
					<td colspan="1" class="text_plain">
131 5672 leinfelder
						<a>
132
							<xsl:attribute name="href">
133
								<xsl:value-of select="$tripleURI"/><xsl:value-of select="./docid"/>
134 5385 leinfelder
							</xsl:attribute>
135 5672 leinfelder
							<b>
136
								<xsl:text>&#187;&#160;</xsl:text>
137
								<xsl:value-of select="./param[@name='dataset/title']"/>
138
							</b>
139
						</a>
140 5675 leinfelder
						(<xsl:value-of select="./docid" />)
141 5385 leinfelder
					</td>
142
				</tr>
143 5536 leinfelder
144 5675 leinfelder
				<!-- the content part -->
145 5385 leinfelder
				<tr valign="top">
146
					<xsl:attribute name="class">
147 5675 leinfelder
	              		<xsl:choose>
148
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
149
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
150 5385 leinfelder
						</xsl:choose>
151
					</xsl:attribute>
152 5675 leinfelder
153 5385 leinfelder
					<td class="text_plain">
154
155 5675 leinfelder
						<table width="100%">
156
							<tr>
157
								<td>
158
									<!-- render the annotation -->
159
									<xsl:for-each select="./*[local-name()='annotation']">
160
										<xsl:call-template name="annotation">
161
											 <xsl:with-param name="showAll" select="false"/>
162
										</xsl:call-template>
163
									</xsl:for-each>
164
								</td>
165
166
								<td>
167
168
									<!-- render people -->
169
									<table class="subGroup subGroup_border">
170
										<tr>
171
											<th>
172
												Owner[s]
173
											</th>
174
										</tr>
175
										<xsl:for-each
176
											select="./param[@name='creator/individualName/surName']">
177
											<tr>
178
												<td>
179
													<xsl:value-of select="." />
180
												</td>
181
											</tr>
182
										</xsl:for-each>
183
									</table>
184
185
								</td>
186
187
								<td>
188
189
									<!-- render orgs -->
190
									<table class="subGroup subGroup_border">
191
										<tr>
192
											<th>
193
												Organizations[s]
194
											</th>
195
										</tr>
196
										<xsl:for-each
197
											select="./param[@name='creator/organizationName']">
198
											<tr>
199
												<td>
200
													<xsl:value-of select="." />
201
												</td>
202
											</tr>
203
										</xsl:for-each>
204
									</table>
205
206
								</td>
207
208
								<td>
209
210
									<!-- render keywords -->
211
									<table class="subGroup subGroup_border">
212
										<tr>
213
											<th>
214
												Keyword[s]
215
											</th>
216
										</tr>
217
										<xsl:for-each
218
											select="./param[@name='keyword']">
219
											<tr>
220
												<td>
221
													<xsl:value-of select="." />
222
												</td>
223
											</tr>
224
										</xsl:for-each>
225
									</table>
226
227
								</td>
228
							</tr>
229
						</table>
230
231 5385 leinfelder
					</td>
232 5675 leinfelder
233 5385 leinfelder
				</tr>
234
235
			</xsl:for-each>
236
		</table>
237 5675 leinfelder
	</xsl:template>
238 5385 leinfelder
239
240
</xsl:stylesheet>