Project

General

Profile

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

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: walker $'
10
  *     '$Date: 2015-02-27 14:44:11 -0800 (Fri, 27 Feb 2015) $'
11
  * '$Revision: 9135 $'
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="UTF-8"
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
          <div class="row-fluid">
50
            <xsl:for-each select="geographicCoverage">
51
                <xsl:call-template name="geographicCoverage">
52
                </xsl:call-template>
53
            </xsl:for-each>
54
          </div>
55
          <div class="row-fluid">
56
             <xsl:for-each select="temporalCoverage">
57
                <xsl:call-template name="temporalCoverage">
58
                </xsl:call-template>
59
            </xsl:for-each>
60
          </div>
61
          <div class="row-fluid">
62
            <xsl:for-each select="taxonomicCoverage">
63
                <xsl:call-template name="taxonomicCoverage">
64
                </xsl:call-template>
65
            </xsl:for-each>
66
          </div>
67
          </xsl:for-each>
68
        </xsl:when>
69
        <xsl:otherwise>
70
          <div class="row-fluid">
71
            <xsl:for-each select="geographicCoverage">
72
                <xsl:call-template name="geographicCoverage">
73
                </xsl:call-template>
74
            </xsl:for-each>
75
          </div>
76
          <div class="row-fluid">
77
            <xsl:for-each select="temporalCoverage">
78
                <xsl:call-template name="temporalCoverage">
79
                </xsl:call-template>
80
            </xsl:for-each>
81
          </div>
82
          <div class="row-fluid">
83
            <xsl:for-each select="taxonomicCoverage">
84
                <xsl:call-template name="taxonomicCoverage">
85
                </xsl:call-template>
86
            </xsl:for-each>
87
          </div>
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
          	<div class="row-fluid geographicCoverage" data-content="geographicCoverage">
103
              <xsl:call-template name="geographicCovCommon" />
104
            </div>
105
            
106
        </xsl:for-each>
107
      </xsl:when>
108
      <xsl:otherwise>
109
          <div class="row-fluid geographicCoverage" data-content="geographicCoverage">
110
            <xsl:call-template name="geographicCovCommon" />
111
          </div>
112
      </xsl:otherwise>
113
    </xsl:choose>
114
  </xsl:template>
115

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

    
131
  <xsl:template match="geographicDescription">
132
    <div class="control-group geographicDescription" data-content="geographicDescription">
133
		<label class="control-label">Geographic Description</label>
134
      	<div class="controls controls-well">
135
      		<xsl:value-of select="."/>
136
    	</div>
137
	</div>
138
  </xsl:template>
139

    
140
  <xsl:template match="boundingCoordinates">
141
      <div class="control-group boundingCoordinates" data-content="boundingCoordinates">
142
		<label class="control-label">Bounding Coordinates</label>
143
      	<div class="controls controls-well">
144
      		<xsl:apply-templates select="northBoundingCoordinate"/>
145
			<xsl:apply-templates select="southBoundingCoordinate"/>
146
			<xsl:apply-templates select="eastBoundingCoordinate"/>
147
			<xsl:apply-templates select="westBoundingCoordinate"/>
148
			<xsl:apply-templates select="boundingAltitudes"/>
149
      </div>
150
	</div>
151
  </xsl:template>
152

    
153
  <xsl:template match="westBoundingCoordinate">
154
  	<xsl:variable name="west"><xsl:value-of select="."/></xsl:variable>
155

    
156
    <div class="control-group westBoundingCoordinate" data-content="westBoundingCoordinate" data-value="{$west}">
157
		<label class="control-label"><xsl:text>West</xsl:text></label>        
158
        <div class="controls">
159
         	<xsl:value-of select="."/>&#160; degrees
160
        </div>
161
     </div>
162
  </xsl:template>
163

    
164
  <xsl:template match="eastBoundingCoordinate">
165
	<xsl:variable name="east"><xsl:value-of select="."/></xsl:variable>
166

    
167
    <div class="control-group eastBoundingCoordinate" data-content="eastBoundingCoordinate" data-value="{$east}">
168
		<label class="control-label"><xsl:text>East</xsl:text></label>
169
		<div class="controls">
170
			<xsl:value-of select="."/>&#160; degrees
171
		</div>
172
     </div>
173
  </xsl:template>
174

    
175
  <xsl:template match="northBoundingCoordinate">
176
   	<xsl:variable name="north"><xsl:value-of select="."/></xsl:variable>
177

    
178
    <div class="control-group northBoundingCoordinate" data-content="northBoundingCoordinate" data-value="{$north}">
179
		<label class="control-label"><xsl:text>North</xsl:text></label>        
180
        <div class="controls">
181
          <xsl:value-of select="."/>&#160; degrees
182
        </div>
183
     </div>
184
  </xsl:template>
185

    
186
  <xsl:template match="southBoundingCoordinate">
187
    <xsl:variable name="south"><xsl:value-of select="."/></xsl:variable>
188
  
189
    <div class="control-group southBoundingCoordinate" data-content="southBoundingCoordinate"  data-value="{$south}">
190
		<label class="control-label"><xsl:text>South</xsl:text></label>
191
		<div class="controls">
192
			<xsl:value-of select="."/>&#160; degrees
193
        </div>
194
    </div>
195
  </xsl:template>
196

    
197

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

    
200
      <div class="control-group">
201
		<label class="control-label">Mimimum Altitude</label>
202
		<div class="controls">
203
        	<xsl:apply-templates select="altitudeMinimum"/>
204
        </div>
205
      </div>  
206
      <div class="control-group">
207
		<label class="control-label">Maximum Altitude</label>
208
		<div class="controls">
209
        	<xsl:apply-templates select="altitudeMaximum"/>
210
        </div>
211
       </div>
212

    
213
  </xsl:template>
214

    
215
  <xsl:template match="altitudeMinimum">
216
     <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
217
  </xsl:template>
218

    
219
  <xsl:template match="altitudeMaximum">
220
    <xsl:value-of select="."/> &#160;<xsl:value-of select="../altitudeUnits"/>
221
  </xsl:template>
222

    
223
  <xsl:template match="datasetGPolygonOuterGRing">
224
    <div class="control-group">
225
		<label class="control-label"><xsl:text>G-Ploygon(Outer Ring)</xsl:text>
226
        </label>
227
        <div class="controls">
228
           <xsl:apply-templates select="gRingPoint"/>
229
           <xsl:apply-templates select="gRing"/>
230
        </div>
231
     </div>
232
  </xsl:template>
233

    
234
  <xsl:template match="datasetGPolygonExclusionGRing">
235
    <div class="control-group">
236
		<label class="control-label"><xsl:text>G-Ploygon(Exclusion Ring)</xsl:text>
237
        </label>
238
        <div class="controls">
239
           <xsl:apply-templates select="gRingPoint"/>
240
           <xsl:apply-templates select="gRing"/>
241
        </div>
242
     </div>
243
  </xsl:template>
244

    
245
  <xsl:template match="gRing">
246
    <xsl:text>(GRing) &#160;</xsl:text>
247
    <xsl:text>Latitude: </xsl:text>
248
    <xsl:value-of select="gRingLatitude"/>,
249
    <xsl:text>Longitude: </xsl:text>
250
    <xsl:value-of select="gRingLongitude"/><br/>
251
  </xsl:template>
252

    
253
  <xsl:template match="gRingPoint">
254
    <xsl:text>Latitude: </xsl:text>
255
    <xsl:value-of select="gRingLatitude"/>,
256
    <xsl:text>Longitude: </xsl:text>
257
    <xsl:value-of select="gRingLongitude"/><br/>
258
  </xsl:template>
259

    
260
<!-- ********************************************************************* -->
261
<!-- ****************  T E M P O R A L   C O V E R A G E  **************** -->
262
<!-- ********************************************************************* -->
263

    
264
  <xsl:template name="temporalCoverage">
265
    <xsl:choose>
266
      <xsl:when test="references!=''">
267
        <xsl:variable name="ref_id" select="references"/>
268
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
269
        <xsl:for-each select="$references">
270
        	<div class="row-fluid temporalCoverage" data-content="temporalCoverage">
271
            	<xsl:call-template name="temporalCovCommon" />
272
            </div>
273
        </xsl:for-each>
274
      </xsl:when>
275
      <xsl:otherwise>
276
        	<div class="row-fluid temporalCoverage" data-content="temporalCoverage">
277
	            <xsl:call-template name="temporalCovCommon" />
278
	        </div>
279
      </xsl:otherwise>
280
    </xsl:choose>
281
  </xsl:template>
282

    
283
  <xsl:template name="temporalCovCommon" >
284
		<h4>Temporal Coverage</h4>
285
		<xsl:apply-templates select="singleDateTime"/>
286
		<xsl:apply-templates select="rangeOfDates"/>
287
  </xsl:template>
288

    
289
  <xsl:template match="singleDateTime">
290
    <div class="control-group">
291
		<label class="control-label">Single Date</label>
292
        <div class="controls controls-well">
293
             <xsl:call-template name="singleDateType" />
294
        </div>
295
     </div>
296
   </xsl:template>
297

    
298
  <xsl:template match="rangeOfDates">
299
 	<div class="control-group">
300
		<label class="control-label">Date Range</label>
301
		<div class="controls controls-well">
302
		     <div class="control-group">
303
				<label class="control-label">Begin</label>
304
		         <div class="controls">
305
		            <xsl:apply-templates select="beginDate"/>
306
		         </div>
307
		     </div>
308
		     <div class="control-group">    
309
		         <label class="control-label">End</label>
310
		         <div class="controls">
311
		            <xsl:apply-templates select="endDate"/>
312
		          </div>
313
		     </div>
314
	     </div>
315
     </div>
316
  </xsl:template>
317

    
318

    
319
  <xsl:template match="beginDate">
320
      <xsl:call-template name="singleDateType"/>
321
  </xsl:template>
322

    
323
  <xsl:template match="endDate">
324
      <xsl:call-template name="singleDateType"/>
325
  </xsl:template>
326

    
327
  <xsl:template name="singleDateType">
328
  	<div class="row-fluid">
329
		<xsl:if test="calendarDate">
330
          <xsl:value-of select="calendarDate"/>
331
          <xsl:if test="./time and normalize-space(./time)!=''">
332
            <xsl:text>&#160; at &#160;</xsl:text><xsl:apply-templates select="time"/>
333
          </xsl:if>
334
		</xsl:if>
335
		<xsl:if test="alternativeTimeScale">
336
			<xsl:apply-templates select="alternativeTimeScale"/>
337
		</xsl:if>
338
     </div>
339
  </xsl:template>
340

    
341

    
342
  <xsl:template match="alternativeTimeScale">
343

    
344
        <div class="control-group">
345
			<label class="control-label">Timescale</label>
346
			<div class="controls">
347
				<xsl:value-of select="timeScaleName"/>
348
			</div>
349
		</div>
350
        <div class="control-group">
351
			<label class="control-label">Time estimate</label>
352
			<div class="controls">
353
				<xsl:value-of select="timeScaleAgeEstimate"/>
354
			</div>
355
		</div>
356
        <xsl:if test="timeScaleAgeUncertainty and normalize-space(timeScaleAgeUncertainty)!=''">
357
        	<div class="control-group">
358
				<label class="control-label">Time uncertainty</label>
359
				<div class="controls">
360
					<xsl:value-of select="timeScaleAgeUncertainty"/>
361
				</div>
362
			</div>
363
        </xsl:if>
364
        <xsl:if test="timeScaleAgeExplanation and normalize-space(timeScaleAgeExplanation)!=''">
365
        	<div class="control-group">
366
				<label class="control-label">Time explanation</label>
367
				<div class="controls">
368
					<xsl:value-of select="timeScaleAgeExplanation"/>
369
				</div>
370
			</div>
371
        </xsl:if>
372
        <xsl:if test="timeScaleCitation and normalize-space(timeScaleCitation)!=''">
373
        	<div class="control-group">
374
				<label class="control-label">Citation</label>
375
				<div class="controls">
376
            		<xsl:apply-templates select="timeScaleCitation"/>
377
        		</div>
378
        	</div>
379
        </xsl:if>
380

    
381
  </xsl:template>
382

    
383
  <xsl:template match="timeScaleCitation">
384
     <!-- Using citation module here -->
385
     <xsl:call-template name="citation">
386
     </xsl:call-template>
387
  </xsl:template>
388

    
389
<!-- ********************************************************************* -->
390
<!-- ***************  T A X O N O M I C   C O V E R A G E  *************** -->
391
<!-- ********************************************************************* -->
392
  <xsl:template name="taxonomicCoverage">
393
     <xsl:choose>
394
      <xsl:when test="references!=''">
395
        <xsl:variable name="ref_id" select="references"/>
396
        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
397
        <xsl:for-each select="$references">
398
        	<div class="row-fluid taxonomicCoverage" data-content="taxonomicCoverage">
399
            	<xsl:call-template name="taxonomicCovCommon" />
400
            </div>
401
        </xsl:for-each>
402
      </xsl:when>
403
      <xsl:otherwise>
404
        	<div class="row-fluid taxonomicCoverage" data-content="taxonomicCoverage">
405
	          <xsl:call-template name="taxonomicCovCommon" />
406
	         </div>
407
      </xsl:otherwise>
408
    </xsl:choose>
409
  </xsl:template>
410

    
411

    
412
  <xsl:template name="taxonomicCovCommon">
413
      <h4>Taxonomic Range</h4>
414

    
415
      <xsl:apply-templates select="taxonomicSystem"/>
416
      <xsl:apply-templates select="generalTaxonomicCoverage"/>
417
      <xsl:for-each select="taxonomicClassification">
418
          <xsl:apply-templates select="."/>
419
      </xsl:for-each>
420
  </xsl:template>
421

    
422

    
423
 <xsl:template match="taxonomicSystem">
424
     <div class="control-group">
425
		<label class="control-label"><xsl:text>Taxonomic System</xsl:text></label>
426
        <div class="controls controls-well">
427
              <xsl:apply-templates select="./*"/>
428
        </div>
429
     </div>
430
  </xsl:template>
431

    
432

    
433
  <xsl:template match="classificationSystem">
434
     <xsl:for-each select="classificationSystemCitation">
435
        <div class="control-group">
436
			<label class="control-label">Classification Citation</label>
437
          	<div class="controls">
438
	           <xsl:call-template name="citation">
439
	             <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
440
	             <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
441
	           </xsl:call-template>
442
	         </div>
443
        </div>
444
     </xsl:for-each>
445
     <xsl:if test="classificationSystemModifications and normalize-space(classificationSystemModifications)!=''">
446
      <div class="control-group">
447
		<label class="control-label">Modification</label>
448
        <div class="controls">
449
          <xsl:value-of select="classificationSystemModifications"/>
450
        </div>
451
      </div>
452
     </xsl:if>
453
  </xsl:template>
454

    
455

    
456
  <xsl:template match="identificationReference">
457
      <div class="control-group">
458
		<label class="control-label">ID Reference</label>
459
        <div class="controls">
460
             <xsl:call-template name="citation">
461
                <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
462
                <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
463
             </xsl:call-template>
464
          </div>
465
     </div>
466
  </xsl:template>
467

    
468
  <xsl:template match="identifierName">
469
      <div class="control-group">
470
		<label class="control-label">ID Name</label>
471
        <div class="controls">
472
           <xsl:call-template name="party">
473
             <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
474
           </xsl:call-template>
475
        </div>
476
      </div>
477
  </xsl:template>
478

    
479
  <xsl:template match="taxonomicProcedures">
480
    <div class="control-group">
481
		<label class="control-label"><xsl:text>Procedures</xsl:text></label>
482
		<div class="controls">
483
        	<xsl:value-of select="."/>
484
        </div>
485
    </div>
486
  </xsl:template>
487

    
488
  <xsl:template match="taxonomicCompleteness">
489
    <div class="control-group">
490
		<label class="control-label"><xsl:text>Completeness</xsl:text></label>
491
		<div class="contorls">
492
        	<xsl:value-of select="."/>
493
        </div>
494
    </div>
495
  </xsl:template>
496

    
497
  <xsl:template match="vouchers">
498
      <div class="control-group">
499
		<label class="control-label">Vouchers</label>
500
        <div class="controls">
501
	        <xsl:apply-templates select="specimen"/>
502
	        <xsl:apply-templates select="repository"/>
503
        </div>
504
      </div>
505
  </xsl:template>
506

    
507
  <xsl:template match="specimen">
508
    <div class="control-group">
509
		<label class="control-label"><xsl:text>Specimen</xsl:text></label>
510
		<div class="controls">
511
        	<xsl:value-of select="."/>
512
        </div>
513
    </div>
514
  </xsl:template>
515

    
516
  <xsl:template match="repository">
517
    <div class="control-group">
518
		<label class="control-label">Repository</label>
519
        <div class="controls">
520
            <xsl:for-each select="originator">
521
               <xsl:call-template name="party">
522
                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
523
               </xsl:call-template>
524
            </xsl:for-each>
525
        </div>
526
    </div>
527
  </xsl:template>
528

    
529

    
530
  <xsl:template match="generalTaxonomicCoverage">
531
      <div class="control-group">
532
		<label class="control-label"><xsl:text>General Coverage</xsl:text></label>
533
        <div class="controls controls-well">
534
             <xsl:value-of select="."/>
535
        </div>
536
      </div>
537
  </xsl:template>
538

    
539

    
540
  <xsl:template match="taxonomicClassification">
541
    <div class="control-group">
542
		<label class="control-label"><xsl:text>Classification</xsl:text></label>
543
		<div class="controls controls-well">
544
        	<xsl:apply-templates select="./*" mode="nest"/>
545
        </div>
546
    </div>
547
  </xsl:template>
548

    
549
  <xsl:template match="taxonRankName" mode="nest" >
550
      <div class="control-group">
551
		<label class="control-label"><xsl:text>Rank Name</xsl:text></label>
552
		<div class="controls">
553
        	<xsl:value-of select="."/>
554
        </div>
555
   	</div>
556
  </xsl:template>
557

    
558
  <xsl:template match="taxonRankValue" mode="nest">
559
      <div class="control-group">
560
		<label class="control-label"><xsl:text>Rank Value</xsl:text></label>
561
		<div class="controls">
562
        	<xsl:value-of select="."/>
563
       	</div>
564
    </div>
565
  </xsl:template>
566

    
567
  <xsl:template match="commonName" mode="nest">
568
      <div class="control-group">
569
		<label class="control-label"><xsl:text>Common Name</xsl:text></label>
570
		<div class="controls">
571
            <xsl:value-of select="."/>
572
        </div>
573
      </div>
574
  </xsl:template>
575

    
576
  <xsl:template match="taxonomicClassification" mode="nest">
577
    <div class="control-group">
578
		<label class="control-label"><xsl:text>Classification</xsl:text></label>
579
        <div class="controls">
580
             <xsl:apply-templates select="./*" mode="nest"/>
581
        </div>
582
     </div>
583
  </xsl:template>
584

    
585
</xsl:stylesheet>