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-text.xsl" />
|
34
|
<xsl:output method="html" encoding="iso-8859-1"
|
35
|
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
|
36
|
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
|
37
|
indent="yes" />
|
38
|
|
39
|
|
40
|
<!-- This module is for distribution and it is self-contained-->
|
41
|
|
42
|
<xsl:template name="distribution">
|
43
|
<xsl:param name="disfirstColStyle"/>
|
44
|
<xsl:param name="dissubHeaderStyle"/>
|
45
|
<xsl:param name="docid"/>
|
46
|
<xsl:param name="level">entitylevel</xsl:param>
|
47
|
<xsl:param name="entitytype"/>
|
48
|
<xsl:param name="entityindex"/>
|
49
|
<xsl:param name="physicalindex"/>
|
50
|
<xsl:param name="distributionindex"/>
|
51
|
<table class="{$tabledefaultStyle}">
|
52
|
<xsl:choose>
|
53
|
<xsl:when test="references!=''">
|
54
|
<xsl:variable name="ref_id" select="references"/>
|
55
|
<xsl:variable name="references" select="$ids[@id=$ref_id]" />
|
56
|
<xsl:for-each select="$references">
|
57
|
<xsl:apply-templates select="online">
|
58
|
<xsl:with-param name="dissubHeaderStyle" select="$dissubHeaderStyle"/>
|
59
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
60
|
</xsl:apply-templates>
|
61
|
<xsl:apply-templates select="offline">
|
62
|
<xsl:with-param name="dissubHeaderStyle" select="$dissubHeaderStyle"/>
|
63
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
64
|
</xsl:apply-templates>
|
65
|
<xsl:apply-templates select="inline">
|
66
|
<xsl:with-param name="dissubHeaderStyle" select="$dissubHeaderStyle"/>
|
67
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
68
|
<xsl:with-param name="docid" select="$docid"/>
|
69
|
<xsl:with-param name="level" select="$level"/>
|
70
|
<xsl:with-param name="entitytype" select="$entitytype"/>
|
71
|
<xsl:with-param name="entityindex" select="$entityindex"/>
|
72
|
<xsl:with-param name="physicalindex" select="$physicalindex"/>
|
73
|
<xsl:with-param name="distributionindex" select="$distributionindex"/>
|
74
|
</xsl:apply-templates>
|
75
|
</xsl:for-each>
|
76
|
</xsl:when>
|
77
|
<xsl:otherwise>
|
78
|
<xsl:apply-templates select="online">
|
79
|
<xsl:with-param name="dissubHeaderStyle" select="$dissubHeaderStyle"/>
|
80
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
81
|
</xsl:apply-templates>
|
82
|
<xsl:apply-templates select="offline">
|
83
|
<xsl:with-param name="dissubHeaderStyle" select="$dissubHeaderStyle"/>
|
84
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
85
|
</xsl:apply-templates>
|
86
|
<xsl:apply-templates select="inline">
|
87
|
<xsl:with-param name="dissubHeaderStyle" select="$dissubHeaderStyle"/>
|
88
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
89
|
<xsl:with-param name="docid" select="$docid"/>
|
90
|
<xsl:with-param name="level" select="$level"/>
|
91
|
<xsl:with-param name="entitytype" select="$entitytype"/>
|
92
|
<xsl:with-param name="entityindex" select="$entityindex"/>
|
93
|
<xsl:with-param name="physicalindex" select="$physicalindex"/>
|
94
|
<xsl:with-param name="distributionindex" select="$distributionindex"/>
|
95
|
</xsl:apply-templates>
|
96
|
</xsl:otherwise>
|
97
|
</xsl:choose>
|
98
|
</table>
|
99
|
</xsl:template>
|
100
|
|
101
|
<!-- ********************************************************************* -->
|
102
|
<!-- ******************************* Online data *********************** -->
|
103
|
<!-- ********************************************************************* -->
|
104
|
<xsl:template match="online">
|
105
|
<xsl:param name="disfirstColStyle"/>
|
106
|
<xsl:param name="dissubHeaderStyle"/>
|
107
|
<tr><td class="{$dissubHeaderStyle}" colspan="2">
|
108
|
<xsl:text>Online Distribution Info:</xsl:text>
|
109
|
</td></tr>
|
110
|
<xsl:apply-templates select="url">
|
111
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
112
|
</xsl:apply-templates>
|
113
|
<xsl:apply-templates select="connection">
|
114
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
115
|
</xsl:apply-templates>
|
116
|
<xsl:apply-templates select="connectionDefinition">
|
117
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
118
|
</xsl:apply-templates>
|
119
|
</xsl:template>
|
120
|
|
121
|
<xsl:template match="url">
|
122
|
<xsl:param name="disfirstColStyle"/>
|
123
|
<xsl:variable name="URL" select="."/>
|
124
|
<tr>
|
125
|
<td class="{$disfirstColStyle}">
|
126
|
<xsl:text> </xsl:text>
|
127
|
</td>
|
128
|
<td class="{$secondColStyle}">
|
129
|
<a>
|
130
|
<xsl:choose>
|
131
|
<xsl:when test="starts-with($URL,'ecogrid')">
|
132
|
<xsl:variable name="URL1" select="substring-after($URL, 'ecogrid://')"/>
|
133
|
<xsl:variable name="docID" select="substring-after($URL1, '/')"/>
|
134
|
<xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docID"/></xsl:attribute>
|
135
|
</xsl:when>
|
136
|
<xsl:otherwise>
|
137
|
<xsl:attribute name="href"><xsl:value-of select="$URL"/></xsl:attribute>
|
138
|
</xsl:otherwise>
|
139
|
</xsl:choose>
|
140
|
<xsl:attribute name="target">_blank</xsl:attribute>
|
141
|
<xsl:value-of select="."/>
|
142
|
</a>
|
143
|
</td>
|
144
|
</tr>
|
145
|
</xsl:template>
|
146
|
|
147
|
<xsl:template match="connection">
|
148
|
<xsl:param name="disfirstColStyle"/>
|
149
|
<xsl:choose>
|
150
|
<xsl:when test="references!=''">
|
151
|
<xsl:variable name="ref_id" select="references"/>
|
152
|
<xsl:variable name="references" select="$ids[@id=$ref_id]" />
|
153
|
<xsl:for-each select="$references">
|
154
|
<xsl:call-template name="connectionCommon">
|
155
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle"/>
|
156
|
</xsl:call-template>
|
157
|
</xsl:for-each>
|
158
|
</xsl:when>
|
159
|
<xsl:otherwise>
|
160
|
<xsl:call-template name="connectionCommon">
|
161
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle"/>
|
162
|
</xsl:call-template>
|
163
|
</xsl:otherwise>
|
164
|
</xsl:choose>
|
165
|
</xsl:template>
|
166
|
|
167
|
<!-- A template shared by connection references and connection in line-->
|
168
|
<xsl:template name="connectionCommon">
|
169
|
<xsl:param name="disfirstColStyle"/>
|
170
|
<xsl:if test="parameter">
|
171
|
<tr>
|
172
|
<td class="{$disfirstColStyle}">
|
173
|
<xsl:text>Parameter(s):</xsl:text>
|
174
|
</td>
|
175
|
<td class="{$secondColStyle}"><xsl:text> </xsl:text>
|
176
|
</td>
|
177
|
</tr>
|
178
|
<xsl:call-template name="renderParameters">
|
179
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
180
|
</xsl:call-template>
|
181
|
</xsl:if>
|
182
|
<xsl:apply-templates select="connectionDefinition">
|
183
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
184
|
</xsl:apply-templates>
|
185
|
</xsl:template>
|
186
|
|
187
|
<xsl:template name="renderParameters">
|
188
|
<xsl:param name="disfirstColStyle"/>
|
189
|
<xsl:for-each select="parameter" >
|
190
|
<tr>
|
191
|
<td class="{$disfirstColStyle}">
|
192
|
<xsl:text>     </xsl:text><xsl:value-of select="name" />
|
193
|
</td>
|
194
|
<td class="{$secondColStyle}">
|
195
|
<xsl:value-of select="value" />
|
196
|
</td>
|
197
|
</tr>
|
198
|
</xsl:for-each>
|
199
|
</xsl:template>
|
200
|
|
201
|
<xsl:template match="connectionDefinition">
|
202
|
<xsl:param name="disfirstColStyle"/>
|
203
|
<xsl:choose>
|
204
|
<xsl:when test="references!=''">
|
205
|
<xsl:variable name="ref_id" select="references"/>
|
206
|
<xsl:variable name="references" select="$ids[@id=$ref_id]" />
|
207
|
<xsl:for-each select="$references">
|
208
|
<xsl:call-template name="connectionDefinitionCommon">
|
209
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle"/>
|
210
|
</xsl:call-template>
|
211
|
</xsl:for-each>
|
212
|
</xsl:when>
|
213
|
<xsl:otherwise>
|
214
|
<xsl:call-template name="connectionDefinitionCommon">
|
215
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle"/>
|
216
|
</xsl:call-template>
|
217
|
</xsl:otherwise>
|
218
|
</xsl:choose>
|
219
|
</xsl:template>
|
220
|
|
221
|
<!-- This template will be shared by both reference and inline connectionDefinition-->
|
222
|
<xsl:template name="connectionDefinitionCommon">
|
223
|
<xsl:param name="disfirstColStyle"/>
|
224
|
<tr>
|
225
|
<td class="{$disfirstColStyle}">
|
226
|
<xsl:text>Schema Name:</xsl:text>
|
227
|
</td>
|
228
|
<td class="{$secondColStyle}">
|
229
|
<xsl:value-of select="schemeName" />
|
230
|
</td>
|
231
|
</tr>
|
232
|
<tr>
|
233
|
<td class="{$disfirstColStyle}">
|
234
|
<xsl:text>Description:</xsl:text>
|
235
|
</td>
|
236
|
<td>
|
237
|
<xsl:apply-templates select="description">
|
238
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
239
|
</xsl:apply-templates>
|
240
|
</td>
|
241
|
</tr>
|
242
|
<xsl:for-each select="parameterDefinition">
|
243
|
<xsl:call-template name="renderParameterDefinition">
|
244
|
<xsl:with-param name="disfirstColStyle" select="$disfirstColStyle" />
|
245
|
</xsl:call-template>
|
246
|
</xsl:for-each>
|
247
|
</xsl:template>
|
248
|
|
249
|
<xsl:template match="description">
|
250
|
<xsl:param name="disfirstColStyle"/>
|
251
|
<xsl:call-template name="text">
|
252
|
<xsl:with-param name="textfirstColStyle" select="$secondColStyle" />
|
253
|
</xsl:call-template>
|
254
|
</xsl:template>
|
255
|
|
256
|
<xsl:template name="renderParameterDefinition">
|
257
|
<xsl:param name="disfirstColStyle"/>
|
258
|
<tr>
|
259
|
<td class="{$disfirstColStyle}">
|
260
|
<xsl:text>     </xsl:text><xsl:value-of select="name" /><xsl:text>:</xsl:text>
|
261
|
</td>
|
262
|
<td>
|
263
|
<table class="{$tabledefaultStyle}">
|
264
|
<tr>
|
265
|
<td class="{$disfirstColStyle}">
|
266
|
<xsl:choose>
|
267
|
<xsl:when test="defaultValue">
|
268
|
<xsl:value-of select="defaultValue" />
|
269
|
</xsl:when>
|
270
|
<xsl:otherwise>
|
271
|
 
|
272
|
</xsl:otherwise>
|
273
|
</xsl:choose>
|
274
|
|
275
|
</td>
|
276
|
<td class="{$secondColStyle}">
|
277
|
<xsl:value-of select="definition" />
|
278
|
</td>
|
279
|
</tr>
|
280
|
</table>
|
281
|
</td>
|
282
|
</tr>
|
283
|
</xsl:template>
|
284
|
|
285
|
<!-- ********************************************************************* -->
|
286
|
<!-- ******************************* Offline data ********************** -->
|
287
|
<!-- ********************************************************************* -->
|
288
|
|
289
|
<xsl:template match="offline">
|
290
|
<xsl:param name="disfirstColStyle"/>
|
291
|
<xsl:param name="dissubHeaderStyle"/>
|
292
|
<tr><td class="{$dissubHeaderStyle}" colspan="2">
|
293
|
<xsl:text>Offline Distribution Info:</xsl:text>
|
294
|
</td></tr>
|
295
|
<xsl:if test="(mediumName) and normalize-space(mediumName)!=''">
|
296
|
<tr><td class="{$disfirstColStyle}"><xsl:text>Medium:</xsl:text></td>
|
297
|
<td class="{$secondColStyle}"><xsl:value-of select="mediumName"/></td></tr>
|
298
|
</xsl:if>
|
299
|
<xsl:if test="(mediumDensity) and normalize-space(mediumDensity)!=''">
|
300
|
<tr><td class="{$disfirstColStyle}"><xsl:text>Medium Density:</xsl:text></td>
|
301
|
<td class="{$secondColStyle}"><xsl:value-of select="mediumDensity"/>
|
302
|
<xsl:if test="(mediumDensityUnits) and normalize-space(mediumDensityUnits)!=''">
|
303
|
<xsl:text> (</xsl:text><xsl:value-of select="mediumDensityUnits"/><xsl:text>)</xsl:text>
|
304
|
</xsl:if>
|
305
|
</td></tr>
|
306
|
</xsl:if>
|
307
|
<xsl:if test="(mediumVol) and normalize-space(mediumVol)!=''">
|
308
|
<tr><td class="{$disfirstColStyle}"><xsl:text>Volume:</xsl:text></td>
|
309
|
<td class="{$secondColStyle}"><xsl:value-of select="mediumVol"/></td></tr>
|
310
|
</xsl:if>
|
311
|
<xsl:if test="(mediumFormat) and normalize-space(mediumFormat)!=''">
|
312
|
<tr><td class="{$disfirstColStyle}"><xsl:text>Format:</xsl:text></td>
|
313
|
<td class="{$secondColStyle}"><xsl:value-of select="mediumFormat"/></td></tr>
|
314
|
</xsl:if>
|
315
|
<xsl:if test="(mediumNote) and normalize-space(mediumNote)!=''">
|
316
|
<tr><td class="{$disfirstColStyle}"><xsl:text>Notes:</xsl:text></td>
|
317
|
<td class="{$secondColStyle}"><xsl:value-of select="mediumNote"/></td></tr>
|
318
|
</xsl:if>
|
319
|
</xsl:template>
|
320
|
|
321
|
<!-- ********************************************************************* -->
|
322
|
<!-- ******************************* Inline data *********************** -->
|
323
|
<!-- ********************************************************************* -->
|
324
|
|
325
|
|
326
|
<xsl:template match="inline">
|
327
|
<xsl:param name="disfirstColStyle"/>
|
328
|
<xsl:param name="dissubHeaderStyle"/>
|
329
|
<xsl:param name="docid"/>
|
330
|
<xsl:param name="level">entity</xsl:param>
|
331
|
<xsl:param name="entitytype"/>
|
332
|
<xsl:param name="entityindex"/>
|
333
|
<xsl:param name="physicalindex"/>
|
334
|
<xsl:param name="distributionindex"/>
|
335
|
|
336
|
<tr><td class="{$dissubHeaderStyle}" colspan="2">
|
337
|
<xsl:text>Inline Data:</xsl:text>
|
338
|
</td></tr>
|
339
|
<tr><td class="{$disfirstColStyle}">
|
340
|
<xsl:text> </xsl:text></td>
|
341
|
<td class="{$secondColStyle}">
|
342
|
<!-- for top top distribution-->
|
343
|
<xsl:if test="$level='toplevel'">
|
344
|
<a><xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&displaymodule=inlinedata&distributionlevel=<xsl:value-of select="$level"/>&distributionindex=<xsl:value-of select="$distributionindex"/></xsl:attribute>
|
345
|
<b>Inline Data</b></a>
|
346
|
</xsl:if>
|
347
|
<xsl:if test="$level='entitylevel'">
|
348
|
<a><xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&displaymodule=inlinedata&distributionlevel=<xsl:value-of select="$level"/>&entitytype=<xsl:value-of select="$entitytype"/>&entityindex=<xsl:value-of select="$entityindex"/>&physicalindex=<xsl:value-of select="$physicalindex"/>&distributionindex=<xsl:value-of select="$distributionindex"/></xsl:attribute>
|
349
|
<b>Inline Data</b></a>
|
350
|
</xsl:if>
|
351
|
</td></tr>
|
352
|
</xsl:template>
|
353
|
|
354
|
|
355
|
</xsl:stylesheet>
|