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: mecum $'
10
  *     '$Date: 2017-06-15 17:13:21 -0700 (Thu, 15 Jun 2017) $'
11
  * '$Revision: 10356 $'
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="alternateIdentifier">
95
             <xsl:for-each select="alternateIdentifier">
96
               <xsl:call-template name="resourcealternateIdentifier">
97
                   <xsl:with-param name="system" select="./@system"/>
98
                   <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
99
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
100
               </xsl:call-template>
101
             </xsl:for-each>
102
             </xsl:if>
103
             <!-- put in the text of the abstract-->
104
             <xsl:if test="./abstract">
105
             <xsl:for-each select="./abstract">
106
               <xsl:call-template name="resourceabstract">
107
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
108
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
109
               </xsl:call-template>
110
             </xsl:for-each>
111
             </xsl:if>
112
             <!-- put in the purpose of the dataset-->
113
             <xsl:if test="./purpose">
114
             <xsl:for-each select="./purpose">
115
               <xsl:call-template name="datasetpurpose">
116
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
117
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
118
               </xsl:call-template>
119
             </xsl:for-each>
120
             </xsl:if>
121
             <!-- put in the keyword sets -->
122
             <xsl:if test="keywordSet">
123
             	<div class="row-fluid">
124
					<div class="control-group">
125
						<label class="control-label">
126
							<xsl:text>Keywords</xsl:text>
127
						</label>	
128
						<div class="controls controls-well">
129
							<xsl:for-each select="keywordSet">
130
								<xsl:call-template name="resourcekeywordSet" >
131
									<xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
132
									<xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
133
								</xsl:call-template>
134
							</xsl:for-each>
135
						</div>
136
					</div>	
137
				</div>
138
             </xsl:if>
139

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

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

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

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

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

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

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

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

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

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

    
377
     <!-- add in the project  info -->
378

    
379
     <div id="dataset-project" class="row-fluid">
380
         <xsl:if test="./project">
381
           <xsl:call-template name="datasetproject">
382
             <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
383
             <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
384
           </xsl:call-template>
385
         </xsl:if>
386
     </div>
387
       
388
     <!-- add in the method info -->
389

    
390
     <div class="row-fluid">
391
         <xsl:if test="./methods">
392
           <xsl:for-each select="./methods">
393
             <xsl:call-template name="datasetmethod">
394
               <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
395
               <xsl:with-param name="methodsecondColStyle" select="$secondColStyle"/>
396
             </xsl:call-template>
397
           </xsl:for-each>
398
         </xsl:if>
399
     </div>
400

    
401
     <h4>Data Set Usage Rights</h4>
402

    
403
       <!-- add in the intellectiual rights info -->
404
     <div class="row-fluid">
405
         <xsl:if test="intellectualRights">
406
           <xsl:for-each select="intellectualRights">
407
             <xsl:call-template name="resourceintellectualRights">
408
               <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
409
               <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
410
             </xsl:call-template>
411
           </xsl:for-each>
412
         </xsl:if>
413
     </div>
414

    
415
       <!-- add in the access control info -->
416
     <div class="row-fluid">
417
         <xsl:if test="access">
418
           <xsl:for-each select="access">
419
             <xsl:call-template name="access">
420
               <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
421
               <xsl:with-param name="accesssecondColStyle" select="$secondColStyle"/>
422
             </xsl:call-template>
423
           </xsl:for-each>
424
         </xsl:if>
425
     </div>
426
  </xsl:template>
427

    
428
  <xsl:template name="datasetresource">
429
     <div class="row-fluid">
430
        <xsl:call-template name="resource">
431
          <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
432
          <xsl:with-param name="ressubHeaderStyle" select="$subHeaderStyle"/>
433
        </xsl:call-template>
434
     </div>
435
  </xsl:template>
436

    
437

    
438
  <xsl:template name="datasetpurpose">
439
    <xsl:for-each select="purpose">
440
      <div class="control-group">
441
      	<label class="control-label"><xsl:text>Purpose</xsl:text></label>
442
       	<div  class="controls">
443
            &#160;
444
              <xsl:call-template name="text">
445
                <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
446
              </xsl:call-template>
447
          </div>
448
       </div>
449
     </xsl:for-each>
450
  </xsl:template>
451

    
452
  <xsl:template name="datasetmaintenance">
453
    <xsl:for-each select="maintenance">
454
      <div class="control-group">
455
      	<label class="control-label"><xsl:text>Maintenance</xsl:text></label>
456
      	<div class="controls">
457
		     <xsl:call-template name="mantenancedescription"/>
458
		      <div class="control-group">
459
      			<label class="control-label">Frequency</label>
460
		        <div class="controls" >
461
		           <xsl:value-of select="maintenanceUpdateFrequency"/>
462
		        </div>
463
		     </div>
464
		     <xsl:call-template name="datasetchangehistory"/>
465
		   </div>
466
		</div>
467
   	</xsl:for-each>
468
  </xsl:template>
469

    
470
  <xsl:template name="mantenancedescription">
471
   <xsl:for-each select="description">
472
     <div class="control-group">
473
      	<label class="control-label">Description</label>
474
        <div class="controls">
475
            <xsl:call-template name="text">
476
               <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
477
             </xsl:call-template>
478
          </div>
479
     </div>
480
    </xsl:for-each>
481
  </xsl:template>
482

    
483
   <xsl:template name="datasetchangehistory">
484
   <xsl:if test="changeHistory">
485
     <div class="control-group">
486
      	<label class="control-label">History</label>
487
          <div class="controls">
488
              <xsl:for-each select="changeHistory">
489
                <xsl:call-template name="historydetails"/>
490
              </xsl:for-each>
491
          </div>
492
     </div>
493
     </xsl:if>
494
   </xsl:template>
495

    
496
   <xsl:template name="historydetails">
497
        <div class="control-group">
498
	      	<label class="control-label">scope</label>
499
	        <div class="controls">
500
	            <xsl:value-of select="changeScope"/>
501
	        </div>
502
        </div>
503
        <div class="control-group">
504
	      	<label class="control-label">old value</label>
505
	        <div class="controls">
506
	            <xsl:value-of select="oldValue"/>
507
        	</div>
508
       	</div>
509
        <div class="control-group">
510
      		<label class="control-label">change date</label>
511
            <div class="controls">
512
	            <xsl:value-of select="changeDate"/>
513
	        </div>
514
	    </div>
515
        <xsl:if test="comment and normalize-space(comment)!=''">
516
			<div class="control-group">
517
      			<label class="control-label">comment</label>
518
      			<div class="controls">
519
		            <xsl:value-of select="comment"/>
520
				</div>
521
			</div>
522
        </xsl:if>
523
  </xsl:template>
524

    
525
  <xsl:template name="datasetcontact">
526
    <div class="control-group">
527
      	<label class="control-label"><xsl:text>Contact</xsl:text></label>
528
	    <div class="controls">
529
		    <xsl:for-each select="contact">
530
			       <xsl:call-template name="party">
531
		              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
532
		       </xsl:call-template>
533
	    	</xsl:for-each>
534
	    </div>
535
	</div>    	
536
  </xsl:template>
537

    
538
  <xsl:template name="datasetpublisher">
539
   <xsl:for-each select="publisher">
540
     <div class="control-group">
541
      	<label class="control-label"><xsl:text>Publisher</xsl:text></label>
542
     	<div class="controls">
543
	       <xsl:call-template name="party">
544
	              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
545
	       </xsl:call-template>
546
     	</div>
547
     </div>
548
   </xsl:for-each>
549
  </xsl:template>
550

    
551
  <xsl:template name="datasetpubplace">
552
    <xsl:for-each select="pubPlace">
553
      <div class="control-group">
554
      	<label class="control-label">Publish Place</label>
555
        <div class="controls">
556
          <xsl:value-of select="."/>
557
		</div>
558
      </div>
559
   </xsl:for-each>
560
  </xsl:template>
561

    
562
  <xsl:template name="datasetmethod">
563
     <xsl:for-each select=".">
564
        <xsl:call-template name="method">
565
          <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
566
        </xsl:call-template>
567
    </xsl:for-each>
568
  </xsl:template>
569

    
570
  <xsl:template name="datasetproject">
571
    <h4><xsl:text>Project Information</xsl:text></h4>
572
    <xsl:for-each select="project">
573
     <div class="row-fluid">
574
       <xsl:call-template name="project">
575
         <xsl:with-param name="projectfirstColStyle" select="$firstColStyle"/>
576
       </xsl:call-template>
577
     </div>
578
    </xsl:for-each>
579
  </xsl:template>
580

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

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

    
812
  <xsl:template match="text()" mode="dataset" />
813
  <xsl:template match="text()" mode="resource" />
814

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