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-15 15:31:14 -0700 (Mon, 15 Jul 2013) $'
11
  * '$Revision: 7989 $'
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="iso-8859-1"
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
     <h3>Data Set Characteristics</h3>
272

    
273
       <!-- add in the coverage info -->
274
     <table class="subGroup onehundred_percent">  
275
       <tr>
276
       <!-- add in the geographic coverage info -->
277
         <td class="fortyfive_percent">
278
           <xsl:if test="./coverage/geographicCoverage">
279
             <xsl:for-each select="./coverage/geographicCoverage">
280
               <xsl:call-template name="geographicCoverage">
281
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
282
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
283
               </xsl:call-template>
284
             </xsl:for-each>
285
           </xsl:if>
286
         </td>
287
       <!-- add in the temporal coverage info -->
288
         <td class="fortyfive_percent">
289
           <xsl:if test="./coverage/temporalCoverage">
290
             <xsl:for-each select="./coverage/temporalCoverage">
291
               <xsl:call-template name="temporalCoverage">
292
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
293
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
294
               </xsl:call-template>
295
             </xsl:for-each>
296
           </xsl:if>
297
         </td>
298
       </tr>
299
       <tr>
300
       <!-- add in the taxonomic coverage info -->
301
         <td colspan="2" class="onehundred_percent">
302
           <xsl:if test="./coverage/taxonomicCoverage">
303
             <xsl:for-each select="./coverage/taxonomicCoverage">
304
               <xsl:call-template name="taxonomicCoverage">
305
                 <xsl:with-param name="firstColStyle" select="$firstColStyle"/>
306
                 <xsl:with-param name="secondColStyle" select="$secondColStyle"/>
307
               </xsl:call-template>
308
             </xsl:for-each>
309
           </xsl:if>
310
         </td>
311
       </tr>
312
     </table>
313

    
314
     <!-- add in the method info -->
315
     <h3>Sampling, Processing and Quality Control Methods</h3>
316

    
317
     <table class="subGroup onehundred_percent">  
318
       <tr>
319
         <td colspan="2" class="onehundred_percent">
320
           <xsl:if test="./methods">
321
             <xsl:for-each select="./methods">
322
               <xsl:call-template name="datasetmethod">
323
                 <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
324
                 <xsl:with-param name="methodsecondColStyle" select="$secondColStyle"/>
325
               </xsl:call-template>
326
             </xsl:for-each>
327
           </xsl:if>
328
         </td>
329
       </tr>
330
     </table>
331

    
332
     <h3>Data Set Usage Rights</h3>
333

    
334
       <!-- add in the intellectiual rights info -->
335
     <table class="subGroup onehundred_percent">  
336
       <tr>
337
         <td>
338
           <xsl:if test="intellectualRights">
339
             <xsl:for-each select="intellectualRights">
340
               <xsl:call-template name="resourceintellectualRights">
341
                 <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
342
                 <xsl:with-param name="ressecondColStyle" select="$secondColStyle"/>
343
               </xsl:call-template>
344
             </xsl:for-each>
345
           </xsl:if>
346
         </td>
347
       </tr>
348
     </table>
349

    
350
       <!-- add in the access control info -->
351
     <table class="subGroup onehundred_percent">  
352
       <tr>
353
         <td>
354
           <xsl:if test="access">
355
             <xsl:for-each select="access">
356
               <xsl:call-template name="access">
357
                 <xsl:with-param name="accessfirstColStyle" select="$firstColStyle"/>
358
                 <xsl:with-param name="accesssecondColStyle" select="$secondColStyle"/>
359
               </xsl:call-template>
360
             </xsl:for-each>
361
           </xsl:if>
362
         </td>
363
       </tr>
364
     </table>
365
  </xsl:template>
366

    
367
  <xsl:template name="datasetresource">
368
     <tr>
369
        <td colspan="2">
370
          <xsl:call-template name="resource">
371
            <xsl:with-param name="resfirstColStyle" select="$firstColStyle"/>
372
            <xsl:with-param name="ressubHeaderStyle" select="$subHeaderStyle"/>
373
          </xsl:call-template>
374
       </td>
375
     </tr>
376
  </xsl:template>
377

    
378

    
379

    
380
  <xsl:template name="datasetpurpose">
381
    <xsl:for-each select="purpose">
382
      <tr><td colspan="2">
383
           <xsl:text>Purpose:</xsl:text>
384
        </td>
385
       </tr>
386
       <tr>
387
            <td  class="{$firstColStyle}">
388
            &#160;
389
            </td>
390
            <td>
391
              <xsl:call-template name="text">
392
                <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
393
              </xsl:call-template>
394
            </td>
395
       </tr>
396
     </xsl:for-each>
397
  </xsl:template>
398

    
399
  <xsl:template name="datasetmaintenance">
400
    <xsl:for-each select="maintenance">
401
      <tr><td colspan="2">
402
        <xsl:text>Maintenance:</xsl:text>
403
     </td></tr>
404
     <xsl:call-template name="mantenancedescription"/>
405
      <tr>
406
          <td  class="{$firstColStyle}">
407
          Frequency:
408
          </td>
409
          <td class="{$secondColStyle}" >
410
           <xsl:value-of select="maintenanceUpdateFrequency"/>
411
          </td>
412
     </tr>
413
     <xsl:call-template name="datasetchangehistory"/>
414
   </xsl:for-each>
415
  </xsl:template>
416

    
417
  <xsl:template name="mantenancedescription">
418
   <xsl:for-each select="description">
419
     <tr>
420
          <td  class="{$firstColStyle}">
421
          Description:
422
          </td>
423
          <td>
424
            <xsl:call-template name="text">
425
               <xsl:with-param name="textfirstColStyle" select="$firstColStyle"/>
426
             </xsl:call-template>
427
          </td>
428
     </tr>
429
    </xsl:for-each>
430
  </xsl:template>
431

    
432
   <xsl:template name="datasetchangehistory">
433
   <xsl:if test="changeHistory">
434
     <tr>
435
          <td class="{$firstColStyle}">
436
          History:
437
          </td>
438
          <td>
439
            <table class="{$tabledefaultStyle}">
440
              <xsl:for-each select="changeHistory">
441
                <xsl:call-template name="historydetails"/>
442
              </xsl:for-each>
443
            </table>
444
          </td>
445
     </tr>
446
     </xsl:if>
447
   </xsl:template>
448

    
449
   <xsl:template name="historydetails">
450
        <tr><td class="{$firstColStyle}">
451
            scope:</td>
452
            <td class="{$secondColStyle}">
453
            <xsl:value-of select="changeScope"/>
454
        </td></tr>
455
        <tr><td class="{$firstColStyle}">
456
            old value:</td>
457
            <td class="{$secondColStyle}">
458
            <xsl:value-of select="oldValue"/>
459
        </td></tr>
460
        <tr><td class="{$firstColStyle}">
461
            change date:</td>
462
            <td class="{$secondColStyle}">
463
            <xsl:value-of select="changeDate"/>
464
        </td></tr>
465
        <xsl:if test="comment and normalize-space(comment)!=''">
466
          <tr><td class="{$firstColStyle}">
467
            comment:</td><td class="{$secondColStyle}">
468
            <xsl:value-of select="comment"/>
469
          </td></tr>
470
        </xsl:if>
471
  </xsl:template>
472

    
473
  <xsl:template name="datasetcontact">
474
    <tr><td colspan="2">
475
        <xsl:text>Contact:</xsl:text>
476
     </td></tr>
477
    <xsl:for-each select="contact">
478
     <tr><td colspan="2">
479
       <xsl:call-template name="party">
480
              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
481
       </xsl:call-template>
482
     </td></tr>
483
    </xsl:for-each>
484
  </xsl:template>
485

    
486
  <xsl:template name="datasetpublisher">
487
   <xsl:for-each select="publisher">
488
     <tr><td colspan="2">
489
        <xsl:text>Publisher:</xsl:text>
490
     </td></tr>
491
     <tr><td colspan="2">
492
       <xsl:call-template name="party">
493
              <xsl:with-param name="partyfirstColStyle" select="$firstColStyle"/>
494
       </xsl:call-template>
495
     </td></tr>
496
   </xsl:for-each>
497
  </xsl:template>
498

    
499
  <xsl:template name="datasetpubplace">
500
    <xsl:for-each select="pubPlace">
501
      <tr><td class="{$firstColStyle}">
502
           Publish Place:</td>
503
          <td class="{$secondColStyle}">
504
          <xsl:value-of select="."/>
505
          </td>
506
      </tr>
507
   </xsl:for-each>
508
  </xsl:template>
509

    
510
  <xsl:template name="datasetmethod">
511
     <xsl:for-each select=".">
512
        <xsl:call-template name="method">
513
          <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
514
        </xsl:call-template>
515
    </xsl:for-each>
516
  </xsl:template>
517

    
518
  <xsl:template name="datasetproject">
519
    <xsl:for-each select="project">
520
     <tr>
521
       <td colspan="2">
522
         <h3><xsl:text>Parent Project Information:</xsl:text></h3>
523
       </td>
524
     </tr>
525
     <tr>
526
       <td colspan="2">
527
       <xsl:call-template name="project">
528
         <xsl:with-param name="projectfirstColStyle" select="$firstColStyle"/>
529
       </xsl:call-template>
530
       </td>
531
     </tr>
532
    </xsl:for-each>
533
  </xsl:template>
534

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

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

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

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