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: cjones $'
|
10
|
* '$Date: 2006-11-17 13:37:07 -0800 (Fri, 17 Nov 2006) $'
|
11
|
* '$Revision: 3094 $'
|
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
|
<!--<xsl:import href="eml-party.xsl"/>
|
34
|
<xsl:import href="eml-distribution.xsl"/>
|
35
|
<xsl:import href="eml-coverage.xsl"/>-->
|
36
|
<xsl:output method="html" encoding="UTF-8"
|
37
|
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
38
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
39
|
indent="yes" />
|
40
|
|
41
|
<!-- This module is for resouce and it is self-contained (it is table)-->
|
42
|
<xsl:template name="resource">
|
43
|
<xsl:param name="resfirstColStyle"/>
|
44
|
<xsl:param name="ressubHeaderStyle"/>
|
45
|
<xsl:param name="creator">Data Set Owner(s):</xsl:param>
|
46
|
</xsl:template>
|
47
|
|
48
|
<!-- style the alternate identifier elements -->
|
49
|
<xsl:template name="resourcealternateIdentifier" >
|
50
|
<xsl:param name="resfirstColStyle"/>
|
51
|
<xsl:param name="ressecondColStyle"/>
|
52
|
<xsl:if test="normalize-space(.)!=''">
|
53
|
<tr>
|
54
|
<td class="{$resfirstColStyle}">Alternate Identifier:</td>
|
55
|
<td class="{$ressecondColStyle}">
|
56
|
<xsl:call-template name="i18n">
|
57
|
<xsl:with-param name="i18nElement" select="."/>
|
58
|
</xsl:call-template>
|
59
|
</td>
|
60
|
</tr>
|
61
|
</xsl:if>
|
62
|
</xsl:template>
|
63
|
|
64
|
|
65
|
<!-- style the short name elements -->
|
66
|
<xsl:template name="resourceshortName">
|
67
|
<xsl:param name="resfirstColStyle"/>
|
68
|
<xsl:param name="ressecondColStyle"/>
|
69
|
<xsl:if test="normalize-space(.)!=''">
|
70
|
<tr>
|
71
|
<td class="{$resfirstColStyle}">Short Name:</td>
|
72
|
<td class="{$ressecondColStyle}">
|
73
|
<xsl:call-template name="i18n">
|
74
|
<xsl:with-param name="i18nElement" select="."/>
|
75
|
</xsl:call-template>
|
76
|
</td>
|
77
|
</tr>
|
78
|
</xsl:if>
|
79
|
</xsl:template>
|
80
|
|
81
|
|
82
|
<!-- style the title element -->
|
83
|
<xsl:template name="resourcetitle" >
|
84
|
<xsl:param name="resfirstColStyle"/>
|
85
|
<xsl:param name="ressecondColStyle"/>
|
86
|
<xsl:if test="normalize-space(.)!=''">
|
87
|
<tr>
|
88
|
<td class="{$resfirstColStyle}">Title:</td>
|
89
|
<td class="{$ressecondColStyle}">
|
90
|
<em class="bold">
|
91
|
<xsl:call-template name="i18n">
|
92
|
<xsl:with-param name="i18nElement" select="."/>
|
93
|
</xsl:call-template>
|
94
|
</em>
|
95
|
</td>
|
96
|
</tr>
|
97
|
</xsl:if>
|
98
|
</xsl:template>
|
99
|
|
100
|
<xsl:template name="resourcecreator" >
|
101
|
<xsl:param name="resfirstColStyle"/>
|
102
|
<tr><td colspan="2">
|
103
|
<xsl:call-template name="party">
|
104
|
<xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
|
105
|
</xsl:call-template>
|
106
|
</td></tr>
|
107
|
</xsl:template>
|
108
|
|
109
|
<xsl:template name="resourcemetadataProvider" >
|
110
|
<xsl:param name="resfirstColStyle"/>
|
111
|
<tr><td colspan="2">
|
112
|
<xsl:call-template name="party">
|
113
|
<xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
|
114
|
</xsl:call-template>
|
115
|
</td></tr>
|
116
|
</xsl:template>
|
117
|
|
118
|
<xsl:template name="resourceassociatedParty">
|
119
|
<xsl:param name="resfirstColStyle"/>
|
120
|
<tr><td colspan="2">
|
121
|
<xsl:call-template name="party">
|
122
|
<xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
|
123
|
</xsl:call-template>
|
124
|
</td></tr>
|
125
|
</xsl:template>
|
126
|
|
127
|
|
128
|
<xsl:template name="resourcepubDate">
|
129
|
<xsl:param name="resfirstColStyle"/>
|
130
|
<xsl:if test="normalize-space(../pubDate)!=''">
|
131
|
<tr><td class="{$resfirstColStyle}">
|
132
|
Publication Date:</td><td class="{$secondColStyle}">
|
133
|
<xsl:value-of select="../pubDate"/></td></tr>
|
134
|
</xsl:if>
|
135
|
</xsl:template>
|
136
|
|
137
|
|
138
|
<xsl:template name="resourcelanguage">
|
139
|
<xsl:param name="resfirstColStyle"/>
|
140
|
<xsl:if test="normalize-space(.)!=''">
|
141
|
<tr>
|
142
|
<td class="{$resfirstColStyle}">
|
143
|
Language:
|
144
|
</td>
|
145
|
<td class="{$secondColStyle}">
|
146
|
<xsl:call-template name="i18n">
|
147
|
<xsl:with-param name="i18nElement" select="."/>
|
148
|
</xsl:call-template>
|
149
|
</td>
|
150
|
</tr>
|
151
|
</xsl:if>
|
152
|
</xsl:template>
|
153
|
|
154
|
|
155
|
<xsl:template name="resourceseries">
|
156
|
<xsl:param name="resfirstColStyle"/>
|
157
|
<xsl:if test="normalize-space(../series)!=''">
|
158
|
<tr><td class="{$resfirstColStyle}">
|
159
|
Series:</td><td class="{$secondColStyle}">
|
160
|
<xsl:value-of select="../series"/></td></tr>
|
161
|
</xsl:if>
|
162
|
</xsl:template>
|
163
|
|
164
|
|
165
|
<xsl:template name="resourceabstract">
|
166
|
<xsl:param name="resfirstColStyle"/>
|
167
|
<xsl:param name="ressecondColStyle"/>
|
168
|
<tr>
|
169
|
<td class="{$resfirstColStyle}"><xsl:text>Abstract:</xsl:text></td>
|
170
|
<td>
|
171
|
<xsl:call-template name="text">
|
172
|
<xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
|
173
|
<xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
|
174
|
</xsl:call-template>
|
175
|
</td>
|
176
|
</tr>
|
177
|
</xsl:template>
|
178
|
|
179
|
|
180
|
<!--<xsl:template match="keywordSet[1]" mode="resource">
|
181
|
<xsl:param name="ressubHeaderStyle"/>
|
182
|
<xsl:param name="resfirstColStyle"/>
|
183
|
<tr><td class="{$ressubHeaderStyle}" colspan="2">
|
184
|
<xsl:text>Keywords:</xsl:text></td></tr>
|
185
|
<xsl:call-template name="renderKeywordSet">
|
186
|
<xsl:with-param name="resfirstColStyle" select="$resfirstColStyle"/>
|
187
|
</xsl:call-template>
|
188
|
</xsl:template>-->
|
189
|
|
190
|
<xsl:template name="resourcekeywordSet">
|
191
|
<xsl:for-each select="keywordThesaurus">
|
192
|
<xsl:if test="normalize-space(.)!=''">
|
193
|
<xsl:value-of select="."/>
|
194
|
<xsl:text>: </xsl:text>
|
195
|
</xsl:if>
|
196
|
<xsl:if test="normalize-space(keyword)!=''">
|
197
|
<ul>
|
198
|
<xsl:for-each select="keyword">
|
199
|
<li>
|
200
|
<xsl:call-template name="i18n">
|
201
|
<xsl:with-param name="i18nElement" select="."/>
|
202
|
</xsl:call-template>
|
203
|
<xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
|
204
|
(<xsl:value-of select="./@keywordType"/>)
|
205
|
</xsl:if>
|
206
|
</li>
|
207
|
</xsl:for-each>
|
208
|
</ul>
|
209
|
</xsl:if>
|
210
|
</xsl:for-each>
|
211
|
<xsl:if test="normalize-space(keyword)!=''">
|
212
|
<ul>
|
213
|
<xsl:for-each select="keyword">
|
214
|
<li>
|
215
|
<xsl:call-template name="i18n">
|
216
|
<xsl:with-param name="i18nElement" select="."/>
|
217
|
</xsl:call-template>
|
218
|
<xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
|
219
|
(<xsl:value-of select="./@keywordType"/>)
|
220
|
</xsl:if>
|
221
|
</li>
|
222
|
</xsl:for-each>
|
223
|
</ul>
|
224
|
</xsl:if>
|
225
|
</xsl:template>
|
226
|
|
227
|
<xsl:template name="resourceadditionalInfo">
|
228
|
<xsl:param name="ressubHeaderStyle"/>
|
229
|
<xsl:param name="resfirstColStyle"/>
|
230
|
<tr><td class="{$ressubHeaderStyle}" colspan="2">
|
231
|
<xsl:text>Additional Information:</xsl:text>
|
232
|
</td></tr>
|
233
|
<tr><td class="{$resfirstColStyle}"> </td>
|
234
|
<td>
|
235
|
<xsl:call-template name="text">
|
236
|
<xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
|
237
|
</xsl:call-template>
|
238
|
</td>
|
239
|
</tr>
|
240
|
</xsl:template>
|
241
|
|
242
|
|
243
|
<xsl:template name="resourceintellectualRights">
|
244
|
<xsl:param name="resfirstColStyle"/>
|
245
|
<xsl:param name="ressecondColStyle"/>
|
246
|
<xsl:call-template name="text">
|
247
|
<xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
|
248
|
</xsl:call-template>
|
249
|
</xsl:template>
|
250
|
|
251
|
<xsl:template name="resourcedistribution">
|
252
|
<xsl:param name="ressubHeaderStyle"/>
|
253
|
<xsl:param name="resfirstColStyle"/>
|
254
|
<xsl:param name="index"/>
|
255
|
<xsl:param name="docid"/>
|
256
|
<tr><td colspan="2">
|
257
|
<xsl:call-template name="distribution">
|
258
|
<xsl:with-param name="disfirstColStyle" select="$resfirstColStyle"/>
|
259
|
<xsl:with-param name="dissubHeaderStyle" select="$ressubHeaderStyle"/>
|
260
|
<xsl:with-param name="level">toplevel</xsl:with-param>
|
261
|
<xsl:with-param name="distributionindex" select="$index"/>
|
262
|
<xsl:with-param name="docid" select="$docid"/>
|
263
|
</xsl:call-template>
|
264
|
</td></tr>
|
265
|
</xsl:template>
|
266
|
|
267
|
<xsl:template name="resourcecoverage">
|
268
|
<xsl:param name="ressubHeaderStyle"/>
|
269
|
<xsl:param name="resfirstColStyle"/>
|
270
|
<tr><td colspan="2">
|
271
|
<xsl:call-template name="coverage">
|
272
|
</xsl:call-template>
|
273
|
</td></tr>
|
274
|
</xsl:template>
|
275
|
|
276
|
<!-- for displaying any nested translation element for i18nNonEmptyString type -->
|
277
|
<xsl:template name="i18n">
|
278
|
<xsl:param name="i18nElement"/>
|
279
|
<!-- the primary value -->
|
280
|
<xsl:if test="$i18nElement/text() != ''">
|
281
|
<xsl:if test="./@xml:lang != ''">
|
282
|
(<xsl:value-of select="./@xml:lang"/>)
|
283
|
</xsl:if>
|
284
|
<xsl:value-of select="$i18nElement/text()"/>
|
285
|
</xsl:if>
|
286
|
<!-- any translations -->
|
287
|
<xsl:if test="count($i18nElement/value) > 0">
|
288
|
<br/>
|
289
|
<xsl:for-each select="$i18nElement/value">
|
290
|
<xsl:if test="./@xml:lang != ''">
|
291
|
(<xsl:value-of select="./@xml:lang"/>)
|
292
|
</xsl:if>
|
293
|
<xsl:value-of select="."/>
|
294
|
<xsl:if test="position() != last()">
|
295
|
<br/>
|
296
|
</xsl:if>
|
297
|
</xsl:for-each>
|
298
|
</xsl:if>
|
299
|
</xsl:template>
|
300
|
|
301
|
|
302
|
</xsl:stylesheet>
|