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
													<xsl:attribute name="title">
132
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
133
														<xsl:text>#</xsl:text>
134
														<xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
135
													</xsl:attribute> 
136
													<xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
137
												</td>
138
											</tr>
139
											
140
											<tr>		
141
												<td class="rowodd">
142
													Ontology:
143
												</td>
144
												<td class="roweven">	 
145
													<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
146
												</td>
147
											</tr>
148
											
149
											<tr>
150
												<td class="rowodd">	
151
													Label:
152
												</td>
153
												<td class="roweven">	 
154
													<xsl:value-of select="./@label"/>
155
												</td>
156
											</tr>	
157
										</table>		
158
									</td>
159
								</tr>
160
								<tr>	
161
									<!-- measurement -->
162
									<xsl:for-each select="./*[local-name()='measurement']">
163
										<td class="text_plain">
164
											<table class="subGroup subGroup_border">
165
												<tr>
166
													<th colspan="3"> 	
167
														Measurement (<xsl:value-of select="./@label" />)
168
													</th>
169
												</tr>	
170
												<tr>
171
													<td class="rowodd">					
172
														Column:
173
													</td>
174
													<td class="roweven">					
175
														<xsl:for-each select="key('mapping', @label)">
176
															<xsl:value-of select="./@attribute" />
177
														</xsl:for-each>
178
													</td>
179
													<td class="roweven"></td>
180
												</tr>
181
												<tr>
182
													<td class="rowodd">					
183
														Characteristic[s]:
184
													</td>
185
													<td class="roweven">
186
														<xsl:for-each select="./*[local-name()='characteristic']">
187
															<p>
188
																<xsl:attribute name="title">
189
																	<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
190
																	<xsl:text>#</xsl:text>
191
																	<xsl:value-of select="substring-after(./@id, ':')"/>
192
																</xsl:attribute>
193
																<xsl:value-of select="substring-after(./@id, ':')"/>
194
															</p>	
195
														</xsl:for-each>
196
													</td>
197
													<!-- 
198
													<td class="roweven">					
199
														<xsl:for-each select="./*[local-name()='characteristic']">
200
															<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
201
														</xsl:for-each>
202
													</td>
203
													-->
204
												</tr>
205
												<tr>
206
													<td class="rowodd">					
207
														Standard:
208
													</td>
209
													<td class="roweven">
210
														<p>
211
															<xsl:attribute name="title">
212
																<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
213
																<xsl:text>#</xsl:text>
214
																<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>	
215
															</xsl:attribute>					
216
															<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>
217
														</p>							
218
													</td>
219
													<!-- 
220
													<td class="roweven">					
221
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
222
													</td>
223
													-->
224
												</tr>
225
												<tr>
226
													<td class="rowodd">					
227
														Protocol:
228
													</td>
229
													<td class="roweven">
230
														<p>
231
															<xsl:attribute name="title">
232
																<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
233
																<xsl:text>#</xsl:text>
234
																<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
235
															</xsl:attribute>					
236
															<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
237
														</p>
238
													</td>
239
													<!-- 
240
													<td class="roweven">					
241
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
242
													</td>
243
													-->
244
												</tr>
245
											</table>
246
										</td>	
247
									</xsl:for-each> <!-- measurement -->
248
								</tr>
249
							</table>
250
						</td>		
251
					</tr>
252
				</xsl:for-each><!-- observation -->	
253
			</xsl:if>
254
			
255
			<tr class="searchresultsdivider">
256
				<td colspan="5">
257
				</td>
258
			</tr>
259
			
260
		</table>
261
		
262
	</xsl:template>
263

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