Project

General

Profile

1 7982 leinfelder
<?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$'
10
  *     '$Date$'
11
  * '$Revision$'
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
        <tr>
47
          <td class="{$IDfirstColStyle}">Identifier:</td>
48
          <td class="{$IDsecondColStyle}">
49
          	<xsl:value-of select="$packageID"/>
50
			<xsl:if test="$withHTMLLinks = '1'">
51
	          	<!-- stats loaded with ajax call -->
52
				<span id="stats"></span>
53
				<script language="JavaScript">
54
					if (window.loadStats) {
55
						loadStats(
56
							'stats',
57
							'<xsl:value-of select="$packageID" />',
58
							'<xsl:value-of select="$contextURL" />/metacat',
59
							'<xsl:value-of select="$qformat" />');
60
					}
61
				</script>
62
			</xsl:if>
63
			<!--  BRL - removing this section per MBJ 20101210
64
	          <xsl:if test="normalize-space(../@system)!=''">
65
	            <xsl:text> (in the </xsl:text>
66
	            <em class="italic">
67
	              <xsl:value-of select="$system"/>
68
	            </em>
69
	            <xsl:text> Catalog System)</xsl:text>
70
	          </xsl:if>
71
	         -->
72
          </td>
73
        </tr>
74
      </xsl:if>
75
    </xsl:template>
76
77
    <!-- for citation information -->
78
    <xsl:template name="datasetcitation">
79
        <tr>
80
        	<th>
81
        		Data Set Citation:
82
        	</th>
83
        </tr>
84
        <tr>
85
        	<td>
86
        		When using this data, please cite the data package:
87
        	</td>
88
        </tr>
89
        <tr>
90
        	<td class="citation">
91
	        	<xsl:for-each select="creator">
92
	        		<xsl:if test="position() &gt; 1">
93
	        			<xsl:if test="last() &gt; 2">, </xsl:if>
94
	        			<xsl:if test="position() = last()"> and</xsl:if>
95
	        			<xsl:text> </xsl:text>
96
	        		</xsl:if>
97
	        		<xsl:call-template name="creatorCitation" />
98
	        		<xsl:if test="position() = last()">.</xsl:if>
99
	        		<xsl:text> </xsl:text>
100
	        	</xsl:for-each>
101
102
	        	<xsl:value-of select="substring(string(pubDate),1,4)"/>
103
	        	<xsl:if test="substring(string(pubDate),1,4) != ''">.</xsl:if>
104
105
	        	<br/>
106
	        	<!-- title -->
107
				<b>
108
				<xsl:for-each select="./title">
109
		     		<xsl:call-template name="i18n">
110
		     			<xsl:with-param name="i18nElement" select="."/>
111
		     		</xsl:call-template>
112
		     	</xsl:for-each>
113
				</b>
114
				<br/>
115
				<xsl:if test="boolean($registryname)">
116
					<xsl:value-of select="$registryname"/>:
117
				</xsl:if>
118
119
                <span class="lsid">
120
				    <xsl:choose>
121
					    <xsl:when test="boolean($lsidauthority)">
122
						    <xsl:call-template name="lsid"/>
123
					    </xsl:when>
124
					    <xsl:otherwise>
125
						    <xsl:value-of select="../@packageId"/>
126
					    </xsl:otherwise>
127
				    </xsl:choose>
128
                </span>
129
130
				<!-- show link? -->
131
				<xsl:if test="$withHTMLLinks = '1'">
132
		        	<xsl:choose>
133
		        		<xsl:when test="boolean($registryurl)">
134
		        			(<a> <xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/></xsl:attribute> <xsl:value-of select="$registryurl"/>/metacat/<xsl:value-of select="../@packageId"/>/<xsl:value-of select="$qformat"/></a>)
135
		        		</xsl:when>
136
		        		<xsl:otherwise>
137
		        			(<a> <xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/></xsl:attribute> <xsl:value-of select="$contextURL"/>/metacat/<xsl:value-of select="../@packageId"/>/<xsl:value-of select="$qformat"/></a>)
138
		        		</xsl:otherwise>
139
		        	</xsl:choose>
140
					<br />
141
				</xsl:if>
142
        </td>
143
     </tr>
144
   </xsl:template>
145
146
   <!--************** creates lsid dataset id **************-->
147
   <xsl:template name="lsid">
148
		<xsl:variable name="lsidString1" select="concat('urn:lsid:',string($lsidauthority),':')"/>
149
		<xsl:variable name="lsidString2" select="concat($lsidString1, substring-before(string(../@packageId),'.'), ':')"/>
150
		<xsl:variable name="lsidString3" select="concat($lsidString2, substring-before(substring-after(string(../@packageId),'.'),'.'), ':')"/>
151
		<xsl:variable name="lsidString4" select="concat($lsidString3, substring-after(substring-after(string(../@packageId),'.'),'.'))"/>
152
		<xsl:value-of select="$lsidString4"/>
153
   </xsl:template>
154
155
   <!--************** creates citation for a creator in "Last FM" format **************-->
156
   <xsl:template name="creatorCitation">
157
	   	<xsl:for-each select="individualName">
158
159
	   		<xsl:value-of select="surName/text()"/>
160
	   		<xsl:text> </xsl:text>
161
162
	   		<xsl:for-each select="givenName">
163
	   			<xsl:value-of select="substring(string(.),1,1)"/>
164
	   		</xsl:for-each>
165
	   	</xsl:for-each>
166
167
	   	<!-- only show organization if the person is omitted  -->
168
	   	<xsl:if test="string(individualName/surName) = ''">
169
		   	<xsl:for-each select="organizationName">
170
		   		<xsl:value-of select="."/>
171
		   	</xsl:for-each>
172
	   	</xsl:if>
173
174
   </xsl:template>
175
176
 </xsl:stylesheet>