Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matthew Brooke
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: 2013-07-15 14:17:45 -0700 (Mon, 15 Jul 2013) $'
11
  * '$Revision: 7987 $'
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 that is valid with respect to the eml-variable.dtd
29
  * module of the Ecological Metadata Language (EML) into an HTML format
30
  * suitable for rendering with modern web browsers.
31
-->
32
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
33

    
34
  <xsl:output method="html" encoding="UTF-8"
35
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
36
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
37
    indent="yes" />  
38
    
39
    <!-- style the identifier and system -->
40
    <xsl:template name="identifier">
41
      <xsl:param name="IDfirstColStyle"/>
42
      <xsl:param name="IDsecondColStyle"/>
43
      <xsl:param name="packageID"/>
44
      <xsl:param name="system"/>
45
      <xsl:if test="normalize-space(.)">
46
        <div class="control-group">
47
          <label class="control-label">Identifier:</label>
48
          <div class="controls">
49
          	<div class="controls-well">
50
          		<xsl:value-of select="$packageID"/>
51
          	</div>
52
			<xsl:if test="$withHTMLLinks = '1'">
53
	          	<!-- stats loaded with ajax call -->
54
				<span id="stats"></span>
55
				<script language="JavaScript">
56
					if (window.loadStats) {
57
						loadStats(
58
							'stats', 
59
							'<xsl:value-of select="$packageID" />', 
60
							'<xsl:value-of select="$contextURL" />/metacat',
61
							'<xsl:value-of select="$qformat" />');
62
					}
63
				</script>
64
			</xsl:if>
65
			
66
          </div>
67
        </div>
68
      </xsl:if>
69
    </xsl:template>
70
    
71
    <!-- for citation information -->
72
    <xsl:template name="datasetcitation">
73
    
74
    	<div class="well">
75
    		<div class="row-fluid">
76
    			<div class="span10">
77
    				<xsl:for-each select="creator">
78
		        		<xsl:if test="position() &gt; 1">
79
		        			<xsl:if test="last() &gt; 2">, </xsl:if>
80
		        			<xsl:if test="position() = last()"> and</xsl:if>
81
		        			<xsl:text> </xsl:text>
82
		        		</xsl:if>
83
		        		<xsl:call-template name="creatorCitation" />
84
		        		<xsl:if test="position() = last()">.</xsl:if>
85
		        		<xsl:text> </xsl:text>    		
86
		        	</xsl:for-each>
87
		        	
88
		        	<xsl:value-of select="substring(string(pubDate),1,4)"/>
89
		        	<xsl:if test="substring(string(pubDate),1,4) != ''">
90
		        		<xsl:text>. </xsl:text>    				     		
91
		        	</xsl:if>
92
		        	
93
		        	<!-- title -->
94
					<strong>
95
					<xsl:for-each select="./title">
96
			     		<xsl:call-template name="i18n">
97
			     			<xsl:with-param name="i18nElement" select="."/>
98
			     		</xsl:call-template>
99
		        		<xsl:text> </xsl:text>    				     		
100
			     	</xsl:for-each>				
101
					</strong>
102
					
103
					<!-- show link? -->
104
					<xsl:if test="$withHTMLLinks = '1'">
105
						<a> 
106
							<xsl:attribute name="href">
107
								<xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>
108
							</xsl:attribute> 
109
							(<xsl:value-of select="../@packageId"/>)
110
						</a>				        		
111
					</xsl:if>
112
    			</div>
113
    			<div class="span2">
114
   					<a class="btn">
115
   						<xsl:attribute name="href">
116
							<xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>
117
						</xsl:attribute>
118
   						<i class="icon-arrow-down"></i> Download Package
119
   					</a>
120
    			</div>	
121
  
122
    		</div>
123
				
124
		</div>
125

    
126
   </xsl:template>
127
   
128
   <!--************** creates lsid dataset id **************-->
129
   <xsl:template name="lsid">
130
		<xsl:variable name="lsidString1" select="concat('urn:lsid:',string($lsidauthority),':')"/>
131
		<xsl:variable name="lsidString2" select="concat($lsidString1, substring-before(string(../@packageId),'.'), ':')"/>
132
		<xsl:variable name="lsidString3" select="concat($lsidString2, substring-before(substring-after(string(../@packageId),'.'),'.'), ':')"/>
133
		<xsl:variable name="lsidString4" select="concat($lsidString3, substring-after(substring-after(string(../@packageId),'.'),'.'))"/>
134
		<xsl:value-of select="$lsidString4"/>
135
   </xsl:template>
136
   
137
   <!--************** creates citation for a creator in "Last FM" format **************-->
138
   <xsl:template name="creatorCitation">
139
	   	<xsl:for-each select="individualName">	
140
	   		
141
	   		<xsl:value-of select="surName/text()"/>
142
	   		<xsl:text> </xsl:text>
143
	   		
144
	   		<xsl:for-each select="givenName">
145
	   			<xsl:value-of select="substring(string(.),1,1)"/>
146
	   		</xsl:for-each>
147
	   	</xsl:for-each>
148
	   	
149
	   	<!-- only show organization if the person is omitted  -->
150
	   	<xsl:if test="string(individualName/surName) = ''"> 
151
		   	<xsl:for-each select="organizationName">
152
		   		<xsl:value-of select="."/>
153
		   	</xsl:for-each>
154
	   	</xsl:if>
155
	   	
156
   </xsl:template>
157
    
158
 </xsl:stylesheet>
(11-11/27)