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-08-30 23:34:14 +0000 (Mon, 30 Aug 2010) $'
|
11
|
* '$Revision: 5533 $'
|
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
|
xmlns:fn="http://www.w3.org/2005/xpath-functions"
|
35
|
version="2.0">
|
36
|
|
37
|
<xsl:output method="html" />
|
38
|
<xsl:param name="sessionid" />
|
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="tripleURI"><xsl:value-of select="$contextURL" /><![CDATA[/metacat?action=read&qformat=]]><xsl:value-of select="$qformat" /><![CDATA[&sessionid=]]><xsl:value-of select="$sessionid" /><![CDATA[&docid=]]></xsl:param>
|
44
|
|
45
|
<xsl:key name="mapping" match="//*[local-name()='map']" use="@measurement" />
|
46
|
|
47
|
<xsl:template name="annotation">
|
48
|
<xsl:param name="showAll">true</xsl:param>
|
49
|
|
50
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="subGroup">
|
51
|
<tr>
|
52
|
<td>
|
53
|
|
54
|
<table class="subGroup subGroup_border">
|
55
|
<tr>
|
56
|
<th colspan="2">
|
57
|
Details
|
58
|
</th>
|
59
|
</tr>
|
60
|
<tr>
|
61
|
<td class="rowodd">
|
62
|
Annotation
|
63
|
</td>
|
64
|
<td class="roweven">
|
65
|
<a>
|
66
|
<xsl:attribute name="href">
|
67
|
<xsl:value-of select="$tripleURI"/><xsl:value-of select="./@id"/>
|
68
|
</xsl:attribute>
|
69
|
<xsl:value-of select="./@id"/>
|
70
|
</a>
|
71
|
|
72
|
<!-- stats -->
|
73
|
<span id="annotationStats"></span>
|
74
|
<script language="JavaScript">
|
75
|
loadStats('annotationStats', '<xsl:value-of select="./@id" />', '<xsl:value-of select="$contextURL" />/metacat');
|
76
|
</script>
|
77
|
|
78
|
</td>
|
79
|
</tr>
|
80
|
<tr>
|
81
|
<td class="rowodd">
|
82
|
Data Package
|
83
|
</td>
|
84
|
<td class="roweven">
|
85
|
<a>
|
86
|
<xsl:attribute name="href">
|
87
|
<xsl:value-of select="$tripleURI"/><xsl:value-of select="./@emlPackage"/>
|
88
|
</xsl:attribute>
|
89
|
<xsl:value-of select="./@emlPackage"/>
|
90
|
</a>
|
91
|
|
92
|
<!-- stats -->
|
93
|
<span id="emlStats"></span>
|
94
|
<script language="JavaScript">
|
95
|
loadStats('emlStats', '<xsl:value-of select="./@emlPackage" />', '<xsl:value-of select="$contextURL" />/metacat');
|
96
|
</script>
|
97
|
|
98
|
</td>
|
99
|
</tr>
|
100
|
<tr>
|
101
|
<td class="rowodd">
|
102
|
Data Table
|
103
|
</td>
|
104
|
<td class="roweven">
|
105
|
<a>
|
106
|
<xsl:attribute name="href">
|
107
|
<xsl:value-of select="$tripleURI"/><xsl:value-of select="./@emlPackage"/>&displaymodule=entity&entitytype=dataTable&entityindex=<xsl:value-of select="number(./@dataTable)+1"/>
|
108
|
</xsl:attribute>
|
109
|
<xsl:value-of select="./@dataTable"/>
|
110
|
</a>
|
111
|
</td>
|
112
|
</tr>
|
113
|
</table>
|
114
|
</td>
|
115
|
</tr>
|
116
|
|
117
|
<xsl:if test="$showAll='true'">
|
118
|
<xsl:for-each select="./*[local-name()='observation']">
|
119
|
<tr>
|
120
|
<td class="text_plain" colspan="2">
|
121
|
<table class="subGroup subGroup_border">
|
122
|
<tr>
|
123
|
<th>
|
124
|
<xsl:attribute name="colspan">
|
125
|
<xsl:value-of select="count(./*[local-name()='measurement'])"/>
|
126
|
</xsl:attribute>
|
127
|
Observation
|
128
|
</th>
|
129
|
</tr>
|
130
|
<tr valign="top">
|
131
|
|
132
|
<!-- observation entity -->
|
133
|
<td>
|
134
|
<xsl:attribute name="colspan">
|
135
|
<xsl:value-of select="count(./*[local-name()='measurement'])"/>
|
136
|
</xsl:attribute>
|
137
|
<table>
|
138
|
<tr>
|
139
|
<td class="rowodd">
|
140
|
Class:
|
141
|
</td>
|
142
|
<td class="roweven">
|
143
|
<p>
|
144
|
<xsl:attribute name="title">
|
145
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
|
146
|
<xsl:text>#</xsl:text>
|
147
|
<xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
|
148
|
</xsl:attribute>
|
149
|
<xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
|
150
|
</p>
|
151
|
</td>
|
152
|
</tr>
|
153
|
|
154
|
<tr>
|
155
|
<td class="rowodd">
|
156
|
Ontology:
|
157
|
</td>
|
158
|
<td class="roweven">
|
159
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
|
160
|
</td>
|
161
|
</tr>
|
162
|
|
163
|
<tr>
|
164
|
<td class="rowodd">
|
165
|
Label:
|
166
|
</td>
|
167
|
<td class="roweven">
|
168
|
<xsl:value-of select="./@label"/>
|
169
|
</td>
|
170
|
</tr>
|
171
|
</table>
|
172
|
</td>
|
173
|
</tr>
|
174
|
<tr>
|
175
|
<!-- measurement -->
|
176
|
<xsl:for-each select="./*[local-name()='measurement']">
|
177
|
<td class="text_plain">
|
178
|
<table class="subGroup subGroup_border">
|
179
|
<tr>
|
180
|
<th colspan="3">
|
181
|
Measurement (<xsl:value-of select="./@label" />)
|
182
|
</th>
|
183
|
</tr>
|
184
|
<tr>
|
185
|
<td class="rowodd">
|
186
|
Column:
|
187
|
</td>
|
188
|
<td class="roweven">
|
189
|
<xsl:for-each select="key('mapping', @label)">
|
190
|
<xsl:value-of select="./@attribute" />
|
191
|
</xsl:for-each>
|
192
|
</td>
|
193
|
<td class="roweven"></td>
|
194
|
</tr>
|
195
|
<tr>
|
196
|
<td class="rowodd">
|
197
|
Characteristic[s]:
|
198
|
</td>
|
199
|
<td class="roweven">
|
200
|
<xsl:for-each select="./*[local-name()='characteristic']">
|
201
|
<p>
|
202
|
<xsl:attribute name="title">
|
203
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
|
204
|
<xsl:text>#</xsl:text>
|
205
|
<xsl:value-of select="substring-after(./@id, ':')"/>
|
206
|
</xsl:attribute>
|
207
|
<xsl:value-of select="substring-after(./@id, ':')"/>
|
208
|
</p>
|
209
|
</xsl:for-each>
|
210
|
</td>
|
211
|
<!--
|
212
|
<td class="roweven">
|
213
|
<xsl:for-each select="./*[local-name()='characteristic']">
|
214
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
|
215
|
</xsl:for-each>
|
216
|
</td>
|
217
|
-->
|
218
|
</tr>
|
219
|
<tr>
|
220
|
<td class="rowodd">
|
221
|
Standard:
|
222
|
</td>
|
223
|
<td class="roweven">
|
224
|
<p>
|
225
|
<xsl:attribute name="title">
|
226
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
|
227
|
<xsl:text>#</xsl:text>
|
228
|
<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>
|
229
|
</xsl:attribute>
|
230
|
<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>
|
231
|
</p>
|
232
|
</td>
|
233
|
<!--
|
234
|
<td class="roweven">
|
235
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
|
236
|
</td>
|
237
|
-->
|
238
|
</tr>
|
239
|
<tr>
|
240
|
<td class="rowodd">
|
241
|
Protocol:
|
242
|
</td>
|
243
|
<td class="roweven">
|
244
|
<p>
|
245
|
<xsl:attribute name="title">
|
246
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
|
247
|
<xsl:text>#</xsl:text>
|
248
|
<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
|
249
|
</xsl:attribute>
|
250
|
<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
|
251
|
</p>
|
252
|
</td>
|
253
|
<!--
|
254
|
<td class="roweven">
|
255
|
<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
|
256
|
</td>
|
257
|
-->
|
258
|
</tr>
|
259
|
</table>
|
260
|
</td>
|
261
|
</xsl:for-each> <!-- measurement -->
|
262
|
</tr>
|
263
|
</table>
|
264
|
</td>
|
265
|
</tr>
|
266
|
</xsl:for-each><!-- observation -->
|
267
|
</xsl:if>
|
268
|
|
269
|
<tr class="searchresultsdivider">
|
270
|
<td colspan="5">
|
271
|
</td>
|
272
|
</tr>
|
273
|
|
274
|
</table>
|
275
|
|
276
|
</xsl:template>
|
277
|
|
278
|
</xsl:stylesheet>
|