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

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