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: tao $'
10
  *     '$Date: 2003-06-26 15:15:54 -0700 (Thu, 26 Jun 2003) $'
11
  * '$Revision: 1695 $'
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-2.0.0.xsl"/>
34
  <xsl:import href="eml-additionalmetadata-2.0.0.xsl"/>
35
  <xsl:import href="eml-attribute-2.0.0.xsl"/>
36
  <xsl:import href="eml-attribute-enumeratedDomain-2.0.0.xsl"/>
37
  <xsl:import href="eml-constraint-2.0.0.xsl"/>
38
  <xsl:import href="eml-coverage-2.0.0.xsl"/>
39
  <xsl:import href="eml-dataset-2.0.0.xsl"/>
40
  <xsl:import href="eml-datatable-2.0.0.xsl"/>
41
  <xsl:import href="eml-distribution-2.0.0.xsl"/>
42
  <xsl:import href="eml-entity-2.0.0.xsl"/>
43
  <xsl:import href="eml-identifier-2.0.0.xsl"/>
44
  <xsl:import href="eml-literature-2.0.0.xsl"/>
45
  <xsl:import href="eml-method-2.0.0.xsl"/>
46
  <xsl:import href="eml-otherentity-2.0.0.xsl"/>
47
  <xsl:import href="eml-party-2.0.0.xsl"/>
48
  <xsl:import href="eml-physical-2.0.0.xsl"/>
49
  <xsl:import href="eml-project-2.0.0.xsl"/>
50
  <xsl:import href="eml-protocol-2.0.0.xsl"/>
51
  <xsl:import href="eml-resource-2.0.0.xsl"/>
52
  <xsl:import href="eml-settings-2.0.0.xsl"/>
53
  <xsl:import href="eml-software-2.0.0.xsl"/>
54
  <xsl:import href="eml-spatialraster-2.0.0.xsl"/>
55
  <xsl:import href="eml-spatialvector-2.0.0.xsl"/>
56
  <xsl:import href="eml-storedprocedure-2.0.0.xsl"/>
57
  <xsl:import href="eml-text-2.0.0.xsl"/>
58
  <xsl:import href="eml-view-2.0.0.xsl"/>
59
  
60
  <xsl:output method="html" encoding="iso-8859-1"/>
61
  <!-- global variables to store id node set in case to be referenced-->
62
  <xsl:variable name="ids" select="//*[@id!='']"/>
63
  
64
  <xsl:template match="/">
65
    <html>
66
      <head>
67
        <link rel="stylesheet" type="text/css" 
68
              href="{$stylePath}/{$qformat}.css" />
69
      </head>
70
      <body>
71
          <table width="100%">
72
          <tr>
73
            <td rowspan="2"><img src="@web-base-url@/images/KNBLogo.gif"/></td>
74
            <td colspan="7"><div class="title">Biocomplexity Data Search</div>
75
            </td>
76
          </tr>
77
          <tr>
78
            <td><a href="@web-base-url@" class="toollink"> KNB </a></td>
79
            <td><a href="@web-base-url@/data.html" class="toollink"> 
80
                Data </a></td>
81
            <td><a href="@web-base-url@/people.html" class="toollink"> 
82
                People </a></td>
83
            <td><a href="@web-base-url@/informatics" class="toollink"> 
84
                Informatics </a></td>
85
            <td><a href="@web-base-url@/biodiversity" class="toollink"> 
86
                Biodiversity </a></td>
87
            <td><a href="@web-base-url@/education" class="toollink"> 
88
                Education </a></td>
89
            <td><a href="@web-base-url@/software" class="toollink"> 
90
                Software </a></td>
91
         </tr>
92
         <tr>
93
          <td align="right" valign="top" colspan="7">
94
            <form action="@html-path@/servlet/metacat" method="POST">
95
             Data Search: <input type="text" name="anyfield" size="10" />
96
             <input type="hidden" name="action" value="query" />   
97
             <input type="hidden" name="qformat" value="knb" />
98
             <input type="hidden" name="operator" value="UNION" />
99
             
100
             <input type="hidden" name="returnfield"
101
              value="creator/individualName/surName" />
102
             <input type="hidden" name="returnfield"
103
              value="creator/organizationName" />
104
             <input type="hidden" name="returnfield" 
105
              value="originator/individualName/surName" />
106
             <input type="hidden" name="returnfield" 
107
              value="originator/individualName/givenName" />
108
             <input type="hidden" name="returnfield" 
109
              value="originator/organizationName" />
110
             <input type="hidden" name="returnfield" 
111
              value="title" />
112
             <input type="hidden" name="returnfield" 
113
              value="keyword" />
114
             <input type="hidden" name="returndoctype"
115
              value="eml://ecoinformatics.org/eml-2.0.0" />
116
             <input type="hidden" name="returndoctype"
117
              value="-//NCEAS//eml-dataset-2.0//EN" />
118
             <input type="hidden" name="returndoctype"
119
              value="-//NCEAS//resource//EN" />
120
             <input type="hidden" name="returndoctype"
121
              value="-//NCEAS//eml-dataset//EN" />
122
              <input type="hidden" name="returndoctype"
123
              value="-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN" />
124
              <input type="hidden" name="returndoctype"
125
              value="-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN" />
126
           </form>
127
          </td>
128
        </tr>  
129
       </table>
130
        <xsl:apply-templates select="*[local-name()='eml']"/>
131
      </body>
132
    </html>
133
   </xsl:template>
134
   
135
   <xsl:template match="*[local-name()='eml']">
136
       <xsl:for-each select="dataset">
137
         <xsl:call-template name="emldataset"/>
138
       </xsl:for-each>
139
       <xsl:for-each select="citation">
140
         <xsl:call-template name="emlcitation"/>
141
       </xsl:for-each>
142
       <xsl:for-each select="software">
143
         <xsl:call-template name="emlsoftware"/>
144
       </xsl:for-each>
145
       <xsl:for-each select="protocol">
146
         <xsl:call-template name="emlprotocol"/>
147
       </xsl:for-each>
148
       <!-- Additinal metadata-->
149
       <xsl:choose>
150
               <xsl:when test="$displaymodule='additionalmetadata'">
151
                   <xsl:for-each select="additionalMetadata"> 
152
                     <xsl:if test="$additionalmetadataindex=position()">
153
                        <xsl:call-template name="additionalmetadata"/>
154
                     </xsl:if>
155
                  </xsl:for-each>
156
               </xsl:when>
157
               <xsl:otherwise>
158
                 <xsl:if test="$displaymodule='dataset'">
159
                   <xsl:for-each select="additionalMetadata">
160
                      <xsl:call-template name="additionalmetadataURL">
161
                        <xsl:with-param name="index" select="position()"/>
162
                      </xsl:call-template>
163
                   </xsl:for-each>
164
                 </xsl:if>
165
              </xsl:otherwise>
166
       </xsl:choose>
167
   </xsl:template>
168
   
169
   <!--********************************************************
170
                             dataset part
171
       ********************************************************-->
172
   
173
   <xsl:template name="emldataset">
174
      <table class="tabledefault" width="100%">
175
          <xsl:if test="$displaymodule='dataset'">
176
             <xsl:call-template name="datasetpart"/>  
177
          </xsl:if>
178
          <xsl:if test="$displaymodule='entity'">
179
             <xsl:call-template name="entitypart"/>
180
          </xsl:if>
181
          <xsl:if test="$displaymodule='attribute'">
182
             <xsl:call-template name="attributepart"/>
183
          </xsl:if>
184
          <xsl:if test="$displaymodule='attributedomain'">
185
             <xsl:call-template name="datasetattributedomain"/>
186
          </xsl:if>
187
          <xsl:if test="$displaymodule='attributecoverage'">
188
             <xsl:call-template name="datasetattributecoverage"/>
189
          </xsl:if>
190
          <xsl:if test="$displaymodule='attributemethod'">
191
             <xsl:call-template name="datasetattributemethod"/>
192
          </xsl:if>
193
          <xsl:if test="$displaymodule='inlinedata'">
194
             <xsl:call-template name="datasetinlinedata"/>
195
          </xsl:if>
196
      </table>
197
   </xsl:template>
198
   
199
   <!--*************** Data set part *************-->
200
   <xsl:template name="datasetpart">
201
      <tr><td colspan="2" width="100%">
202
         <right>
203
            <h3>Data Set Description</h3>
204
         </right>
205
      </td></tr>
206
       <xsl:call-template name="identifier">
207
                <xsl:with-param name="packageID" select="../@packageId"/>
208
                <xsl:with-param name="system" select="../@system"/>
209
      </xsl:call-template>
210
      <tr>
211
           <td colspan="2" width="100%">
212
              <xsl:apply-templates select="." mode="dataset"/>
213
           </td>
214
      </tr>  
215
   </xsl:template>
216
   
217
   <!--************ Entity part *****************-->
218
   <xsl:template name="entitypart">
219
       <xsl:choose>
220
               <xsl:when test="references!=''">
221
                  <xsl:variable name="ref_id" select="references"/>
222
                  <xsl:variable name="references" select="$ids[@id=$ref_id]" />
223
                  <xsl:for-each select="$references">
224
                     <xsl:call-template name="entitypartcommon"/>
225
                  </xsl:for-each>
226
               </xsl:when>
227
               <xsl:otherwise>
228
                  <xsl:call-template name="entitypartcommon"/>
229
              </xsl:otherwise>
230
         </xsl:choose>
231
    </xsl:template>
232
   
233
   
234
    <xsl:template name="entitypartcommon">
235
      <tr><td colspan="2" width="100%" >
236
         <right>
237
            <h3>Entity Description</h3>
238
          </right>
239
      </td></tr>
240
      <xsl:call-template name="identifier">
241
                <xsl:with-param name="packageID" select="../@packageId"/>
242
                <xsl:with-param name="system" select="../@system"/>
243
      </xsl:call-template>
244
      <tr>
245
           <td width="100%" colspan="2">
246
              <!-- find the subtree to process -->
247
             <xsl:call-template name="chooseentity"/>
248
           </td>
249
      </tr>  
250
   </xsl:template>
251
   
252
   <!--************ Attribute part *****************-->
253
    <xsl:template name="attributepart">
254
      <tr><td width="100%">
255
         <right>
256
            <h3>Attributes Description</h3>
257
         </right>
258
      </td></tr>
259
      <tr>
260
           <td width="100%">
261
              <!-- find the subtree to process -->
262
            <xsl:if test="$entitytype='dataTable'">
263
              <xsl:for-each select="dataTable">
264
                  <xsl:if test="position()=$entityindex">
265
                      <xsl:for-each select="attributeList">
266
                         <xsl:call-template name="attributelist">
267
                            <xsl:with-param name="docid" select="$docid"/>
268
                            <xsl:with-param name="entitytype" select="$entitytype"/>
269
                            <xsl:with-param name="entityindex" select="$entityindex"/>
270
                         </xsl:call-template>
271
                      </xsl:for-each>
272
                  </xsl:if>
273
              </xsl:for-each>
274
            </xsl:if>
275
          </td>
276
      </tr>  
277
   </xsl:template>
278
   
279
   <!--************************Attribute Domain************************-->
280
   <xsl:template name="datasetattributedomain">
281
      <tr><td>
282
         <right>
283
            <h3>Attributes Domain</h3>
284
         </right>
285
      </td></tr>
286
      <tr>
287
           <td width="100%">
288
             <!-- find the subtree to process -->
289
             <xsl:call-template name="chooseentity"/>
290
          </td>
291
      </tr>  
292
   </xsl:template>
293
   
294
   
295
   <!--************************Attribute Method************************-->
296
   <xsl:template name="datasetattributemethod">
297
      <tr><td>
298
         <right>
299
            <h3>Attributes Method</h3>
300
         </right>
301
      </td></tr>
302
      <tr>
303
           <td width="100%">
304
             <!-- find the subtree to process -->
305
             <xsl:call-template name="chooseentity"/>
306
          </td>
307
      </tr>  
308
   </xsl:template>
309
   
310
   
311
   <!--************************Attribute Coverage************************-->
312
   <xsl:template name="datasetattributecoverage">
313
     <tr><td>
314
         <right>
315
            <h3>Attributes Coverage</h3>
316
         </right>
317
      </td></tr>
318
      <tr>
319
           <td width="100%">
320
             <!-- find the subtree to process -->
321
             <xsl:call-template name="chooseentity"/>
322
          </td>
323
      </tr>  
324
   </xsl:template>
325
   
326
   
327
   <xsl:template name="chooseentity">
328
           <xsl:if test="$entitytype='dataTable'">
329
              <xsl:for-each select="dataTable">
330
                  <xsl:if test="position()=$entityindex">
331
                         <xsl:choose>
332
                           <xsl:when test="references!=''">
333
                              <xsl:variable name="ref_id" select="references"/>
334
                              <xsl:variable name="references" select="$ids[@id=$ref_id]" />
335
                                <xsl:for-each select="$references">
336
                                    <xsl:choose>
337
                                       <xsl:when test="$displaymodule='entity'">
338
                                          <xsl:call-template name="dataTable">
339
                                              <xsl:with-param name="datatablefirstColStyle" select="$firstColStyle"/>
340
                                              <xsl:with-param name="datatablesubHeaderStyle" select="$subHeaderStyle"/>  
341
                                              <xsl:with-param name="docid" select="$docid"/>
342
                                              <xsl:with-param name="entitytype" select="$entitytype"/>
343
                                              <xsl:with-param name="entityindex" select="$entityindex"/>
344
                                          </xsl:call-template>
345
                                       </xsl:when>
346
                                       <xsl:otherwise>
347
                                          <xsl:call-template name="chooseattributelist"/>
348
                                       </xsl:otherwise>
349
                                    </xsl:choose>
350
                                </xsl:for-each>
351
                           </xsl:when>
352
                           <xsl:otherwise>
353
                             <xsl:choose>
354
                                       <xsl:when test="$displaymodule='entity'">
355
                                          <xsl:call-template name="dataTable">
356
                                              <xsl:with-param name="datatablefirstColStyle" select="$firstColStyle"/>
357
                                              <xsl:with-param name="datatablesubHeaderStyle" select="$subHeaderStyle"/>  
358
                                              <xsl:with-param name="docid" select="$docid"/>
359
                                              <xsl:with-param name="entitytype" select="$entitytype"/>
360
                                              <xsl:with-param name="entityindex" select="$entityindex"/>
361
                                          </xsl:call-template>
362
                                       </xsl:when>
363
                                       <xsl:otherwise>
364
                                          <xsl:call-template name="chooseattributelist"/>
365
                                       </xsl:otherwise>
366
                             </xsl:choose>   
367
                         </xsl:otherwise>
368
                      </xsl:choose>
369
                  </xsl:if>
370
              </xsl:for-each>
371
            </xsl:if>
372
            <xsl:if test="$entitytype='spatialRaster'">
373
              <xsl:for-each select="spatialRaster">
374
                  <xsl:if test="position()=$entityindex">
375
                         <xsl:choose>
376
                           <xsl:when test="references!=''">
377
                              <xsl:variable name="ref_id" select="references"/>
378
                              <xsl:variable name="references" select="$ids[@id=$ref_id]" />
379
                                <xsl:for-each select="$references">
380
                                    <xsl:choose>
381
                                       <xsl:when test="$displaymodule='entity'">
382
                                          <xsl:call-template name="spatialRaster">
383
                                              <xsl:with-param name="spatialrasterfirstColStyle" select="$firstColStyle"/>
384
                                              <xsl:with-param name="spatialrastersubHeaderStyle" select="$subHeaderStyle"/>  
385
                                              <xsl:with-param name="docid" select="$docid"/>
386
                                              <xsl:with-param name="entitytype" select="$entitytype"/>
387
                                              <xsl:with-param name="entityindex" select="$entityindex"/>
388
                                          </xsl:call-template>
389
                                       </xsl:when>
390
                                       <xsl:otherwise>
391
                                          <xsl:call-template name="chooseattributelist"/>
392
                                       </xsl:otherwise>
393
                                    </xsl:choose>
394
                                </xsl:for-each>
395
                           </xsl:when>
396
                           <xsl:otherwise>
397
                             <xsl:choose>
398
                                       <xsl:when test="$displaymodule='entity'">
399
                                          <xsl:call-template name="spatialRaster">
400
                                              <xsl:with-param name="spatialrasterfirstColStyle" select="$firstColStyle"/>
401
                                              <xsl:with-param name="spatialrastersubHeaderStyle" select="$subHeaderStyle"/>  
402
                                              <xsl:with-param name="docid" select="$docid"/>
403
                                              <xsl:with-param name="entitytype" select="$entitytype"/>
404
                                              <xsl:with-param name="entityindex" select="$entityindex"/>
405
                                          </xsl:call-template>
406
                                       </xsl:when>
407
                                       <xsl:otherwise>
408
                                          <xsl:call-template name="chooseattributelist"/>
409
                                       </xsl:otherwise>
410
                             </xsl:choose>   
411
                         </xsl:otherwise>
412
                      </xsl:choose>
413
                  </xsl:if>
414
              </xsl:for-each>
415
            </xsl:if>
416
            <xsl:if test="$entitytype='spatialVector'">
417
              <xsl:for-each select="spatialVector">
418
                  <xsl:if test="position()=$entityindex">
419
                         <xsl:choose>
420
                           <xsl:when test="references!=''">
421
                              <xsl:variable name="ref_id" select="references"/>
422
                              <xsl:variable name="references" select="$ids[@id=$ref_id]" />
423
                                <xsl:for-each select="$references">
424
                                    <xsl:choose>
425
                                       <xsl:when test="$displaymodule='entity'">
426
                                          <xsl:call-template name="spatialVector">
427
                                             <xsl:with-param name="spatialvectorfirstColStyle" select="$firstColStyle"/>
428
                                              <xsl:with-param name="spatialvectorsubHeaderStyle" select="$subHeaderStyle"/>  
429
                                              <xsl:with-param name="docid" select="$docid"/>
430
                                              <xsl:with-param name="entitytype" select="$entitytype"/>
431
                                              <xsl:with-param name="entityindex" select="$entityindex"/>
432
                                          </xsl:call-template>
433
                                       </xsl:when>
434
                                       <xsl:otherwise>
435
                                          <xsl:call-template name="chooseattributelist"/>
436
                                       </xsl:otherwise>
437
                                    </xsl:choose>
438
                                </xsl:for-each>
439
                           </xsl:when>
440
                           <xsl:otherwise>
441
                             <xsl:choose>
442
                                       <xsl:when test="$displaymodule='entity'">
443
                                          <xsl:call-template name="spatialVector">
444
                                              <xsl:with-param name="spatialvectorfirstColStyle" select="$firstColStyle"/>
445
                                              <xsl:with-param name="spatialvectorsubHeaderStyle" select="$subHeaderStyle"/>  
446
                                              <xsl:with-param name="docid" select="$docid"/>
447
                                              <xsl:with-param name="entitytype" select="$entitytype"/>
448
                                              <xsl:with-param name="entityindex" select="$entityindex"/>
449
                                          </xsl:call-template>
450
                                       </xsl:when>
451
                                       <xsl:otherwise>
452
                                          <xsl:call-template name="chooseattributelist"/>
453
                                       </xsl:otherwise>
454
                             </xsl:choose>   
455
                         </xsl:otherwise>
456
                      </xsl:choose>
457
                  </xsl:if>
458
              </xsl:for-each>
459
            </xsl:if>
460
            <xsl:if test="$entitytype='storedProcedure'">
461
              <xsl:for-each select="storedProcedure">
462
                  <xsl:if test="position()=$entityindex">
463
                         <xsl:choose>
464
                           <xsl:when test="references!=''">
465
                              <xsl:variable name="ref_id" select="references"/>
466
                              <xsl:variable name="references" select="$ids[@id=$ref_id]" />
467
                                <xsl:for-each select="$references">
468
                                    <xsl:choose>
469
                                       <xsl:when test="$displaymodule='entity'">
470
                                          <xsl:call-template name="storedProcedure">
471
                                             <xsl:with-param name="storedprocedurefirstColStyle" select="$firstColStyle"/>
472
                                             <xsl:with-param name="storedproceduresubHeaderStyle" select="$subHeaderStyle"/>  
473
                                             <xsl:with-param name="docid" select="$docid"/>
474
                                             <xsl:with-param name="entitytype" select="$entitytype"/>
475
                                             <xsl:with-param name="entityindex" select="$entityindex"/>
476
                                          </xsl:call-template>
477
                                       </xsl:when>
478
                                       <xsl:otherwise>
479
                                          <xsl:call-template name="chooseattributelist"/>
480
                                       </xsl:otherwise>
481
                                    </xsl:choose>
482
                                </xsl:for-each>
483
                           </xsl:when>
484
                           <xsl:otherwise>
485
                             <xsl:choose>
486
                                       <xsl:when test="$displaymodule='entity'">
487
                                          <xsl:call-template name="storedProcedure">
488
                                             <xsl:with-param name="storedprocedurefirstColStyle" select="$firstColStyle"/>
489
                                             <xsl:with-param name="storedproceduresubHeaderStyle" select="$subHeaderStyle"/>  
490
                                             <xsl:with-param name="docid" select="$docid"/>
491
                                             <xsl:with-param name="entitytype" select="$entitytype"/>
492
                                             <xsl:with-param name="entityindex" select="$entityindex"/>
493
                                          </xsl:call-template>
494
                                       </xsl:when>
495
                                       <xsl:otherwise>
496
                                          <xsl:call-template name="chooseattributelist"/>
497
                                       </xsl:otherwise>
498
                             </xsl:choose>   
499
                         </xsl:otherwise>
500
                      </xsl:choose>
501
                  </xsl:if>
502
              </xsl:for-each>
503
            </xsl:if>
504
            <xsl:if test="$entitytype='view'">
505
              <xsl:for-each select="view">
506
                  <xsl:if test="position()=$entityindex">
507
                         <xsl:choose>
508
                           <xsl:when test="references!=''">
509
                              <xsl:variable name="ref_id" select="references"/>
510
                              <xsl:variable name="references" select="$ids[@id=$ref_id]" />
511
                                <xsl:for-each select="$references">
512
                                    <xsl:choose>
513
                                       <xsl:when test="$displaymodule='entity'">
514
                                          <xsl:call-template name="view">
515
                                             <xsl:with-param name="viewfirstColStyle" select="$firstColStyle"/>
516
                                             <xsl:with-param name="viewsubHeaderStyle" 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:for-each>
527
                           </xsl:when>
528
                           <xsl:otherwise>
529
                             <xsl:choose>
530
                                       <xsl:when test="$displaymodule='entity'">
531
                                          <xsl:call-template name="view">
532
                                             <xsl:with-param name="viewfirstColStyle" select="$firstColStyle"/>
533
                                             <xsl:with-param name="viewsubHeaderStyle" select="$subHeaderStyle"/>  
534
                                             <xsl:with-param name="docid" select="$docid"/>
535
                                             <xsl:with-param name="entitytype" select="$entitytype"/>
536
                                             <xsl:with-param name="entityindex" select="$entityindex"/>
537
                                          </xsl:call-template>
538
                                       </xsl:when>
539
                                       <xsl:otherwise>
540
                                          <xsl:call-template name="chooseattributelist"/>
541
                                       </xsl:otherwise>
542
                             </xsl:choose>   
543
                         </xsl:otherwise>
544
                      </xsl:choose>
545
                  </xsl:if>
546
              </xsl:for-each>
547
            </xsl:if>
548
            <xsl:if test="$entitytype='otherEntity'">
549
              <xsl:for-each select="otherEntity">
550
                  <xsl:if test="position()=$entityindex">
551
                         <xsl:choose>
552
                           <xsl:when test="references!=''">
553
                              <xsl:variable name="ref_id" select="references"/>
554
                              <xsl:variable name="references" select="$ids[@id=$ref_id]" />
555
                                <xsl:for-each select="$references">
556
                                    <xsl:choose>
557
                                       <xsl:when test="$displaymodule='entity'">
558
                                          <xsl:call-template name="otherEntity">
559
                                             <xsl:with-param name="otherentityfirstColStyle" select="$firstColStyle"/>
560
                                             <xsl:with-param name="otherentitysubHeaderStyle" 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:for-each>
571
                           </xsl:when>
572
                           <xsl:otherwise>
573
                             <xsl:choose>
574
                                       <xsl:when test="$displaymodule='entity'">
575
                                          <xsl:call-template name="otherEntity">
576
                                             <xsl:with-param name="otherentityfirstColStyle" select="$firstColStyle"/>
577
                                             <xsl:with-param name="otherentitysubHeaderStyle" select="$subHeaderStyle"/>  
578
                                             <xsl:with-param name="docid" select="$docid"/>
579
                                             <xsl:with-param name="entitytype" select="$entitytype"/>
580
                                             <xsl:with-param name="entityindex" select="$entityindex"/>
581
                                          </xsl:call-template>
582
                                       </xsl:when>
583
                                       <xsl:otherwise>
584
                                          <xsl:call-template name="chooseattributelist"/>
585
                                       </xsl:otherwise>
586
                             </xsl:choose>   
587
                         </xsl:otherwise>
588
                      </xsl:choose>
589
                  </xsl:if>
590
              </xsl:for-each>
591
            </xsl:if>
592
   </xsl:template>
593
   
594
   <xsl:template name="chooseattributelist">
595
       <xsl:for-each select="attributeList">
596
          <xsl:choose>
597
               <xsl:when test="references!=''">
598
                  <xsl:variable name="ref_id" select="references"/>
599
                  <xsl:variable name="references" select="$ids[@id=$ref_id]" />
600
                  <xsl:for-each select="$references">
601
                     <xsl:call-template name="chooseattribute"/>
602
                 </xsl:for-each>
603
               </xsl:when>
604
               <xsl:otherwise>
605
                   <xsl:call-template name="chooseattribute"/>
606
              </xsl:otherwise>
607
         </xsl:choose>
608
      </xsl:for-each>
609
   </xsl:template>
610
   
611
   <xsl:template name="chooseattribute">
612
       <xsl:for-each select="attribute">
613
          <xsl:if test="position()=$attributeindex">
614
            <xsl:if test="$displaymodule='attributedomain'">
615
              <xsl:for-each select="measurementScale/*/*">
616
                <xsl:call-template name="nonNumericDomain">
617
                    <xsl:with-param name="nondomainfirstColStyle" select="$firstColStyle"/>
618
                 </xsl:call-template>
619
              </xsl:for-each>
620
           </xsl:if>
621
           <xsl:if test="$displaymodule='attributecoverage'">
622
              <xsl:for-each select="coverage">
623
                <xsl:call-template name="coverage">
624
                </xsl:call-template>
625
              </xsl:for-each>
626
           </xsl:if>
627
           <xsl:if test="$displaymodule='attributemethod'">
628
              <xsl:for-each select="method">
629
                <xsl:call-template name="method">
630
                    <xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
631
                    <xsl:with-param name="methodsubHeaderStyle" select="$firstColStyle"/>
632
                 </xsl:call-template>
633
              </xsl:for-each>
634
           </xsl:if>
635
         </xsl:if>
636
       </xsl:for-each>
637
   </xsl:template>
638
   
639
   
640
   
641
   <!--*************************Distribution Inline Data*****************-->
642
   <xsl:template name="datasetinlinedata">
643
      <tr><td>
644
         <right>
645
            <h3>Inline Data</h3>
646
         </right>
647
      </td></tr>
648
      <tr>
649
           <td width="100%">
650
            <xsl:if test="$distributionlevel='toplevel'">
651
               <xsl:for-each select="distribution">
652
                  <xsl:if test="position=$distributionindex">
653
                     <xsl:choose>
654
                       <xsl:when test="references!=''">
655
                          <xsl:variable name="ref_id1" select="references"/>
656
                          <xsl:variable name="references1" select="$ids[@id=$ref_id1]" />
657
                          <xsl:for-each select="$references1">
658
                              <xsl:for-each select="inline">
659
                                  <xsl:value-of select="."/>
660
                              </xsl:for-each>
661
                          </xsl:for-each>
662
                       </xsl:when>
663
                       <xsl:otherwise>
664
                           <xsl:for-each select="inline">
665
                                  <xsl:value-of select="."/>
666
                           </xsl:for-each>
667
                       </xsl:otherwise>
668
                     </xsl:choose>
669
                  </xsl:if>
670
               </xsl:for-each>
671
            </xsl:if>
672
            <xsl:if test="$distributionlevel='entitylevel'">
673
              <xsl:if test="$entitytype='dataTable'">
674
                <xsl:for-each select="dataTable">
675
                  <xsl:if test="position()=$entityindex">
676
                      <xsl:choose>
677
                       <xsl:when test="references!=''">
678
                          <xsl:variable name="ref_id2" select="references"/>
679
                          <xsl:variable name="references2" select="$ids[@id=$ref_id2]" />
680
                          <xsl:for-each select="$references2">
681
                             <xsl:call-template name="choosephysical"/>
682
                          </xsl:for-each>
683
                       </xsl:when>
684
                       <xsl:otherwise>
685
                           <xsl:call-template name="choosephysical"/>
686
                       </xsl:otherwise>
687
                     </xsl:choose>
688
                  </xsl:if>
689
                </xsl:for-each>
690
              </xsl:if>
691
            </xsl:if>
692
          </td>
693
      </tr>  
694
   </xsl:template>
695
   
696
   <xsl:template name="choosephysical">
697
      <xsl:for-each select="physical">
698
         <xsl:if test="position()=$physicalindex">
699
            <xsl:choose>
700
               <xsl:when test="references!=''">
701
                  <xsl:variable name="ref_id" select="references"/>
702
                  <xsl:variable name="references" select="$ids[@id=$ref_id]" />
703
                  <xsl:for-each select="$references">
704
                     <xsl:call-template name="choosedistribution"/>
705
                  </xsl:for-each>
706
               </xsl:when>
707
               <xsl:otherwise>
708
                  <xsl:call-template name="choosedistribution"/>
709
              </xsl:otherwise>
710
           </xsl:choose>
711
        </xsl:if>
712
      </xsl:for-each>
713
   </xsl:template>
714
   
715
   <xsl:template name="choosedistribution">
716
      <xsl:for-each select="distribution">
717
         <xsl:if test="$distributionindex=position()">
718
            <xsl:choose>
719
               <xsl:when test="references!=''">
720
                  <xsl:variable name="ref_id" select="references"/>
721
                  <xsl:variable name="references" select="$ids[@id=$ref_id]" />
722
                  <xsl:for-each select="$references">
723
                     <xsl:for-each select="inline">
724
                        <xsl:value-of select="."/>
725
                      </xsl:for-each>
726
                  </xsl:for-each>
727
               </xsl:when>
728
               <xsl:otherwise>
729
                  <xsl:for-each select="inline">
730
                    <xsl:value-of select="."/>
731
                  </xsl:for-each>
732
              </xsl:otherwise>
733
           </xsl:choose>
734
        </xsl:if>
735
      </xsl:for-each>
736
   </xsl:template>
737
   
738
   
739
     <!--********************************************************
740
                     Citation part
741
       ********************************************************-->
742
   <xsl:template name="emlcitation">
743
       
744
        <table class="tabledefault" width="100%">
745
        <tr>
746
          <td width="100%" colspan="2">
747
             <right>
748
               <h3>Citation Description</h3>
749
             </right>
750
          </td>
751
        </tr>
752
        <xsl:call-template name="identifier">
753
              <xsl:with-param name="packageID" select="../@packageId"/>
754
              <xsl:with-param name="system" select="../@system"/>
755
        </xsl:call-template>
756
        <tr>
757
          <td width="100%" colspan="2">
758
            <xsl:call-template name="citation">
759
               <xsl:with-param name="citationfirstColStyle" select="$firstColStyle"/>
760
               <xsl:with-param name="citationsubHeaderStyle" select="$subHeaderStyle"/>
761
           </xsl:call-template>
762
          </td>
763
        </tr>
764
     </table>
765
   </xsl:template>
766
   
767
   
768
      
769
     <!--********************************************************
770
                    Software part
771
       ********************************************************-->
772
   
773
   <xsl:template name="emlsoftware">
774
     <table class="tabledefault" width="100%">
775
        <tr>
776
          <td width="100%" colspan="2">
777
             <right>
778
               <h3>Software Description</h3>
779
             </right>
780
          </td>
781
        </tr>
782
        <xsl:call-template name="identifier">
783
              <xsl:with-param name="packageID" select="../@packageId"/>
784
              <xsl:with-param name="system" select="../@system"/>
785
        </xsl:call-template>
786
         <tr>
787
          <td width="100%" colspan="2">
788
            <xsl:call-template name="software">
789
               <xsl:with-param name="softwarefirstColStyle" select="$firstColStyle"/>
790
               <xsl:with-param name="softwaresubHeaderStyle" select="$subHeaderStyle"/>
791
           </xsl:call-template>
792
          </td>
793
        </tr>
794
     </table>
795
   </xsl:template>
796
   
797
     
798
     <!--********************************************************
799
                    Protocal part
800
       ********************************************************-->
801
   
802
   <xsl:template name="emlprotocol">
803
      <table class="tabledefault" width="100%">
804
        <tr>
805
          <td width="100%" colspan="2">
806
             <right>
807
               <h3>Protocal Description</h3>
808
             </right>
809
          </td>
810
        </tr>
811
        <xsl:call-template name="identifier">
812
              <xsl:with-param name="packageID" select="../@packageId"/>
813
              <xsl:with-param name="system" select="../@system"/>
814
        </xsl:call-template>
815
       <tr>
816
       <td width="100%" colspan="2">
817
            <xsl:call-template name="protocol">
818
               <xsl:with-param name="protocolfirstColStyle" select="$firstColStyle"/>
819
               <xsl:with-param name="protocolsubHeaderStyle" select="$subHeaderStyle"/>
820
           </xsl:call-template>
821
          </td>
822
        </tr>
823
     </table>
824
   </xsl:template>
825
   
826
      <!--********************************************************
827
                   additionalmetadata part
828
       ********************************************************-->
829
   <xsl:template name="additionalmetadataURL">
830
     <xsl:param name="index"/>
831
     <table class="default" width="100%">
832
       <tr><td width="100%" class="{$subHeaderStyle}">
833
              <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>
834
              <b>Additional Metadata</b></a>
835
           </td>
836
       </tr>
837
     </table>
838
   </xsl:template>
839
    
840
</xsl:stylesheet>
(2-2/34)