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="5" cellspacing="0" width="100%" class="subGroup">
51
			<tr class="subpanel">	
52
				<td class="text_plain" colspan="2">
53
					<table class="subGroup subGroup_border">
54
						<tr>
55
							<td class="text_plain">
56
								Annotation ID:
57
							</td>
58
							<td class="text_plain">
59
								<xsl:value-of select="./@id"/>
60
							</td>
61
							<td class="text_plain">
62
								<a>
63
									<xsl:attribute name="href">
64
										<xsl:value-of select="$tripleURI"/><xsl:value-of select="./@id"/></xsl:attribute>
65
			     						View Annotation
66
			     				</a>
67
			     			</td>	
68
						</tr>
69
						<tr>
70
							<td class="text_plain">
71
								Data Package:
72
							</td>
73
							<td class="text_plain">
74
								<xsl:value-of select="./@emlPackage"/>
75
							</td>
76
							<td class="text_plain">
77
								<a>
78
									<xsl:attribute name="href">
79
										<xsl:value-of select="$tripleURI"/><xsl:value-of select="./@emlPackage"/></xsl:attribute>
80
			     						View Data Package
81
			     				</a>
82
			     			</td>
83
			     		</tr>
84
			     		<tr>	
85
							<td class="text_plain">
86
								Data Table:
87
							</td>
88
							<td class="text_plain">
89
								<xsl:value-of select="./@dataTable"/>
90
							</td>
91
							<td class="text_plain">
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
			     					View Data Table Metadata
97
			     				</a>
98
			     			</td>
99
			     		</tr>
100
			     	</table>				
101
				</td>
102
			</tr>
103
			
104
			<xsl:if test="$showAll='true'">
105
								
106
				<tr class="subpanel">
107
					<td class="text_plain" colspan="2">
108
						<table class="subGroup subGroup_border">
109
							<tr class="subpanel">
110
								<th	style="text-align: left">
111
									Entity
112
								</th>
113
								<th	style="text-align: left"> 	
114
									Measurement
115
								</th>
116
							</tr>
117
					
118
							<xsl:for-each select="./*[local-name()='observation']">
119
								<tr valign="top" class="subpanel">
120
									<xsl:attribute name="class">
121
					              			<xsl:choose>
122
										    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
123
										    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
124
										</xsl:choose>
125
									</xsl:attribute>
126
					
127
									<!-- observation entity -->
128
									<td class="text_plain">
129
										Class: <xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
130
										<br/>
131
										Ontology: <xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
132
										<br />
133
										Label: <xsl:value-of select="./@label"/>
134
									</td>
135
									<!-- measurement -->
136
									<td class="text_plain">					
137
										<xsl:for-each select="./*[local-name()='measurement']">
138
											<table>
139
												<tr>
140
													<td class="text_plain">					
141
														Column:
142
													</td>
143
													<td class="text_plain">					
144
														<xsl:for-each select="key('mapping', @label)">
145
															<xsl:value-of select="./@attribute" />
146
														</xsl:for-each>
147
													</td>
148
													<td></td>
149
												</tr>
150
												<tr>
151
													<td class="text_plain">					
152
														Characteristic[s]:
153
													</td>
154
													<td class="text_plain">					
155
														<xsl:for-each select="./*[local-name()='characteristic']">
156
															<!--xsl:value-of select="./@id" /-->
157
															<xsl:value-of select="substring-after(./@id, ':')"/>
158
														</xsl:for-each>
159
													</td>
160
													<td class="text_plain">					
161
														<xsl:for-each select="./*[local-name()='characteristic']">
162
															<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./@id, ':'), .)"/>
163
														</xsl:for-each>
164
													</td>
165
												</tr>
166
												<tr>
167
													<td class="text_plain">					
168
														Standard:
169
													</td>
170
													<td class="text_plain">					
171
														<!-- xsl:value-of select="./*[local-name()='standard']/@id" /-->
172
														<xsl:value-of select="substring-after(./*[local-name()='standard']/@id, ':')"/>						
173
													</td>
174
													<td class="text_plain">					
175
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='standard']/@id, ':'), .)"/>
176
													</td>
177
												</tr>
178
												<tr>
179
													<td class="text_plain">					
180
														Protocol:
181
													</td>
182
													<td class="text_plain">					
183
														<!-- xsl:value-of select="./*[local-name()='protocol']/@id" /-->
184
														<xsl:value-of select="substring-after(./*[local-name()='protocol']/@id, ':')"/>
185
													</td>
186
													<td class="text_plain">					
187
														<xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='protocol']/@id, ':'), .)"/>
188
													</td>
189
												</tr>
190
											</table>
191
											<hr/>
192
										</xsl:for-each>
193
									</td>
194
								</tr>
195
							</xsl:for-each>
196
						</table>
197
					</td>		
198
				</tr>
199
			</xsl:if>
200
			
201
			<tr class="searchresultsdivider">
202
				<td colspan="5">
203
				</td>
204
			</tr>
205
			
206
		</table>
207
		
208
	</xsl:template>
209

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