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="10" width="100%" class="subGroup">
51
			<tr>
52
				<td>
53
					<table class="subGroup subGroup_border">
54
						<tr>
55
							<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
									<xsl:attribute name="href">
66
										<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
							</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:text>&#187;&#160;</xsl:text>
83
									<xsl:value-of select="./@emlPackage"/>
84
								</a>	
85
							</td>
86
			     		</tr>
87
			     		<tr>	
88
							<td class="rowodd">
89
			     				Data Table
90
			     			</td>
91
			     			<td class="roweven">
92
			     				<a>
93
									<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
									<xsl:text>&#187;&#160;</xsl:text>
97
									<xsl:value-of select="./@dataTable"/>
98
								</a>	
99
							</td>
100
			     		</tr>
101
			     	</table>				
102
				</td>
103
			</tr>
104
			
105
			<xsl:if test="$showAll='true'">
106
				<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
									<th>
112
										<xsl:attribute name="colspan">
113
											<xsl:value-of select="count(./*[local-name()='measurement'])"/>
114
										</xsl:attribute>
115
										Observation
116
									</th>
117
								</tr>
118
								<tr valign="top">
119
								
120
									<!-- observation entity -->
121
									<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
													<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
														<xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
138
													</p>	
139
												</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
									</td>
161
								</tr>
162
								<tr>	
163
									<!-- measurement -->
164
									<xsl:for-each select="./*[local-name()='measurement']">
165
										<td class="text_plain">
166
											<table class="subGroup subGroup_border">
167
												<tr>
168
													<th colspan="3"> 	
169
														Measurement (<xsl:value-of select="./@label" />)
170
													</th>
171
												</tr>	
172
												<tr>
173
													<td class="rowodd">					
174
														Column:
175
													</td>
176
													<td class="roweven">					
177
														<xsl:for-each select="key('mapping', @label)">
178
															<xsl:value-of select="./@attribute" />
179
														</xsl:for-each>
180
													</td>
181
													<td class="roweven"></td>
182
												</tr>
183
												<tr>
184
													<td class="rowodd">					
185
														Characteristic[s]:
186
													</td>
187
													<td class="roweven">
188
														<xsl:for-each select="./*[local-name()='characteristic']">
189
															<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
														</xsl:for-each>
198
													</td>
199
													<!-- 
200
													<td class="roweven">					
201
														<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
													-->
206
												</tr>
207
												<tr>
208
													<td class="rowodd">					
209
														Standard:
210
													</td>
211
													<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
													</td>
221
													<!-- 
222
													<td class="roweven">					
223
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
224
													</td>
225
													-->
226
												</tr>
227
												<tr>
228
													<td class="rowodd">					
229
														Protocol:
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()='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
													</td>
241
													<!-- 
242
													<td class="roweven">					
243
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
244
													</td>
245
													-->
246
												</tr>
247
											</table>
248
										</td>	
249
									</xsl:for-each> <!-- measurement -->
250
								</tr>
251
							</table>
252
						</td>		
253
					</tr>
254
				</xsl:for-each><!-- observation -->	
255
			</xsl:if>
256
			
257
			<tr class="searchresultsdivider">
258
				<td colspan="5">
259
				</td>
260
			</tr>
261
			
262
		</table>
263
		
264
	</xsl:template>
265

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