Project

General

Profile

1 5771 leinfelder
<?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$'
10
  *     '$Date$'
11
  * '$Revision$'
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
  <xsl:import href="eml-access.xsl"/>
34
  <xsl:import href="eml-additionalmetadata.xsl"/>
35
  <xsl:import href="eml-attribute.xsl"/>
36
  <xsl:import href="eml-attribute-enumeratedDomain.xsl"/>
37
  <xsl:import href="eml-constraint.xsl"/>
38
  <xsl:import href="eml-coverage.xsl"/>
39
  <xsl:import href="eml-dataset.xsl"/>
40
  <xsl:import href="eml-datatable.xsl"/>
41
  <xsl:import href="eml-distribution.xsl"/>
42
  <xsl:import href="eml-entity.xsl"/>
43
  <xsl:import href="eml-identifier.xsl"/>
44
  <xsl:import href="eml-literature.xsl"/>
45
  <xsl:import href="eml-method.xsl"/>
46
  <xsl:import href="eml-otherentity.xsl"/>
47
  <xsl:import href="eml-party.xsl"/>
48
  <xsl:import href="eml-physical.xsl"/>
49
  <xsl:import href="eml-project.xsl"/>
50
  <xsl:import href="eml-protocol.xsl"/>
51
  <xsl:import href="eml-resource.xsl"/>
52
  <xsl:import href="eml-settings.xsl"/>
53
  <xsl:import href="eml-software.xsl"/>
54
  <xsl:import href="eml-spatialraster.xsl"/>
55
  <xsl:import href="eml-spatialvector.xsl"/>
56
  <xsl:import href="eml-storedprocedure.xsl"/>
57
  <xsl:import href="eml-text.xsl"/>
58
  <xsl:import href="eml-view.xsl"/>
59
60
  <!-- global variables to store id node set in case to be referenced-->
61
  <xsl:variable name="ids" select="//*[@id!='']"/>
62
63
   <xsl:template match="*[local-name()='eml']">
64
     <xsl:for-each select="dataset">
65
       <xsl:call-template name="emldataset"/>
66
     </xsl:for-each>
67
     <xsl:for-each select="citation">
68
       <xsl:call-template name="emlcitation"/>
69
     </xsl:for-each>
70
     <xsl:for-each select="software">
71
       <xsl:call-template name="emlsoftware"/>
72
     </xsl:for-each>
73
     <xsl:for-each select="protocol">
74
       <xsl:call-template name="emlprotocol"/>
75
     </xsl:for-each>
76
     <!-- Additional metadata-->
77
     <xsl:choose>
78
       <xsl:when test="$displaymodule='additionalmetadata'">
79
         <xsl:for-each select="additionalMetadata">
80
           <xsl:if test="$additionalmetadataindex=position()">
81
              <div class="{$tabledefaultStyle}">
82
                 <xsl:call-template name="additionalmetadata"/>
83
               </div>
84
            </xsl:if>
85
         </xsl:for-each>
86
       </xsl:when>
87
       <xsl:otherwise>
88
         <xsl:if test="$displaymodule='dataset'">
89
           <xsl:if test="$withAdditionalMetadataLink='1'">
90
             <xsl:for-each select="additionalMetadata">
91
               <div class="{$tabledefaultStyle}">
92
                 <xsl:call-template name="additionalmetadataURL">
93
                    <xsl:with-param name="index" select="position()"/>
94
                  </xsl:call-template>
95
               </div>
96
             </xsl:for-each>
97
           </xsl:if>
98
         </xsl:if>
99
       </xsl:otherwise>
100
     </xsl:choose>
101
     <!-- xml format-->
102
     <xsl:if test="$displaymodule='dataset'">
103
       <xsl:if test="$withOriginalXMLLink='1'">
104
         <xsl:call-template name="xml"/>
105
       </xsl:if>
106
     </xsl:if>
107
   </xsl:template>
108
109
   <!--********************************************************
110
                       dataset part
111
       ********************************************************-->
112
113
   <xsl:template name="emldataset">
114
    <xsl:if test="$displaymodule='dataset'">
115
    	<div>
116
			<xsl:call-template name="datasetpart"/>
117
		</div>
118
    </xsl:if>
119
    <xsl:if test="$displaymodule='entity'">
120
       <xsl:call-template name="entitypart"/>
121
    </xsl:if>
122
    <xsl:if test="$displaymodule='attribute'">
123
       <xsl:call-template name="attributepart"/>
124
    </xsl:if>
125
    <xsl:if test="$displaymodule='attributedomain'">
126
       <xsl:call-template name="datasetattributedomain"/>
127
    </xsl:if>
128
    <xsl:if test="$displaymodule='attributecoverage'">
129
       <xsl:call-template name="datasetattributecoverage"/>
130
    </xsl:if>
131
    <xsl:if test="$displaymodule='attributemethod'">
132
       <xsl:call-template name="datasetattributemethod"/>
133
    </xsl:if>
134
    <xsl:if test="$displaymodule='inlinedata'">
135
       <xsl:call-template name="emlinlinedata"/>
136
    </xsl:if>
137
    <xsl:if test="$displaymodule='attributedetail'">
138
       <xsl:call-template name="entityparam"/>
139
    </xsl:if>
140
   </xsl:template>
141
142
   <!--*************** Data set diaplay *************-->
143
   <xsl:template name="datasetpart">
144
       <xsl:apply-templates select="." mode="dataset"/>
145
   </xsl:template>
146
147
   <!--************ Entity diplay *****************-->
148
   <xsl:template name="entitypart">
149
       <xsl:choose>
150
         <xsl:when test="references!=''">
151
            <xsl:variable name="ref_id" select="references"/>
152
            <xsl:variable name="references" select="$ids[@id=$ref_id]" />
153
            <xsl:for-each select="$references">
154
               <xsl:call-template name="entitypartcommon"/>
155
            </xsl:for-each>
156
         </xsl:when>
157
         <xsl:otherwise>
158
            <xsl:call-template name="entitypartcommon"/>
159
        </xsl:otherwise>
160
   </xsl:choose>
161
    </xsl:template>
162
163
164
    <xsl:template name="entitypartcommon">
165
      <tr><th colspan="2">
166
      Data Object Description
167
      </th></tr>
168
      <xsl:call-template name="identifier">
169
          <xsl:with-param name="packageID" select="../@packageId"/>
170
          <xsl:with-param name="system" select="../@system"/>
171
      </xsl:call-template>
172
      <tr>
173
     <td colspan="2">
174
        <!-- find the subtree to process -->
175
       <xsl:call-template name="entityparam"/>
176
     </td>
177
      </tr>
178
   </xsl:template>
179
180
   <!--************ Attribute display *****************-->
181
   <xsl:template name="attributedetailpart">
182
   </xsl:template>
183
184
    <xsl:template name="attributepart">
185
      <tr><td>
186
      <h3>Attributes Description</h3>
187
      </td></tr>
188
      <tr>
189
     <td>
190
        <!-- find the subtree to process -->
191
      <xsl:if test="$entitytype='dataTable'">
192
        <xsl:for-each select="dataTable">
193
            <xsl:if test="position()=$entityindex">
194
                <xsl:for-each select="attributeList">
195
                   <xsl:call-template name="attributelist">
196
                      <xsl:with-param name="docid" select="$docid"/>
197
                      <xsl:with-param name="entitytype" select="$entitytype"/>
198
                      <xsl:with-param name="entityindex" select="$entityindex"/>
199
                   </xsl:call-template>
200
                </xsl:for-each>
201
            </xsl:if>
202
        </xsl:for-each>
203
      </xsl:if>
204
    </td>
205
      </tr>
206
   </xsl:template>
207
208
   <!--************************Attribute Domain display module************************-->
209
   <xsl:template name="datasetattributedomain">
210
      <tr><td>
211
      <h3>Attribute Domain</h3>
212
      </td></tr>
213
      <tr>
214
     <td>
215
       <!-- find the subtree to process -->
216
       <xsl:call-template name="entityparam"/>
217
    </td>
218
      </tr>
219
   </xsl:template>
220
221
222
   <!--************************Attribute Method display module************************-->
223
   <xsl:template name="datasetattributemethod">
224
      <tr><td>
225
      <h3>Attribute Method</h3>
226
      </td></tr>
227
      <tr>
228
     <td>
229
       <!-- find the subtree to process -->
230
       <xsl:call-template name="entityparam"/>
231
    </td>
232
      </tr>
233
   </xsl:template>
234
235
236
   <!--************************Attribute Coverage display module************************-->
237
   <xsl:template name="datasetattributecoverage">
238
     <tr><td>
239
      <h3>Attribute Coverage</h3>
240
      </td></tr>
241
      <tr>
242
     <td>
243
       <!-- find the subtree to process -->
244
       <xsl:call-template name="entityparam"/>
245
    </td>
246
      </tr>
247
   </xsl:template>
248
249
250
   <xsl:template name="entityparam">
251
     <xsl:choose>
252
      <xsl:when test="$entitytype=''">
253
        <xsl:variable name="dataTableCount" select="0"/>
254
        <xsl:variable name="spatialRasterCount" select="0"/>
255
        <xsl:variable name="spatialVectorCount" select="0"/>
256
        <xsl:variable name="storedProcedureCount" select="0"/>
257
        <xsl:variable name="viewCount" select="0"/>
258
        <xsl:variable name="otherEntityCount" select="0"/>
259
        <xsl:for-each select="dataTable|spatialRaster|spatialVector|storedProcedure|view|otherEntity">
260
261
        <xsl:if test="'dataTable' = name()">
262
           <xsl:variable name="currentNode" select="."/>
263
           <xsl:variable name="dataTableCount">
264
            <xsl:for-each select="../dataTable">
265
                  <xsl:if test=". = $currentNode">
266
                <xsl:value-of select="position()"/>
267
              </xsl:if>
268
            </xsl:for-each>
269
           </xsl:variable>
270
           <xsl:if test="position() = $entityindex">
271
             <xsl:choose>
272
               <xsl:when test="$displaymodule='attributedetail'">
273
                 <xsl:for-each select="attributeList">
274
                   <xsl:call-template name="singleattribute">
275
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
276
                    <xsl:with-param name="docid" select="$docid"/>
277
                    <xsl:with-param name="entitytype" select="'dataTable'"/>
278
                    <xsl:with-param name="entityindex" select="$dataTableCount"/>
279
                   </xsl:call-template>
280
                 </xsl:for-each>
281
               </xsl:when>
282
               <xsl:otherwise>
283
                 <xsl:for-each select="../.">
284
                   <xsl:call-template name="chooseentity">
285
                    <xsl:with-param name="entitytype" select="'dataTable'"/>
286
                    <xsl:with-param name="entityindex" select="$dataTableCount"/>
287
                   </xsl:call-template>
288
                  </xsl:for-each>
289
                  </xsl:otherwise>
290
                 </xsl:choose>
291
           </xsl:if>
292
        </xsl:if>
293
294
        <xsl:if test="'spatialRaster' = name()">
295
          <xsl:variable name="currentNode" select="."/>
296
           <xsl:variable name="spatialRasterCount">
297
            <xsl:for-each select="../spatialRaster">
298
                  <xsl:if test=". = $currentNode">
299
                <xsl:value-of select="position()"/>
300
              </xsl:if>
301
            </xsl:for-each>
302
           </xsl:variable>
303
            <xsl:if test="position() = $entityindex">
304
           <xsl:choose>
305
               <xsl:when test="$displaymodule='attributedetail'">
306
                 <xsl:for-each select="attributeList">
307
                   <xsl:call-template name="singleattribute">
308
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
309
                    <xsl:with-param name="docid" select="$docid"/>
310
                    <xsl:with-param name="entitytype" select="'spatialRaster'"/>
311
                    <xsl:with-param name="entityindex" select="$spatialRasterCount"/>
312
                   </xsl:call-template>
313
                 </xsl:for-each>
314
               </xsl:when>
315
               <xsl:otherwise>
316
                 <xsl:for-each select="../.">
317
                   <xsl:call-template name="chooseentity">
318
                    <xsl:with-param name="entitytype" select="'spatialRaster'"/>
319
                    <xsl:with-param name="entityindex" select="$spatialRasterCount"/>
320
                   </xsl:call-template>
321
                  </xsl:for-each>
322
                  </xsl:otherwise>
323
                 </xsl:choose>
324
            </xsl:if>
325
        </xsl:if>
326
327
        <xsl:if test="'spatialVector' = name()">
328
          <xsl:variable name="currentNode" select="."/>
329
           <xsl:variable name="spatialVectorCount">
330
            <xsl:for-each select="../spatialVector">
331
                  <xsl:if test=". = $currentNode">
332
                <xsl:value-of select="position()"/>
333
              </xsl:if>
334
            </xsl:for-each>
335
           </xsl:variable>
336
           <xsl:if test="position() = $entityindex">
337
             <xsl:choose>
338
               <xsl:when test="$displaymodule='attributedetail'">
339
                 <xsl:for-each select="attributeList">
340
                   <xsl:call-template name="singleattribute">
341
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
342
                    <xsl:with-param name="docid" select="$docid"/>
343
                    <xsl:with-param name="entitytype" select="'spatialVector'"/>
344
                    <xsl:with-param name="entityindex" select="$spatialVectorCount"/>
345
                   </xsl:call-template>
346
                 </xsl:for-each>
347
               </xsl:when>
348
               <xsl:otherwise>
349
                 <xsl:for-each select="../.">
350
                   <xsl:call-template name="chooseentity">
351
                    <xsl:with-param name="entitytype" select="'spatialVector'"/>
352
                    <xsl:with-param name="entityindex" select="$spatialVectorCount"/>
353
                   </xsl:call-template>
354
                  </xsl:for-each>
355
                  </xsl:otherwise>
356
                 </xsl:choose>
357
           </xsl:if>
358
        </xsl:if>
359
360
        <xsl:if test="'storedProcedure' = name()">
361
          <xsl:variable name="currentNode" select="."/>
362
           <xsl:variable name="storedProcedureCount">
363
            <xsl:for-each select="../storedProcedure">
364
                  <xsl:if test=". = $currentNode">
365
                <xsl:value-of select="position()"/>
366
              </xsl:if>
367
            </xsl:for-each>
368
           </xsl:variable>
369
           <xsl:if test="position() = $entityindex">
370
             <xsl:choose>
371
               <xsl:when test="$displaymodule='attributedetail'">
372
                 <xsl:for-each select="attributeList">
373
                   <xsl:call-template name="singleattribute">
374
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
375
                    <xsl:with-param name="docid" select="$docid"/>
376
                    <xsl:with-param name="entitytype" select="'storedProcedure'"/>
377
                    <xsl:with-param name="entityindex" select="$storedProcedureCount"/>
378
                   </xsl:call-template>
379
                 </xsl:for-each>
380
               </xsl:when>
381
               <xsl:otherwise>
382
                 <xsl:for-each select="../.">
383
                   <xsl:call-template name="chooseentity">
384
                    <xsl:with-param name="entitytype" select="'storedProcedure'"/>
385
                    <xsl:with-param name="entityindex" select="$storedProcedureCount"/>
386
                   </xsl:call-template>
387
                  </xsl:for-each>
388
                  </xsl:otherwise>
389
              </xsl:choose>
390
           </xsl:if>
391
        </xsl:if>
392
393
        <xsl:if test="'view' = name()">
394
          <xsl:variable name="currentNode" select="."/>
395
           <xsl:variable name="viewCount">
396
            <xsl:for-each select="../view">
397
                  <xsl:if test=". = $currentNode">
398
                <xsl:value-of select="position()"/>
399
              </xsl:if>
400
            </xsl:for-each>
401
           </xsl:variable>
402
           <xsl:if test="position() = $entityindex">
403
            <xsl:choose>
404
               <xsl:when test="$displaymodule='attributedetail'">
405
                 <xsl:for-each select="attributeList">
406
                   <xsl:call-template name="singleattribute">
407
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
408
                    <xsl:with-param name="docid" select="$docid"/>
409
                    <xsl:with-param name="entitytype" select="'view'"/>
410
                    <xsl:with-param name="entityindex" select="$viewCount"/>
411
                   </xsl:call-template>
412
                 </xsl:for-each>
413
               </xsl:when>
414
               <xsl:otherwise>
415
                 <xsl:for-each select="../.">
416
                   <xsl:call-template name="chooseentity">
417
                    <xsl:with-param name="entitytype" select="'view'"/>
418
                    <xsl:with-param name="entityindex" select="$viewCount"/>
419
                   </xsl:call-template>
420
                  </xsl:for-each>
421
                  </xsl:otherwise>
422
                 </xsl:choose>
423
            </xsl:if>
424
        </xsl:if>
425
426
        <xsl:if test="'otherEntityTable' = name()">
427
          <xsl:variable name="currentNode" select="."/>
428
           <xsl:variable name="otherEntityCount">
429
            <xsl:for-each select="../otherEntity">
430
                  <xsl:if test=". = $currentNode">
431
                <xsl:value-of select="position()"/>
432
              </xsl:if>
433
            </xsl:for-each>
434
           </xsl:variable>
435
           <xsl:if test="position() = $entityindex">
436
            <xsl:choose>
437
               <xsl:when test="$displaymodule='attributedetail'">
438
                 <xsl:for-each select="attributeList">
439
                   <xsl:call-template name="singleattribute">
440
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
441
                    <xsl:with-param name="docid" select="$docid"/>
442
                    <xsl:with-param name="entitytype" select="'otherEntity'"/>
443
                    <xsl:with-param name="entityindex" select="$otherEntityCount"/>
444
                   </xsl:call-template>
445
                 </xsl:for-each>
446
               </xsl:when>
447
               <xsl:otherwise>
448
                 <xsl:for-each select="../.">
449
                   <xsl:call-template name="chooseentity">
450
                    <xsl:with-param name="entitytype" select="'otherEntity'"/>
451
                    <xsl:with-param name="entityindex" select="$otherEntityCount"/>
452
                   </xsl:call-template>
453
                  </xsl:for-each>
454
                  </xsl:otherwise>
455
                 </xsl:choose>
456
             </xsl:if>
457
          </xsl:if>
458
        </xsl:for-each>
459
      </xsl:when>
460
      <xsl:otherwise>
461
  <xsl:choose>
462
     <xsl:when test="$displaymodule='attributedetail'">
463
      <xsl:for-each select="attributeList">
464
       <xsl:call-template name="singleattribute">
465
         <xsl:with-param name="attributeindex" select="$attributeindex"/>
466
         <xsl:with-param name="docid" select="$docid"/>
467
         <xsl:with-param name="entitytype" select="$entitytype"/>
468
         <xsl:with-param name="entityindex" select="$entityindex"/>
469
       </xsl:call-template>
470
      </xsl:for-each>
471
     </xsl:when>
472
     <xsl:otherwise>
473
       <xsl:call-template name="chooseentity">
474
         <xsl:with-param name="entitytype" select="$entitytype"/>
475
         <xsl:with-param name="entityindex" select="$entityindex"/>
476
       </xsl:call-template>
477
     </xsl:otherwise>
478
    </xsl:choose>
479
       </xsl:otherwise>
480
     </xsl:choose>
481
   </xsl:template>
482
483
484
   <xsl:template name="chooseentity" match='dataset'>
485
      <xsl:param name="entityindex"/>
486
      <xsl:param name="entitytype"/>
487
     <xsl:if test="$entitytype='dataTable'">
488
        <xsl:for-each select="dataTable">
489
            <xsl:if test="position()=$entityindex">
490
                   <xsl:choose>
491
                     <xsl:when test="references!=''">
492
                        <xsl:variable name="ref_id" select="references"/>
493
                        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
494
                          <xsl:for-each select="$references">
495
                              <xsl:choose>
496
                                 <xsl:when test="$displaymodule='entity'">
497
                                    <xsl:call-template name="dataTable">
498
                                        <xsl:with-param name="datatablefirstColStyle" select="$firstColStyle"/>
499
                                        <xsl:with-param name="datatablesubHeaderStyle" select="$subHeaderStyle"/>
500
                                        <xsl:with-param name="docid" select="$docid"/>
501
                                        <xsl:with-param name="entitytype" select="$entitytype"/>
502
                                        <xsl:with-param name="entityindex" select="$entityindex"/>
503
                                    </xsl:call-template>
504
                                 </xsl:when>
505
                                 <xsl:otherwise>
506
                                    <xsl:call-template name="chooseattributelist"/>
507
                                 </xsl:otherwise>
508
                              </xsl:choose>
509
                          </xsl:for-each>
510
                     </xsl:when>
511
                     <xsl:otherwise>
512
                       <xsl:choose>
513
                                 <xsl:when test="$displaymodule='entity'">
514
                                    <xsl:call-template name="dataTable">
515
                                        <xsl:with-param name="datatablefirstColStyle" select="$firstColStyle"/>
516
                                        <xsl:with-param name="datatablesubHeaderStyle" select="$subHeaderStyle"/>
517
                                        <xsl:with-param name="docid" select="$docid"/>
518
                                        <xsl:with-param name="entitytype" select="$entitytype"/>
519
                                        <xsl:with-param name="entityindex" select="$entityindex"/>
520
                                    </xsl:call-template>
521
                                 </xsl:when>
522
                                 <xsl:otherwise>
523
                                    <xsl:call-template name="chooseattributelist"/>
524
                                 </xsl:otherwise>
525
                       </xsl:choose>
526
                   </xsl:otherwise>
527
                </xsl:choose>
528
            </xsl:if>
529
        </xsl:for-each>
530
      </xsl:if>
531
      <xsl:if test="$entitytype='spatialRaster'">
532
        <xsl:for-each select="spatialRaster">
533
            <xsl:if test="position()=$entityindex">
534
                   <xsl:choose>
535
                     <xsl:when test="references!=''">
536
                        <xsl:variable name="ref_id" select="references"/>
537
                        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
538
                          <xsl:for-each select="$references">
539
                              <xsl:choose>
540
                                 <xsl:when test="$displaymodule='entity'">
541
                                    <xsl:call-template name="spatialRaster">
542
                                        <xsl:with-param name="spatialrasterfirstColStyle" select="$firstColStyle"/>
543
                                        <xsl:with-param name="spatialrastersubHeaderStyle" select="$subHeaderStyle"/>
544
                                        <xsl:with-param name="docid" select="$docid"/>
545
                                        <xsl:with-param name="entitytype" select="$entitytype"/>
546
                                        <xsl:with-param name="entityindex" select="$entityindex"/>
547
                                    </xsl:call-template>
548
                                 </xsl:when>
549
                                 <xsl:otherwise>
550
                                    <xsl:call-template name="chooseattributelist"/>
551
                                 </xsl:otherwise>
552
                              </xsl:choose>
553
                          </xsl:for-each>
554
                     </xsl:when>
555
                     <xsl:otherwise>
556
                       <xsl:choose>
557
                                 <xsl:when test="$displaymodule='entity'">
558
                                    <xsl:call-template name="spatialRaster">
559
                                        <xsl:with-param name="spatialrasterfirstColStyle" select="$firstColStyle"/>
560
                                        <xsl:with-param name="spatialrastersubHeaderStyle" select="$subHeaderStyle"/>
561
                                        <xsl:with-param name="docid" select="$docid"/>
562
                                        <xsl:with-param name="entitytype" select="$entitytype"/>
563
                                        <xsl:with-param name="entityindex" select="$entityindex"/>
564
                                    </xsl:call-template>
565
                                 </xsl:when>
566
                                 <xsl:otherwise>
567
                                    <xsl:call-template name="chooseattributelist"/>
568
                                 </xsl:otherwise>
569
                       </xsl:choose>
570
                   </xsl:otherwise>
571
                </xsl:choose>
572
            </xsl:if>
573
        </xsl:for-each>
574
      </xsl:if>
575
      <xsl:if test="$entitytype='spatialVector'">
576
        <xsl:for-each select="spatialVector">
577
            <xsl:if test="position()=$entityindex">
578
                   <xsl:choose>
579
                     <xsl:when test="references!=''">
580
                        <xsl:variable name="ref_id" select="references"/>
581
                        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
582
                          <xsl:for-each select="$references">
583
                              <xsl:choose>
584
                                 <xsl:when test="$displaymodule='entity'">
585
                                    <xsl:call-template name="spatialVector">
586
                                       <xsl:with-param name="spatialvectorfirstColStyle" select="$firstColStyle"/>
587
                                        <xsl:with-param name="spatialvectorsubHeaderStyle" select="$subHeaderStyle"/>
588
                                        <xsl:with-param name="docid" select="$docid"/>
589
                                        <xsl:with-param name="entitytype" select="$entitytype"/>
590
                                        <xsl:with-param name="entityindex" select="$entityindex"/>
591
                                    </xsl:call-template>
592
                                 </xsl:when>
593
                                 <xsl:otherwise>
594
                                    <xsl:call-template name="chooseattributelist"/>
595
                                 </xsl:otherwise>
596
                              </xsl:choose>
597
                          </xsl:for-each>
598
                     </xsl:when>
599
                     <xsl:otherwise>
600
                       <xsl:choose>
601
                                 <xsl:when test="$displaymodule='entity'">
602
                                    <xsl:call-template name="spatialVector">
603
                                        <xsl:with-param name="spatialvectorfirstColStyle" select="$firstColStyle"/>
604
                                        <xsl:with-param name="spatialvectorsubHeaderStyle" select="$subHeaderStyle"/>
605
                                        <xsl:with-param name="docid" select="$docid"/>
606
                                        <xsl:with-param name="entitytype" select="$entitytype"/>
607
                                        <xsl:with-param name="entityindex" select="$entityindex"/>
608
                                    </xsl:call-template>
609
                                 </xsl:when>
610
                                 <xsl:otherwise>
611
                                    <xsl:call-template name="chooseattributelist"/>
612
                                 </xsl:otherwise>
613
                       </xsl:choose>
614
                   </xsl:otherwise>
615
                </xsl:choose>
616
            </xsl:if>
617
        </xsl:for-each>
618
      </xsl:if>
619
      <xsl:if test="$entitytype='storedProcedure'">
620
        <xsl:for-each select="storedProcedure">
621
            <xsl:if test="position()=$entityindex">
622
                   <xsl:choose>
623
                     <xsl:when test="references!=''">
624
                        <xsl:variable name="ref_id" select="references"/>
625
                        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
626
                          <xsl:for-each select="$references">
627
                              <xsl:choose>
628
                                 <xsl:when test="$displaymodule='entity'">
629
                                    <xsl:call-template name="storedProcedure">
630
                                       <xsl:with-param name="storedprocedurefirstColStyle" select="$firstColStyle"/>
631
                                       <xsl:with-param name="storedproceduresubHeaderStyle" select="$subHeaderStyle"/>
632
                                       <xsl:with-param name="docid" select="$docid"/>
633
                                       <xsl:with-param name="entitytype" select="$entitytype"/>
634
                                       <xsl:with-param name="entityindex" select="$entityindex"/>
635
                                    </xsl:call-template>
636
                                 </xsl:when>
637
                                 <xsl:otherwise>
638
                                    <xsl:call-template name="chooseattributelist"/>
639
                                 </xsl:otherwise>
640
                              </xsl:choose>
641
                          </xsl:for-each>
642
                     </xsl:when>
643
                     <xsl:otherwise>
644
                       <xsl:choose>
645
                                 <xsl:when test="$displaymodule='entity'">
646
                                    <xsl:call-template name="storedProcedure">
647
                                       <xsl:with-param name="storedprocedurefirstColStyle" select="$firstColStyle"/>
648
                                       <xsl:with-param name="storedproceduresubHeaderStyle" select="$subHeaderStyle"/>
649
                                       <xsl:with-param name="docid" select="$docid"/>
650
                                       <xsl:with-param name="entitytype" select="$entitytype"/>
651
                                       <xsl:with-param name="entityindex" select="$entityindex"/>
652
                                    </xsl:call-template>
653
                                 </xsl:when>
654
                                 <xsl:otherwise>
655
                                    <xsl:call-template name="chooseattributelist"/>
656
                                 </xsl:otherwise>
657
                       </xsl:choose>
658
                   </xsl:otherwise>
659
                </xsl:choose>
660
            </xsl:if>
661
        </xsl:for-each>
662
      </xsl:if>
663
      <xsl:if test="$entitytype='view'">
664
        <xsl:for-each select="view">
665
            <xsl:if test="position()=$entityindex">
666
                   <xsl:choose>
667
                     <xsl:when test="references!=''">
668
                        <xsl:variable name="ref_id" select="references"/>
669
                        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
670
                          <xsl:for-each select="$references">
671
                              <xsl:choose>
672
                                 <xsl:when test="$displaymodule='entity'">
673
                                    <xsl:call-template name="view">
674
                                       <xsl:with-param name="viewfirstColStyle" select="$firstColStyle"/>
675
                                       <xsl:with-param name="viewsubHeaderStyle" select="$subHeaderStyle"/>
676
                                       <xsl:with-param name="docid" select="$docid"/>
677
                                       <xsl:with-param name="entitytype" select="$entitytype"/>
678
                                       <xsl:with-param name="entityindex" select="$entityindex"/>
679
                                    </xsl:call-template>
680
                                 </xsl:when>
681
                                 <xsl:otherwise>
682
                                    <xsl:call-template name="chooseattributelist"/>
683
                                 </xsl:otherwise>
684
                              </xsl:choose>
685
                          </xsl:for-each>
686
                     </xsl:when>
687
                     <xsl:otherwise>
688
                       <xsl:choose>
689
                                 <xsl:when test="$displaymodule='entity'">
690
                                    <xsl:call-template name="view">
691
                                       <xsl:with-param name="viewfirstColStyle" select="$firstColStyle"/>
692
                                       <xsl:with-param name="viewsubHeaderStyle" select="$subHeaderStyle"/>
693
                                       <xsl:with-param name="docid" select="$docid"/>
694
                                       <xsl:with-param name="entitytype" select="$entitytype"/>
695
                                       <xsl:with-param name="entityindex" select="$entityindex"/>
696
                                    </xsl:call-template>
697
                                 </xsl:when>
698
                                 <xsl:otherwise>
699
                                    <xsl:call-template name="chooseattributelist"/>
700
                                 </xsl:otherwise>
701
                       </xsl:choose>
702
                   </xsl:otherwise>
703
                </xsl:choose>
704
            </xsl:if>
705
        </xsl:for-each>
706
      </xsl:if>
707
      <xsl:if test="$entitytype='otherEntity'">
708
        <xsl:for-each select="otherEntity">
709
            <xsl:if test="position()=$entityindex">
710
                   <xsl:choose>
711
                     <xsl:when test="references!=''">
712
                        <xsl:variable name="ref_id" select="references"/>
713
                        <xsl:variable name="references" select="$ids[@id=$ref_id]" />
714
                          <xsl:for-each select="$references">
715
                              <xsl:choose>
716
                                 <xsl:when test="$displaymodule='entity'">
717
                                    <xsl:call-template name="otherEntity">
718
                                       <xsl:with-param name="otherentityfirstColStyle" select="$firstColStyle"/>
719
                                       <xsl:with-param name="otherentitysubHeaderStyle" select="$subHeaderStyle"/>
720
                                       <xsl:with-param name="docid" select="$docid"/>
721
                                       <xsl:with-param name="entitytype" select="$entitytype"/>
722
                                       <xsl:with-param name="entityindex" select="$entityindex"/>
723
                                    </xsl:call-template>
724
                                 </xsl:when>
725
                                 <xsl:otherwise>
726
                                    <xsl:call-template name="chooseattributelist"/>
727
                                 </xsl:otherwise>
728
                              </xsl:choose>
729
                          </xsl:for-each>
730
                     </xsl:when>
731
                     <xsl:otherwise>
732
                       <xsl:choose>
733
                                 <xsl:when test="$displaymodule='entity'">
734
                                    <xsl:call-template name="otherEntity">
735
                                       <xsl:with-param name="otherentityfirstColStyle" select="$firstColStyle"/>
736
                                       <xsl:with-param name="otherentitysubHeaderStyle" select="$subHeaderStyle"/>
737
                                       <xsl:with-param name="docid" select="$docid"/>
738
                                       <xsl:with-param name="entitytype" select="$entitytype"/>
739
                                       <xsl:with-param name="entityindex" select="$entityindex"/>
740
                                    </xsl:call-template>
741
                                 </xsl:when>
742
                                 <xsl:otherwise>
743
                                    <xsl:call-template name="chooseattributelist"/>
744
                                 </xsl:otherwise>
745
                       </xsl:choose>
746
                   </xsl:otherwise>
747
                </xsl:choose>
748
            </xsl:if>
749
        </xsl:for-each>
750
      </xsl:if>
751
   </xsl:template>
752
753
   <xsl:template name="chooseattributelist">
754
       <xsl:for-each select="attributeList">
755
    <xsl:choose>
756
         <xsl:when test="references!=''">
757
            <xsl:variable name="ref_id" select="references"/>
758
            <xsl:variable name="references" select="$ids[@id=$ref_id]" />
759
            <xsl:for-each select="$references">
760
               <xsl:call-template name="chooseattribute"/>
761
           </xsl:for-each>
762
         </xsl:when>
763
         <xsl:otherwise>
764
             <xsl:call-template name="chooseattribute"/>
765
        </xsl:otherwise>
766
   </xsl:choose>
767
      </xsl:for-each>
768
   </xsl:template>
769
770
   <xsl:template name="chooseattribute">
771
       <xsl:for-each select="attribute">
772
    <xsl:if test="position()=$attributeindex">
773
      <xsl:if test="$displaymodule='attributedomain'">
774
        <xsl:for-each select="measurementScale/*/*">
775
          <xsl:call-template name="nonNumericDomain">
776
              <xsl:with-param name="nondomainfirstColStyle" select="$firstColStyle"/>
777
           </xsl:call-template>
778
        </xsl:for-each>
779
     </xsl:if>
780
     <xsl:if test="$displaymodule='attributecoverage'">
781
        <xsl:for-each select="coverage">
782
          <xsl:call-template name="coverage">
783
          </xsl:call-template>
784
        </xsl:for-each>
785
     </xsl:if>
786
     <xsl:if test="$displaymodule='attributemethod'">
787
        <xsl:for-each select="method">
788
          <xsl:call-template name="method">
789
              <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
790
              <xsl:with-param name="methodsubHeaderStyle" select="$firstColStyle"/>
791
           </xsl:call-template>
792
        </xsl:for-each>
793
     </xsl:if>
794
   </xsl:if>
795
       </xsl:for-each>
796
   </xsl:template>
797
798
799
800
   <!--*************************Distribution Inline Data display module*****************-->
801
   <xsl:template name="emlinlinedata">
802
      <tr><td>
803
      <h3>Inline Data</h3>
804
      </td></tr>
805
      <tr>
806
     <td>
807
      <xsl:if test="$distributionlevel='toplevel'">
808
         <xsl:for-each select="distribution">
809
            <xsl:if test="position()=$distributionindex">
810
               <xsl:choose>
811
                 <xsl:when test="references!=''">
812
                    <xsl:variable name="ref_id1" select="references"/>
813
                    <xsl:variable name="references1" select="$ids[@id=$ref_id1]" />
814
                    <xsl:for-each select="$references1">
815
                        <xsl:for-each select="inline">
816
                            <xsl:value-of select="."/>
817
                        </xsl:for-each>
818
                    </xsl:for-each>
819
                 </xsl:when>
820
                 <xsl:otherwise>
821
                     <xsl:for-each select="inline">
822
                            <xsl:value-of select="."/>
823
                     </xsl:for-each>
824
                 </xsl:otherwise>
825
               </xsl:choose>
826
            </xsl:if>
827
         </xsl:for-each>
828
      </xsl:if>
829
      <xsl:if test="$distributionlevel='entitylevel'">
830
        <xsl:if test="$entitytype='dataTable'">
831
          <xsl:for-each select="dataTable">
832
            <xsl:if test="position()=$entityindex">
833
                <xsl:choose>
834
                 <xsl:when test="references!=''">
835
                    <xsl:variable name="ref_id2" select="references"/>
836
                    <xsl:variable name="references2" select="$ids[@id=$ref_id2]" />
837
                    <xsl:for-each select="$references2">
838
                       <xsl:call-template name="choosephysical"/>
839
                    </xsl:for-each>
840
                 </xsl:when>
841
                 <xsl:otherwise>
842
                     <xsl:call-template name="choosephysical"/>
843
                 </xsl:otherwise>
844
               </xsl:choose>
845
            </xsl:if>
846
          </xsl:for-each>
847
        </xsl:if>
848
        <xsl:if test="$entitytype='spatialRaster'">
849
          <xsl:for-each select="spatialRaster">
850
            <xsl:if test="position()=$entityindex">
851
                <xsl:choose>
852
                 <xsl:when test="references!=''">
853
                    <xsl:variable name="ref_id2" select="references"/>
854
                    <xsl:variable name="references2" select="$ids[@id=$ref_id2]" />
855
                    <xsl:for-each select="$references2">
856
                       <xsl:call-template name="choosephysical"/>
857
                    </xsl:for-each>
858
                 </xsl:when>
859
                 <xsl:otherwise>
860
                     <xsl:call-template name="choosephysical"/>
861
                 </xsl:otherwise>
862
               </xsl:choose>
863
            </xsl:if>
864
          </xsl:for-each>
865
        </xsl:if>
866
        <xsl:if test="$entitytype='spatialVector'">
867
          <xsl:for-each select="spatialVector">
868
            <xsl:if test="position()=$entityindex">
869
                <xsl:choose>
870
                 <xsl:when test="references!=''">
871
                    <xsl:variable name="ref_id2" select="references"/>
872
                    <xsl:variable name="references2" select="$ids[@id=$ref_id2]" />
873
                    <xsl:for-each select="$references2">
874
                       <xsl:call-template name="choosephysical"/>
875
                    </xsl:for-each>
876
                 </xsl:when>
877
                 <xsl:otherwise>
878
                     <xsl:call-template name="choosephysical"/>
879
                 </xsl:otherwise>
880
               </xsl:choose>
881
            </xsl:if>
882
          </xsl:for-each>
883
        </xsl:if>
884
        <xsl:if test="$entitytype='storedProcedure'">
885
          <xsl:for-each select="storedProcedure">
886
            <xsl:if test="position()=$entityindex">
887
                <xsl:choose>
888
                 <xsl:when test="references!=''">
889
                    <xsl:variable name="ref_id2" select="references"/>
890
                    <xsl:variable name="references2" select="$ids[@id=$ref_id2]" />
891
                    <xsl:for-each select="$references2">
892
                       <xsl:call-template name="choosephysical"/>
893
                    </xsl:for-each>
894
                 </xsl:when>
895
                 <xsl:otherwise>
896
                     <xsl:call-template name="choosephysical"/>
897
                 </xsl:otherwise>
898
               </xsl:choose>
899
            </xsl:if>
900
          </xsl:for-each>
901
        </xsl:if>
902
        <xsl:if test="$entitytype='view'">
903
          <xsl:for-each select="view">
904
            <xsl:if test="position()=$entityindex">
905
                <xsl:choose>
906
                 <xsl:when test="references!=''">
907
                    <xsl:variable name="ref_id2" select="references"/>
908
                    <xsl:variable name="references2" select="$ids[@id=$ref_id2]" />
909
                    <xsl:for-each select="$references2">
910
                       <xsl:call-template name="choosephysical"/>
911
                    </xsl:for-each>
912
                 </xsl:when>
913
                 <xsl:otherwise>
914
                     <xsl:call-template name="choosephysical"/>
915
                 </xsl:otherwise>
916
               </xsl:choose>
917
            </xsl:if>
918
          </xsl:for-each>
919
        </xsl:if>
920
        <xsl:if test="$entitytype='otherEntity'">
921
          <xsl:for-each select="otherEntity">
922
            <xsl:if test="position()=$entityindex">
923
                <xsl:choose>
924
                 <xsl:when test="references!=''">
925
                    <xsl:variable name="ref_id2" select="references"/>
926
                    <xsl:variable name="references2" select="$ids[@id=$ref_id2]" />
927
                    <xsl:for-each select="$references2">
928
                       <xsl:call-template name="choosephysical"/>
929
                    </xsl:for-each>
930
                 </xsl:when>
931
                 <xsl:otherwise>
932
                     <xsl:call-template name="choosephysical"/>
933
                 </xsl:otherwise>
934
               </xsl:choose>
935
            </xsl:if>
936
          </xsl:for-each>
937
        </xsl:if>
938
      </xsl:if>
939
    </td>
940
      </tr>
941
   </xsl:template>
942
943
   <xsl:template name="choosephysical">
944
      <xsl:for-each select="physical">
945
   <xsl:if test="position()=$physicalindex">
946
      <xsl:choose>
947
         <xsl:when test="references!=''">
948
            <xsl:variable name="ref_id" select="references"/>
949
            <xsl:variable name="references" select="$ids[@id=$ref_id]" />
950
            <xsl:for-each select="$references">
951
               <xsl:call-template name="choosedistribution"/>
952
            </xsl:for-each>
953
         </xsl:when>
954
         <xsl:otherwise>
955
            <xsl:call-template name="choosedistribution"/>
956
        </xsl:otherwise>
957
     </xsl:choose>
958
  </xsl:if>
959
      </xsl:for-each>
960
   </xsl:template>
961
962
   <xsl:template name="choosedistribution">
963
      <xsl:for-each select="distribution">
964
   <xsl:if test="$distributionindex=position()">
965
      <xsl:choose>
966
         <xsl:when test="references!=''">
967
            <xsl:variable name="ref_id" select="references"/>
968
            <xsl:variable name="references" select="$ids[@id=$ref_id]" />
969
            <xsl:for-each select="$references">
970
               <xsl:for-each select="inline">
971
                  <xsl:value-of select="."/>
972
                </xsl:for-each>
973
            </xsl:for-each>
974
         </xsl:when>
975
         <xsl:otherwise>
976
            <xsl:for-each select="inline">
977
              <xsl:value-of select="."/>
978
            </xsl:for-each>
979
        </xsl:otherwise>
980
     </xsl:choose>
981
  </xsl:if>
982
      </xsl:for-each>
983
   </xsl:template>
984
985
986
     <!--********************************************************
987
               Citation part
988
       ********************************************************-->
989
   <xsl:template name="emlcitation">
990
     <xsl:choose>
991
       <xsl:when test="$displaymodule='inlinedata'">
992
    <xsl:call-template name="emlinlinedata"/>
993
       </xsl:when>
994
       <xsl:otherwise>
995
  <table xsl:use-attribute-sets="cellspacing" class="{$tabledefaultStyle}">
996
  <tr>
997
    <td colspan="2">
998
         <h3>Citation Description</h3>
999
    </td>
1000
  </tr>
1001
  <xsl:call-template name="identifier">
1002
        <xsl:with-param name="packageID" select="../@packageId"/>
1003
        <xsl:with-param name="system" select="../@system"/>
1004
  </xsl:call-template>
1005
  <tr>
1006
    <td colspan="2">
1007
      <xsl:call-template name="citation">
1008
         <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
1009
         <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
1010
     </xsl:call-template>
1011
    </td>
1012
  </tr>
1013
      </table>
1014
     </xsl:otherwise>
1015
    </xsl:choose>
1016
   </xsl:template>
1017
1018
1019
1020
     <!--********************************************************
1021
              Software part
1022
       ********************************************************-->
1023
1024
   <xsl:template name="emlsoftware">
1025
     <xsl:choose>
1026
       <xsl:when test="$displaymodule='inlinedata'">
1027
    <xsl:call-template name="emlinlinedata"/>
1028
       </xsl:when>
1029
       <xsl:otherwise>
1030
    <table xsl:use-attribute-sets="cellspacing" class="{$tabledefaultStyle}">
1031
    <tr>
1032
      <td colspan="2">
1033
         <h3>Software Description</h3>
1034
     </td>
1035
    </tr>
1036
    <xsl:call-template name="identifier">
1037
        <xsl:with-param name="packageID" select="../@packageId"/>
1038
        <xsl:with-param name="system" select="../@system"/>
1039
    </xsl:call-template>
1040
    <tr>
1041
     <td colspan="2">
1042
      <xsl:call-template name="software">
1043
         <xsl:with-param name="softwarefirstColStyle" select="$firstColStyle"/>
1044
         <xsl:with-param name="softwaresubHeaderStyle" select="$subHeaderStyle"/>
1045
     </xsl:call-template>
1046
     </td>
1047
   </tr>
1048
       </table>
1049
      </xsl:otherwise>
1050
     </xsl:choose>
1051
   </xsl:template>
1052
1053
1054
     <!--********************************************************
1055
              Protocal part
1056
       ********************************************************-->
1057
1058
   <xsl:template name="emlprotocol">
1059
    <xsl:choose>
1060
       <xsl:when test="$displaymodule='inlinedata'">
1061
    <xsl:call-template name="emlinlinedata"/>
1062
       </xsl:when>
1063
       <xsl:otherwise>
1064
  <table xsl:use-attribute-sets="cellspacing" class="{$tabledefaultStyle}">
1065
   <tr>
1066
    <td colspan="2">
1067
         <h3>Protocal Description</h3>
1068
    </td>
1069
   </tr>
1070
   <xsl:call-template name="identifier">
1071
        <xsl:with-param name="packageID" select="../@packageId"/>
1072
        <xsl:with-param name="system" select="../@system"/>
1073
   </xsl:call-template>
1074
   <tr>
1075
    <td colspan="2">
1076
      <xsl:call-template name="protocol">
1077
         <xsl:with-param name="protocolfirstColStyle" select="$firstColStyle"/>
1078
         <xsl:with-param name="protocolsubHeaderStyle" select="$subHeaderStyle"/>
1079
     </xsl:call-template>
1080
    </td>
1081
   </tr>
1082
       </table>
1083
      </xsl:otherwise>
1084
    </xsl:choose>
1085
   </xsl:template>
1086
1087
      <!--********************************************************
1088
             additionalmetadata part
1089
       ********************************************************-->
1090
   <xsl:template name="additionalmetadataURL">
1091
     <xsl:param name="index"/>
1092
     <table class="{$tabledefaultStyle}">
1093
       <tr>
1094
         <td>
1095
           <a><xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=additionalmetadata&amp;additionalmetadataindex=<xsl:value-of select="$index"/></xsl:attribute>
1096
             Additional Metadata
1097
           </a>
1098
         </td>
1099
       </tr>
1100
     </table>
1101
   </xsl:template>
1102
     <!--********************************************************
1103
             download xml part
1104
       ********************************************************-->
1105
   <xsl:template name="xml">
1106
     <xsl:param name="index"/>
1107
        <br />
1108
        <a>
1109
          <xsl:attribute name="href">
1110
            <xsl:value-of select="$xmlURI"/>
1111
            <xsl:value-of select="$docid"/>
1112
          </xsl:attribute>
1113
          View the original XML Data (EML format)
1114
        </a>
1115
   </xsl:template>
1116
</xsl:stylesheet>