1
|
<?xml version="1.0"?>
|
2
|
<!--
|
3
|
* '$RCSfile$'
|
4
|
* Authors: Matt Jones
|
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: tao $'
|
10
|
* '$Date: 2003-06-05 18:44:46 -0700 (Thu, 05 Jun 2003) $'
|
11
|
* '$Revision: 1632 $'
|
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-dataset.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-settings-2.0.0.xsl"/>
|
34
|
<xsl:import href="eml-identifier-2.0.0.xsl"/>
|
35
|
<xsl:import href="eml-text-2.0.0.xsl"/>
|
36
|
<xsl:import href="eml-dataset-2.0.0.xsl"/>
|
37
|
<xsl:import href="eml-entity-2.0.0.xsl"/>
|
38
|
<xsl:import href="eml-physical-2.0.0.xsl"/>
|
39
|
<xsl:import href="eml-datatable-2.0.0.xsl"/>
|
40
|
<xsl:import href="eml-attribute-2.0.0.xsl"/>
|
41
|
|
42
|
<xsl:output method="html" encoding="iso-8859-1"/>
|
43
|
<!-- global variables to store id node set in case to be referenced-->
|
44
|
<xsl:variable name="ids" select="//*[@id!='']"/>
|
45
|
|
46
|
<xsl:template match="/">
|
47
|
<html>
|
48
|
<head>
|
49
|
<link rel="stylesheet" type="text/css"
|
50
|
href="{$stylePath}/{$qformat}.css" />
|
51
|
</head>
|
52
|
<body>
|
53
|
<xsl:apply-templates select="*[local-name()='eml']"/>
|
54
|
</body>
|
55
|
</html>
|
56
|
</xsl:template>
|
57
|
|
58
|
<xsl:template match="*[local-name()='eml']">
|
59
|
<xsl:for-each select="dataset">
|
60
|
<xsl:call-template name="emldataset"/>
|
61
|
</xsl:for-each>
|
62
|
<xsl:for-each select="citation">
|
63
|
<xsl:call-template name="emlcitation"/>
|
64
|
</xsl:for-each>
|
65
|
<xsl:for-each select="software">
|
66
|
<xsl:call-template name="emlsoftware"/>
|
67
|
</xsl:for-each>
|
68
|
<xsl:for-each select="protocol">
|
69
|
<xsl:call-template name="emlprotocol"/>
|
70
|
</xsl:for-each>
|
71
|
</xsl:template>
|
72
|
|
73
|
<!--********************************************************
|
74
|
dataset part
|
75
|
********************************************************-->
|
76
|
|
77
|
<xsl:template name="emldataset">
|
78
|
<table class="tabledefault" width="100%">
|
79
|
<xsl:if test="$displaymodule='dataset'">
|
80
|
<xsl:call-template name="datasetpart"/>
|
81
|
</xsl:if>
|
82
|
<xsl:if test="$displaymodule='entity'">
|
83
|
<xsl:call-template name="entitypart"/>
|
84
|
</xsl:if>
|
85
|
<xsl:if test="$displaymodule='attribute'">
|
86
|
<xsl:call-template name="attributepart"/>
|
87
|
</xsl:if>
|
88
|
</table>
|
89
|
</xsl:template>
|
90
|
|
91
|
<!--*************** Data set part *************-->
|
92
|
<xsl:template name="datasetpart">
|
93
|
<tr><td>
|
94
|
<center>
|
95
|
<h1>Data Set Description</h1>
|
96
|
<h3>Ecological Metadata Language</h3>
|
97
|
</center>
|
98
|
</td></tr>
|
99
|
<tr>
|
100
|
<td width="100%">
|
101
|
<xsl:call-template name="identifier">
|
102
|
<xsl:with-param name="packageID" select="../@packageId"/>
|
103
|
<xsl:with-param name="system" select="../@system"/>
|
104
|
</xsl:call-template>
|
105
|
</td>
|
106
|
</tr>
|
107
|
<tr>
|
108
|
<td width="100%">
|
109
|
<xsl:apply-templates select="." mode="dataset"/>
|
110
|
</td>
|
111
|
</tr>
|
112
|
</xsl:template>
|
113
|
|
114
|
<!--************ Entity part *****************-->
|
115
|
<xsl:template name="entitypart">
|
116
|
<tr><td>
|
117
|
<center>
|
118
|
<h1>Entity Description</h1>
|
119
|
<h3>Ecological Metadata Language</h3>
|
120
|
</center>
|
121
|
</td></tr>
|
122
|
<tr>
|
123
|
<td width="100%">
|
124
|
<xsl:call-template name="identifier">
|
125
|
<xsl:with-param name="packageID" select="../@packageId"/>
|
126
|
<xsl:with-param name="system" select="../@system"/>
|
127
|
</xsl:call-template>
|
128
|
</td>
|
129
|
</tr>
|
130
|
<tr>
|
131
|
<td width="100%">
|
132
|
<!-- find the subtree to process -->
|
133
|
<xsl:if test="$entitytype='dataTable'">
|
134
|
<xsl:for-each select="dataTable">
|
135
|
<xsl:if test="position()=$entityindex">
|
136
|
<xsl:call-template name="dataTable">
|
137
|
<xsl:with-param name="datatablefirstColStyle" select="$firstColStyle"/>
|
138
|
<xsl:with-param name="datatablesubHeaderStyle" select="$subHeaderStyle"/>
|
139
|
<xsl:with-param name="docid" select="$docid"/>
|
140
|
<xsl:with-param name="entitytype" select="$entitytype"/>
|
141
|
<xsl:with-param name="entityindex" select="$entityindex"/>
|
142
|
</xsl:call-template>
|
143
|
</xsl:if>
|
144
|
</xsl:for-each>
|
145
|
</xsl:if>
|
146
|
</td>
|
147
|
</tr>
|
148
|
</xsl:template>
|
149
|
|
150
|
<!--************ Attribute part *****************-->
|
151
|
<xsl:template name="attributepart">
|
152
|
<tr><td>
|
153
|
<center>
|
154
|
<h1>Attributes Description</h1>
|
155
|
<h3>Ecological Metadata Language</h3>
|
156
|
</center>
|
157
|
</td></tr>
|
158
|
<tr>
|
159
|
<td width="100%">
|
160
|
<!-- find the subtree to process -->
|
161
|
<xsl:if test="$entitytype='dataTable'">
|
162
|
<xsl:for-each select="dataTable">
|
163
|
<xsl:if test="position()=$entityindex">
|
164
|
<xsl:for-each select="attributeList">
|
165
|
<xsl:call-template name="attributelist">
|
166
|
<xsl:with-param name="docid" select="$docid"/>
|
167
|
<xsl:with-param name="entitytype" select="$entitytype"/>
|
168
|
<xsl:with-param name="entityindex" select="$entityindex"/>
|
169
|
</xsl:call-template>
|
170
|
</xsl:for-each>
|
171
|
</xsl:if>
|
172
|
</xsl:for-each>
|
173
|
</xsl:if>
|
174
|
</td>
|
175
|
</tr>
|
176
|
</xsl:template>
|
177
|
|
178
|
|
179
|
|
180
|
|
181
|
|
182
|
<!--********************************************************
|
183
|
Citation part
|
184
|
********************************************************-->
|
185
|
<xsl:template name="emlcitation">
|
186
|
<center>
|
187
|
<h1>Citation Description</h1>
|
188
|
<h3>Ecological Metadata Language</h3>
|
189
|
</center>
|
190
|
<table class="tabledefault" width="100%">
|
191
|
<tr>
|
192
|
<td width="100%">
|
193
|
<xsl:call-template name="identifier">
|
194
|
<xsl:with-param name="packageID" select="../@packageId"/>
|
195
|
<xsl:with-param name="system" select="../@system"/>
|
196
|
</xsl:call-template>
|
197
|
</td>
|
198
|
</tr>
|
199
|
<tr>
|
200
|
<td width="100%">
|
201
|
<xsl:call-template name="citation">
|
202
|
<xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
|
203
|
<xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
|
204
|
</xsl:call-template>
|
205
|
</td>
|
206
|
</tr>
|
207
|
</table>
|
208
|
</xsl:template>
|
209
|
|
210
|
|
211
|
|
212
|
<!--********************************************************
|
213
|
Software part
|
214
|
********************************************************-->
|
215
|
|
216
|
<xsl:template name="emlsoftware">
|
217
|
<center>
|
218
|
<h1>Software Description</h1>
|
219
|
<h3>Ecological Metadata Language</h3>
|
220
|
</center>
|
221
|
<table class="tabledefault" width="100%">
|
222
|
<tr><td width="100%">
|
223
|
<xsl:call-template name="identifier">
|
224
|
<xsl:with-param name="packageID" select="../@packageId"/>
|
225
|
<xsl:with-param name="system" select="../@system"/>
|
226
|
</xsl:call-template>
|
227
|
</td></tr>
|
228
|
</table>
|
229
|
</xsl:template>
|
230
|
|
231
|
|
232
|
<!--********************************************************
|
233
|
Protocal part
|
234
|
********************************************************-->
|
235
|
|
236
|
<xsl:template name="emlprotocol">
|
237
|
<center>
|
238
|
<h1>Protocol Description</h1>
|
239
|
<h3>Ecological Metadata Language</h3>
|
240
|
</center>
|
241
|
<table class="tabledefault" width="100%">
|
242
|
<tr><td width="100%">
|
243
|
<xsl:call-template name="identifier">
|
244
|
<xsl:with-param name="packageID" select="../@packageId"/>
|
245
|
<xsl:with-param name="system" select="../@system"/>
|
246
|
</xsl:call-template>
|
247
|
</td></tr>
|
248
|
</table>
|
249
|
</xsl:template>
|
250
|
|
251
|
</xsl:stylesheet>
|