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

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