Project

General

Profile

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: jones $'
10
  *     '$Date: 2002-02-03 22:02:28 -0800 (Sun, 03 Feb 2002) $'
11
  * '$Revision: 922 $'
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

    
34
  <xsl:output method="html" encoding="iso-8859-1"/>
35
  
36
  <xsl:param name="qformat">default</xsl:param>
37

    
38
  <xsl:template match="/">
39
    <html>
40
      <head>
41
        <link rel="stylesheet" type="text/css" 
42
              href="@style-path@/{$qformat}.css" />
43
<!--
44
              href="@style-path@/default.css" />
45
-->
46
      </head>
47
      <body>
48
        <center>
49
          <h1>Data set description</h1>
50
          <h3>Ecological Metadata Language</h3>
51
        </center>
52
        <table width="100%">
53
        <xsl:apply-templates select="/dataset/title" mode="layout"/>
54
        <xsl:apply-templates select="/dataset/shortName" mode="layout"/>
55
        <xsl:apply-templates select="/dataset/identifier" mode="layout"/>
56
        </table>
57

    
58
        <xsl:apply-templates/>      
59

    
60

    
61
        <table width="100%">
62
        <tr><td class="highlight">
63
        <b><xsl:text>Related Metadata and Data Files:</xsl:text></b>
64
        </td></tr>
65
        <tr><td>
66
        <ul>
67
          <xsl:for-each select="//triple">
68
            <li>
69
             <a><xsl:attribute name="href"><![CDATA[@html-path@/servlet/metacat?action=read&qformat=@default-style@&docid=]]><xsl:value-of select="./subject"/></xsl:attribute><xsl:value-of select="./subject"/></a>
70
             <xsl:text> </xsl:text>
71
             <xsl:value-of select="./relationship"/>
72
             <xsl:text> </xsl:text>
73
             <a><xsl:attribute name="href"><![CDATA[@html-path@/servlet/metacat?action=read&qformat=@default-style@&docid=]]><xsl:value-of select="./object"/></xsl:attribute><xsl:value-of select="./object"/></a>
74
            </li>
75
          </xsl:for-each>
76
        </ul>
77
        </td></tr>
78
        </table>
79

    
80
      </body>
81
    </html>
82
  </xsl:template>
83

    
84
  <xsl:template match="identifier"/>
85
  <xsl:template match="identifier" mode="layout">
86
     <tr>
87
       <td class="highlight"><b><xsl:text>Metadata Identifier:</xsl:text></b></td>
88
       <td><xsl:value-of select="."/>
89
       <xsl:if test="./@system">
90
         (Metadata system=<xsl:value-of select="./@system"/>)
91
       </xsl:if>
92
       </td>
93
     </tr>
94
  </xsl:template>
95

    
96
  <xsl:template match="title"/>
97
  <xsl:template match="title" mode="layout">
98
     <tr>
99
       <td class="highlight"><b><xsl:text>Title:</xsl:text></b></td>
100
       <td><b><xsl:value-of select="."/></b></td>
101
     </tr>
102
  </xsl:template>
103

    
104
  <xsl:template match="shortName"/>
105
  <xsl:template match="shortName" mode="layout">
106
     <tr>
107
       <td class="highlight"><b><xsl:text>Short Name:</xsl:text></b></td>
108
       <td><xsl:value-of select="."/></td>
109
     </tr>
110
  </xsl:template>
111

    
112
  <xsl:template match="originator">
113
    <p class="indent">
114
      <xsl:apply-templates/>
115
    </p>
116
  </xsl:template>
117

    
118
  <xsl:template match="originator[1]">
119
      <p><xsl:text> </xsl:text></p>
120
      <table width="100%">
121
      <tr><td class="highlight">
122
      <b><xsl:text>Data Set Owner(s):</xsl:text></b>
123
      </td></tr>
124
      </table>
125
      <p class="indent">
126
        <xsl:apply-templates/>
127
      </p>
128
  </xsl:template>
129

    
130
  <xsl:template match="organizationName">
131
    <b><xsl:value-of select="."/></b><br />
132
  </xsl:template>
133

    
134
  <xsl:template match="individualName">
135
    <b>
136
       <xsl:value-of select="./salutation"/>
137
       <xsl:text> </xsl:text>
138
       <xsl:value-of select="./givenName"/>
139
       <xsl:text> </xsl:text>
140
       <xsl:value-of select="./surName"/>
141
    </b><br />
142
  </xsl:template>
143

    
144
  <xsl:template match="address">
145
    <table>
146
    <xsl:for-each select="./deliveryPoint">
147
      <tr>
148
      <td><xsl:value-of select="."/></td>
149
      </tr>
150
    </xsl:for-each>
151
    <tr>
152
    <td><xsl:value-of select="./city"/>
153
        <xsl:text>, </xsl:text>
154
        <xsl:value-of select="./administrativeArea"/>
155
        <xsl:text> </xsl:text>
156
        <xsl:value-of select="./postalCode"/>
157
    </td>
158
    </tr>
159
    <xsl:if test="./country">
160
      <tr><td><xsl:value-of select="./country"/></td></tr>
161
    </xsl:if>
162
    </table>
163
  </xsl:template>
164

    
165
  <xsl:template match="phone">
166
      <xsl:text>Phone: </xsl:text><xsl:value-of select="."/><br />
167
  </xsl:template>
168

    
169
  <xsl:template match="electronicMailAddress">
170
      <xsl:text>Email: </xsl:text><xsl:value-of select="."/><br />
171
  </xsl:template>
172

    
173
  <xsl:template match="onlineLink">
174
      <xsl:text>URL: </xsl:text><xsl:value-of select="."/><br />
175
  </xsl:template>
176

    
177
  <xsl:template match="role">
178
      <xsl:text>Role: </xsl:text><xsl:value-of select="."/><br />
179
  </xsl:template>
180

    
181
  <xsl:template match="abstract">
182
    <table width="100%">
183
    <tr>
184
    <td class="highlight"><b><xsl:text>Abstract:</xsl:text></b></td>
185
    </tr>
186
    <tr>
187
    <td><xsl:value-of select="./paragraph"/></td>
188
    </tr></table>
189
  </xsl:template>
190

    
191
  <xsl:template match="rights">
192
    <table width="100%">
193
    <tr>
194
    <td class="highlight"><b><xsl:text>License and Usage Rights:</xsl:text></b></td>
195
    </tr>
196
    <tr>
197
    <td><xsl:value-of select="./paragraph"/></td>
198
    </tr></table>
199
  </xsl:template>
200

    
201
  <xsl:template match="additionalInfo">
202
    <table width="100%">
203
    <tr>
204
    <td class="highlight"><b><xsl:text>Additional Information:</xsl:text></b></td>
205
    </tr>
206
    <tr>
207
    <td><xsl:value-of select="./paragraph"/></td>
208
    </tr></table>
209
  </xsl:template>
210

    
211
  <xsl:template match="onlineURL">
212
    <table width="100%">
213
    <tr>
214
    <td class="highlight"><b><xsl:text>Online Distribution information:</xsl:text></b></td>
215
    </tr>
216
    <tr>
217
    <td><a>
218
          <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
219
          <xsl:value-of select="."/>
220
        </a>
221
    </td>
222
    </tr></table>
223
  </xsl:template>
224

    
225
  <xsl:template match="offlineMedium">
226
    <table width="100%">
227
    <tr>
228
    <td class="highlight"><b><xsl:text>Offline Distribution information:</xsl:text></b></td>
229
    </tr>
230
    <xsl:apply-templates/>
231
    </table>
232
  </xsl:template>
233

    
234
  <xsl:template match="medName">
235
    <tr><td><xsl:text>Medium: </xsl:text><xsl:value-of select="."/></td></tr>
236
  </xsl:template>
237

    
238
  <xsl:template match="temporalCov">
239
    <table width="100%">
240
    <tr>
241
    <td class="highlight"><b><xsl:text>Temporal Coverage:</xsl:text></b></td>
242
    </tr>
243
    <xsl:apply-templates/>
244
    </table>
245
  </xsl:template>
246

    
247
  <xsl:template match="rngdates">
248
    <tr><td>
249
    <xsl:text>Date Range: </xsl:text>
250
    <xsl:apply-templates select="begdate"/>
251
    <xsl:text> </xsl:text><xsl:apply-templates select="begtime"/>
252
    <xsl:text> </xsl:text><xsl:apply-templates select="beggeol"/>
253
    <xsl:text> to </xsl:text>
254
    <xsl:apply-templates select="enddate"/>
255
    <xsl:text> </xsl:text><xsl:apply-templates select="endtime"/>
256
    <xsl:text> </xsl:text><xsl:apply-templates select="endgeol"/>
257
    </td></tr>
258
  </xsl:template>
259

    
260
  <xsl:template match="sngdate">
261
    <tr><td>
262
    <xsl:text>Date: </xsl:text>
263
    <xsl:apply-templates select="caldate"/>
264
    <xsl:text> </xsl:text><xsl:apply-templates select="time"/>
265
    <xsl:text> </xsl:text><xsl:apply-templates select="geolage"/>
266
    </td></tr>
267
  </xsl:template>
268

    
269
  <xsl:template match="mdattim">
270
    <xsl:apply-templates/>
271
  </xsl:template>
272

    
273
  <xsl:template match="geographicCov">
274
    <table width="100%">
275
    <tr>
276
    <td class="highlight"><b><xsl:text>Geographic Coverage:</xsl:text></b></td>
277
    </tr>
278
    <tr><td><xsl:apply-templates/></td></tr>
279
    </table>
280
  </xsl:template>
281

    
282
  <xsl:template match="descgeog">
283
    <p>
284
    <xsl:text>Description: </xsl:text>
285
    <xsl:value-of select="."/>
286
    </p>
287
  </xsl:template>
288

    
289
  <xsl:template match="westbc">
290
    <xsl:text>West Bounding coordinate: </xsl:text>
291
    <xsl:value-of select="."/> degrees<br />
292
  </xsl:template>
293

    
294
  <xsl:template match="eastbc">
295
    <xsl:text>East Bounding coordinate: </xsl:text>
296
    <xsl:value-of select="."/> degrees<br />
297
  </xsl:template>
298

    
299
  <xsl:template match="northbc">
300
    <xsl:text>North Bounding coordinate: </xsl:text>
301
    <xsl:value-of select="."/> degrees<br />
302
  </xsl:template>
303

    
304
  <xsl:template match="southbc">
305
    <xsl:text>South Bounding coordinate: </xsl:text>
306
    <xsl:value-of select="."/> degrees<br />
307
  </xsl:template>
308

    
309
  <xsl:template match="taxonomicCov">
310
    <table width="100%">
311
    <tr>
312
    <td class="highlight"><b><xsl:text>Taxomomic Coverage:</xsl:text></b></td>
313
    </tr>
314
    <tr><td><xsl:apply-templates/></td></tr>
315
    </table>
316
  </xsl:template>
317

    
318
  <xsl:template match="keywtax">
319
    <p>
320
    <xsl:text>Taxon Keywords: </xsl:text>
321
    <xsl:apply-templates select="taxonkey"/>
322
    </p>
323
  </xsl:template>
324

    
325
  <xsl:template match="taxoncl">
326
    <p class="indent">
327
    <xsl:text>Name: </xsl:text><xsl:value-of select="taxonrv"/>
328
    <a target="itisca">
329
      <xsl:attribute name="href"><xsl:text><![CDATA[http://sis.agr.gc.ca/pls/itisca/taxastep?king=every&p_action=containing&p_ifx=aafc&taxa=]]></xsl:text><xsl:value-of select="taxonrv"/></xsl:attribute>
330
      Check ITIS*ca for this taxon
331
    </a>
332
    <br />
333
    <xsl:text>Rank: </xsl:text><xsl:value-of select="taxonrn"/><br />
334
    <xsl:text>Common name: </xsl:text><xsl:value-of select="common"/><br />
335
    <xsl:apply-templates select="taxoncl"/>
336
    </p>
337
  </xsl:template>
338

    
339
  <xsl:template match="keywordSet">
340
    <table width="100%">
341
    <tr><td class="highlight">
342
    <b><xsl:text>Keywords:</xsl:text></b>
343
    </td></tr>
344
    <xsl:if test="./keywordThesaurus">
345
      <tr><td>Thesaurus: <xsl:value-of select="keywordThesaurus"/></td></tr>
346
    </xsl:if>
347
    <tr><td>
348
      <ul>
349
        <xsl:for-each select="keyword">
350
          <li><xsl:value-of select="."/> 
351
          <xsl:if test="./@keywordType">
352
            (<xsl:value-of select="./@keywordType"/>)
353
          </xsl:if>
354
          </li>
355
        </xsl:for-each>
356
      </ul>
357
    </td></tr>
358
    </table>
359
  </xsl:template>
360
         
361
  <xsl:template match="triple"/>
362

    
363
</xsl:stylesheet>
(6-6/18)