Project

General

Profile

metacat / lib / style / skins / metacatui / eml-2 / eml-coverage.xsl @ 7987

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: leinfelder $'
10
  *     '$Date: 2013-07-15 10:37:09 -0700 (Mon, 15 Jul 2013) $'
11
  * '$Revision: 7982 $'
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.xsl"/>
35

    
36
  <xsl:output method="html" encoding="iso-8859-1"
37
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
38
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
39
    indent="yes" />  
40

    
41
  <!-- This module is for coverage and it is self contained(It is a table
42
       and will handle reference by it self)-->
43
  <xsl:template name="coverage">
44
        <xsl:choose>
45
         <xsl:when test="references!=''">
46
          <xsl:variable name="ref_id" select="references"/>
47
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
48
          <xsl:for-each select="$references">
49
          <table class="{$tabledefaultStyle}">
50
            <xsl:for-each select="geographicCoverage">
51
                <xsl:call-template name="geographicCoverage">
52
                </xsl:call-template>
53
            </xsl:for-each>
54
          </table>
55
          <table class="{$tabledefaultStyle}">
56
             <xsl:for-each select="temporalCoverage">
57
                <xsl:call-template name="temporalCoverage">
58
                </xsl:call-template>
59
            </xsl:for-each>
60
          </table>
61
          <table class="{$tabledefaultStyle}">
62
            <xsl:for-each select="taxonomicCoverage">
63
                <xsl:call-template name="taxonomicCoverage">
64
                </xsl:call-template>
65
            </xsl:for-each>
66
          </table>
67
          </xsl:for-each>
68
        </xsl:when>
69
        <xsl:otherwise>
70
          <table class="{$tabledefaultStyle}">
71
            <xsl:for-each select="geographicCoverage">
72
                <xsl:call-template name="geographicCoverage">
73
                </xsl:call-template>
74
            </xsl:for-each>
75
          </table>
76
          <table class="{$tabledefaultStyle}">
77
            <xsl:for-each select="temporalCoverage">
78
                <xsl:call-template name="temporalCoverage">
79
                </xsl:call-template>
80
            </xsl:for-each>
81
          </table>
82
          <table class="{$tabledefaultStyle}">
83
            <xsl:for-each select="taxonomicCoverage">
84
                <xsl:call-template name="taxonomicCoverage">
85
                </xsl:call-template>
86
            </xsl:for-each>
87
          </table>
88
        </xsl:otherwise>
89
      </xsl:choose>
90
  </xsl:template>
91

    
92
 <!-- ********************************************************************* -->
93
 <!-- **************  G E O G R A P H I C   C O V E R A G E  ************** -->
94
 <!-- ********************************************************************* -->
95
  <xsl:template name="geographicCoverage">
96
    <xsl:choose>
97
      <xsl:when test="references!=''">
98
        <xsl:variable name="ref_id" select="references"/>
99
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
100
        <xsl:for-each select="$references">
101
        	
102
            <table class="{$tabledefaultStyle}">
103
              <xsl:call-template name="geographicCovCommon" />
104
            </table>
105
            
106
        </xsl:for-each>
107
      </xsl:when>
108
      <xsl:otherwise>
109
          <table class="{$tabledefaultStyle}">
110
            <xsl:call-template name="geographicCovCommon" />
111
          </table>
112
      </xsl:otherwise>
113
    </xsl:choose>
114
  </xsl:template>
115

    
116
  <xsl:template name="geographicCovCommon">
117
      <tr>
118
        <th colspan="2">
119
          <xsl:text>Geographic Region:</xsl:text>
120
        </th>
121
      </tr>
122
      <xsl:apply-templates select="geographicDescription"/>
123
      <xsl:apply-templates select="boundingCoordinates"/>
124
      <xsl:for-each select="datasetGPolygon">
125
          <xsl:if test="datasetGPolygonOuterGRing">
126
            <xsl:apply-templates select="datasetGPolygonOuterGRing"/>
127
          </xsl:if>
128
          <xsl:if test="datasetGPolygonExclusionGRing">
129
              <xsl:apply-templates select="datasetGPolygonExclusionGRing"/>
130
          </xsl:if>
131
     </xsl:for-each>
132
  </xsl:template>
133

    
134
  <xsl:template match="geographicDescription">
135
    <tr>
136
      <td class="{$firstColStyle}">Geographic Description:</td>
137
      <td class="{$secondColStyle}"><xsl:value-of select="."/></td>
138
    </tr>
139
  </xsl:template>
140

    
141
  <xsl:template match="boundingCoordinates">
142
      <tr><td class="{$firstColStyle}">
143
           Bounding Coordinates:
144
          </td>
145
       <td>
146
         <table>
147
           <xsl:apply-templates select="westBoundingCoordinate"/>
148
           <xsl:apply-templates select="eastBoundingCoordinate"/>
149
           <xsl:apply-templates select="northBoundingCoordinate"/>
150
           <xsl:apply-templates select="southBoundingCoordinate"/>
151
           <xsl:apply-templates select="boundingAltitudes"/>
152
         </table>
153
      </td>
154
      </tr>
155
  </xsl:template>
156

    
157
  <xsl:template match="westBoundingCoordinate">
158
    <tr><td class="{$firstColStyle}">
159
         <xsl:text>West: &#160;</xsl:text>
160
        </td>
161
        <td class="{$secondColStyle}">
162
         <xsl:value-of select="."/>&#160; degrees
163
        </td>
164
     </tr>
165
  </xsl:template>
166

    
167
  <xsl:template match="eastBoundingCoordinate">
168
    <tr><td class="{$firstColStyle}">
169
       <xsl:text>East: &#160;</xsl:text>
170
       </td>
171
       <td class="{$secondColStyle}">
172
         <xsl:value-of select="."/>&#160; degrees
173
       </td>
174
     </tr>
175
  </xsl:template>
176

    
177
  <xsl:template match="northBoundingCoordinate">
178
    <tr><td class="{$firstColStyle}">
179
         <xsl:text>North: &#160;</xsl:text>
180
        </td>
181
        <td class="{$secondColStyle}">
182
          <xsl:value-of select="."/>&#160; degrees
183
        </td>
184
     </tr>
185
  </xsl:template>
186

    
187
  <xsl:template match="southBoundingCoordinate">
188
    <tr><td class="{$firstColStyle}">
189
         <xsl:text>South: &#160;</xsl:text>
190
       </td>
191
       <td class="{$secondColStyle}">
192
         <xsl:value-of select="."/>&#160; degrees
193
        </td>
194
    </tr>
195
  </xsl:template>
196

    
197

    
198
  <xsl:template match="boundingAltitudes">
199

    
200
      <tr><td class="{$firstColStyle}">
201
        Mimimum Altitude:</td><td class="{$secondColStyle}">
202
        <xsl:apply-templates select="altitudeMinimum"/></td></tr>
203
      <tr><td class="{$firstColStyle}">
204
        Maximum Altitude:</td><td class="{$secondColStyle}">
205
        <xsl:apply-templates select="altitudeMaximum"/></td></tr>
206

    
207
  </xsl:template>
208

    
209
  <xsl:template match="altitudeMinimum">
210
     <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
211
  </xsl:template>
212

    
213
  <xsl:template match="altitudeMaximum">
214
    <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
215
  </xsl:template>
216

    
217
  <xsl:template match="datasetGPolygonOuterGRing">
218
    <tr><td class="{$firstColStyle}">
219
          <xsl:text>G-Ploygon(Outer Ring): </xsl:text>
220
        </td>
221
        <td class="{$secondColStyle}">
222
           <xsl:apply-templates select="gRingPoint"/>
223
           <xsl:apply-templates select="gRing"/>
224
        </td>
225
     </tr>
226
  </xsl:template>
227

    
228
  <xsl:template match="datasetGPolygonExclusionGRing">
229
    <tr><td class="{$firstColStyle}">
230
          <xsl:text>G-Ploygon(Exclusion Ring): </xsl:text>
231
        </td>
232
        <td class="{$secondColStyle}">
233
           <xsl:apply-templates select="gRingPoint"/>
234
           <xsl:apply-templates select="gRing"/>
235
        </td>
236
     </tr>
237
  </xsl:template>
238

    
239
  <xsl:template match="gRing">
240
    <xsl:text>(GRing) &#160;</xsl:text>
241
    <xsl:text>Latitude: </xsl:text>
242
    <xsl:value-of select="gRingLatitude"/>,
243
    <xsl:text>Longitude: </xsl:text>
244
    <xsl:value-of select="gRingLongitude"/><br/>
245
  </xsl:template>
246

    
247
  <xsl:template match="gRingPoint">
248
    <xsl:text>Latitude: </xsl:text>
249
    <xsl:value-of select="gRingLatitude"/>,
250
    <xsl:text>Longitude: </xsl:text>
251
    <xsl:value-of select="gRingLongitude"/><br/>
252
  </xsl:template>
253

    
254
<!-- ********************************************************************* -->
255
<!-- ****************  T E M P O R A L   C O V E R A G E  **************** -->
256
<!-- ********************************************************************* -->
257

    
258
  <xsl:template name="temporalCoverage">
259
    <xsl:choose>
260
      <xsl:when test="references!=''">
261
        <xsl:variable name="ref_id" select="references"/>
262
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
263
        <xsl:for-each select="$references">
264
          <table class="{$tabledefaultStyle}">
265
            <xsl:call-template name="temporalCovCommon" />
266
          </table>
267
        </xsl:for-each>
268
      </xsl:when>
269
      <xsl:otherwise>
270
          <table class="{$tabledefaultStyle}">
271
            <xsl:call-template name="temporalCovCommon" />
272
          </table>
273
      </xsl:otherwise>
274
    </xsl:choose>
275
  </xsl:template>
276

    
277
  <xsl:template name="temporalCovCommon" >
278
     <tr><th colspan="2">
279
      <xsl:text>Time Period:</xsl:text></th></tr>
280
      <xsl:apply-templates select="singleDateTime"/>
281
      <xsl:apply-templates select="rangeOfDates"/>
282
  </xsl:template>
283

    
284
  <xsl:template match="singleDateTime">
285
    <tr><td class="{$firstColStyle}">
286
            Date:
287
         </td>
288
         <td>
289
             <xsl:call-template name="singleDateType" />
290
         </td>
291
     </tr>
292
   </xsl:template>
293

    
294
  <xsl:template match="rangeOfDates">
295
     <tr><td class="{$firstColStyle}">
296
            Begin:
297
         </td>
298
         <td>
299
            <xsl:apply-templates select="beginDate"/>
300
          </td>
301
     </tr>
302

    
303
     <tr><td class="{$firstColStyle}">
304
            End:
305
          </td>
306
          <td>
307
             <xsl:apply-templates select="endDate"/>
308
          </td>
309
     </tr>
310
  </xsl:template>
311

    
312

    
313
  <xsl:template match="beginDate">
314
      <xsl:call-template name="singleDateType"/>
315
  </xsl:template>
316

    
317
  <xsl:template match="endDate">
318
      <xsl:call-template name="singleDateType"/>
319
  </xsl:template>
320

    
321
  <xsl:template name="singleDateType">
322
    <table>
323
     <xsl:if test="calendarDate">
324
      <tr>
325
       <td colspan="2" class="{$secondColStyle}">
326
          <xsl:value-of select="calendarDate"/>
327
          <xsl:if test="./time and normalize-space(./time)!=''">
328
            <xsl:text>&#160; at &#160;</xsl:text><xsl:apply-templates select="time"/>
329
          </xsl:if>
330
        </td>
331
      </tr>
332
     </xsl:if>
333
     <xsl:if test="alternativeTimeScale">
334
         <xsl:apply-templates select="alternativeTimeScale"/>
335
     </xsl:if>
336
    </table>
337
  </xsl:template>
338

    
339

    
340
  <xsl:template match="alternativeTimeScale">
341

    
342
        <tr><td class="{$firstColStyle}">
343
            Timescale:</td><td class="{$secondColStyle}"><xsl:value-of select="timeScaleName"/></td></tr>
344
        <tr><td class="{$firstColStyle}">
345
            Time estimate:</td><td class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeEstimate"/></td></tr>
346
        <xsl:if test="timeScaleAgeUncertainty and normalize-space(timeScaleAgeUncertainty)!=''">
347
        <tr><td class="{$firstColStyle}">
348
            Time uncertainty:</td><td class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeUncertainty"/></td></tr>
349
        </xsl:if>
350
        <xsl:if test="timeScaleAgeExplanation and normalize-space(timeScaleAgeExplanation)!=''">
351
        <tr><td class="{$firstColStyle}">
352
            Time explanation:</td><td class="{$secondColStyle}"><xsl:value-of select="timeScaleAgeExplanation"/></td></tr>
353
        </xsl:if>
354
        <xsl:if test="timeScaleCitation and normalize-space(timeScaleCitation)!=''">
355
        <tr><td class="{$firstColStyle}">
356
            Citation:</td><td class="{$secondColStyle}">
357
            <xsl:apply-templates select="timeScaleCitation"/>
358
        </td></tr>
359
        </xsl:if>
360

    
361
  </xsl:template>
362

    
363
  <xsl:template match="timeScaleCitation">
364
     <!-- Using citation module here -->
365
     <xsl:call-template name="citation">
366
     </xsl:call-template>
367
  </xsl:template>
368

    
369
<!-- ********************************************************************* -->
370
<!-- ***************  T A X O N O M I C   C O V E R A G E  *************** -->
371
<!-- ********************************************************************* -->
372
  <xsl:template name="taxonomicCoverage">
373
     <xsl:choose>
374
      <xsl:when test="references!=''">
375
        <xsl:variable name="ref_id" select="references"/>
376
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
377
        <xsl:for-each select="$references">
378
          <table class="{$tabledefaultStyle}">
379
            <xsl:call-template name="taxonomicCovCommon" />
380
          </table>
381
        </xsl:for-each>
382
      </xsl:when>
383
      <xsl:otherwise>
384
        <table class="{$tabledefaultStyle}">
385
          <xsl:call-template name="taxonomicCovCommon" />
386
        </table>
387
      </xsl:otherwise>
388
    </xsl:choose>
389
  </xsl:template>
390

    
391

    
392
  <xsl:template name="taxonomicCovCommon">
393
      <tr><th colspan="2">
394
      <xsl:text>Taxonomic Range:</xsl:text></th></tr>
395
      <xsl:apply-templates select="taxonomicSystem"/>
396
      <xsl:apply-templates select="generalTaxonomicCoverage"/>
397
      <xsl:for-each select="taxonomicClassification">
398
          <xsl:apply-templates select="."/>
399
      </xsl:for-each>
400
  </xsl:template>
401

    
402

    
403
 <xsl:template match="taxonomicSystem">
404
     <tr><td class="{$firstColStyle}">
405
        <xsl:text>Taxonomic System:</xsl:text></td>
406
        <td>
407
            <table class="{$tabledefaultStyle}">
408
              <xsl:apply-templates select="./*"/>
409
            </table>
410
        </td>
411
     </tr>
412
  </xsl:template>
413

    
414

    
415
  <xsl:template match="classificationSystem">
416
     <xsl:for-each select="classificationSystemCitation">
417
        <tr><td class="{$firstColStyle}">Classification Citation:</td>
418
          <td>
419
           <xsl:call-template name="citation">
420
             <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
421
             <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
422
           </xsl:call-template>
423
         </td>
424
        </tr>
425
     </xsl:for-each>
426
     <xsl:if test="classificationSystemModifications and normalize-space(classificationSystemModifications)!=''">
427
      <tr><td class="{$firstColStyle}">Modification:</td>
428
        <td class="{$secondColStyle}">
429
          <xsl:value-of select="classificationSystemModifications"/>
430
        </td>
431
      </tr>
432
     </xsl:if>
433
  </xsl:template>
434

    
435

    
436
  <xsl:template match="identificationReference">
437
      <tr><td class="{$firstColStyle}">ID Reference:</td>
438
          <td>
439
             <xsl:call-template name="citation">
440
                <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
441
                <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
442
             </xsl:call-template>
443
          </td>
444
     </tr>
445
  </xsl:template>
446

    
447
  <xsl:template match="identifierName">
448
      <tr><td class="{$firstColStyle}">ID Name:</td>
449
          <td>
450
             <xsl:call-template name="party">
451
               <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
452
             </xsl:call-template>
453
          </td>
454
      </tr>
455
  </xsl:template>
456

    
457
  <xsl:template match="taxonomicProcedures">
458
    <tr><td class="{$firstColStyle}">
459
        <xsl:text>Procedures:</xsl:text></td><td class="{$secondColStyle}">
460
        <xsl:value-of select="."/></td></tr>
461
  </xsl:template>
462

    
463
  <xsl:template match="taxonomicCompleteness">
464
    <tr><td class="{$firstColStyle}">
465
        <xsl:text>Completeness:</xsl:text></td><td class="{$secondColStyle}">
466
        <xsl:value-of select="."/></td></tr>
467
  </xsl:template>
468

    
469
  <xsl:template match="vouchers">
470
      <tr><td class="{$firstColStyle}">Vouchers:</td>
471
        <td>
472
        <table class="{$tabledefaultStyle}">
473
        <xsl:apply-templates select="specimen"/>
474
        <xsl:apply-templates select="repository"/>
475
        </table>
476
        </td></tr>
477
  </xsl:template>
478

    
479
  <xsl:template match="specimen">
480
    <tr><td class="{$firstColStyle}">
481
        <xsl:text>Specimen:</xsl:text></td><td class="{$secondColStyle}">
482
        <xsl:value-of select="."/></td></tr>
483
  </xsl:template>
484

    
485
  <xsl:template match="repository">
486
    <tr><td class="{$firstColStyle}">Repository:</td>
487
        <td>
488
            <xsl:for-each select="originator">
489
               <xsl:call-template name="party">
490
                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
491
               </xsl:call-template>
492
            </xsl:for-each>
493
        </td>
494
    </tr>
495
  </xsl:template>
496

    
497

    
498
  <xsl:template match="generalTaxonomicCoverage">
499
      <tr><td class="{$firstColStyle}">
500
             <xsl:text>General Coverage:</xsl:text></td>
501
           <td class="{$secondColStyle}">
502
             <xsl:value-of select="."/>
503
          </td>
504
      </tr>
505
  </xsl:template>
506

    
507

    
508
  <xsl:template match="taxonomicClassification">
509
    <tr><td class="{$firstColStyle}">
510
        <xsl:text>Classification:</xsl:text></td><td>
511
        <table class="{$tabledefaultStyle}">
512
        <xsl:apply-templates select="./*" mode="nest"/>
513
        </table>
514
        </td></tr>
515
  </xsl:template>
516

    
517
  <xsl:template match="taxonRankName" mode="nest" >
518
      <tr><td class="{$firstColStyle}">
519
        <xsl:text>Rank Name:</xsl:text></td><td class="{$secondColStyle}">
520
        <xsl:value-of select="."/></td></tr>
521
  </xsl:template>
522

    
523
  <xsl:template match="taxonRankValue" mode="nest">
524
      <tr><td class="{$firstColStyle}">
525
        <xsl:text>Rank Value:</xsl:text></td><td class="{$secondColStyle}">
526
        <xsl:value-of select="."/></td></tr>
527
  </xsl:template>
528

    
529
  <xsl:template match="commonName" mode="nest">
530
      <tr><td class="{$firstColStyle}">
531
            <xsl:text>Common Name:</xsl:text></td><td class="{$secondColStyle}">
532
            <xsl:value-of select="."/>
533
          </td>
534
      </tr>
535
  </xsl:template>
536

    
537
  <xsl:template match="taxonomicClassification" mode="nest">
538
    <tr><td class="{$firstColStyle}">
539
          <xsl:text>Classification:</xsl:text>
540
        </td>
541
        <td>
542
           <table class="{$tabledefaultStyle}">
543
             <xsl:apply-templates select="./*" mode="nest"/>
544
           </table>
545
        </td>
546
     </tr>
547
  </xsl:template>
548

    
549
</xsl:stylesheet>