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

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