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: mecum $'
|
10
|
* '$Date: 2017-06-15 17:13:21 -0700 (Thu, 15 Jun 2017) $'
|
11
|
* '$Revision: 10356 $'
|
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 Creator(s)</xsl:param>
|
46
|
</xsl:template>
|
47
|
|
48
|
<!-- style the alternate identifier elements -->
|
49
|
<xsl:template name="resourcealternateIdentifier" >
|
50
|
<xsl:param name="system"/>
|
51
|
<xsl:param name="resfirstColStyle"/>
|
52
|
<xsl:param name="ressecondColStyle"/>
|
53
|
<xsl:if test="normalize-space(.)!=''">
|
54
|
<div class="control-group">
|
55
|
<label class="control-label">Alternate Identifier</label>
|
56
|
<div class="controls controls-well">
|
57
|
<xsl:call-template name="i18n">
|
58
|
<xsl:with-param name="i18nElement" select="."/>
|
59
|
</xsl:call-template>
|
60
|
<xsl:if test="normalize-space($system)!=''">
|
61
|
 (<xsl:value-of select="$system"/>)
|
62
|
</xsl:if>
|
63
|
</div>
|
64
|
</div>
|
65
|
</xsl:if>
|
66
|
</xsl:template>
|
67
|
|
68
|
|
69
|
<!-- style the short name elements -->
|
70
|
<xsl:template name="resourceshortName">
|
71
|
<xsl:param name="resfirstColStyle"/>
|
72
|
<xsl:param name="ressecondColStyle"/>
|
73
|
<xsl:if test="normalize-space(.)!=''">
|
74
|
<div class="control-group">
|
75
|
<label class="control-label">Short Name</label>
|
76
|
<div class="controls controls-well">
|
77
|
<xsl:call-template name="i18n">
|
78
|
<xsl:with-param name="i18nElement" select="."/>
|
79
|
</xsl:call-template>
|
80
|
</div>
|
81
|
</div>
|
82
|
</xsl:if>
|
83
|
</xsl:template>
|
84
|
|
85
|
|
86
|
<!-- style the title element -->
|
87
|
<xsl:template name="resourcetitle" >
|
88
|
<xsl:param name="resfirstColStyle"/>
|
89
|
<xsl:param name="ressecondColStyle"/>
|
90
|
<xsl:if test="normalize-space(.)!=''">
|
91
|
<div class="control-group hidden">
|
92
|
<label class="control-label">Title</label>
|
93
|
<div class="controls controls-well">
|
94
|
<strong>
|
95
|
<xsl:call-template name="i18n">
|
96
|
<xsl:with-param name="i18nElement" select="."/>
|
97
|
</xsl:call-template>
|
98
|
</strong>
|
99
|
</div>
|
100
|
</div>
|
101
|
</xsl:if>
|
102
|
</xsl:template>
|
103
|
|
104
|
<xsl:template name="resourcecreator" >
|
105
|
<xsl:param name="resfirstColStyle"/>
|
106
|
<xsl:call-template name="party">
|
107
|
<xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
|
108
|
</xsl:call-template>
|
109
|
</xsl:template>
|
110
|
|
111
|
<xsl:template name="resourcemetadataProvider" >
|
112
|
<xsl:param name="resfirstColStyle"/>
|
113
|
<xsl:call-template name="party">
|
114
|
<xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
|
115
|
</xsl:call-template>
|
116
|
</xsl:template>
|
117
|
|
118
|
<xsl:template name="resourceassociatedParty">
|
119
|
<xsl:param name="resfirstColStyle"/>
|
120
|
<xsl:call-template name="party">
|
121
|
<xsl:with-param name="partyfirstColStyle" select="$resfirstColStyle"/>
|
122
|
</xsl:call-template>
|
123
|
</xsl:template>
|
124
|
|
125
|
|
126
|
<xsl:template name="resourcepubDate">
|
127
|
<xsl:param name="resfirstColStyle"/>
|
128
|
<xsl:if test="normalize-space(../pubDate)!=''">
|
129
|
<div class="control-group">
|
130
|
<label class="control-label">Publication Date</label>
|
131
|
<div class="controls controls-well">
|
132
|
<xsl:value-of select="../pubDate"/>
|
133
|
</div>
|
134
|
</div>
|
135
|
</xsl:if>
|
136
|
</xsl:template>
|
137
|
|
138
|
|
139
|
<xsl:template name="resourcelanguage">
|
140
|
<xsl:param name="resfirstColStyle"/>
|
141
|
<xsl:if test="normalize-space(.)!=''">
|
142
|
<div class="control-group">
|
143
|
<label class="control-label">Language</label>
|
144
|
<div class="controls controls-well">
|
145
|
<xsl:call-template name="i18n">
|
146
|
<xsl:with-param name="i18nElement" select="."/>
|
147
|
</xsl:call-template>
|
148
|
</div>
|
149
|
</div>
|
150
|
</xsl:if>
|
151
|
</xsl:template>
|
152
|
|
153
|
|
154
|
<xsl:template name="resourceseries">
|
155
|
<xsl:param name="resfirstColStyle"/>
|
156
|
<xsl:if test="normalize-space(../series)!=''">
|
157
|
<div class="control-group">
|
158
|
<label class="control-label">Series</label>
|
159
|
<div class="controls controls-well">
|
160
|
<xsl:value-of select="../series"/>
|
161
|
</div>
|
162
|
</div>
|
163
|
</xsl:if>
|
164
|
</xsl:template>
|
165
|
|
166
|
|
167
|
<xsl:template name="resourceabstract">
|
168
|
<xsl:param name="resfirstColStyle"/>
|
169
|
<xsl:param name="ressecondColStyle"/>
|
170
|
<div class="control-group">
|
171
|
<label class="control-label">Abstract</label>
|
172
|
<div class="controls controls-well">
|
173
|
<xsl:call-template name="text">
|
174
|
<xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
|
175
|
<xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
|
176
|
</xsl:call-template>
|
177
|
</div>
|
178
|
</div>
|
179
|
</xsl:template>
|
180
|
|
181
|
<xsl:template name="resourcekeywordSet">
|
182
|
|
183
|
<xsl:if test="normalize-space(keyword)!=''">
|
184
|
<p>
|
185
|
<xsl:value-of select="keywordThesaurus"/>
|
186
|
</p>
|
187
|
<div>
|
188
|
<table class="table table-striped table-condensed">
|
189
|
<thead>
|
190
|
<tr>
|
191
|
<th>Keyword</th>
|
192
|
<th>Type</th>
|
193
|
</tr>
|
194
|
</thead>
|
195
|
<xsl:for-each select="keyword">
|
196
|
<tr>
|
197
|
<td>
|
198
|
<xsl:call-template name="i18n">
|
199
|
<xsl:with-param name="i18nElement" select="."/>
|
200
|
</xsl:call-template>
|
201
|
</td>
|
202
|
<td>
|
203
|
<xsl:if test="./@keywordType and normalize-space(./@keywordType)!=''">
|
204
|
<xsl:value-of select="./@keywordType"/>
|
205
|
</xsl:if>
|
206
|
</td>
|
207
|
</tr>
|
208
|
</xsl:for-each>
|
209
|
</table>
|
210
|
</div>
|
211
|
|
212
|
|
213
|
</xsl:if>
|
214
|
|
215
|
</xsl:template>
|
216
|
|
217
|
<xsl:template name="resourceadditionalInfo">
|
218
|
<xsl:param name="ressubHeaderStyle"/>
|
219
|
<xsl:param name="resfirstColStyle"/>
|
220
|
<div class="control-group">
|
221
|
<label class="control-label">Additional Information</label>
|
222
|
<div class="controls controls-well">
|
223
|
<xsl:call-template name="text">
|
224
|
<xsl:with-param name="textfirstColStyle" select="$resfirstColStyle"/>
|
225
|
</xsl:call-template>
|
226
|
</div>
|
227
|
</div>
|
228
|
</xsl:template>
|
229
|
|
230
|
|
231
|
<xsl:template name="resourceintellectualRights">
|
232
|
<xsl:param name="resfirstColStyle"/>
|
233
|
<xsl:param name="ressecondColStyle"/>
|
234
|
<div class="control-group">
|
235
|
<label class="control-label">Intellectual Rights</label>
|
236
|
<div class="controls controls-well">
|
237
|
<xsl:call-template name="text">
|
238
|
<xsl:with-param name="textsecondColStyle" select="$ressecondColStyle"/>
|
239
|
</xsl:call-template>
|
240
|
</div>
|
241
|
</div>
|
242
|
</xsl:template>
|
243
|
|
244
|
<xsl:template name="resourcedistribution">
|
245
|
<xsl:param name="ressubHeaderStyle"/>
|
246
|
<xsl:param name="resfirstColStyle"/>
|
247
|
<xsl:param name="index"/>
|
248
|
<xsl:param name="docid"/>
|
249
|
<xsl:call-template name="distribution">
|
250
|
<xsl:with-param name="disfirstColStyle" select="$resfirstColStyle"/>
|
251
|
<xsl:with-param name="dissubHeaderStyle" select="$ressubHeaderStyle"/>
|
252
|
<xsl:with-param name="level">toplevel</xsl:with-param>
|
253
|
<xsl:with-param name="distributionindex" select="$index"/>
|
254
|
<xsl:with-param name="docid" select="$docid"/>
|
255
|
</xsl:call-template>
|
256
|
</xsl:template>
|
257
|
|
258
|
<xsl:template name="resourcecoverage">
|
259
|
<xsl:param name="ressubHeaderStyle"/>
|
260
|
<xsl:param name="resfirstColStyle"/>
|
261
|
<xsl:call-template name="coverage">
|
262
|
</xsl:call-template>
|
263
|
</xsl:template>
|
264
|
|
265
|
<!-- for displaying any nested translation element for i18nNonEmptyString type -->
|
266
|
<xsl:template name="i18n">
|
267
|
<xsl:param name="i18nElement"/>
|
268
|
<!-- the primary value -->
|
269
|
<xsl:if test="$i18nElement/text() != ''">
|
270
|
<xsl:if test="./@xml:lang != ''">
|
271
|
(<xsl:value-of select="./@xml:lang"/>)
|
272
|
</xsl:if>
|
273
|
<xsl:value-of select="$i18nElement/."/>
|
274
|
</xsl:if>
|
275
|
<!-- any translations -->
|
276
|
<xsl:if test="count($i18nElement/value) > 0">
|
277
|
<br/>
|
278
|
<xsl:for-each select="$i18nElement/value">
|
279
|
<xsl:if test="./@xml:lang != ''">
|
280
|
(<xsl:value-of select="./@xml:lang"/>)
|
281
|
</xsl:if>
|
282
|
<xsl:value-of select="."/>
|
283
|
<xsl:if test="position() != last()">
|
284
|
<br/>
|
285
|
</xsl:if>
|
286
|
</xsl:for-each>
|
287
|
</xsl:if>
|
288
|
</xsl:template>
|
289
|
|
290
|
|
291
|
</xsl:stylesheet>
|