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: leinfelder $'
10
  *     '$Date: 2016-02-05 11:54:42 -0800 (Fri, 05 Feb 2016) $'
11
  * '$Revision: 9518 $'
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
		         		<!--
197
		         		<div class="annotation-target">
198
			         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
199
			         		<xsl:attribute name="type">party</xsl:attribute>
200
			         		PARTY
201
			         	</div>
202
			         	-->	
203
		               <xsl:call-template name="party">
204
		                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
205
		                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
206
		               </xsl:call-template>
207
		         	</div>      
208
		         </xsl:for-each>
209
         	</div>
210
         </div>
211
       </xsl:if>
212

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

    
245
       <!-- add in the associatedParty  -->
246
       <xsl:if test="associatedParty">
247
         <div class="control-group">
248
         	<label class="control-label">Associated Parties</label>
249
         	<div class="controls controls-well">
250
				<xsl:for-each select="associatedParty">
251
					<xsl:variable name="absolutePath" >
252
			         	<xsl:for-each select="ancestor-or-self::*">
253
			         		<xsl:text>/</xsl:text>			         	
254
			         		<xsl:value-of select="local-name()" />
255
			         	</xsl:for-each>
256
			         </xsl:variable>	
257
					<xsl:variable name="index" select="position()" />
258
		         	<div>
259
		         		<!--
260
		         		<div class="annotation-target">
261
			         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
262
			         		<xsl:attribute name="type">party</xsl:attribute>
263
			         		PARTY
264
			         	</div>
265
			         	-->
266
					<xsl:call-template name="party">
267
						<xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
268
						<xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
269
					</xsl:call-template>
270
					</div>	
271
		         </xsl:for-each>
272
	         </div>	
273
         </div>
274
		         
275
       </xsl:if>
276

    
277
       <!-- add in the metadataProviders using a two column table -->
278
       <xsl:if test="metadataProvider">
279
		<div class="control-group">
280
         	<label class="control-label">Metadata Providers</label>
281
         	<div class="controls controls-well">
282
				<xsl:for-each select="metadataProvider">
283
					<xsl:variable name="absolutePath" >
284
			         	<xsl:for-each select="ancestor-or-self::*">
285
			         		<xsl:text>/</xsl:text>			         	
286
			         		<xsl:value-of select="local-name()" />
287
			         	</xsl:for-each>
288
			         </xsl:variable>	
289
					<xsl:variable name="index" select="position()" />
290
		         	<div>
291
		         		<!--
292
		         		<div class="annotation-target">
293
			         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
294
			         		<xsl:attribute name="type">party</xsl:attribute>
295
			         		PARTY
296
			         	</div>
297
			         	-->
298
	               <xsl:call-template name="party">
299
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
300
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
301
	               </xsl:call-template>
302
					</div>	
303
				</xsl:for-each>
304
		   </div>
305
		</div>      
306
       </xsl:if>
307

    
308
       <!-- add in the publishers using a two column table -->
309
       <xsl:if test="publisher">
310
         <div class="control-group">
311
         	<label class="control-label">Data Set Publishers</label>
312
         	<div class="controls controls-well">
313
		         <xsl:for-each select="publisher">
314
		         	<xsl:variable name="absolutePath" >
315
			         	<xsl:for-each select="ancestor-or-self::*">
316
			         		<xsl:text>/</xsl:text>			         	
317
			         		<xsl:value-of select="local-name()" />
318
			         	</xsl:for-each>
319
			         </xsl:variable>	
320
					<xsl:variable name="index" select="position()" />
321
		         	<div>
322
		         		<!--
323
		         		<div class="annotation-target">
324
			         		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$index"/>])</xsl:attribute>
325
			         		<xsl:attribute name="type">party</xsl:attribute>
326
			         		PARTY
327
			         	</div>
328
			         	-->
329
	               <xsl:call-template name="party">
330
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
331
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
332
	               </xsl:call-template>
333
					</div>		
334
		         </xsl:for-each>
335
	         </div>
336
         </div>
337
       </xsl:if>
338

    
339
     <!-- add in the coverage info -->
340
     <!--  <h4>Context</h4> -->
341
     
342
     <!-- add in the geographic coverage info -->
343
     <div class="row-fluid">  
344
           <xsl:if test="./coverage/geographicCoverage">
345
             <xsl:for-each select="./coverage/geographicCoverage">
346
               <xsl:call-template name="geographicCoverage">
347
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
348
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
349
               </xsl:call-template>
350
             </xsl:for-each>
351
           </xsl:if>
352
       </div>
353
       <!-- add in the temporal coverage info -->
354
       <div class="row-fluid">
355
           <xsl:if test="./coverage/temporalCoverage">
356
             <xsl:for-each select="./coverage/temporalCoverage">
357
               <xsl:call-template name="temporalCoverage">
358
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
359
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
360
               </xsl:call-template>
361
             </xsl:for-each>
362
           </xsl:if>
363
       </div>
364
       <!-- add in the taxonomic coverage info -->
365
       <div class="row-fluid">
366
           <xsl:if test="./coverage/taxonomicCoverage">
367
             <xsl:for-each select="./coverage/taxonomicCoverage">
368
               <xsl:call-template name="taxonomicCoverage">
369
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
370
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
371
               </xsl:call-template>
372
             </xsl:for-each>
373
           </xsl:if>
374
       </div>
375

    
376
     <!-- add in the method info -->
377
     <h4>Sampling, Processing and Quality Control Methods</h4>
378

    
379
     <div class="row-fluid">
380
         <xsl:if test="./methods">
381
           <xsl:for-each select="./methods">
382
             <xsl:call-template name="datasetmethod">
383
               <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
384
               <xsl:with-param name="methodsecondColStyle" select="$secondColStyle"/>
385
             </xsl:call-template>
386
           </xsl:for-each>
387
         </xsl:if>
388
     </div>
389

    
390
     <h4>Data Set Usage Rights</h4>
391

    
392
       <!-- add in the intellectiual rights info -->
393
     <div class="row-fluid">
394
         <xsl:if test="intellectualRights">
395
           <xsl:for-each select="intellectualRights">
396
             <xsl:call-template name="resourceintellectualRights">
397
               <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
398
               <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
399
             </xsl:call-template>
400
           </xsl:for-each>
401
         </xsl:if>
402
     </div>
403

    
404
       <!-- add in the access control info -->
405
     <div class="row-fluid">
406
         <xsl:if test="access">
407
           <xsl:for-each select="access">
408
             <xsl:call-template name="access">
409
               <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
410
               <xsl:with-param name="accesssecondColStyle" select="$secondColStyle"/>
411
             </xsl:call-template>
412
           </xsl:for-each>
413
         </xsl:if>
414
     </div>
415
  </xsl:template>
416

    
417
  <xsl:template name="datasetresource">
418
     <div class="row-fluid">
419
        <xsl:call-template name="resource">
420
          <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
421
          <xsl:with-param name="ressubHeaderStyle" select="$subHeaderStyle"/>
422
        </xsl:call-template>
423
     </div>
424
  </xsl:template>
425

    
426

    
427
  <xsl:template name="datasetpurpose">
428
    <xsl:for-each select="purpose">
429
      <div class="control-group">
430
      	<label class="control-label"><xsl:text>Purpose</xsl:text></label>
431
       	<div  class="controls">
432
            &#160;
433
              <xsl:call-template name="text">
434
                <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
435
              </xsl:call-template>
436
          </div>
437
       </div>
438
     </xsl:for-each>
439
  </xsl:template>
440

    
441
  <xsl:template name="datasetmaintenance">
442
    <xsl:for-each select="maintenance">
443
      <div class="control-group">
444
      	<label class="control-label"><xsl:text>Maintenance</xsl:text></label>
445
      	<div class="controls">
446
		     <xsl:call-template name="mantenancedescription"/>
447
		      <div class="control-group">
448
      			<label class="control-label">Frequency</label>
449
		        <div class="controls" >
450
		           <xsl:value-of select="maintenanceUpdateFrequency"/>
451
		        </div>
452
		     </div>
453
		     <xsl:call-template name="datasetchangehistory"/>
454
		   </div>
455
		</div>
456
   	</xsl:for-each>
457
  </xsl:template>
458

    
459
  <xsl:template name="mantenancedescription">
460
   <xsl:for-each select="description">
461
     <div class="control-group">
462
      	<label class="control-label">Description</label>
463
        <div class="controls">
464
            <xsl:call-template name="text">
465
               <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
466
             </xsl:call-template>
467
          </div>
468
     </div>
469
    </xsl:for-each>
470
  </xsl:template>
471

    
472
   <xsl:template name="datasetchangehistory">
473
   <xsl:if test="changeHistory">
474
     <div class="control-group">
475
      	<label class="control-label">History</label>
476
          <div class="controls">
477
              <xsl:for-each select="changeHistory">
478
                <xsl:call-template name="historydetails"/>
479
              </xsl:for-each>
480
          </div>
481
     </div>
482
     </xsl:if>
483
   </xsl:template>
484

    
485
   <xsl:template name="historydetails">
486
        <div class="control-group">
487
	      	<label class="control-label">scope</label>
488
	        <div class="controls">
489
	            <xsl:value-of select="changeScope"/>
490
	        </div>
491
        </div>
492
        <div class="control-group">
493
	      	<label class="control-label">old value</label>
494
	        <div class="controls">
495
	            <xsl:value-of select="oldValue"/>
496
        	</div>
497
       	</div>
498
        <div class="control-group">
499
      		<label class="control-label">change date</label>
500
            <div class="controls">
501
	            <xsl:value-of select="changeDate"/>
502
	        </div>
503
	    </div>
504
        <xsl:if test="comment and normalize-space(comment)!=''">
505
			<div class="control-group">
506
      			<label class="control-label">comment</label>
507
      			<div class="controls">
508
		            <xsl:value-of select="comment"/>
509
				</div>
510
			</div>
511
        </xsl:if>
512
  </xsl:template>
513

    
514
  <xsl:template name="datasetcontact">
515
    <div class="control-group">
516
      	<label class="control-label"><xsl:text>Contact</xsl:text></label>
517
	    <div class="controls">
518
		    <xsl:for-each select="contact">
519
			       <xsl:call-template name="party">
520
		              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
521
		       </xsl:call-template>
522
	    	</xsl:for-each>
523
	    </div>
524
	</div>    	
525
  </xsl:template>
526

    
527
  <xsl:template name="datasetpublisher">
528
   <xsl:for-each select="publisher">
529
     <div class="control-group">
530
      	<label class="control-label"><xsl:text>Publisher</xsl:text></label>
531
     	<div class="controls">
532
	       <xsl:call-template name="party">
533
	              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
534
	       </xsl:call-template>
535
     	</div>
536
     </div>
537
   </xsl:for-each>
538
  </xsl:template>
539

    
540
  <xsl:template name="datasetpubplace">
541
    <xsl:for-each select="pubPlace">
542
      <div class="control-group">
543
      	<label class="control-label">Publish Place</label>
544
        <div class="controls">
545
          <xsl:value-of select="."/>
546
		</div>
547
      </div>
548
   </xsl:for-each>
549
  </xsl:template>
550

    
551
  <xsl:template name="datasetmethod">
552
     <xsl:for-each select=".">
553
        <xsl:call-template name="method">
554
          <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
555
        </xsl:call-template>
556
    </xsl:for-each>
557
  </xsl:template>
558

    
559
  <xsl:template name="datasetproject">
560
    <h4><xsl:text>Parent Project Information</xsl:text></h4>
561
    <xsl:for-each select="project">
562
     <div class="row-fluid">
563
       <xsl:call-template name="project">
564
         <xsl:with-param name="projectfirstColStyle" select="$firstColStyle"/>
565
       </xsl:call-template>
566
     </div>
567
    </xsl:for-each>
568
  </xsl:template>
569

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

    
737
	<xsl:template name="entityurl">
738
		<xsl:param name="showtype" />
739
		<xsl:param name="type" />
740
		<xsl:param name="index" />
741
		<xsl:choose>
742
			<xsl:when test="references!=''">
743
				<xsl:variable name="ref_id" select="references" />
744
				<xsl:variable name="references" select="$ids[@id=$ref_id]" />
745
				<xsl:for-each select="$references">
746
					<div class="control-group">
747
						<label class="control-label">
748
							View Metadata
749
						</label>
750
						<div class="controls controls-well">
751
							<a>
752
								<xsl:attribute name="href">
753
									<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"/>
754
								</xsl:attribute>
755
								<xsl:value-of select="./physical/objectName"/>
756
							</a>
757
						</div>
758
					</div>
759
				</xsl:for-each>
760
			</xsl:when>
761
			<xsl:otherwise>
762
				<div class="control-group">
763
					<label class="control-label">
764
						<xsl:value-of select="$showtype"/>
765
					</label>
766
					<div class="controls controls-well"> 
767
						<xsl:value-of select="./entityName"/> 
768
						(<a>
769
						<xsl:attribute name="href">
770
						<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>
771
						View Metadata</a> 
772
						<xsl:text> </xsl:text>
773
					    <xsl:choose>
774
						    <xsl:when test="./physical/distribution/online/url"> 
775
						    	| 
776
						    	<xsl:variable name="URL" select="./physical/distribution/online/url"/>
777
					            <a>
778
									<xsl:choose>
779
										<xsl:when test="starts-with($URL,'ecogrid')">
780
											<xsl:variable name="URL1" select="substring-after($URL, 'ecogrid://')"/>
781
											<xsl:variable name="dataDocID" select="substring-after($URL1, '/')"/>
782
											<xsl:attribute name="href">
783
												<xsl:value-of select="$tripleURI"/><xsl:value-of select="$dataDocID"/>
784
											</xsl:attribute>
785
										</xsl:when>
786
										<xsl:otherwise>
787
											<xsl:attribute name="href"><xsl:value-of select="$URL"/></xsl:attribute>
788
										</xsl:otherwise>
789
									</xsl:choose>
790
								<xsl:attribute name="target">_blank</xsl:attribute>
791
								Download File <i class="icon-download" alt="download"></i>
792
								</a>
793
							</xsl:when>
794
						</xsl:choose>)
795
					</div>
796
				</div>
797
			</xsl:otherwise>
798
		</xsl:choose>
799
	</xsl:template>
800

    
801
  <xsl:template match="text()" mode="dataset" />
802
  <xsl:template match="text()" mode="resource" />
803

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