Project

General

Profile

metacat / lib / style / eml2 / eml-coverage-2.0.0.xsl @ 1689

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: 2003-06-24 17:19:15 -0700 (Tue, 24 Jun 2003) $'
11
  * '$Revision: 1686 $'
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.0.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
          <xsl:if test="datasetGPolygonOuterGRing">
105
            <xsl:apply-templates select="datasetGPolygonOuterGRing"/>
106
          </xsl:if>
107
          <xsl:if test="datasetGPolygonExclusionGRing">
108
              <xsl:apply-templates select="datasetGPolygonExclusionGRing"/>
109
          </xsl:if>
110
     </xsl:for-each>
111
  </xsl:template>
112

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

    
119
  <xsl:template match="boundingCoordinates">
120
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
121
           Bounding Coordinates:
122
          </td>
123
       <td width="{$secondColWidth}">
124
         <table class="tabledefault" width="100%">
125
           <xsl:apply-templates select="westBoundingCoordinate"/>
126
           <xsl:apply-templates select="eastBoundingCoordinate"/>
127
           <xsl:apply-templates select="northBoundingCoordinate"/>
128
           <xsl:apply-templates select="southBoundingCoordinate"/>
129
           <xsl:apply-templates select="boundingAltitudes"/>
130
         </table>
131
      </td>
132
      </tr>
133
  </xsl:template>
134

    
135
  <xsl:template match="westBoundingCoordinate">
136
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
137
         <xsl:text>West: &#160;</xsl:text>
138
        </td>
139
        <td width="{$secondColWidth}" class="{$secondColStyle}">
140
         <xsl:value-of select="."/>&#160; degrees
141
        </td>
142
     </tr>
143
  </xsl:template>
144

    
145
  <xsl:template match="eastBoundingCoordinate">
146
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
147
       <xsl:text>East: &#160;</xsl:text>
148
       </td>
149
       <td width="{$secondColWidth}" class="{$secondColStyle}">
150
         <xsl:value-of select="."/>&#160; degrees
151
       </td>
152
     </tr>
153
  </xsl:template>
154

    
155
  <xsl:template match="northBoundingCoordinate">
156
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
157
         <xsl:text>North: &#160;</xsl:text>
158
        </td>
159
        <td width="{$secondColWidth}" class="{$secondColStyle}">
160
          <xsl:value-of select="."/>&#160; degrees
161
        </td>
162
     </tr>
163
  </xsl:template>
164

    
165
  <xsl:template match="southBoundingCoordinate">
166
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
167
         <xsl:text>South: &#160;</xsl:text>
168
       </td>
169
       <td width="{$secondColWidth}" class="{$secondColStyle}">
170
         <xsl:value-of select="."/>&#160; degrees
171
        </td>
172
    </tr>
173
  </xsl:template>
174

    
175

    
176
  <xsl:template match="boundingAltitudes">
177
    
178
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
179
        Mimimum Altitude:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
180
        <xsl:apply-templates select="altitudeMinimum"/></td></tr>
181
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
182
        Maximum Altitude:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
183
        <xsl:apply-templates select="altitudeMaximum"/></td></tr>
184
 
185
  </xsl:template>
186

    
187
  <xsl:template match="altitudeMinimum">
188
     <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
189
  </xsl:template>
190

    
191
  <xsl:template match="altitudeMaximum">
192
    <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
193
  </xsl:template>
194

    
195
  <xsl:template match="datasetGPolygonOuterGRing">
196
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
197
          <xsl:text>G-Ploygon(Outer Ring): </xsl:text>
198
        </td>
199
        <td width="{$secondColWidth}" class="{$secondColStyle}">
200
           <xsl:apply-templates select="gRingPoint"/>
201
           <xsl:apply-templates select="gRing"/>
202
        </td>
203
     </tr>
204
  </xsl:template>
205

    
206
  <xsl:template match="datasetGPolygonExclusionGRing">
207
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
208
          <xsl:text>G-Ploygon(Exclusion Ring): </xsl:text>
209
        </td>
210
        <td width="{$secondColWidth}" class="{$secondColStyle}">
211
           <xsl:apply-templates select="gRingPoint"/>
212
           <xsl:apply-templates select="gRing"/>
213
        </td>
214
     </tr>
215
  </xsl:template>
216

    
217
  <xsl:template match="gRing">
218
    <xsl:text>(GRing) &#160;</xsl:text>
219
    <xsl:text>Latitude: </xsl:text>
220
    <xsl:value-of select="gRingLatitude"/>,
221
    <xsl:text>Longitude: </xsl:text>
222
    <xsl:value-of select="gRingLongitude"/><br/>
223
  </xsl:template>
224

    
225
  <xsl:template match="gRingPoint">
226
    <xsl:text>Latitude: </xsl:text>
227
    <xsl:value-of select="gRingLatitude"/>,
228
    <xsl:text>Longitude: </xsl:text>
229
    <xsl:value-of select="gRingLongitude"/><br/>
230
  </xsl:template>
231

    
232
<!-- ********************************************************************* -->
233
<!-- ****************  T E M P O R A L   C O V E R A G E  **************** -->
234
<!-- ********************************************************************* -->
235
  
236
  <xsl:template name="temporalCoverage">
237
    <xsl:choose>
238
      <xsl:when test="references!=''">
239
        <xsl:variable name="ref_id" select="references"/>
240
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
241
        <xsl:for-each select="$references">
242
          <xsl:call-template name="temporalCovCommon">
243
          </xsl:call-template>
244
        </xsl:for-each>
245
      </xsl:when>
246
      <xsl:otherwise>
247
        <xsl:call-template name="temporalCovCommon">
248
        </xsl:call-template>
249
      </xsl:otherwise>
250
    </xsl:choose>
251
  </xsl:template>
252

    
253
  <xsl:template name="temporalCovCommon" >
254
     <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
255
      <xsl:text>Temporal Coverage:</xsl:text></td></tr>
256
      <xsl:apply-templates select="singleDateTime"/>
257
      <xsl:apply-templates select="rangeOfDates"/>
258
  </xsl:template>
259
  
260
  <xsl:template match="singleDateTime">
261
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
262
            Date:
263
         </td>
264
         <td width="{$secondColWidth}" class="{$secondColStyle}">
265
             <xsl:call-template name="singleDateType" />
266
         </td>
267
     </tr>
268
   </xsl:template>
269
  
270
  <xsl:template match="rangeOfDates">
271
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
272
            Begin:
273
         </td>
274
         <td width="{$secondColWidth}" class="{$secondColStyle}">
275
            <xsl:apply-templates select="beginDate"/>
276
          </td>
277
     </tr>
278

    
279
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
280
            End:
281
          </td>
282
          <td width="{$secondColWidth}" class="{$secondColStyle}">
283
             <xsl:apply-templates select="endDate"/>
284
          </td>
285
     </tr>
286
  </xsl:template>
287

    
288

    
289
  <xsl:template match="beginDate">
290
      <xsl:call-template name="singleDateType"/>
291
  </xsl:template>
292

    
293
  <xsl:template match="endDate">
294
      <xsl:call-template name="singleDateType"/>
295
  </xsl:template>
296
  
297
  <xsl:template name="singleDateType">
298
    <table width="100%">
299
     <xsl:if test="calendarDate">
300
      <tr>
301
       <td width="100%" colspan="2" class="{$secondColStyle}">
302
          <xsl:value-of select="calendarDate"/>
303
          <xsl:if test="./time and normalize-space(./time)!=''">
304
            <xsl:text>&#160; at &#160;</xsl:text><xsl:apply-templates select="time"/>
305
          </xsl:if>
306
        </td>
307
      </tr>
308
     </xsl:if>
309
     <xsl:if test="alternativeTimeScale">
310
         <xsl:apply-templates select="alternativeTimeScale"/>
311
     </xsl:if>
312
    </table>
313
  </xsl:template>
314

    
315
 
316
  <xsl:template match="alternativeTimeScale">
317
   
318
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
319
            Timescale:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleName"/></td></tr>
320
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
321
            Time estimate:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeEstimate"/></td></tr>
322
        <xsl:if test="timeScaleAgeUncertainty and normalize-space(timeScaleAgeUncertainty)!=''">
323
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
324
            Time uncertainty:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeUncertainty"/></td></tr>
325
        </xsl:if>
326
        <xsl:if test="timeScaleAgeExplanation and normalize-space(timeScaleAgeExplanation)!=''">
327
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
328
            Time explanation:</td><td width="{$secondColWidth}" class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeExplanation"/></td></tr>
329
        </xsl:if>
330
        <xsl:if test="timeScaleCitation and normalize-space(timeScaleCitation)!=''">
331
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
332
            Citation:</td><td width="{$secondColWidth}" class="{$secondColStyle}">
333
            <xsl:apply-templates select="timeScaleCitation"/>
334
        </td></tr>
335
        </xsl:if>
336
  
337
  </xsl:template>
338

    
339
  <xsl:template match="timeScaleCitation">
340
     <!-- Using citation module here -->
341
     <xsl:call-template name="citation">
342
     </xsl:call-template>
343
  </xsl:template>
344

    
345
<!-- ********************************************************************* -->
346
<!-- ***************  T A X O N O M I C   C O V E R A G E  *************** -->
347
<!-- ********************************************************************* -->
348
  <xsl:template name="taxonomicCoverage">
349
     <xsl:choose>
350
      <xsl:when test="references!=''">
351
        <xsl:variable name="ref_id" select="references"/>
352
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
353
        <xsl:for-each select="$references">
354
          <xsl:call-template name="taxonomicCovCommon">
355
          </xsl:call-template>
356
        </xsl:for-each>
357
      </xsl:when>
358
      <xsl:otherwise>
359
        <xsl:call-template name="taxonomicCovCommon">
360
        </xsl:call-template>
361
      </xsl:otherwise>
362
    </xsl:choose>
363
  </xsl:template>
364
  
365
  
366
  <xsl:template name="taxonomicCovCommon">
367
      <tr class="{$subHeaderStyle}"><td class="{$subHeaderStyle}" colspan="2">
368
      <xsl:text>Taxonomic Coverage:</xsl:text></td></tr>
369
      <xsl:apply-templates select="taxonomicSystem"/>
370
      <xsl:apply-templates select="generalTaxonomicCoverage"/>
371
      <xsl:for-each select="taxonomicClassification">
372
          <xsl:apply-templates select="."/>
373
      </xsl:for-each>
374
  </xsl:template>
375
  
376
  
377
 <xsl:template match="taxonomicSystem">
378
     <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
379
        <xsl:text>Taxonomic System:</xsl:text></td>
380
        <td width="{$secondColWidth}" class="{$secondColStyle}">
381
            <table width="100%" class="tabledefault">
382
              <xsl:apply-templates select="./*"/>
383
            </table>
384
        </td>
385
     </tr>
386
  </xsl:template>
387
  
388

    
389
  <xsl:template match="classificationSystem">
390
     <xsl:for-each select="classificationSystemCitation">
391
        <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Classification Citation:</td>
392
          <td width="{$secondColWidth}" class="{$secondColStyle}">
393
           <xsl:call-template name="citation">
394
             <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
395
             <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
396
           </xsl:call-template>
397
         </td>
398
        </tr>
399
     </xsl:for-each>
400
     <xsl:if test="classificationSystemModifications and normalize-space(classificationSystemModifications)!=''">
401
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Modification:</td>
402
        <td width="{$secondColWidth}" class="{$secondColStyle}">
403
          <xsl:apply-templates select="classificationSystemModifications"/>
404
        </td>
405
      </tr>
406
     </xsl:if>
407
  </xsl:template>
408

    
409
  
410
  <xsl:template match="identificationReference">
411
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">ID Reference:</td>
412
        <td width="{$secondColWidth}" class="{$secondColStyle}">&#160;
413
        </td></tr>
414
        <tr><td colspan="2">
415
          <xsl:call-template name="citation">
416
            <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
417
            <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
418
          </xsl:call-template>
419
        </td></tr>
420
  </xsl:template>
421

    
422
  <xsl:template match="identifierName">
423
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">ID Name:</td>
424
          <td width="{$secondColWidth}" class="{$secondColStyle}">
425
             <xsl:call-template name="party">
426
               <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
427
             </xsl:call-template>
428
          </td>
429
      </tr>
430
  </xsl:template>
431

    
432
  <xsl:template match="taxonomicProcedures">
433
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
434
        <xsl:text>Procedures:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
435
        <xsl:value-of select="."/></td></tr>
436
  </xsl:template>
437

    
438
  <xsl:template match="taxonomicCompleteness">
439
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
440
        <xsl:text>Completeness:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
441
        <xsl:value-of select="."/></td></tr>
442
  </xsl:template>
443

    
444
  <xsl:template match="vouchers">
445
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Vouchers:</td>
446
        <td width="{$secondColWidth}" class="{$secondColStyle}">
447
        <table width="100%">
448
        <xsl:apply-templates select="specimen"/>
449
        <xsl:apply-templates select="repository"/>
450
        </table>
451
        </td></tr>
452
  </xsl:template>
453

    
454
  <xsl:template match="specimen">
455
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
456
        <xsl:text>Specimen:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
457
        <xsl:value-of select="."/></td></tr>
458
  </xsl:template>
459

    
460
  <xsl:template match="repository">
461
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">Repository:</td>
462
        <td width="{$secondColWidth}" class="{$secondColStyle}">
463
            <xsl:for-each select="originator">
464
               <xsl:call-template name="party">
465
                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
466
               </xsl:call-template>
467
            </xsl:for-each>
468
        </td>
469
    </tr>
470
  </xsl:template>
471

    
472

    
473
  <xsl:template match="generalTaxonomicCoverage">
474
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
475
             <xsl:text>General Coverage:</xsl:text></td>
476
           <td width="{$secondColWidth}" class="{$secondColStyle}">
477
             <xsl:value-of select="."/>
478
          </td>
479
      </tr>
480
  </xsl:template>
481
 
482

    
483
  <xsl:template match="taxonomicClassification">
484
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
485
        <xsl:text>Classification:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
486
        <table width="100%">
487
        <xsl:apply-templates select="./*" mode="nest"/>
488
        </table>
489
        </td></tr>
490
  </xsl:template>
491

    
492
  <xsl:template match="taxonRankName" mode="nest" >
493
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
494
        <xsl:text>Rank Name:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
495
        <xsl:value-of select="."/></td></tr>
496
  </xsl:template>
497

    
498
  <xsl:template match="taxonRankValue" mode="nest">
499
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
500
        <xsl:text>Rank Value:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
501
        <xsl:value-of select="."/></td></tr>
502
  </xsl:template>
503

    
504
  <xsl:template match="commonName" mode="nest">
505
      <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
506
            <xsl:text>Common Name:</xsl:text></td><td width="{$secondColWidth}" class="{$secondColStyle}">
507
            <xsl:value-of select="."/>
508
          </td>
509
      </tr>
510
  </xsl:template>
511
  
512
  <xsl:template match="taxonomicClassification" mode="nest">
513
    <tr><td width="{$firstColWidth}" class="{$firstColStyle}">
514
          <xsl:text>Classification:</xsl:text>
515
        </td>
516
        <td width="{$secondColWidth}" class="{$secondColStyle}">
517
           <table class="tabledefault" width="100%">
518
             <xsl:apply-templates select="./*" mode="nest"/>
519
           </table>
520
        </td>
521
     </tr>
522
  </xsl:template>
523
  
524
</xsl:stylesheet>