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('emlStats', '<xsl:value-of select="./@emlPackage" />', '<xsl:value-of select="$contextURL" />/metacat');
100
								</script>
101
									
102
							</td>
103
			     		</tr>
104
			     		<tr>	
105
							<td class="rowodd">
106
			     				Data Table
107
			     			</td>
108
			     			<td class="roweven">
109
			     				<a>
110
									<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
									<xsl:value-of select="./@dataTable"/>
114
								</a>	
115
							</td>
116
			     		</tr>
117
			     	</table>		
118
				</td>
119
			</tr>
120
			
121
			<xsl:if test="$showAll='true'">
122
				<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
									<th>
128
										<xsl:attribute name="colspan">
129
											<xsl:value-of select="count(./*[local-name()='measurement'])"/>
130
										</xsl:attribute>
131
										Observation
132
									</th>
133
								</tr>
134
								<tr valign="top">
135
								
136
									<!-- observation entity -->
137
									<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
													<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
														<xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
154
													</p>	
155
												</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
									</td>
177
								</tr>
178
								<tr>	
179
									<!-- measurement -->
180
									<xsl:for-each select="./*[local-name()='measurement']">
181
										<td class="text_plain">
182
											<table class="subGroup subGroup_border">
183
												<tr>
184
													<th colspan="3"> 	
185
														Measurement (<xsl:value-of select="./@label" />)
186
													</th>
187
												</tr>	
188
												<tr>
189
													<td class="rowodd">					
190
														Column:
191
													</td>
192
													<td class="roweven">					
193
														<xsl:for-each select="key('mapping', @label)">
194
															<xsl:value-of select="./@attribute" />
195
														</xsl:for-each>
196
													</td>
197
													<td class="roweven"></td>
198
												</tr>
199
												<tr>
200
													<td class="rowodd">					
201
														Characteristic[s]:
202
													</td>
203
													<td class="roweven">
204
														<xsl:for-each select="./*[local-name()='characteristic']">
205
															<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
														</xsl:for-each>
214
													</td>
215
													<!-- 
216
													<td class="roweven">					
217
														<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
													-->
222
												</tr>
223
												<tr>
224
													<td class="rowodd">					
225
														Standard:
226
													</td>
227
													<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
													</td>
237
													<!-- 
238
													<td class="roweven">					
239
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
240
													</td>
241
													-->
242
												</tr>
243
												<tr>
244
													<td class="rowodd">					
245
														Protocol:
246
													</td>
247
													<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
													</td>
257
													<!-- 
258
													<td class="roweven">					
259
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
260
													</td>
261
													-->
262
												</tr>
263
											</table>
264
										</td>	
265
									</xsl:for-each> <!-- measurement -->
266
								</tr>
267
							</table>
268
						</td>		
269
					</tr>
270
				</xsl:for-each><!-- observation -->	
271
			</xsl:if>
272
			
273
			<tr class="searchresultsdivider">
274
				<td colspan="5">
275
				</td>
276
			</tr>
277
			
278
		</table>
279
		
280
	</xsl:template>
281

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