Project

General

Profile

1 34 jones
<?xml version="1.0"?>
2
<!--
3 666 jones
  *  '$RCSfile$'
4 34 jones
  *      Authors: Matt Jones
5 666 jones
  *    Copyright: 2000 Regents of the University of California and the
6 34 jones
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *
9 666 jones
  *   '$Author$'
10
  *     '$Date$'
11
  * '$Revision$'
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 34 jones
  * 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 65 bojilova
  <xsl:output method="html" encoding="iso-8859-1"/>
35 34 jones
36
  <xsl:template match="/">
37
    <html>
38
      <head>
39 506 jones
        <link rel="stylesheet" type="text/css"
40 827 jones
              href="@style-path@/default.css" />
41 34 jones
      </head>
42 506 jones
      <body>
43 65 bojilova
        <center>
44 34 jones
          <h1>Data set description</h1>
45
          <h3>Ecological Metadata Language</h3>
46
        </center>
47 823 jones
        <table width="100%">
48
        <xsl:apply-templates select="/dataset/title" mode="layout"/>
49
        <xsl:apply-templates select="/dataset/shortName" mode="layout"/>
50 829 jones
        <xsl:apply-templates select="/dataset/identifier" mode="layout"/>
51 823 jones
        </table>
52
53 34 jones
        <xsl:apply-templates/>
54
55
56
        <table width="100%">
57 497 jones
        <tr><td class="highlight">
58 34 jones
        <b><xsl:text>Related Metadata and Data Files:</xsl:text></b>
59
        </td></tr>
60
        <tr><td>
61
        <ul>
62 823 jones
          <xsl:for-each select="//triple">
63 34 jones
            <li>
64 829 jones
             <a><xsl:attribute name="href"><![CDATA[@html-path@/servlet/metacat?action=read&qformat=html&docid=]]><xsl:value-of select="./subject"/></xsl:attribute><xsl:value-of select="./subject"/></a>
65 34 jones
             <xsl:text> </xsl:text>
66 823 jones
             <xsl:value-of select="./relationship"/>
67 34 jones
             <xsl:text> </xsl:text>
68 829 jones
             <a><xsl:attribute name="href"><![CDATA[@html-path@/servlet/metacat?action=read&qformat=html&docid=]]><xsl:value-of select="./object"/></xsl:attribute><xsl:value-of select="./object"/></a>
69 34 jones
            </li>
70
          </xsl:for-each>
71
        </ul>
72
        </td></tr>
73
        </table>
74
75
      </body>
76
    </html>
77
  </xsl:template>
78
79 823 jones
  <xsl:template match="identifier"/>
80
  <xsl:template match="identifier" mode="layout">
81
     <tr>
82
       <td class="highlight"><b><xsl:text>Metadata Identifier:</xsl:text></b></td>
83
       <td><xsl:value-of select="."/>
84
       <xsl:if test="./@system">
85
         (Metadata system=<xsl:value-of select="./@system"/>)
86
       </xsl:if>
87
       </td>
88
     </tr>
89 34 jones
  </xsl:template>
90
91
  <xsl:template match="title"/>
92 823 jones
  <xsl:template match="title" mode="layout">
93
     <tr>
94
       <td class="highlight"><b><xsl:text>Title:</xsl:text></b></td>
95 827 jones
       <td><b><xsl:value-of select="."/></b></td>
96 823 jones
     </tr>
97
  </xsl:template>
98 34 jones
99 823 jones
  <xsl:template match="shortName"/>
100
  <xsl:template match="shortName" mode="layout">
101
     <tr>
102
       <td class="highlight"><b><xsl:text>Short Name:</xsl:text></b></td>
103
       <td><xsl:value-of select="."/></td>
104
     </tr>
105
  </xsl:template>
106
107
  <xsl:template match="originator">
108
    <p class="indent">
109
      <xsl:apply-templates/>
110
    </p>
111
  </xsl:template>
112
113 34 jones
  <xsl:template match="originator[1]">
114 823 jones
      <p><xsl:text> </xsl:text></p>
115 34 jones
      <table width="100%">
116 497 jones
      <tr><td class="highlight">
117 34 jones
      <b><xsl:text>Data Set Owner(s):</xsl:text></b>
118
      </td></tr>
119
      </table>
120 823 jones
      <p class="indent">
121
        <xsl:apply-templates/>
122
      </p>
123 34 jones
  </xsl:template>
124
125 823 jones
  <xsl:template match="organizationName">
126 829 jones
    <b><xsl:value-of select="."/></b><br />
127 34 jones
  </xsl:template>
128
129 823 jones
  <xsl:template match="individualName">
130 34 jones
    <b>
131
       <xsl:value-of select="./salutation"/>
132
       <xsl:text> </xsl:text>
133 823 jones
       <xsl:value-of select="./givenName"/>
134 34 jones
       <xsl:text> </xsl:text>
135 823 jones
       <xsl:value-of select="./surName"/>
136 829 jones
    </b><br />
137 34 jones
  </xsl:template>
138
139 823 jones
  <xsl:template match="address">
140 34 jones
    <table>
141 823 jones
    <xsl:for-each select="./deliveryPoint">
142 34 jones
      <tr>
143
      <td><xsl:value-of select="."/></td>
144
      </tr>
145
    </xsl:for-each>
146
    <tr>
147
    <td><xsl:value-of select="./city"/>
148
        <xsl:text>, </xsl:text>
149 823 jones
        <xsl:value-of select="./administrativeArea"/>
150 34 jones
        <xsl:text> </xsl:text>
151 823 jones
        <xsl:value-of select="./postalCode"/>
152 34 jones
    </td>
153
    </tr>
154 823 jones
    <xsl:if test="./country">
155
      <tr><td><xsl:value-of select="./country"/></td></tr>
156 34 jones
    </xsl:if>
157
    </table>
158
  </xsl:template>
159
160 823 jones
  <xsl:template match="phone">
161 829 jones
      <xsl:text>Phone: </xsl:text><xsl:value-of select="."/><br />
162 823 jones
  </xsl:template>
163
164
  <xsl:template match="electronicMailAddress">
165 829 jones
      <xsl:text>Email: </xsl:text><xsl:value-of select="."/><br />
166 823 jones
  </xsl:template>
167
168
  <xsl:template match="onlineLink">
169 829 jones
      <xsl:text>URL: </xsl:text><xsl:value-of select="."/><br />
170 823 jones
  </xsl:template>
171
172
  <xsl:template match="role">
173 829 jones
      <xsl:text>Role: </xsl:text><xsl:value-of select="."/><br />
174 823 jones
  </xsl:template>
175
176 34 jones
  <xsl:template match="abstract">
177
    <table width="100%">
178
    <tr>
179 497 jones
    <td class="highlight"><b><xsl:text>Abstract:</xsl:text></b></td>
180 34 jones
    </tr>
181
    <tr>
182 823 jones
    <td><xsl:value-of select="./paragraph"/></td>
183 34 jones
    </tr></table>
184
  </xsl:template>
185
186 823 jones
  <xsl:template match="rights">
187
    <table width="100%">
188
    <tr>
189
    <td class="highlight"><b><xsl:text>License and Usage Rights:</xsl:text></b></td>
190
    </tr>
191
    <tr>
192
    <td><xsl:value-of select="./paragraph"/></td>
193
    </tr></table>
194
  </xsl:template>
195 34 jones
196 823 jones
  <xsl:template match="additionalInfo">
197
    <table width="100%">
198
    <tr>
199
    <td class="highlight"><b><xsl:text>Additional Information:</xsl:text></b></td>
200
    </tr>
201
    <tr>
202
    <td><xsl:value-of select="./paragraph"/></td>
203
    </tr></table>
204
  </xsl:template>
205
206 829 jones
  <xsl:template match="onlineURL">
207
    <table width="100%">
208
    <tr>
209
    <td class="highlight"><b><xsl:text>Online Distribution information:</xsl:text></b></td>
210
    </tr>
211
    <tr>
212
    <td><a>
213
          <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
214
          <xsl:value-of select="."/>
215
        </a>
216
    </td>
217
    </tr></table>
218
  </xsl:template>
219
220
  <xsl:template match="offlineMedium">
221
    <table width="100%">
222
    <tr>
223
    <td class="highlight"><b><xsl:text>Offline Distribution information:</xsl:text></b></td>
224
    </tr>
225
    <xsl:apply-templates/>
226
    </table>
227
  </xsl:template>
228
229
  <xsl:template match="medName">
230
    <tr><td><xsl:text>Medium: </xsl:text><xsl:value-of select="."/></td></tr>
231
  </xsl:template>
232
233
  <xsl:template match="temporalCov">
234
    <table width="100%">
235
    <tr>
236
    <td class="highlight"><b><xsl:text>Temporal Coverage:</xsl:text></b></td>
237
    </tr>
238
    <xsl:apply-templates/>
239
    </table>
240
  </xsl:template>
241
242
  <xsl:template match="rngdates">
243
    <tr><td>
244
    <xsl:text>Date Range: </xsl:text>
245
    <xsl:apply-templates select="begdate"/>
246
    <xsl:text> </xsl:text><xsl:apply-templates select="begtime"/>
247
    <xsl:text> </xsl:text><xsl:apply-templates select="beggeol"/>
248
    <xsl:text> to </xsl:text>
249
    <xsl:apply-templates select="enddate"/>
250
    <xsl:text> </xsl:text><xsl:apply-templates select="endtime"/>
251
    <xsl:text> </xsl:text><xsl:apply-templates select="endgeol"/>
252
    </td></tr>
253
  </xsl:template>
254
255
  <xsl:template match="sngdate">
256
    <tr><td>
257
    <xsl:text>Date: </xsl:text>
258
    <xsl:apply-templates select="caldate"/>
259
    <xsl:text> </xsl:text><xsl:apply-templates select="time"/>
260
    <xsl:text> </xsl:text><xsl:apply-templates select="geolage"/>
261
    </td></tr>
262
  </xsl:template>
263
264
  <xsl:template match="mdattim">
265
    <xsl:apply-templates/>
266
  </xsl:template>
267
268
  <xsl:template match="geographicCov">
269
    <table width="100%">
270
    <tr>
271
    <td class="highlight"><b><xsl:text>Geographic Coverage:</xsl:text></b></td>
272
    </tr>
273
    <tr><td><xsl:apply-templates/></td></tr>
274
    </table>
275
  </xsl:template>
276
277
  <xsl:template match="descgeog">
278
    <p>
279
    <xsl:text>Description: </xsl:text>
280
    <xsl:value-of select="."/>
281
    </p>
282
  </xsl:template>
283
284
  <xsl:template match="westbc">
285
    <xsl:text>West Bounding coordinate: </xsl:text>
286
    <xsl:value-of select="."/> degrees<br />
287
  </xsl:template>
288
289
  <xsl:template match="eastbc">
290
    <xsl:text>East Bounding coordinate: </xsl:text>
291
    <xsl:value-of select="."/> degrees<br />
292
  </xsl:template>
293
294
  <xsl:template match="northbc">
295
    <xsl:text>North Bounding coordinate: </xsl:text>
296
    <xsl:value-of select="."/> degrees<br />
297
  </xsl:template>
298
299
  <xsl:template match="southbc">
300
    <xsl:text>South Bounding coordinate: </xsl:text>
301
    <xsl:value-of select="."/> degrees<br />
302
  </xsl:template>
303
304
  <xsl:template match="taxonomicCov">
305
    <table width="100%">
306
    <tr>
307
    <td class="highlight"><b><xsl:text>Taxomomic Coverage:</xsl:text></b></td>
308
    </tr>
309
    <tr><td><xsl:apply-templates/></td></tr>
310
    </table>
311
  </xsl:template>
312
313
  <xsl:template match="keywtax">
314
    <p>
315
    <xsl:text>Taxon Keywords: </xsl:text>
316
    <xsl:apply-templates select="taxonkey"/>
317
    </p>
318
  </xsl:template>
319
320
  <xsl:template match="taxoncl">
321
    <p class="indent">
322
    <xsl:text>Name: </xsl:text><xsl:value-of select="taxonrv"/>
323
    <a target="itisca">
324
      <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>
325
      Check ITIS*ca for this taxon
326
    </a>
327
    <br />
328
    <xsl:text>Rank: </xsl:text><xsl:value-of select="taxonrn"/><br />
329
    <xsl:text>Common name: </xsl:text><xsl:value-of select="common"/><br />
330
    <xsl:apply-templates select="taxoncl"/>
331
    </p>
332
  </xsl:template>
333
334
  <xsl:template match="keywordSet">
335
    <table width="100%">
336
    <tr><td class="highlight">
337
    <b><xsl:text>Keywords:</xsl:text></b>
338
    </td></tr>
339
    <xsl:if test="./keywordThesaurus">
340
      <tr><td>Thesaurus: <xsl:value-of select="keywordThesaurus"/></td></tr>
341
    </xsl:if>
342
    <tr><td>
343
      <ul>
344
        <xsl:for-each select="keyword">
345
          <li><xsl:value-of select="."/>
346
          <xsl:if test="./@keywordType">
347
            (<xsl:value-of select="./@keywordType"/>)
348
          </xsl:if>
349
          </li>
350
        </xsl:for-each>
351
      </ul>
352
    </td></tr>
353
    </table>
354
  </xsl:template>
355
356 823 jones
  <xsl:template match="triple"/>
357
358 85 jones
</xsl:stylesheet>