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