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:apply-templates mode="coverage">
47
            </xsl:apply-templates>
48
          </xsl:for-each>
49
        </xsl:when>
50
        <xsl:otherwise>
51
          <xsl:apply-templates mode="coverage">
52
          </xsl:apply-templates>
53
        </xsl:otherwise>
54
      </xsl:choose>
55
    </table>
56
  </xsl:template>
57

    
58
 <!-- ********************************************************************* -->
59
 <!-- **************  G E O G R A P H I C   C O V E R A G E  ************** -->
60
 <!-- ********************************************************************* -->
61
  <xsl:template match="geographicCov" mode="coverage">
62
    <xsl:choose>
63
      <xsl:when test="references!=''">
64
        <xsl:variable name="ref_id" select="references"/>
65
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
66
        <xsl:for-each select="$references">
67
          <xsl:call-template name="geographicCovCommon">
68
          </xsl:call-template>
69
        </xsl:for-each>
70
      </xsl:when>
71
      <xsl:otherwise>
72
        <xsl:call-template name="geographicCovCommon">
73
        </xsl:call-template>
74
      </xsl:otherwise>
75
    </xsl:choose>
76
  </xsl:template>
77

    
78
  <xsl:template name="geographicCovCommon">
79
      <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
80
      <xsl:text>Geographic Coverage:</xsl:text></td></tr>
81
      <xsl:apply-templates select="geographicDescription"/>
82
      <xsl:apply-templates select="boundingCoordinates"/>
83
      <xsl:for-each select="datasetGPolygon">
84
         <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
85
            Dataset G-Polygon:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
86
            <xsl:apply-templates select="datasetGPolygonOuterGRing"/></td></tr>
87
         <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
88
             &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
89
         <xsl:for-each select="datasetGPolygonExclusionGRing">
90
             <xsl:apply-templates select="."/>
91
         </xsl:for-each></td></tr>
92
      </xsl:for-each>
93
  </xsl:template>
94

    
95
  <xsl:template match="geographicDescription">
96
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
97
        Geographic Description:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
98
        <xsl:value-of select="."/></td></tr>
99
  </xsl:template>
100

    
101
  <xsl:template match="boundingCoordinates">
102
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
103
        Bounding Coordinates:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
104
        <xsl:apply-templates select="westBoundingCoordinate"/></td></tr>
105
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
106
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
107
        <xsl:apply-templates select="eastBoundingCoordinate"/></td></tr>
108
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
109
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
110
        <xsl:apply-templates select="northBoundingCoordinate"/></td></tr>
111
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
112
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
113
        <xsl:apply-templates select="southBoundingCoordinate"/></td></tr>
114
        <xsl:apply-templates select="boundingAltitudes"/>
115
  </xsl:template>
116

    
117
  <xsl:template match="westBoundingCoordinate">
118
    <xsl:text>West: &#160;</xsl:text>
119
    <xsl:value-of select="."/>&#160; degrees
120
  </xsl:template>
121

    
122
  <xsl:template match="eastBoundingCoordinate">
123
    <xsl:text>East: &#160;</xsl:text>
124
    <xsl:value-of select="."/>&#160; degrees
125
  </xsl:template>
126

    
127
  <xsl:template match="northBoundingCoordinate">
128
    <xsl:text>North: &#160;</xsl:text>
129
    <xsl:value-of select="."/>&#160; degrees
130
  </xsl:template>
131

    
132
  <xsl:template match="southBoundingCoordinate">
133
    <xsl:text>South: &#160;</xsl:text>
134
    <xsl:value-of select="."/>&#160; degrees
135
  </xsl:template>
136

    
137

    
138
  <xsl:template match="boundingAltitudes">
139
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
140
        Bounding Altitudes:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
141
        <xsl:apply-templates select="altitudeMinimum"/></td></tr>
142
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
143
        &#160;</td><td width="{$secondColWidth}" class="{$secondColStyle}">
144
        <xsl:apply-templates select="altitudeMaximum"/></td></tr>
145
  </xsl:template>
146

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

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

    
157
  <xsl:template match="datasetGPolygonOuterGRing">
158
    <xsl:text>Outer Ring: &#160;</xsl:text>
159
    <xsl:for-each select="gringpoint">
160
       <xsl:apply-templates select="."/>
161
    </xsl:for-each>
162
    <xsl:apply-templates select="gring"/>
163
  </xsl:template>
164

    
165
  <xsl:template match="datasetGPolygonExclusionGRing">
166
    <xsl:text>Exclusion Ring: &#160;</xsl:text>
167
    <xsl:for-each select="gRingPoint">
168
       <xsl:apply-templates select="."/>
169
    </xsl:for-each>
170
    <xsl:apply-templates select="gRing"/>
171
  </xsl:template>
172

    
173
  <xsl:template match="gRing">
174
    <xsl:text>(GRing) &#160;</xsl:text>
175
    <xsl:text>Latitude: </xsl:text>
176
    <xsl:value-of select="gRingLatitude"/>,
177
    <xsl:text>Longitude: </xsl:text>
178
    <xsl:value-of select="gRingLongitude"/><br/>
179
  </xsl:template>
180

    
181
  <xsl:template match="gRingPoint">
182
    <xsl:text>Latitude: </xsl:text>
183
    <xsl:value-of select="gRingLatitude"/>,
184
    <xsl:text>Longitude: </xsl:text>
185
    <xsl:value-of select="gRingLongitude"/><br/>
186
  </xsl:template>
187

    
188
<!-- ********************************************************************* -->
189
<!-- ****************  T E M P O R A L   C O V E R A G E  **************** -->
190
<!-- ********************************************************************* -->
191
  
192
  <xsl:template match="temporalCov" mode="coverage">
193
    <xsl:choose>
194
      <xsl:when test="references!=''">
195
        <xsl:variable name="ref_id" select="references"/>
196
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
197
        <xsl:for-each select="$references">
198
          <xsl:call-template name="temporalCovCommon">
199
          </xsl:call-template>
200
        </xsl:for-each>
201
      </xsl:when>
202
      <xsl:otherwise>
203
        <xsl:call-template name="temporalCovCommon">
204
        </xsl:call-template>
205
      </xsl:otherwise>
206
    </xsl:choose>
207
  </xsl:template>
208

    
209
  <xsl:template name="temporalCovCommon" >
210
     <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
211
      <xsl:text>Temporal Coverage:</xsl:text></td></tr>
212
      <xsl:apply-templates select="singleDateTime"/>
213
      <xsl:apply-templates select="rangeOfDates"/>
214
  </xsl:template>
215
  
216
  <xsl:template match="singleDateTime">
217
    <xsl:call-template name="singleDateType" />
218
  </xsl:template>
219
  
220
  <xsl:template match="rangeOfDates">
221
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
222
            Begin:
223
         </td>
224
         <td width="{$secondColWidth}" class="{$secondColStyle}">
225
                <xsl:apply-templates select="beginDate"/>
226
         </td>
227
     </tr>
228

    
229
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
230
            End:
231
          </td>
232
          <td width="{$secondColWidth}" class="{$secondColStyle}">
233
             <xsl:apply-templates select="endDate"/>
234
          </td>
235
     </tr>
236
    
237

    
238
  </xsl:template>
239

    
240

    
241
  <xsl:template match="beginDate">
242
      <xsl:call-template name="singleDateType"/>
243
  </xsl:template>
244

    
245
  <xsl:template match="endDate">
246
      <xsl:call-template name="singleDateType"/>
247
  </xsl:template>
248
  
249
  <xsl:template name="singleDateType">
250
     <xsl:if test="calendarDate"> 
251
      <tr>
252
       <td width="{$firstColWidth}" class="{$firstColStyle}">
253
          Calendar Date:</td>
254
       <td width="{$secondColWidth}" class="{$secondColStyle}">
255
          <xsl:value-of select="calendarDate"/>
256
          <xsl:if test="./time and normalize-space(./time)!=''">
257
            <xsl:text>&#160; at &#160;</xsl:text><xsl:apply-templates select="time"/>
258
          </xsl:if>
259
        </td>
260
      </tr>
261
     </xsl:if>
262
     <xsl:if test="alternativeTimeScale">
263
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
264
            Other Time Scale:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
265
            <xsl:apply-templates select="alternativeTimeScale"/></td></tr>
266
    </xsl:if>
267
  </xsl:template>
268

    
269
 
270
  <xsl:template match="alternativeTimeScale">
271
    <table width="100%">
272
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
273
            timescale:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleName"/></td></tr>
274
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
275
            time estimate:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeEstimate"/></td></tr>
276
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
277
            time uncertainty:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeUncertainty"/></td></tr>
278
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
279
            time explanation:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeExplanation"/></td></tr>
280
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
281
            citation:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
282
            <table width="100%"><xsl:apply-templates select="timeScaleCitation"/></table>
283
        </td></tr>
284
    </table>
285
  </xsl:template>
286

    
287
  <xsl:template match="timeScaleCitation">
288
     <!-- Using citation module here -->
289
     
290
  </xsl:template>
291

    
292
<!-- ********************************************************************* -->
293
<!-- ***************  T A X O N O M I C   C O V E R A G E  *************** -->
294
<!-- ********************************************************************* -->
295
  <xsl:template match="taxonomicCov" mode="coverage">
296
     <xsl:choose>
297
      <xsl:when test="references!=''">
298
        <xsl:variable name="ref_id" select="references"/>
299
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
300
        <xsl:for-each select="$references">
301
          <xsl:call-template name="taxonomicCovCommon">
302
          </xsl:call-template>
303
        </xsl:for-each>
304
      </xsl:when>
305
      <xsl:otherwise>
306
        <xsl:call-template name="taxonomicCovCommon">
307
        </xsl:call-template>
308
      </xsl:otherwise>
309
    </xsl:choose>
310
  </xsl:template>
311
  
312
  
313
  <xsl:template name="taxonomicCovCommon">
314
      <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
315
      <xsl:text>Taxonomic Coverage:</xsl:text></td></tr>
316
      <xsl:apply-templates select="taxonsys"/>
317
      <xsl:apply-templates select="generalTaxonomicCoverage"/>
318
      <xsl:for-each select="taxoncl">
319
          <xsl:apply-templates select="."/>
320
      </xsl:for-each>
321
  </xsl:template>
322

    
323
 
324
  <xsl:template match="generalTaxonomicCoverage">
325
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
326
        <xsl:text>General:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
327
        <xsl:value-of select="."/></td></tr>
328
  </xsl:template>
329

    
330
  <!-- output for taxonomic system is not finished -->
331
  <xsl:template match="taxonomicSystem">
332
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
333
        <xsl:text>Taxonomic System:</xsl:text></td>
334
        <td width="{$secondColWidth}" class="{$firstColStyle}">&#160;</td></tr>
335
      <xsl:apply-templates select="./*"/>
336
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
337
        <xsl:text>&#160;</xsl:text></td><td width="{$secondColWidth}" class="{$firstColStyle}">&#160;</td></tr>
338
  </xsl:template>
339

    
340
  <xsl:template match="classificationSystem">
341
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Classification System:</td>
342
        <td width="{$secondColWidth}" class="{$secondColStyle}">
343
        <table width="100%">
344
        <xsl:apply-templates select="classificationSystemCitaion"/>
345
        <xsl:apply-templates select="./classmod"/>
346
        </table>
347
        </td></tr>
348
  </xsl:template>
349

    
350
  <xsl:template match="classificationSystemCitation">
351
    <!-- Need using citaion module -->
352
  
353
  </xsl:template>
354

    
355
  <xsl:template match="classificationSystemModifications">
356
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
357
        <xsl:text>Modifications:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
358
        <xsl:value-of select="."/></td></tr>
359
  </xsl:template>
360

    
361
  <xsl:template match="identificationReference">
362
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">ID Reference:</td>
363
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
364
        </td></tr>
365
        <!-- Need using citaion module-->
366
  </xsl:template>
367

    
368
  <xsl:template match="identifierName">
369
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">ID Name:</td>
370
        <td width="{$secondColWidth}" class="{$secondColStyle}">
371
          &#160;
372
        </td></tr>
373
       <tr><td colspan="2">
374
           <xsl:call-template name="party">
375
             <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
376
           </xsl:call-template>
377
       </td></tr>
378
  </xsl:template>
379

    
380
  <xsl:template match="taxonomicProcedures">
381
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
382
        <xsl:text>Procedures:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
383
        <xsl:apply-templates select="."/></td></tr>
384
  </xsl:template>
385

    
386
  <xsl:template match="taxonomicCompleteness">
387
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
388
        <xsl:text>Completeness:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
389
        <xsl:apply-templates select="."/></td></tr>
390
  </xsl:template>
391

    
392
  <xsl:template match="vouchers">
393
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Vouchers:</td>
394
        <td width="{$secondColWidth}" class="{$secondColStyle}">
395
        <table width="100%">
396
        <xsl:apply-templates select="specimen"/>
397
        <xsl:apply-templates select="repository"/>
398
        </table>
399
        </td></tr>
400
  </xsl:template>
401

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

    
408
  <xsl:template match="repository">
409
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Repository:</td>
410
        <td width="{$secondColWidth}" class="{$secondColStyle}">
411
          &#160;
412
        </td></tr>
413
        <tr><td colspan="2">
414
           <xsl:call-template name="party">
415
             <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
416
           </xsl:call-template>
417
       </td></tr>
418
  </xsl:template>
419

    
420
  <xsl:template match="taxonomicClassification">
421
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
422
        <xsl:text>Classification:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
423
        <table width="100%">
424
        <xsl:apply-templates select="./*"/>
425
        </table>
426
        </td></tr>
427
  </xsl:template>
428

    
429
  <xsl:template match="taxonRankName">
430
      <tr><td width="{$secondColIndent}" class="{$secondColStyle}">
431
        <xsl:text>Rank Name:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
432
        <xsl:value-of select="."/></td></tr>
433
  </xsl:template>
434

    
435
  <xsl:template match="taxonRankValue">
436
      <tr><td width="{$secondColIndent}" class="{$secondColStyle}">
437
        <xsl:text>Rank Value:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
438
        <xsl:value-of select="."/></td></tr>
439
  </xsl:template>
440

    
441
  <xsl:template match="commonName">
442
      <tr><td width="{$secondColIndent}" class="{$secondColStyle}">
443
        <xsl:text>Common Name:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
444
        <xsl:for-each select=".">
445
            <xsl:value-of select="."/>
446
        </xsl:for-each></td></tr>
447
  </xsl:template>
448
  
449
  
450
</xsl:stylesheet>
(9-9/33)