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