Project

General

Profile

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: tao $'
10
  *     '$Date: 2000-11-20 05:14:04 -0800 (Mon, 20 Nov 2000) $'
11
  * '$Revision: 553 $'
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

    
33
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
34
  <!-- <xsl:import href="eml-literature-2.0.0beta6-@name@.xsl"/>-->
35
  <xsl:output method="html" encoding="iso-8859-1"/>
36

    
37
  <!-- This module is for coverage and it is self contained(It is a table 
38
       and will handle reference by it self)-->
39
  <xsl:template name="coverage">
40
    <table class="tabledefault" width="100%">
41
        <xsl:choose>
42
         <xsl:when test="references!=''">
43
          <xsl:variable name="ref_id" select="references"/>
44
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
45
          <xsl:for-each select="$references">
46
            <xsl:for-each select="geographicCoverage">
47
                <xsl:call-template name="geographicCoverage">
48
                </xsl:call-template>
49
            </xsl:for-each>
50
             <xsl:for-each select="temporalCoverage">
51
                <xsl:call-template name="temporalCoverage">
52
                </xsl:call-template>
53
            </xsl:for-each>
54
            <xsl:for-each select="taxonomicCoverage">
55
                <xsl:call-template name="taxonomicCoverage">
56
                </xsl:call-template>
57
            </xsl:for-each>
58
          </xsl:for-each>
59
        </xsl:when>
60
        <xsl:otherwise>
61
            <xsl:for-each select="geographicCoverage">
62
                <xsl:call-template name="geographicCoverage">
63
                </xsl:call-template>
64
            </xsl:for-each>
65
            <xsl:for-each select="temporalCoverage">
66
                <xsl:call-template name="temporalCoverage">
67
                </xsl:call-template>
68
            </xsl:for-each>
69
            <xsl:for-each select="taxonomicCoverage">
70
                <xsl:call-template name="taxonomicCoverage">
71
                </xsl:call-template>
72
            </xsl:for-each>
73
        </xsl:otherwise>
74
      </xsl:choose>
75
    </table>
76
  </xsl:template>
77

    
78
 <!-- ********************************************************************* -->
79
 <!-- **************  G E O G R A P H I C   C O V E R A G E  ************** -->
80
 <!-- ********************************************************************* -->
81
  <xsl:template name="geographicCoverage">
82
    <xsl:choose>
83
      <xsl:when test="references!=''">
84
        <xsl:variable name="ref_id" select="references"/>
85
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
86
        <xsl:for-each select="$references">
87
          <xsl:call-template name="geographicCovCommon">
88
          </xsl:call-template>
89
        </xsl:for-each>
90
      </xsl:when>
91
      <xsl:otherwise>
92
        <xsl:call-template name="geographicCovCommon">
93
        </xsl:call-template>
94
      </xsl:otherwise>
95
    </xsl:choose>
96
  </xsl:template>
97

    
98
  <xsl:template name="geographicCovCommon">
99
      <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
100
      <xsl:text>Geographic Coverage:</xsl:text></td></tr>
101
      <xsl:apply-templates select="geographicDescription"/>
102
      <xsl:apply-templates select="boundingCoordinates"/>
103
      <xsl:for-each select="datasetGPolygon">
104
         <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
105
            Dataset G-Polygon:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
106
            <xsl:apply-templates select="datasetGPolygonOuterGRing"/></td></tr>
107
         <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
108
             &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
109
         <xsl:for-each select="datasetGPolygonExclusionGRing">
110
             <xsl:apply-templates select="."/>
111
         </xsl:for-each></td></tr>
112
      </xsl:for-each>
113
  </xsl:template>
114

    
115
  <xsl:template match="geographicDescription">
116
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
117
        Geographic Description:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
118
        <xsl:value-of select="."/></td></tr>
119
  </xsl:template>
120

    
121
  <xsl:template match="boundingCoordinates">
122
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
123
        Bounding Coordinates:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
124
        <xsl:apply-templates select="westBoundingCoordinate"/></td></tr>
125
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
126
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
127
        <xsl:apply-templates select="eastBoundingCoordinate"/></td></tr>
128
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
129
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
130
        <xsl:apply-templates select="northBoundingCoordinate"/></td></tr>
131
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
132
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
133
        <xsl:apply-templates select="southBoundingCoordinate"/></td></tr>
134
        <xsl:apply-templates select="boundingAltitudes"/>
135
  </xsl:template>
136

    
137
  <xsl:template match="westBoundingCoordinate">
138
    <xsl:text>West: &#160;</xsl:text>
139
    <xsl:value-of select="."/>&#160; degrees
140
  </xsl:template>
141

    
142
  <xsl:template match="eastBoundingCoordinate">
143
    <xsl:text>East: &#160;</xsl:text>
144
    <xsl:value-of select="."/>&#160; degrees
145
  </xsl:template>
146

    
147
  <xsl:template match="northBoundingCoordinate">
148
    <xsl:text>North: &#160;</xsl:text>
149
    <xsl:value-of select="."/>&#160; degrees
150
  </xsl:template>
151

    
152
  <xsl:template match="southBoundingCoordinate">
153
    <xsl:text>South: &#160;</xsl:text>
154
    <xsl:value-of select="."/>&#160; degrees
155
  </xsl:template>
156

    
157

    
158
  <xsl:template match="boundingAltitudes">
159
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
160
        Bounding Altitudes:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
161
        <xsl:apply-templates select="altitudeMinimum"/></td></tr>
162
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
163
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
164
        <xsl:apply-templates select="altitudeMaximum"/></td></tr>
165
  </xsl:template>
166

    
167
  <xsl:template match="altitudeMinimum">
168
    <xsl:text>Minimum: &#160;</xsl:text>
169
    <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
170
  </xsl:template>
171

    
172
  <xsl:template match="altitudeMaximum">
173
    <xsl:text>Maximum: &#160;</xsl:text>
174
    <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
175
  </xsl:template>
176

    
177
  <xsl:template match="datasetGPolygonOuterGRing">
178
    <xsl:text>Outer Ring: &#160;</xsl:text>
179
    <xsl:for-each select="gringpoint">
180
       <xsl:apply-templates select="."/>
181
    </xsl:for-each>
182
    <xsl:apply-templates select="gring"/>
183
  </xsl:template>
184

    
185
  <xsl:template match="datasetGPolygonExclusionGRing">
186
    <xsl:text>Exclusion Ring: &#160;</xsl:text>
187
    <xsl:for-each select="gRingPoint">
188
       <xsl:apply-templates select="."/>
189
    </xsl:for-each>
190
    <xsl:apply-templates select="gRing"/>
191
  </xsl:template>
192

    
193
  <xsl:template match="gRing">
194
    <xsl:text>(GRing) &#160;</xsl:text>
195
    <xsl:text>Latitude: </xsl:text>
196
    <xsl:value-of select="gRingLatitude"/>,
197
    <xsl:text>Longitude: </xsl:text>
198
    <xsl:value-of select="gRingLongitude"/><br/>
199
  </xsl:template>
200

    
201
  <xsl:template match="gRingPoint">
202
    <xsl:text>Latitude: </xsl:text>
203
    <xsl:value-of select="gRingLatitude"/>,
204
    <xsl:text>Longitude: </xsl:text>
205
    <xsl:value-of select="gRingLongitude"/><br/>
206
  </xsl:template>
207

    
208
<!-- ********************************************************************* -->
209
<!-- ****************  T E M P O R A L   C O V E R A G E  **************** -->
210
<!-- ********************************************************************* -->
211
  
212
  <xsl:template name="temporalCoverage">
213
    <xsl:choose>
214
      <xsl:when test="references!=''">
215
        <xsl:variable name="ref_id" select="references"/>
216
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
217
        <xsl:for-each select="$references">
218
          <xsl:call-template name="temporalCovCommon">
219
          </xsl:call-template>
220
        </xsl:for-each>
221
      </xsl:when>
222
      <xsl:otherwise>
223
        <xsl:call-template name="temporalCovCommon">
224
        </xsl:call-template>
225
      </xsl:otherwise>
226
    </xsl:choose>
227
  </xsl:template>
228

    
229
  <xsl:template name="temporalCovCommon" >
230
     <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
231
      <xsl:text>Temporal Coverage:</xsl:text></td></tr>
232
      <xsl:apply-templates select="singleDateTime"/>
233
      <xsl:apply-templates select="rangeOfDates"/>
234
  </xsl:template>
235
  
236
  <xsl:template match="singleDateTime">
237
    <xsl:call-template name="singleDateType" />
238
  </xsl:template>
239
  
240
  <xsl:template match="rangeOfDates">
241
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
242
            Begin:
243
         </td>
244
         <td width="{$secondColWidth}" class="{$secondColStyle}">
245
                <xsl:apply-templates select="beginDate"/>
246
         </td>
247
     </tr>
248

    
249
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
250
            End:
251
          </td>
252
          <td width="{$secondColWidth}" class="{$secondColStyle}">
253
             <xsl:apply-templates select="endDate"/>
254
          </td>
255
     </tr>
256
    
257

    
258
  </xsl:template>
259

    
260

    
261
  <xsl:template match="beginDate">
262
      <xsl:call-template name="singleDateType"/>
263
  </xsl:template>
264

    
265
  <xsl:template match="endDate">
266
      <xsl:call-template name="singleDateType"/>
267
  </xsl:template>
268
  
269
  <xsl:template name="singleDateType">
270
     <xsl:if test="calendarDate"> 
271
      <tr>
272
       <td width="{$firstColWidth}" class="{$firstColStyle}">
273
          Calendar Date:</td>
274
       <td width="{$secondColWidth}" class="{$secondColStyle}">
275
          <xsl:value-of select="calendarDate"/>
276
          <xsl:if test="./time and normalize-space(./time)!=''">
277
            <xsl:text>&#160; at &#160;</xsl:text><xsl:apply-templates select="time"/>
278
          </xsl:if>
279
        </td>
280
      </tr>
281
     </xsl:if>
282
     <xsl:if test="alternativeTimeScale">
283
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
284
            Other Time Scale:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
285
            <xsl:apply-templates select="alternativeTimeScale"/></td></tr>
286
    </xsl:if>
287
  </xsl:template>
288

    
289
 
290
  <xsl:template match="alternativeTimeScale">
291
    <table width="100%">
292
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
293
            timescale:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleName"/></td></tr>
294
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
295
            time estimate:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeEstimate"/></td></tr>
296
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
297
            time uncertainty:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeUncertainty"/></td></tr>
298
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
299
            time explanation:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeExplanation"/></td></tr>
300
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
301
            citation:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
302
            <xsl:apply-templates select="timeScaleCitation"/>
303
        </td></tr>
304
    </table>
305
  </xsl:template>
306

    
307
  <xsl:template match="timeScaleCitation">
308
     <!-- Using citation module here -->
309
     <xsl:call-template name="citation">
310
     </xsl:call-template>
311
  </xsl:template>
312

    
313
<!-- ********************************************************************* -->
314
<!-- ***************  T A X O N O M I C   C O V E R A G E  *************** -->
315
<!-- ********************************************************************* -->
316
  <xsl:template name="taxonomicCoverage">
317
     <xsl:choose>
318
      <xsl:when test="references!=''">
319
        <xsl:variable name="ref_id" select="references"/>
320
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
321
        <xsl:for-each select="$references">
322
          <xsl:call-template name="taxonomicCovCommon">
323
          </xsl:call-template>
324
        </xsl:for-each>
325
      </xsl:when>
326
      <xsl:otherwise>
327
        <xsl:call-template name="taxonomicCovCommon">
328
        </xsl:call-template>
329
      </xsl:otherwise>
330
    </xsl:choose>
331
  </xsl:template>
332
  
333
  
334
  <xsl:template name="taxonomicCovCommon">
335
      <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
336
      <xsl:text>Taxonomic Coverage:</xsl:text></td></tr>
337
      <xsl:apply-templates select="taxonsys"/>
338
      <xsl:apply-templates select="generalTaxonomicCoverage"/>
339
      <xsl:for-each select="taxoncl">
340
          <xsl:apply-templates select="."/>
341
      </xsl:for-each>
342
  </xsl:template>
343

    
344
 
345
  <xsl:template match="generalTaxonomicCoverage">
346
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
347
        <xsl:text>General:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
348
        <xsl:value-of select="."/></td></tr>
349
  </xsl:template>
350

    
351
  <!-- output for taxonomic system is not finished -->
352
  <xsl:template match="taxonomicSystem">
353
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
354
        <xsl:text>Taxonomic System:</xsl:text></td>
355
        <td width="{$secondColWidth}" class="{$firstColStyle}">&#160;</td></tr>
356
      <xsl:apply-templates select="./*"/>
357
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
358
        <xsl:text>&#160;</xsl:text></td><td width="{$secondColWidth}" class="{$firstColStyle}">&#160;</td></tr>
359
  </xsl:template>
360

    
361
  <xsl:template match="classificationSystem">
362
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Classification System:</td>
363
        <td width="{$secondColWidth}" class="{$secondColStyle}">
364
        <table width="100%">
365
        <xsl:apply-templates select="classificationSystemCitaion"/>
366
        <xsl:apply-templates select="./classmod"/>
367
        </table>
368
        </td></tr>
369
  </xsl:template>
370

    
371
  <xsl:template match="classificationSystemCitation">
372
    <!-- Need using citaion module -->
373
  
374
  </xsl:template>
375

    
376
  <xsl:template match="classificationSystemModifications">
377
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
378
        <xsl:text>Modifications:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
379
        <xsl:value-of select="."/></td></tr>
380
  </xsl:template>
381

    
382
  <xsl:template match="identificationReference">
383
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">ID Reference:</td>
384
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
385
        </td></tr>
386
        <!-- Need using citaion module-->
387
  </xsl:template>
388

    
389
  <xsl:template match="identifierName">
390
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">ID Name:</td>
391
        <td width="{$secondColWidth}" class="{$secondColStyle}">
392
          &#160;
393
        </td></tr>
394
       <tr><td colspan="2">
395
           <xsl:call-template name="party">
396
             <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
397
           </xsl:call-template>
398
       </td></tr>
399
  </xsl:template>
400

    
401
  <xsl:template match="taxonomicProcedures">
402
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
403
        <xsl:text>Procedures:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
404
        <xsl:apply-templates select="."/></td></tr>
405
  </xsl:template>
406

    
407
  <xsl:template match="taxonomicCompleteness">
408
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
409
        <xsl:text>Completeness:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
410
        <xsl:apply-templates select="."/></td></tr>
411
  </xsl:template>
412

    
413
  <xsl:template match="vouchers">
414
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Vouchers:</td>
415
        <td width="{$secondColWidth}" class="{$secondColStyle}">
416
        <table width="100%">
417
        <xsl:apply-templates select="specimen"/>
418
        <xsl:apply-templates select="repository"/>
419
        </table>
420
        </td></tr>
421
  </xsl:template>
422

    
423
  <xsl:template match="specimen">
424
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
425
        <xsl:text>Specimen:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
426
        <xsl:apply-templates select="./*"/></td></tr>
427
  </xsl:template>
428

    
429
  <xsl:template match="repository">
430
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Repository:</td>
431
        <td width="{$secondColWidth}" class="{$secondColStyle}">
432
          &#160;
433
        </td></tr>
434
        <tr><td colspan="2">
435
           <xsl:call-template name="party">
436
             <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
437
           </xsl:call-template>
438
       </td></tr>
439
  </xsl:template>
440

    
441
  <xsl:template match="taxonomicClassification">
442
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
443
        <xsl:text>Classification:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
444
        <table width="100%">
445
        <xsl:apply-templates select="./*"/>
446
        </table>
447
        </td></tr>
448
  </xsl:template>
449

    
450
  <xsl:template match="taxonRankName">
451
      <tr><td width="{$secondColIndent}" class="{$secondColStyle}">
452
        <xsl:text>Rank Name:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
453
        <xsl:value-of select="."/></td></tr>
454
  </xsl:template>
455

    
456
  <xsl:template match="taxonRankValue">
457
      <tr><td width="{$secondColIndent}" class="{$secondColStyle}">
458
        <xsl:text>Rank Value:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
459
        <xsl:value-of select="."/></td></tr>
460
  </xsl:template>
461

    
462
  <xsl:template match="commonName">
463
      <tr><td width="{$secondColIndent}" class="{$secondColStyle}">
464
        <xsl:text>Common Name:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
465
        <xsl:for-each select=".">
466
            <xsl:value-of select="."/>
467
        </xsl:for-each></td></tr>
468
  </xsl:template>
469
  
470
  
471
</xsl:stylesheet>
(8-8/26)