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

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