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: 2013-07-16 13:17:24 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 8005 $'
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:choose>
86
             		<xsl:when test="$docid != ''" >
87
             			<!-- use docid parameter when we have it -->         	
88
						<xsl:call-template name="identifier">
89
							<xsl:with-param name="packageID" select="$docid"/>
90
							<xsl:with-param name="system" select="../@system"/>
91
							<xsl:with-param name="IDfirstColStyle" select="$firstColStyle"/>
92
							<xsl:with-param name="IDsecondColStyle" select="$secondColStyle"/>
93
						</xsl:call-template>
94
		             </xsl:when>
95
		             <xsl:otherwise>
96
		             	<xsl:call-template name="identifier">
97
			               <xsl:with-param name="packageID" select="../@packageId"/>
98
			               <xsl:with-param name="system" select="../@system"/>
99
			               <xsl:with-param name="IDfirstColStyle" select="$firstColStyle"/>
100
			               <xsl:with-param name="IDsecondColStyle" select="$secondColStyle"/>
101
			             </xsl:call-template>
102
		             </xsl:otherwise>
103
	             </xsl:choose>
104
             </xsl:for-each>
105
             </xsl:if>
106
             <!-- put in the alternate identifiers -->
107
             <xsl:if test="keywordSet">
108
             <xsl:for-each select="alternateIdentifier">
109
               <xsl:call-template name="resourcealternateIdentifier">
110
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
111
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
112
               </xsl:call-template>
113
             </xsl:for-each>
114
             </xsl:if>
115
             <!-- put in the text of the abstract-->
116
             <xsl:if test="./abstract">
117
             <xsl:for-each select="./abstract">
118
               <xsl:call-template name="resourceabstract">
119
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
120
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
121
               </xsl:call-template>
122
             </xsl:for-each>
123
             </xsl:if>
124
             <!-- put in the purpose of the dataset-->
125
             <xsl:if test="./purpose">
126
             <xsl:for-each select="./purpose">
127
               <xsl:call-template name="datasetpurpose">
128
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
129
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
130
               </xsl:call-template>
131
             </xsl:for-each>
132
             </xsl:if>
133
             <!-- put in the keyword sets -->
134
             <xsl:if test="keywordSet">
135
             	<div class="row-fluid">
136
					<div class="control-group">
137
						<label class="control-label">
138
							<xsl:text>Keywords</xsl:text>
139
						</label>	
140
						<div class="controls controls-well">
141
							<xsl:for-each select="keywordSet">
142
								<xsl:call-template name="resourcekeywordSet" >
143
									<xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
144
									<xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
145
								</xsl:call-template>
146
							</xsl:for-each>
147
						</div>
148
					</div>	
149
				</div>
150
             </xsl:if>
151

    
152
             <!-- put in the publication date -->
153
             <xsl:if test="./pubDate">
154
               <xsl:for-each select="pubDate">
155
                <xsl:call-template name="resourcepubDate" >
156
                  <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
157
                 </xsl:call-template>
158
               </xsl:for-each>
159
             </xsl:if>
160

    
161
             <!-- put in the language -->
162
             <xsl:if test="./language">
163
               <xsl:for-each select="language">
164
                 <xsl:call-template name="resourcelanguage" >
165
                   <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
166
                  </xsl:call-template>
167
               </xsl:for-each>
168
             </xsl:if>
169

    
170
             <!-- put in the series -->
171
             <xsl:if test="./series">
172
               <xsl:for-each select="series">
173
                 <xsl:call-template name="resourceseries" >
174
                   <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
175
                 </xsl:call-template>
176
               </xsl:for-each>
177
             </xsl:if>
178
             
179
         
180
         
181
           <!-- create a second easy access table listing the data entities -->
182
           <xsl:if test="dataTable|spatialRaster|spatialVector|storedProcedure|view|otherEntity">
183
			<xsl:if test="$withEntityLinks='1' or $displaymodule = 'printall'">
184
	             <xsl:call-template name="datasetentity"/>
185
			</xsl:if>
186
           </xsl:if>
187
           
188

    
189
     
190
     <h4>People and Associated Parties</h4>
191

    
192
       <!-- add in the creators -->
193
       <xsl:if test="creator">
194
         <div class="control-group">
195
         	<label class="control-label">
196
         		Data Set Creators
197
         	</label>
198
         	<div class="controls controls-well">
199
		         <xsl:for-each select="creator">
200
		               <xsl:call-template name="party">
201
		                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
202
		                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
203
		               </xsl:call-template>
204
		         </xsl:for-each>
205
         	</div>
206
         </div>
207
       </xsl:if>
208

    
209
       <!-- add in the contacts -->
210
       <xsl:if test="contact">
211
         <div class="control-group">
212
         	<label class="control-label">Data Set Contacts</label>
213
         	<div class="controls controls-well">
214
	         	<xsl:for-each select="contact">
215
	               <xsl:call-template name="party">
216
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
217
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
218
	               </xsl:call-template>
219
		             
220
	         	</xsl:for-each>
221
	         </div>	
222
         </div>
223
       </xsl:if>
224

    
225
       <!-- add in the associatedParty  -->
226
       <xsl:if test="associatedParty">
227
         <div class="control-group">
228
         	<label class="control-label">Associated Parties</label>
229
         	<div class="controls controls-well">
230
				<xsl:for-each select="associatedParty">
231
					<xsl:call-template name="party">
232
						<xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
233
						<xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
234
					</xsl:call-template>
235
		         </xsl:for-each>
236
	         </div>	
237
         </div>
238
		         
239
       </xsl:if>
240

    
241
       <!-- add in the metadataProviders using a two column table -->
242
       <xsl:if test="metadataProvider">
243
		<div class="control-group">
244
         	<label class="control-label">Metadata Providers</label>
245
         	<div class="controls controls-well">
246
				<xsl:for-each select="metadataProvider">
247
	               <xsl:call-template name="party">
248
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
249
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
250
	               </xsl:call-template>
251
				</xsl:for-each>
252
		   </div>
253
		</div>      
254
       </xsl:if>
255

    
256
       <!-- add in the publishers using a two column table -->
257
       <xsl:if test="publisher">
258
         <div class="control-group">
259
         	<label class="control-label">Data Set Publishers</label>
260
         	<div class="controls controls-well">
261
		         <xsl:for-each select="publisher">
262
	               <xsl:call-template name="party">
263
	                 <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
264
	                 <xsl:with-param name="partysecondColStyle" select="$secondColStyle"/>
265
	               </xsl:call-template>
266
		         </xsl:for-each>
267
	         </div>
268
         </div>
269
       </xsl:if>
270

    
271
     <!-- add in the coverage info -->
272
     <!--  <h4>Context</h4> -->
273
     
274
     <!-- add in the geographic coverage info -->
275
     <div class="row-fluid">  
276
           <xsl:if test="./coverage/geographicCoverage">
277
             <xsl:for-each select="./coverage/geographicCoverage">
278
               <xsl:call-template name="geographicCoverage">
279
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
280
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
281
               </xsl:call-template>
282
             </xsl:for-each>
283
           </xsl:if>
284
       </div>
285
       <!-- add in the temporal coverage info -->
286
       <div class="row-fluid">
287
           <xsl:if test="./coverage/temporalCoverage">
288
             <xsl:for-each select="./coverage/temporalCoverage">
289
               <xsl:call-template name="temporalCoverage">
290
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
291
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
292
               </xsl:call-template>
293
             </xsl:for-each>
294
           </xsl:if>
295
       </div>
296
       <!-- add in the taxonomic coverage info -->
297
       <div class="row-fluid">
298
           <xsl:if test="./coverage/taxonomicCoverage">
299
             <xsl:for-each select="./coverage/taxonomicCoverage">
300
               <xsl:call-template name="taxonomicCoverage">
301
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
302
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
303
               </xsl:call-template>
304
             </xsl:for-each>
305
           </xsl:if>
306
       </div>
307

    
308
     <!-- add in the method info -->
309
     <h4>Sampling, Processing and Quality Control Methods</h4>
310

    
311
     <div class="row-fluid">
312
         <xsl:if test="./methods">
313
           <xsl:for-each select="./methods">
314
             <xsl:call-template name="datasetmethod">
315
               <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
316
               <xsl:with-param name="methodsecondColStyle" select="$secondColStyle"/>
317
             </xsl:call-template>
318
           </xsl:for-each>
319
         </xsl:if>
320
     </div>
321

    
322
     <h4>Data Set Usage Rights</h4>
323

    
324
       <!-- add in the intellectiual rights info -->
325
     <div class="row-fluid">
326
         <xsl:if test="intellectualRights">
327
           <xsl:for-each select="intellectualRights">
328
             <xsl:call-template name="resourceintellectualRights">
329
               <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
330
               <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
331
             </xsl:call-template>
332
           </xsl:for-each>
333
         </xsl:if>
334
     </div>
335

    
336
       <!-- add in the access control info -->
337
     <div class="row-fluid">
338
         <xsl:if test="access">
339
           <xsl:for-each select="access">
340
             <xsl:call-template name="access">
341
               <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
342
               <xsl:with-param name="accesssecondColStyle" select="$secondColStyle"/>
343
             </xsl:call-template>
344
           </xsl:for-each>
345
         </xsl:if>
346
     </div>
347
  </xsl:template>
348

    
349
  <xsl:template name="datasetresource">
350
     <div class="row-fluid">
351
        <xsl:call-template name="resource">
352
          <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
353
          <xsl:with-param name="ressubHeaderStyle" select="$subHeaderStyle"/>
354
        </xsl:call-template>
355
     </div>
356
  </xsl:template>
357

    
358

    
359
  <xsl:template name="datasetpurpose">
360
    <xsl:for-each select="purpose">
361
      <div class="control-group">
362
      	<label class="control-label"><xsl:text>Purpose</xsl:text></label>
363
       	<div  class="controls">
364
            &#160;
365
              <xsl:call-template name="text">
366
                <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
367
              </xsl:call-template>
368
          </div>
369
       </div>
370
     </xsl:for-each>
371
  </xsl:template>
372

    
373
  <xsl:template name="datasetmaintenance">
374
    <xsl:for-each select="maintenance">
375
      <div class="control-group">
376
      	<label class="control-label"><xsl:text>Maintenance</xsl:text></label>
377
      	<div class="controls">
378
		     <xsl:call-template name="mantenancedescription"/>
379
		      <div class="control-group">
380
      			<label class="control-label">Frequency</label>
381
		        <div class="controls" >
382
		           <xsl:value-of select="maintenanceUpdateFrequency"/>
383
		        </div>
384
		     </div>
385
		     <xsl:call-template name="datasetchangehistory"/>
386
		   </div>
387
		</div>
388
   	</xsl:for-each>
389
  </xsl:template>
390

    
391
  <xsl:template name="mantenancedescription">
392
   <xsl:for-each select="description">
393
     <div class="control-group">
394
      	<label class="control-label">Description</label>
395
        <div class="controls">
396
            <xsl:call-template name="text">
397
               <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
398
             </xsl:call-template>
399
          </div>
400
     </div>
401
    </xsl:for-each>
402
  </xsl:template>
403

    
404
   <xsl:template name="datasetchangehistory">
405
   <xsl:if test="changeHistory">
406
     <div class="control-group">
407
      	<label class="control-label">History</label>
408
          <div class="controls">
409
              <xsl:for-each select="changeHistory">
410
                <xsl:call-template name="historydetails"/>
411
              </xsl:for-each>
412
          </div>
413
     </div>
414
     </xsl:if>
415
   </xsl:template>
416

    
417
   <xsl:template name="historydetails">
418
        <div class="control-group">
419
	      	<label class="control-label">scope:</label>
420
	        <div class="controls">
421
	            <xsl:value-of select="changeScope"/>
422
	        </div>
423
        </div>
424
        <div class="control-group">
425
	      	<label class="control-label">old value:</label>
426
	        <div class="controls">
427
	            <xsl:value-of select="oldValue"/>
428
        	</div>
429
       	</div>
430
        <div class="control-group">
431
      		<label class="control-label">change date:</label>
432
            <div class="controls">
433
	            <xsl:value-of select="changeDate"/>
434
	        </div>
435
	    </div>
436
        <xsl:if test="comment and normalize-space(comment)!=''">
437
			<div class="control-group">
438
      			<label class="control-label">comment:</label>
439
      			<div class="controls">
440
		            <xsl:value-of select="comment"/>
441
				</div>
442
			</div>
443
        </xsl:if>
444
  </xsl:template>
445

    
446
  <xsl:template name="datasetcontact">
447
    <div class="control-group">
448
      	<label class="control-label"><xsl:text>Contact</xsl:text></label>
449
	    <div class="controls">
450
		    <xsl:for-each select="contact">
451
			       <xsl:call-template name="party">
452
		              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
453
		       </xsl:call-template>
454
	    	</xsl:for-each>
455
	    </div>
456
	</div>    	
457
  </xsl:template>
458

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

    
472
  <xsl:template name="datasetpubplace">
473
    <xsl:for-each select="pubPlace">
474
      <div class="control-group">
475
      	<label class="control-label">Publish Place</label>
476
        <div class="controls">
477
          <xsl:value-of select="."/>
478
		</div>
479
      </div>
480
   </xsl:for-each>
481
  </xsl:template>
482

    
483
  <xsl:template name="datasetmethod">
484
     <xsl:for-each select=".">
485
        <xsl:call-template name="method">
486
          <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
487
        </xsl:call-template>
488
    </xsl:for-each>
489
  </xsl:template>
490

    
491
  <xsl:template name="datasetproject">
492
    <h4><xsl:text>Parent Project Information</xsl:text></h4>
493
    <xsl:for-each select="project">
494
     <div class="row-fluid">
495
       <xsl:call-template name="project">
496
         <xsl:with-param name="projectfirstColStyle" select="$firstColStyle"/>
497
       </xsl:call-template>
498
     </div>
499
    </xsl:for-each>
500
  </xsl:template>
501

    
502
   <xsl:template name="datasetaccess">
503
    <xsl:for-each select="access">
504
      <div class="row-fluid">
505
        <xsl:call-template name="access">
506
          <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
507
          <xsl:with-param name="accesssubHeaderStyle" select="$subHeaderStyle"/>
508
        </xsl:call-template>
509
      </div>
510
    </xsl:for-each>
511
  </xsl:template>
512
  
513
	<xsl:template name="datasetentity">
514
		<xsl:if test="dataTable or spatialRaster or spatialVector or storedProcedures or view or otherEntity">
515
			<h4>
516
				<xsl:text>Data Table, Image, and Other Data Details</xsl:text>
517
			</h4>
518
		</xsl:if>
519
		
520
		<xsl:call-template name="xml" />
521
			
522
		<xsl:choose>
523
			<xsl:when test="$displaymodule!='printall'">
524
				<xsl:for-each select="dataTable">
525
					<xsl:call-template name="entityurl">
526
						<xsl:with-param name="type">dataTable</xsl:with-param>
527
						<xsl:with-param name="showtype">Data Table</xsl:with-param>
528
						<xsl:with-param name="index" select="position()" />
529
					</xsl:call-template>
530
				</xsl:for-each>
531
				<xsl:for-each select="spatialRaster">
532
					<xsl:call-template name="entityurl">
533
						<xsl:with-param name="type">spatialRaster</xsl:with-param>
534
						<xsl:with-param name="showtype">Spatial Raster</xsl:with-param>
535
						<xsl:with-param name="index" select="position()" />
536
					</xsl:call-template>
537
				</xsl:for-each>
538
				<xsl:for-each select="spatialVector">
539
					<xsl:call-template name="entityurl">
540
						<xsl:with-param name="type">spatialVector</xsl:with-param>
541
						<xsl:with-param name="showtype">Spatial Vector</xsl:with-param>
542
						<xsl:with-param name="index" select="position()" />
543
					</xsl:call-template>
544
				</xsl:for-each>
545
				<xsl:for-each select="storedProcedure">
546
					<xsl:call-template name="entityurl">
547
						<xsl:with-param name="type">storedProcedure</xsl:with-param>
548
						<xsl:with-param name="showtype">Stored Procedure</xsl:with-param>
549
						<xsl:with-param name="index" select="position()" />
550
					</xsl:call-template>
551
				</xsl:for-each>
552
				<xsl:for-each select="view">
553
					<xsl:call-template name="entityurl">
554
						<xsl:with-param name="type">view</xsl:with-param>
555
						<xsl:with-param name="showtype">View</xsl:with-param>
556
						<xsl:with-param name="index" select="position()" />
557
					</xsl:call-template>
558
				</xsl:for-each>
559
				<xsl:for-each select="otherEntity">
560
					<xsl:call-template name="entityurl">
561
						<xsl:with-param name="type">otherEntity</xsl:with-param>
562
						<xsl:with-param name="showtype">Other Data</xsl:with-param>
563
						<xsl:with-param name="index" select="position()" />
564
					</xsl:call-template>
565
				</xsl:for-each>
566
			</xsl:when>
567
			<xsl:otherwise>
568
				<xsl:for-each select="dataTable">
569
					<xsl:variable name="currentNode" select="position()" />
570
					<xsl:for-each select="../.">
571
						<div class="control-group">
572
							<label class="control-label">
573
								<xsl:text>Data Table</xsl:text>
574
							</label>
575
							<div class="controls controls-well">
576
								<xsl:call-template name="chooseentity">
577
									<xsl:with-param name="entitytype">dataTable</xsl:with-param>
578
									<xsl:with-param name="entityindex" select="$currentNode" />
579
								</xsl:call-template>
580
							</div>
581
						</div>
582
					</xsl:for-each>
583
				</xsl:for-each>
584
				<xsl:for-each select="spatialRaster">
585
					<xsl:variable name="currentNode" select="position()" />
586
					<xsl:for-each select="../.">
587
						<div class="control-group">
588
							<label class="control-label">
589
								<xsl:text>Spatial Raster</xsl:text>
590
							</label>
591
							<div class="controls controls-well">
592
								<xsl:call-template name="chooseentity">
593
									<xsl:with-param name="entitytype">spatialRaster</xsl:with-param>
594
									<xsl:with-param name="entityindex" select="$currentNode" />
595
								</xsl:call-template>
596
							</div>
597
						</div>
598
					</xsl:for-each>
599
				</xsl:for-each>
600
				<xsl:for-each select="spatialVector">
601
					<xsl:variable name="currentNode" select="position()" />
602
					<xsl:for-each select="../.">
603
						<div class="control-group">
604
							<label class="control-label">
605
								<xsl:text>Spatial Vector</xsl:text>
606
							</label>
607
							<div class="controls controls-well">
608
								<xsl:call-template name="chooseentity">
609
									<xsl:with-param name="entitytype">spatialVector</xsl:with-param>
610
									<xsl:with-param name="entityindex" select="$currentNode" />
611
								</xsl:call-template>
612
							</div>
613
						</div>
614
					</xsl:for-each>
615
				</xsl:for-each>
616
				<xsl:for-each select="storedProcedure">
617
					<xsl:variable name="currentNode" select="position()" />
618
					<xsl:for-each select="../.">
619
						<div class="control-group">
620
							<label class="control-label">
621
								<xsl:text>Stored Procedure:</xsl:text>
622
							</label>
623
							<div class="controls controls-well">
624
								<xsl:call-template name="chooseentity">
625
									<xsl:with-param name="entitytype">storedProcedure</xsl:with-param>
626
									<xsl:with-param name="entityindex" select="$currentNode" />
627
								</xsl:call-template>
628
							</div>
629
						</div>
630
					</xsl:for-each>
631
				</xsl:for-each>
632
				<xsl:for-each select="view">
633
					<xsl:variable name="currentNode" select="position()" />
634
					<xsl:for-each select="../.">
635
						<div class="control-group">
636
							<label class="control-label">
637
								<xsl:text>View:</xsl:text>
638
							</label>
639
							<div class="controls controls-well">
640
								<xsl:call-template name="chooseentity">
641
									<xsl:with-param name="entitytype">view</xsl:with-param>
642
									<xsl:with-param name="entityindex" select="$currentNode" />
643
								</xsl:call-template>
644
							</div>
645
						</div>
646
					</xsl:for-each>
647
				</xsl:for-each>
648
				<xsl:for-each select="otherEntity">
649
					<xsl:variable name="currentNode" select="position()" />
650
					<xsl:for-each select="../.">
651
						<div class="control-group">
652
							<label class="control-label">
653
								<xsl:text>Other Entity:</xsl:text>
654
							</label>
655
							<div class="controls controls-well">
656
								<xsl:call-template name="chooseentity">
657
									<xsl:with-param name="entitytype">otherEntity</xsl:with-param>
658
									<xsl:with-param name="entityindex" select="$currentNode" />
659
								</xsl:call-template>
660
							</div>
661
						</div>
662
					</xsl:for-each>
663
				</xsl:for-each>
664
			</xsl:otherwise>
665
		</xsl:choose>
666
	</xsl:template>
667

    
668
	<xsl:template name="entityurl">
669
		<xsl:param name="showtype" />
670
		<xsl:param name="type" />
671
		<xsl:param name="index" />
672
		<xsl:choose>
673
			<xsl:when test="references!=''">
674
				<xsl:variable name="ref_id" select="references" />
675
				<xsl:variable name="references" select="$ids[@id=$ref_id]" />
676
				<xsl:for-each select="$references">
677
					<div class="control-group">
678
						<label class="control-label">
679
							View Metadata:
680
						</label>
681
						<div class="controls controls-well">
682
							<a>
683
								<xsl:attribute name="href">
684
									<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"/>
685
								</xsl:attribute>
686
								<xsl:value-of select="./physical/objectName"/>
687
							</a>
688
						</div>
689
					</div>
690
				</xsl:for-each>
691
			</xsl:when>
692
			<xsl:otherwise>
693
				<div class="control-group">
694
					<label class="control-label">
695
						<xsl:value-of select="$showtype"/>:
696
					</label>
697
					<div class="controls controls-well"> 
698
						<xsl:value-of select="./entityName"/> 
699
						(<a>
700
						<xsl:attribute name="href">
701
						<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>
702
						View Metadata</a> 
703
						<xsl:text> </xsl:text>
704
					    <xsl:choose>
705
						    <xsl:when test="./physical/distribution/online/url"> 
706
						    	| 
707
						    	<xsl:variable name="URL" select="./physical/distribution/online/url"/>
708
					            <a>
709
									<xsl:choose>
710
										<xsl:when test="starts-with($URL,'ecogrid')">
711
											<xsl:variable name="URL1" select="substring-after($URL, 'ecogrid://')"/>
712
											<xsl:variable name="dataDocID" select="substring-after($URL1, '/')"/>
713
											<xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$dataDocID"/></xsl:attribute>
714
										</xsl:when>
715
										<xsl:otherwise>
716
											<xsl:attribute name="href"><xsl:value-of select="$URL"/></xsl:attribute>
717
										</xsl:otherwise>
718
									</xsl:choose>
719
								<xsl:attribute name="target">_blank</xsl:attribute>
720
								Download File <img src="/knb/style/images/page_white_put.png" style="margin:0px 0px; padding:0px;" border="0" alt="download"/></a>
721
							</xsl:when>
722
						</xsl:choose>)
723
					</div>
724
				</div>
725
			</xsl:otherwise>
726
		</xsl:choose>
727
	</xsl:template>
728

    
729
  <xsl:template match="text()" mode="dataset" />
730
  <xsl:template match="text()" mode="resource" />
731

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