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

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