Project

General

Profile

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