Project

General

Profile

« Previous | Next » 

Revision 5541

include stylesheet to display annotation document on it's own (in addition to within a resultset)

View differences:

lib/style/skins/semtools/annotation.xsl
7 7
	*  For Details: http://www.nceas.ucsb.edu/
8 8
	*
9 9
	*   '$Author: leinfelder $'
10
	*     '$Date: 2010-08-30 23:34:14 +0000 (Mon, 30 Aug 2010) $'
11
	* '$Revision: 5533 $'
10
	*     '$Date: 2010-09-03 23:53:00 +0000 (Fri, 03 Sep 2010) $'
11
	* '$Revision: 5536 $'
12 12
	*
13 13
	* This program is free software; you can redistribute it and/or modify
14 14
	* it under the terms of the GNU General Public License as published by
......
31 31
<xsl:stylesheet 
32 32
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
33 33
	xmlns:sms="http://ecoinformatics.org/sms/annotation.0.9"
34
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
35
	version="2.0">
34
	version="1.0">
35
	<xsl:import href="annotation-root.xsl"/>
36 36

  
37 37
	<xsl:output method="html" />
38 38
	<xsl:param name="sessid" />
39 39
	<xsl:param name="qformat">semtools</xsl:param>
40 40
	<xsl:param name="enableediting">false</xsl:param>
41 41
	<xsl:param name="contextURL"/>
42
	
43
	<xsl:key name="mapping" match="//*[local-name()='map']" use="@measurement" />
44
	
45
	<xsl:template name="annotation">
42
	<xsl:template match="/">
43
		<html>
44
			<head>
45
				<title>Search Results</title>
46
				<link rel="stylesheet" type="text/css"
47
					href="/knb/style/skins/{$qformat}/{$qformat}.css" />
48
				<script language="Javascript" type="text/JavaScript"
49
					src="/knb/style/skins/{$qformat}/{$qformat}.js" />
50
				<script language="Javascript" type="text/JavaScript"
51
					src="/knb/style/common/branding.js" />
52
			</head>
53

  
54
			<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
55
				<script language="JavaScript">
56
					insertTemplateOpening('<xsl:value-of select="$contextURL" />'); insertSearchBox('<xsl:value-of select="$contextURL" />');
57
				</script>
58
				
59
				<xsl:for-each select="/*[local-name()='annotation']">
60
					<xsl:call-template name="annotation"/>
61
				</xsl:for-each>	
62
				
63
				<script language="JavaScript">
64
					insertTemplateClosing('<xsl:value-of select="$contextURL" />');
65
				</script>
66
			</body>
46 67
			
47
		<table align="center" border="0" cellpadding="5" cellspacing="0" width="100%">
48
			<tr>
49
				<th class="tablehead" colspan="2">
50
					Annotation
51
				</th>
52
			</tr>
53
			<tr class="subpanel">
54
				<th	style="text-align: left" colspan="2">Details</th>
55
			</tr>
56
			<tr class="subpanel">	
57
				<td class="text_plain" colspan="2">
58
					ID: <xsl:value-of select="./@id"/>
59
					<br />
60
					Data Package: <xsl:value-of select="./@emlPackage"/>
61
					<br />
62
					Data Table: <xsl:value-of select="./@dataTable"/>
63
				</td>
64
			</tr>
65
			<tr class="subpanel">
66
				<th	style="text-align: left">
67
					Entity
68
				</th>
69
				<th	style="text-align: left"> 	
70
					Measurement
71
				</th>
72
			</tr>
68
		</html>
69
	</xsl:template>
73 70
	
74
			<xsl:for-each select="./*[local-name()='observation']">
75
				<tr valign="top" class="subpanel">
76
					<xsl:attribute name="class">
77
	              			<xsl:choose>
78
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
79
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
80
						</xsl:choose>
81
					</xsl:attribute>
82
	
83
					<!-- observation entity -->
84
					<td class="text_plain">
85
						Class: <xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
86
						<br/>
87
						Ontology: <xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
88
						<br />
89
						(Label: <xsl:value-of select="./@label"/>)
90
					</td>
91
					<!-- measurement -->
92
					<td class="text_plain">
93
						<xsl:for-each select="./*[local-name()='measurement']">
94
							<xsl:for-each select="key('mapping', @label)">
95
								Column: <xsl:value-of select="./@attribute" />
96
								<br />
97
							</xsl:for-each>
98
							<!-- 
99
							<xsl:value-of select="./@label" />
100
							<br />
101
							-->
102
							Characteristic[s]: 
103
							<xsl:for-each select="./*[local-name()='characteristic']">
104
								<xsl:value-of select="./@id" />
105
							</xsl:for-each>
106
							<br/>
107
							Standard: <xsl:value-of select="./*[local-name()='standard']/@id" />
108
							<br/>
109
							Protocol: <xsl:value-of select="./*[local-name()='protocol']/@id" />
110
							<hr/>
111
						</xsl:for-each>
112
					</td>
113
					
114
				</tr>
115
				<tr class="searchresultsdivider">
116
					<td colspan="5">
117
					</td>
118
				</tr>
119
	
120
			</xsl:for-each>
121
		</table>
122
	</xsl:template>
123

  
124 71
</xsl:stylesheet>
lib/style/skins/semtools/resultset.xsl
32 32
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
33 33
	xmlns:sms="http://ecoinformatics.org/sms/annotation.0.9"
34 34
	version="1.0">
35
	<xsl:import href="annotation.xsl"/>
35
	<xsl:import href="annotation-root.xsl"/>
36 36

  
37 37
	<xsl:output method="html" />
38 38
	<xsl:param name="sessid" />
lib/style/skins/semtools/annotation-root.xsl
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="sessid" />
39
	<xsl:param name="qformat">semtools</xsl:param>
40
	<xsl:param name="enableediting">false</xsl:param>
41
	<xsl:param name="contextURL"/>
42
	
43
	<xsl:key name="mapping" match="//*[local-name()='map']" use="@measurement" />
44
	
45
	<xsl:template name="annotation">
46
			
47
		<table align="center" border="0" cellpadding="5" cellspacing="0" width="100%">
48
			<tr>
49
				<th class="tablehead" colspan="2">
50
					Annotation
51
				</th>
52
			</tr>
53
			<tr class="subpanel">
54
				<th	style="text-align: left" colspan="2">Details</th>
55
			</tr>
56
			<tr class="subpanel">	
57
				<td class="text_plain" colspan="2">
58
					ID: <xsl:value-of select="./@id"/>
59
					<br />
60
					Data Package: <xsl:value-of select="./@emlPackage"/>
61
					<br />
62
					Data Table: <xsl:value-of select="./@dataTable"/>
63
				</td>
64
			</tr>
65
			<tr class="subpanel">
66
				<th	style="text-align: left">
67
					Entity
68
				</th>
69
				<th	style="text-align: left"> 	
70
					Measurement
71
				</th>
72
			</tr>
73
	
74
			<xsl:for-each select="./*[local-name()='observation']">
75
				<tr valign="top" class="subpanel">
76
					<xsl:attribute name="class">
77
	              			<xsl:choose>
78
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
79
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
80
						</xsl:choose>
81
					</xsl:attribute>
82
	
83
					<!-- observation entity -->
84
					<td class="text_plain">
85
						Class: <xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
86
						<br/>
87
						Ontology: <xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
88
						<br />
89
						(Label: <xsl:value-of select="./@label"/>)
90
					</td>
91
					<!-- measurement -->
92
					<td class="text_plain">
93
						<xsl:for-each select="./*[local-name()='measurement']">
94
							<xsl:for-each select="key('mapping', @label)">
95
								Column: <xsl:value-of select="./@attribute" />
96
								<br />
97
							</xsl:for-each>
98
							<!-- 
99
							<xsl:value-of select="./@label" />
100
							<br />
101
							-->
102
							Characteristic[s]: 
103
							<xsl:for-each select="./*[local-name()='characteristic']">
104
								<xsl:value-of select="./@id" />
105
							</xsl:for-each>
106
							<br/>
107
							Standard: <xsl:value-of select="./*[local-name()='standard']/@id" />
108
							<br/>
109
							Protocol: <xsl:value-of select="./*[local-name()='protocol']/@id" />
110
							<hr/>
111
						</xsl:for-each>
112
					</td>
113
					
114
				</tr>
115
				<tr class="searchresultsdivider">
116
					<td colspan="5">
117
					</td>
118
				</tr>
119
	
120
			</xsl:for-each>
121
		</table>
122
	</xsl:template>
123

  
124
</xsl:stylesheet>
0 125

  
lib/style/skins/semtools/semtools.xml
7 7
    <target publicid="-//W3C//HTML//EN">/style/skins/semtools/resultset.xsl</target>
8 8
  </doctype>
9 9
  
10
  <!-- Annotation rendering -->  
11
  <doctype publicid="http://ecoinformatics.org/sms/annotation.0.9">
12
    <target publicid="-//W3C//HTML//EN">/style/skins/semtools/annotation.xsl</target>
13
  </doctype>
14
  
10 15
<!-- eml-2.1.0 modules -->
11 16
  <doctype publicid="eml://ecoinformatics.org/eml-2.1.0">
12 17
    <!-- target publicid="-//W3C//HTML//EN">/style/common/eml-2.1.0/eml.xsl</target -->

Also available in: Unified diff