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

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