Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matt Jones
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-10-01 14:23:09 -0700 (Thu, 01 Oct 2015) $'
11
  * '$Revision: 9352 $'
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-dataset.dtd
29
  * module of the Ecological Metadata Language (EML) into an HTML format
30
  * suitable for rendering with modern web browsers.
31
-->
32
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
33

    
34

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

    
40
  <xsl:template match="dataset" mode="dataset">
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:call-template name="datasetmixed"/>
47
          </xsl:for-each>
48
       </xsl:when>
49
       <xsl:otherwise>
50
             <xsl:call-template name="datasetmixed"/>
51
       </xsl:otherwise>
52
      </xsl:choose>
53

    
54
  </xsl:template>
55
  
56
  <xsl:template name="datasetmixed">
57
	
58
     <!-- citation -->
59
	<xsl:for-each select=".">
60
		<xsl:call-template name="datasetcitation" />
61
    </xsl:for-each>		
62
     
63
     <h4>General</h4>
64
             <!-- put in the title -->
65
             <xsl:if test="./title">
66
               <xsl:for-each select="./title">
67
                 <xsl:call-template name="resourcetitle">
68
                   <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
69
                   <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
70
                 </xsl:call-template>
71
               </xsl:for-each>
72
             </xsl:if>
73
             <!-- put in the short name -->
74
             <xsl:if test="shortName">
75
             <xsl:for-each select="./shortName">
76
             <xsl:call-template name="resourceshortName">
77
               <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
78
               <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
79
             </xsl:call-template>
80
             </xsl:for-each>
81
             </xsl:if>
82
             <!-- put in the identifier and system that the ID belongs to -->
83
             <xsl:if test="../@packageId">
84
	             <xsl:for-each select="../@packageId">
85
	             	<xsl:call-template name="identifier">
86
		               <xsl:with-param name="packageID" select="../@packageId"/>
87
		               <xsl:with-param name="system" select="../@system"/>
88
		               <xsl:with-param name="IDfirstColStyle" select="$firstColStyle"/>
89
		               <xsl:with-param name="IDsecondColStyle" select="$secondColStyle"/>
90
		             </xsl:call-template>
91
	             </xsl:for-each>
92
             </xsl:if>
93
             <!-- put in the alternate identifiers -->
94
             <xsl:if test="keywordSet">
95
             <xsl:for-each select="alternateIdentifier">
96
               <xsl:call-template name="resourcealternateIdentifier">
97
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
98
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
99
               </xsl:call-template>
100
             </xsl:for-each>
101
             </xsl:if>
102
             <!-- put in the text of the abstract-->
103
             <xsl:if test="./abstract">
104
             <xsl:for-each select="./abstract">
105
               <xsl:call-template name="resourceabstract">
106
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
107
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
108
               </xsl:call-template>
109
             </xsl:for-each>
110
             </xsl:if>
111
             <!-- put in the purpose of the dataset-->
112
             <xsl:if test="./purpose">
113
             <xsl:for-each select="./purpose">
114
               <xsl:call-template name="datasetpurpose">
115
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
116
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
117
               </xsl:call-template>
118
             </xsl:for-each>
119
             </xsl:if>
120
             <!-- put in the keyword sets -->
121
             <xsl:if test="keywordSet">
122
             	<div class="row-fluid">
123
					<div class="control-group">
124
						<label class="control-label">
125
							<xsl:text>Keywords</xsl:text>
126
						</label>	
127
						<div class="controls controls-well">
128
							<xsl:for-each select="keywordSet">
129
								<xsl:call-template name="resourcekeywordSet" >
130
									<xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
131
									<xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
132
								</xsl:call-template>
133
							</xsl:for-each>
134
						</div>
135
					</div>	
136
				</div>
137
             </xsl:if>
138

    
139
             <!-- put in the publication date -->
140
             <xsl:if test="./pubDate">
141
               <xsl:for-each select="pubDate">
142
                <xsl:call-template name="resourcepubDate" >
143
                  <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
144
                 </xsl:call-template>
145
               </xsl:for-each>
146
             </xsl:if>
147

    
148
             <!-- put in the language -->
149
             <xsl:if test="./language">
150
               <xsl:for-each select="language">
151
                 <xsl:call-template name="resourcelanguage" >
152
                   <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
153
                  </xsl:call-template>
154
               </xsl:for-each>
155
             </xsl:if>
156

    
157
             <!-- put in the series -->
158
             <xsl:if test="./series">
159
               <xsl:for-each select="series">
160
                 <xsl:call-template name="resourceseries" >
161
                   <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
162
                 </xsl:call-template>
163
               </xsl:for-each>
164
             </xsl:if>
165
             
166
         
167
         
168
           <!-- create a second easy access table listing the data entities -->
169
           <xsl:if test="dataTable|spatialRaster|spatialVector|storedProcedure|view|otherEntity">
170
			<xsl:if test="$withEntityLinks='1' or $displaymodule = 'printall'">
171
	             <xsl:call-template name="datasetentity"/>
172
			</xsl:if>
173
           </xsl:if>
174
           
175

    
176
     
177
     <h4>People and Associated Parties</h4>
178

    
179
       <!-- add in the creators -->
180
       <xsl:if test="creator">
181
         <div class="control-group">
182
         	<label class="control-label">
183
         		Data Set Creators
184
         	</label>
185
         	<div class="controls controls-well">
186
		         <xsl:for-each select="creator">
187
		         
188
		         	<xsl:variable name="absolutePath" >
189
			         	<xsl:for-each select="ancestor-or-self::*">
190
			         		<xsl:text>/</xsl:text>			         	
191
			         		<xsl:value-of select="local-name()" />
192
			         	</xsl:for-each>
193
			         </xsl:variable>	
194
					<xsl:variable name="index" select="position()" />
195
		         	<div>
196
		         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
197
		         		<xsl:attribute name="type">party</xsl:attribute>
198
		               <xsl:call-template name="party">
199
		                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
200
		                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
201
		               </xsl:call-template>
202
		         	</div>      
203
		         </xsl:for-each>
204
         	</div>
205
         </div>
206
       </xsl:if>
207

    
208
       <!-- add in the contacts -->
209
       <xsl:if test="contact">
210
         <div class="control-group">
211
         	<label class="control-label">Data Set Contacts</label>
212
         	<div class="controls controls-well">
213
	         	<xsl:for-each select="contact">
214
	         		<xsl:variable name="absolutePath" >
215
			         	<xsl:for-each select="ancestor-or-self::*">
216
			         		<xsl:text>/</xsl:text>			         	
217
			         		<xsl:value-of select="local-name()" />
218
			         	</xsl:for-each>
219
			         </xsl:variable>	
220
					<xsl:variable name="index" select="position()" />
221
		         	<div>
222
		         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
223
		         		<xsl:attribute name="type">party</xsl:attribute>
224
	               <xsl:call-template name="party">
225
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
226
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
227
	               </xsl:call-template>
228
	               </div>
229
		             
230
	         	</xsl:for-each>
231
	         </div>	
232
         </div>
233
       </xsl:if>
234

    
235
       <!-- add in the associatedParty  -->
236
       <xsl:if test="associatedParty">
237
         <div class="control-group">
238
         	<label class="control-label">Associated Parties</label>
239
         	<div class="controls controls-well">
240
				<xsl:for-each select="associatedParty">
241
					<xsl:variable name="absolutePath" >
242
			         	<xsl:for-each select="ancestor-or-self::*">
243
			         		<xsl:text>/</xsl:text>			         	
244
			         		<xsl:value-of select="local-name()" />
245
			         	</xsl:for-each>
246
			         </xsl:variable>	
247
					<xsl:variable name="index" select="position()" />
248
		         	<div>
249
		         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
250
		         		<xsl:attribute name="type">party</xsl:attribute>
251
					<xsl:call-template name="party">
252
						<xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
253
						<xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
254
					</xsl:call-template>
255
					</div>	
256
		         </xsl:for-each>
257
	         </div>	
258
         </div>
259
		         
260
       </xsl:if>
261

    
262
       <!-- add in the metadataProviders using a two column table -->
263
       <xsl:if test="metadataProvider">
264
		<div class="control-group">
265
         	<label class="control-label">Metadata Providers</label>
266
         	<div class="controls controls-well">
267
				<xsl:for-each select="metadataProvider">
268
					<xsl:variable name="absolutePath" >
269
			         	<xsl:for-each select="ancestor-or-self::*">
270
			         		<xsl:text>/</xsl:text>			         	
271
			         		<xsl:value-of select="local-name()" />
272
			         	</xsl:for-each>
273
			         </xsl:variable>	
274
					<xsl:variable name="index" select="position()" />
275
		         	<div>
276
		         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
277
		         		<xsl:attribute name="type">party</xsl:attribute>
278
	               <xsl:call-template name="party">
279
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
280
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
281
	               </xsl:call-template>
282
					</div>	
283
				</xsl:for-each>
284
		   </div>
285
		</div>      
286
       </xsl:if>
287

    
288
       <!-- add in the publishers using a two column table -->
289
       <xsl:if test="publisher">
290
         <div class="control-group">
291
         	<label class="control-label">Data Set Publishers</label>
292
         	<div class="controls controls-well">
293
		         <xsl:for-each select="publisher">
294
		         	<xsl:variable name="absolutePath" >
295
			         	<xsl:for-each select="ancestor-or-self::*">
296
			         		<xsl:text>/</xsl:text>			         	
297
			         		<xsl:value-of select="local-name()" />
298
			         	</xsl:for-each>
299
			         </xsl:variable>	
300
					<xsl:variable name="index" select="position()" />
301
		         	<div>
302
		         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
303
		         		<xsl:attribute name="type">party</xsl:attribute>
304
	               <xsl:call-template name="party">
305
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
306
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
307
	               </xsl:call-template>
308
					</div>		
309
		         </xsl:for-each>
310
	         </div>
311
         </div>
312
       </xsl:if>
313

    
314
     <!-- add in the coverage info -->
315
     <!--  <h4>Context</h4> -->
316
     
317
     <!-- add in the geographic coverage info -->
318
     <div class="row-fluid">  
319
           <xsl:if test="./coverage/geographicCoverage">
320
             <xsl:for-each select="./coverage/geographicCoverage">
321
               <xsl:call-template name="geographicCoverage">
322
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
323
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
324
               </xsl:call-template>
325
             </xsl:for-each>
326
           </xsl:if>
327
       </div>
328
       <!-- add in the temporal coverage info -->
329
       <div class="row-fluid">
330
           <xsl:if test="./coverage/temporalCoverage">
331
             <xsl:for-each select="./coverage/temporalCoverage">
332
               <xsl:call-template name="temporalCoverage">
333
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
334
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
335
               </xsl:call-template>
336
             </xsl:for-each>
337
           </xsl:if>
338
       </div>
339
       <!-- add in the taxonomic coverage info -->
340
       <div class="row-fluid">
341
           <xsl:if test="./coverage/taxonomicCoverage">
342
             <xsl:for-each select="./coverage/taxonomicCoverage">
343
               <xsl:call-template name="taxonomicCoverage">
344
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
345
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
346
               </xsl:call-template>
347
             </xsl:for-each>
348
           </xsl:if>
349
       </div>
350

    
351
     <!-- add in the method info -->
352
     <h4>Sampling, Processing and Quality Control Methods</h4>
353

    
354
     <div class="row-fluid">
355
         <xsl:if test="./methods">
356
           <xsl:for-each select="./methods">
357
             <xsl:call-template name="datasetmethod">
358
               <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
359
               <xsl:with-param name="methodsecondColStyle" select="$secondColStyle"/>
360
             </xsl:call-template>
361
           </xsl:for-each>
362
         </xsl:if>
363
     </div>
364

    
365
     <h4>Data Set Usage Rights</h4>
366

    
367
       <!-- add in the intellectiual rights info -->
368
     <div class="row-fluid">
369
         <xsl:if test="intellectualRights">
370
           <xsl:for-each select="intellectualRights">
371
             <xsl:call-template name="resourceintellectualRights">
372
               <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
373
               <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
374
             </xsl:call-template>
375
           </xsl:for-each>
376
         </xsl:if>
377
     </div>
378

    
379
       <!-- add in the access control info -->
380
     <div class="row-fluid">
381
         <xsl:if test="access">
382
           <xsl:for-each select="access">
383
             <xsl:call-template name="access">
384
               <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
385
               <xsl:with-param name="accesssecondColStyle" select="$secondColStyle"/>
386
             </xsl:call-template>
387
           </xsl:for-each>
388
         </xsl:if>
389
     </div>
390
  </xsl:template>
391

    
392
  <xsl:template name="datasetresource">
393
     <div class="row-fluid">
394
        <xsl:call-template name="resource">
395
          <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
396
          <xsl:with-param name="ressubHeaderStyle" select="$subHeaderStyle"/>
397
        </xsl:call-template>
398
     </div>
399
  </xsl:template>
400

    
401

    
402
  <xsl:template name="datasetpurpose">
403
    <xsl:for-each select="purpose">
404
      <div class="control-group">
405
      	<label class="control-label"><xsl:text>Purpose</xsl:text></label>
406
       	<div  class="controls">
407
            &#160;
408
              <xsl:call-template name="text">
409
                <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
410
              </xsl:call-template>
411
          </div>
412
       </div>
413
     </xsl:for-each>
414
  </xsl:template>
415

    
416
  <xsl:template name="datasetmaintenance">
417
    <xsl:for-each select="maintenance">
418
      <div class="control-group">
419
      	<label class="control-label"><xsl:text>Maintenance</xsl:text></label>
420
      	<div class="controls">
421
		     <xsl:call-template name="mantenancedescription"/>
422
		      <div class="control-group">
423
      			<label class="control-label">Frequency</label>
424
		        <div class="controls" >
425
		           <xsl:value-of select="maintenanceUpdateFrequency"/>
426
		        </div>
427
		     </div>
428
		     <xsl:call-template name="datasetchangehistory"/>
429
		   </div>
430
		</div>
431
   	</xsl:for-each>
432
  </xsl:template>
433

    
434
  <xsl:template name="mantenancedescription">
435
   <xsl:for-each select="description">
436
     <div class="control-group">
437
      	<label class="control-label">Description</label>
438
        <div class="controls">
439
            <xsl:call-template name="text">
440
               <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
441
             </xsl:call-template>
442
          </div>
443
     </div>
444
    </xsl:for-each>
445
  </xsl:template>
446

    
447
   <xsl:template name="datasetchangehistory">
448
   <xsl:if test="changeHistory">
449
     <div class="control-group">
450
      	<label class="control-label">History</label>
451
          <div class="controls">
452
              <xsl:for-each select="changeHistory">
453
                <xsl:call-template name="historydetails"/>
454
              </xsl:for-each>
455
          </div>
456
     </div>
457
     </xsl:if>
458
   </xsl:template>
459

    
460
   <xsl:template name="historydetails">
461
        <div class="control-group">
462
	      	<label class="control-label">scope</label>
463
	        <div class="controls">
464
	            <xsl:value-of select="changeScope"/>
465
	        </div>
466
        </div>
467
        <div class="control-group">
468
	      	<label class="control-label">old value</label>
469
	        <div class="controls">
470
	            <xsl:value-of select="oldValue"/>
471
        	</div>
472
       	</div>
473
        <div class="control-group">
474
      		<label class="control-label">change date</label>
475
            <div class="controls">
476
	            <xsl:value-of select="changeDate"/>
477
	        </div>
478
	    </div>
479
        <xsl:if test="comment and normalize-space(comment)!=''">
480
			<div class="control-group">
481
      			<label class="control-label">comment</label>
482
      			<div class="controls">
483
		            <xsl:value-of select="comment"/>
484
				</div>
485
			</div>
486
        </xsl:if>
487
  </xsl:template>
488

    
489
  <xsl:template name="datasetcontact">
490
    <div class="control-group">
491
      	<label class="control-label"><xsl:text>Contact</xsl:text></label>
492
	    <div class="controls">
493
		    <xsl:for-each select="contact">
494
			       <xsl:call-template name="party">
495
		              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
496
		       </xsl:call-template>
497
	    	</xsl:for-each>
498
	    </div>
499
	</div>    	
500
  </xsl:template>
501

    
502
  <xsl:template name="datasetpublisher">
503
   <xsl:for-each select="publisher">
504
     <div class="control-group">
505
      	<label class="control-label"><xsl:text>Publisher</xsl:text></label>
506
     	<div class="controls">
507
	       <xsl:call-template name="party">
508
	              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
509
	       </xsl:call-template>
510
     	</div>
511
     </div>
512
   </xsl:for-each>
513
  </xsl:template>
514

    
515
  <xsl:template name="datasetpubplace">
516
    <xsl:for-each select="pubPlace">
517
      <div class="control-group">
518
      	<label class="control-label">Publish Place</label>
519
        <div class="controls">
520
          <xsl:value-of select="."/>
521
		</div>
522
      </div>
523
   </xsl:for-each>
524
  </xsl:template>
525

    
526
  <xsl:template name="datasetmethod">
527
     <xsl:for-each select=".">
528
        <xsl:call-template name="method">
529
          <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
530
        </xsl:call-template>
531
    </xsl:for-each>
532
  </xsl:template>
533

    
534
  <xsl:template name="datasetproject">
535
    <h4><xsl:text>Parent Project Information</xsl:text></h4>
536
    <xsl:for-each select="project">
537
     <div class="row-fluid">
538
       <xsl:call-template name="project">
539
         <xsl:with-param name="projectfirstColStyle" select="$firstColStyle"/>
540
       </xsl:call-template>
541
     </div>
542
    </xsl:for-each>
543
  </xsl:template>
544

    
545
   <xsl:template name="datasetaccess">
546
    <xsl:for-each select="access">
547
      <div class="row-fluid">
548
        <xsl:call-template name="access">
549
          <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
550
          <xsl:with-param name="accesssubHeaderStyle" select="$subHeaderStyle"/>
551
        </xsl:call-template>
552
      </div>
553
    </xsl:for-each>
554
  </xsl:template>
555
  
556
	<xsl:template name="datasetentity">
557
		<xsl:if test="dataTable or spatialRaster or spatialVector or storedProcedures or view or otherEntity">
558
			<h4>
559
				<xsl:text>Data Table, Image, and Other Data Details</xsl:text>
560
			</h4>
561
		</xsl:if>
562
		
563
		<xsl:call-template name="xml" />
564
			
565
		<xsl:choose>
566
			<xsl:when test="$displaymodule!='printall'">
567
				<xsl:for-each select="dataTable">
568
					<xsl:call-template name="entityurl">
569
						<xsl:with-param name="type">dataTable</xsl:with-param>
570
						<xsl:with-param name="showtype">Data Table</xsl:with-param>
571
						<xsl:with-param name="index" select="position()" />
572
					</xsl:call-template>
573
				</xsl:for-each>
574
				<xsl:for-each select="spatialRaster">
575
					<xsl:call-template name="entityurl">
576
						<xsl:with-param name="type">spatialRaster</xsl:with-param>
577
						<xsl:with-param name="showtype">Spatial Raster</xsl:with-param>
578
						<xsl:with-param name="index" select="position()" />
579
					</xsl:call-template>
580
				</xsl:for-each>
581
				<xsl:for-each select="spatialVector">
582
					<xsl:call-template name="entityurl">
583
						<xsl:with-param name="type">spatialVector</xsl:with-param>
584
						<xsl:with-param name="showtype">Spatial Vector</xsl:with-param>
585
						<xsl:with-param name="index" select="position()" />
586
					</xsl:call-template>
587
				</xsl:for-each>
588
				<xsl:for-each select="storedProcedure">
589
					<xsl:call-template name="entityurl">
590
						<xsl:with-param name="type">storedProcedure</xsl:with-param>
591
						<xsl:with-param name="showtype">Stored Procedure</xsl:with-param>
592
						<xsl:with-param name="index" select="position()" />
593
					</xsl:call-template>
594
				</xsl:for-each>
595
				<xsl:for-each select="view">
596
					<xsl:call-template name="entityurl">
597
						<xsl:with-param name="type">view</xsl:with-param>
598
						<xsl:with-param name="showtype">View</xsl:with-param>
599
						<xsl:with-param name="index" select="position()" />
600
					</xsl:call-template>
601
				</xsl:for-each>
602
				<xsl:for-each select="otherEntity">
603
					<xsl:call-template name="entityurl">
604
						<xsl:with-param name="type">otherEntity</xsl:with-param>
605
						<xsl:with-param name="showtype">Other Data</xsl:with-param>
606
						<xsl:with-param name="index" select="position()" />
607
					</xsl:call-template>
608
				</xsl:for-each>
609
			</xsl:when>
610
			<xsl:otherwise>
611
				<xsl:for-each select="dataTable">
612
					<xsl:variable name="currentNode" select="position()" />
613
					<xsl:for-each select="../.">
614
						<div class="control-group entity">
615
							<div class="controls controls-well entitydetails">
616
								<label class="control-label">
617
									<xsl:text>Data Table</xsl:text>
618
								</label>
619
								<xsl:call-template name="chooseentity">
620
									<xsl:with-param name="entitytype">dataTable</xsl:with-param>
621
									<xsl:with-param name="entityindex" select="$currentNode" />
622
								</xsl:call-template>
623
							</div>
624
						</div>
625
					</xsl:for-each>
626
				</xsl:for-each>
627
				<xsl:for-each select="spatialRaster">
628
					<xsl:variable name="currentNode" select="position()" />
629
					<xsl:for-each select="../.">
630
						<div class="control-group entity">
631
							<div class="controls controls-well entitydetails">
632
								<label class="control-label">
633
									<xsl:text>Spatial Raster</xsl:text>
634
								</label>
635
								<xsl:call-template name="chooseentity">
636
									<xsl:with-param name="entitytype">spatialRaster</xsl:with-param>
637
									<xsl:with-param name="entityindex" select="$currentNode" />
638
								</xsl:call-template>
639
							</div>
640
						</div>
641
					</xsl:for-each>
642
				</xsl:for-each>
643
				<xsl:for-each select="spatialVector">
644
					<xsl:variable name="currentNode" select="position()" />
645
					<xsl:for-each select="../.">
646
						<div class="control-group entity">
647
							<div class="controls controls-well entitydetails">
648
								<label class="control-label">
649
									<xsl:text>Spatial Vector</xsl:text>
650
								</label>
651
								<xsl:call-template name="chooseentity">
652
									<xsl:with-param name="entitytype">spatialVector</xsl:with-param>
653
									<xsl:with-param name="entityindex" select="$currentNode" />
654
								</xsl:call-template>
655
							</div>
656
						</div>
657
					</xsl:for-each>
658
				</xsl:for-each>
659
				<xsl:for-each select="storedProcedure">
660
					<xsl:variable name="currentNode" select="position()" />
661
					<xsl:for-each select="../.">
662
						<div class="control-group entity">
663
							<div class="controls controls-well entitydetails">
664
								<label class="control-label">
665
									<xsl:text>Stored Procedure</xsl:text>
666
								</label>
667
								<xsl:call-template name="chooseentity">
668
									<xsl:with-param name="entitytype">storedProcedure</xsl:with-param>
669
									<xsl:with-param name="entityindex" select="$currentNode" />
670
								</xsl:call-template>
671
							</div>
672
						</div>
673
					</xsl:for-each>
674
				</xsl:for-each>
675
				<xsl:for-each select="view">
676
					<xsl:variable name="currentNode" select="position()" />
677
					<xsl:for-each select="../.">
678
						<div class="control-group entity">
679
							<div class="controls controls-well entitydetails">
680
								<label class="control-label">
681
									<xsl:text>View</xsl:text>
682
								</label>
683
								<xsl:call-template name="chooseentity">
684
									<xsl:with-param name="entitytype">view</xsl:with-param>
685
									<xsl:with-param name="entityindex" select="$currentNode" />
686
								</xsl:call-template>
687
							</div>
688
						</div>
689
					</xsl:for-each>
690
				</xsl:for-each>
691
				<xsl:for-each select="otherEntity">
692
					<xsl:variable name="currentNode" select="position()" />
693
					<xsl:for-each select="../.">
694
						<div class="control-group entity">
695
							<div class="controls controls-well entitydetails">
696
								<label class="control-label">
697
									<xsl:text>Other Entity</xsl:text>
698
								</label>
699
								<xsl:call-template name="chooseentity">
700
									<xsl:with-param name="entitytype">otherEntity</xsl:with-param>
701
									<xsl:with-param name="entityindex" select="$currentNode" />
702
								</xsl:call-template>
703
							</div>
704
						</div>
705
					</xsl:for-each>
706
				</xsl:for-each>
707
			</xsl:otherwise>
708
		</xsl:choose>
709
	</xsl:template>
710

    
711
	<xsl:template name="entityurl">
712
		<xsl:param name="showtype" />
713
		<xsl:param name="type" />
714
		<xsl:param name="index" />
715
		<xsl:choose>
716
			<xsl:when test="references!=''">
717
				<xsl:variable name="ref_id" select="references" />
718
				<xsl:variable name="references" select="$ids[@id=$ref_id]" />
719
				<xsl:for-each select="$references">
720
					<div class="control-group">
721
						<label class="control-label">
722
							View Metadata
723
						</label>
724
						<div class="controls controls-well">
725
							<a>
726
								<xsl:attribute name="href">
727
									<xsl:value-of select="$tripleURI" /><xsl:value-of select="$docid" />&amp;displaymodule=entity&amp;entitytype=<xsl:value-of select="$type"/>&amp;entityindex=<xsl:value-of select="$index"/>
728
								</xsl:attribute>
729
								<xsl:value-of select="./physical/objectName"/>
730
							</a>
731
						</div>
732
					</div>
733
				</xsl:for-each>
734
			</xsl:when>
735
			<xsl:otherwise>
736
				<div class="control-group">
737
					<label class="control-label">
738
						<xsl:value-of select="$showtype"/>
739
					</label>
740
					<div class="controls controls-well"> 
741
						<xsl:value-of select="./entityName"/> 
742
						(<a>
743
						<xsl:attribute name="href">
744
						<xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=entity&amp;entitytype=<xsl:value-of select="$type"/>&amp;entityindex=<xsl:value-of select="$index"/></xsl:attribute>
745
						View Metadata</a> 
746
						<xsl:text> </xsl:text>
747
					    <xsl:choose>
748
						    <xsl:when test="./physical/distribution/online/url"> 
749
						    	| 
750
						    	<xsl:variable name="URL" select="./physical/distribution/online/url"/>
751
					            <a>
752
									<xsl:choose>
753
										<xsl:when test="starts-with($URL,'ecogrid')">
754
											<xsl:variable name="URL1" select="substring-after($URL, 'ecogrid://')"/>
755
											<xsl:variable name="dataDocID" select="substring-after($URL1, '/')"/>
756
											<xsl:attribute name="href">
757
												<xsl:value-of select="$tripleURI"/><xsl:value-of select="$dataDocID"/>
758
											</xsl:attribute>
759
										</xsl:when>
760
										<xsl:otherwise>
761
											<xsl:attribute name="href"><xsl:value-of select="$URL"/></xsl:attribute>
762
										</xsl:otherwise>
763
									</xsl:choose>
764
								<xsl:attribute name="target">_blank</xsl:attribute>
765
								Download File <i class="icon-download" alt="download"></i>
766
								</a>
767
							</xsl:when>
768
						</xsl:choose>)
769
					</div>
770
				</div>
771
			</xsl:otherwise>
772
		</xsl:choose>
773
	</xsl:template>
774

    
775
  <xsl:template match="text()" mode="dataset" />
776
  <xsl:template match="text()" mode="resource" />
777

    
778
</xsl:stylesheet>
(7-7/27)