Project

General

Profile

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

    
275
</xsl:stylesheet>
(1-1/14)