Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *    Copyright: 2000 Regents of the University of California and the
5
  *               National Center for Ecological Analysis and Synthesis
6
  *  For Details: http://www.nceas.ucsb.edu/
7
  *
8
  *   '$Author: tao $'
9
  *     '$Date: 2003-07-03 17:17:46 -0700 (Thu, 03 Jul 2003) $'
10
  * '$Revision: 1726 $'
11
  *
12
  * This program is free software; you can redistribute it and/or modify
13
  * it under the terms of the GNU General Public License as published by
14
  * the Free Software Foundation; either version 2 of the License, or
15
  * (at your option) any later version.
16
  *
17
  * This program is distributed in the hope that it will be useful,
18
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
  * GNU General Public License for more details.
21
  *
22
  * You should have received a copy of the GNU General Public License
23
  * along with this program; if not, write to the Free Software
24
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
  *
26
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
27
  * convert an XML file that is valid with respect to the eml-variable.dtd
28
  * module of the Ecological Metadata Language (EML) into an HTML format
29
  * suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32

    
33

    
34
<xsl:output method="html" encoding="iso-8859-1"/>
35

    
36
<xsl:template name="attributelist">
37
   <xsl:param name="docid"/>
38
   <xsl:param name="entitytype"/>
39
   <xsl:param name="entityindex"/>
40
  
41
   <table xsl:use-attribute-sets="cellspacing" class="tableattribute" width="100%">
42
        <xsl:choose>
43
         <xsl:when test="references!=''">
44
          <xsl:variable name="ref_id" select="references"/>
45
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
46
          <xsl:for-each select="$references">
47
            <xsl:call-template name="attributecommon">
48
               <xsl:with-param name="docid" select="$docid"/>
49
               <xsl:with-param name="entitytype" select="$entitytype"/>
50
               <xsl:with-param name="entityindex" select="$entityindex"/>
51
            </xsl:call-template>
52
          </xsl:for-each>
53
        </xsl:when>
54
        <xsl:otherwise>
55
          <xsl:call-template name="attributecommon">
56
               <xsl:with-param name="docid" select="$docid"/>
57
               <xsl:with-param name="entitytype" select="$entitytype"/>
58
               <xsl:with-param name="entityindex" select="$entityindex"/>
59
          </xsl:call-template>
60
        </xsl:otherwise>
61
      </xsl:choose>
62
  </table>
63
</xsl:template>
64

    
65

    
66
<xsl:template name="attributecommon">
67
   <xsl:param name="docid"/>
68
   <xsl:param name="entitytype"/>
69
   <xsl:param name="entityindex"/>
70

    
71

    
72
  <!-- First row for attribute name-->
73
  <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Attribute Names</th>
74
  <xsl:for-each select="attribute">
75
    <xsl:choose>
76
         <xsl:when test="references!=''">
77
          <xsl:variable name="ref_id" select="references"/>
78
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
79
          <xsl:for-each select="$references">
80
            <th colspan="1" align="center"  class="bordered"><xsl:value-of select="attributeName"/></th>
81
          </xsl:for-each>
82
        </xsl:when>
83
        <xsl:otherwise>
84
          <th colspan="1" align="center"  class="bordered"><xsl:value-of select="attributeName"/></th>
85
        </xsl:otherwise>
86
     </xsl:choose>
87
  </xsl:for-each>
88
  </tr>
89
  
90
  <!-- Second row for attribute label-->
91
  <tr><th colspan="1" width="{$attributefirstColWidth}" class="bordered" >Label(s) of the Column</th>
92
   <xsl:for-each select="attribute">
93
    <xsl:variable name="stripes">
94
              <xsl:choose>
95
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
96
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
97
              </xsl:choose>
98
    </xsl:variable>
99
    <xsl:choose>
100
         <xsl:when test="references!=''">
101
          <xsl:variable name="ref_id" select="references"/>
102
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
103
          <xsl:for-each select="$references">
104
             <xsl:choose>
105
                <xsl:when test="attributeLabel!=''">
106
                  <td colspan="1" align="center" class="{$stripes}">
107
                     <xsl:for-each select="attributeLabel">
108
                       <xsl:value-of select="."/>
109
                         &#160;<br />
110
                       </xsl:for-each>
111
                  </td>
112
                </xsl:when>
113
                <xsl:otherwise>
114
                   <td colspan="1" align="center" class="{$stripes}">
115
                       &#160;<br />
116
                   </td>
117
                </xsl:otherwise>
118
              </xsl:choose>
119
          </xsl:for-each>
120
        </xsl:when>
121
        <xsl:otherwise>
122
             <xsl:choose>
123
                <xsl:when test="attributeLabel!=''">
124
                  <td colspan="1" align="center" class="{$stripes}">
125
                     <xsl:for-each select="attributeLabel">
126
                       <xsl:value-of select="."/>
127
                         &#160;<br/>
128
                       </xsl:for-each>
129
                  </td>
130
                </xsl:when>
131
                <xsl:otherwise>
132
                   <td colspan="1" align="center" class="{$stripes}">
133
                       &#160;<br />
134
                   </td>
135
                </xsl:otherwise>
136
              </xsl:choose>
137
        </xsl:otherwise>
138
     </xsl:choose>
139
   </xsl:for-each>
140
  </tr>
141
  
142
  <!-- Third row for attribute defination-->
143
  <tr><th colspan="1" width="{$attributefirstColWidth}" class="bordered">Meaning</th>
144
    <xsl:for-each select="attribute">
145
      <xsl:variable name="stripes">
146
              <xsl:choose>
147
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
148
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
149
              </xsl:choose>
150
      </xsl:variable>
151
      <xsl:choose>
152
         <xsl:when test="references!=''">
153
          <xsl:variable name="ref_id" select="references"/>
154
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
155
           <xsl:for-each select="$references">
156
             <td colspan="1" align="center" class="{$stripes}">
157
               <xsl:value-of select="attributeDefinition"/>
158
             </td>
159
           </xsl:for-each>
160
        </xsl:when>
161
        <xsl:otherwise>
162
          <td colspan="1" align="center" class="{$stripes}">
163
             <xsl:value-of select="attributeDefinition"/>
164
          </td>
165
        </xsl:otherwise>
166
     </xsl:choose>    
167
   </xsl:for-each>
168
  </tr>
169
  
170
  <!-- The fourth row for attribute storage type-->
171
   <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Type of Value</th>
172
     <xsl:for-each select="attribute">
173
      <xsl:variable name="stripes">
174
              <xsl:choose>
175
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
176
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
177
              </xsl:choose>
178
      </xsl:variable>
179
      <xsl:choose>
180
         <xsl:when test="references!=''">
181
          <xsl:variable name="ref_id" select="references"/>
182
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
183
          <xsl:for-each select="$references">
184
            <xsl:choose>
185
              <xsl:when test="storageType!=''">
186
                 <td colspan="1" align="center" class="{$stripes}">
187
                    <xsl:for-each select="storageType">
188
                      <xsl:value-of select="."/>
189
                       &#160;<br/>
190
                    </xsl:for-each>
191
                 </td>
192
              </xsl:when>
193
              <xsl:otherwise>
194
                  <td colspan="1" align="center" class="{$stripes}">
195
                       &#160;
196
                   </td>
197
              </xsl:otherwise>
198
            </xsl:choose>
199
          </xsl:for-each>
200
        </xsl:when>
201
        <xsl:otherwise>
202
           <xsl:choose>
203
              <xsl:when test="storageType!=''">
204
                 <td colspan="1" align="center" class="{$stripes}">
205
                    <xsl:for-each select="storageType">
206
                      <xsl:value-of select="."/>
207
                       &#160;<br/>
208
                    </xsl:for-each>
209
                 </td>
210
              </xsl:when>
211
              <xsl:otherwise>
212
                  <td colspan="1" align="center" class="{$stripes}">
213
                       &#160;
214
                   </td>
215
              </xsl:otherwise>
216
            </xsl:choose>
217
        </xsl:otherwise>
218
     </xsl:choose>
219
   </xsl:for-each>
220
  </tr>
221
  
222
  <!-- The fifth row for meaturement type-->
223
  <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Measurement Type</th>
224
   <xsl:for-each select="attribute">
225
    <xsl:variable name="stripes">
226
              <xsl:choose>
227
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
228
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
229
              </xsl:choose>
230
    </xsl:variable>
231
    <xsl:choose>
232
         <xsl:when test="references!=''">
233
          <xsl:variable name="ref_id" select="references"/>
234
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
235
          <xsl:for-each select="$references">
236
            <td colspan="1" align="center" class="{$stripes}">
237
              <xsl:for-each select="measurementScale">
238
                 <xsl:value-of select="local-name(./*)"/>
239
              </xsl:for-each>
240
            </td>
241
         </xsl:for-each>
242
        </xsl:when>
243
        <xsl:otherwise>
244
           <td colspan="1" align="center" class="{$stripes}">
245
              <xsl:for-each select="measurementScale">
246
                 <xsl:value-of select="local-name(./*)"/>
247
              </xsl:for-each>
248
           </td>
249
        </xsl:otherwise>
250
     </xsl:choose>
251
   </xsl:for-each>
252
  </tr>
253
  
254
  <!-- The sixth row for meaturement domain-->
255
  <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Measurement Domain</th>
256
   <xsl:for-each select="attribute">
257
    <xsl:variable name="stripes">
258
              <xsl:choose>
259
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
260
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
261
              </xsl:choose>
262
    </xsl:variable>
263
     <xsl:variable name="innerstripes">
264
              <xsl:choose>
265
                <xsl:when test="position() mod 2 = 0">innercoleven</xsl:when>
266
                <xsl:when test="position() mod 2 = 1">innercolodd</xsl:when>
267
              </xsl:choose>
268
    </xsl:variable>
269
    <xsl:choose>
270
         <xsl:when test="references!=''">
271
          <xsl:variable name="ref_id" select="references"/>
272
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
273
          <xsl:for-each select="$references">
274
            <td colspan="1" align="center" class="{$stripes}">
275
              <xsl:for-each select="measurementScale">
276
                <xsl:call-template name="measurementscale">
277
                    <xsl:with-param name="docid" select="$docid"/>
278
                    <xsl:with-param name="entitytype" select="$entitytype"/>
279
                    <xsl:with-param name="entityindex" select="$entityindex"/>
280
                    <xsl:with-param name="attributeindex" select="position()"/>
281
                    <xsl:with-param name="stripes" select="$innerstripes"/>
282
                </xsl:call-template>
283
              </xsl:for-each>
284
            </td>
285
         </xsl:for-each>
286
        </xsl:when>
287
        <xsl:otherwise>
288
           <td colspan="1" align="center" class="{$stripes}">
289
              <xsl:for-each select="measurementScale">
290
                <xsl:call-template name="measurementscale">
291
                      <xsl:with-param name="docid" select="$docid"/>
292
                      <xsl:with-param name="entitytype" select="$entitytype"/>
293
                      <xsl:with-param name="entityindex" select="$entityindex"/>
294
                      <xsl:with-param name="attributeindex" select="position()"/>
295
                      <xsl:with-param name="stripes" select="$innerstripes"/>
296
                </xsl:call-template>
297
              </xsl:for-each>
298
           </td>
299
        </xsl:otherwise>
300
     </xsl:choose>
301
   </xsl:for-each>
302
  </tr>
303

    
304
 
305
  <!-- The seventh row for missing value code-->
306
  <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Missing Value Code</th>
307
    <xsl:for-each select="attribute">
308
      <xsl:variable name="stripes">
309
              <xsl:choose>
310
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
311
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
312
              </xsl:choose>
313
     </xsl:variable>
314
     <xsl:variable name="innerstripes">
315
              <xsl:choose>
316
                <xsl:when test="position() mod 2 = 0">innercoleven</xsl:when>
317
                <xsl:when test="position() mod 2 = 1">innercolodd</xsl:when>
318
              </xsl:choose>
319
     </xsl:variable>
320
     <xsl:choose>
321
         <xsl:when test="references!=''">
322
          <xsl:variable name="ref_id" select="references"/>
323
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
324
          <xsl:for-each select="$references">
325
            <xsl:choose>
326
              <xsl:when test="missingValueCode!=''">
327
                 <td colspan="1" align="center" class="{$stripes}">
328
                    <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
329
                       <xsl:for-each select="missingValueCode">
330
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Code</b></td>
331
                              <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
332
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Expl</b></td>
333
                               <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
334
                          </tr>
335
                       </xsl:for-each>
336
                   </table>
337
                 </td>
338
              </xsl:when>
339
              <xsl:otherwise>
340
                <td colspan="1" width="{$firstColWidth}" class="{$stripes}">
341
                   &#160;
342
                </td>
343
              </xsl:otherwise>
344
            </xsl:choose>
345
          </xsl:for-each>
346
        </xsl:when>
347
        <xsl:otherwise>
348
           <xsl:choose>
349
              <xsl:when test="missingValueCode!=''">
350
                 <td colspan="1" align="center" class="{$stripes}">
351
                    <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
352
                       <xsl:for-each select="missingValueCode">
353
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Code</b></td>
354
                              <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
355
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Expl</b></td>
356
                               <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
357
                          </tr>
358
                       </xsl:for-each>
359
                   </table>
360
                 </td>
361
              </xsl:when>
362
              <xsl:otherwise>
363
                <td colspan="1" align="center" class="{$stripes}">
364
                   &#160;
365
                </td>
366
              </xsl:otherwise>
367
            </xsl:choose>
368
        </xsl:otherwise>
369
     </xsl:choose>
370
   </xsl:for-each>
371
  </tr>
372
 
373
 
374
  <!-- The eighth row for accuracy report-->
375
  <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Accuracy Report</th>
376
     <xsl:for-each select="attribute">
377
     <xsl:variable name="stripes">
378
         <xsl:choose>
379
             <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
380
             <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
381
         </xsl:choose>
382
    </xsl:variable>
383
    <xsl:choose>
384
         <xsl:when test="references!=''">
385
          <xsl:variable name="ref_id" select="references"/>
386
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
387
          <xsl:for-each select="$references">
388
            <xsl:choose>
389
               <xsl:when test="accuracy!=''">
390
                 <td colspan="1" align="center" class="{$stripes}">
391
                    <xsl:for-each select="accuracy">
392
                          <xsl:value-of select="attributeAccuracyReport"/>
393
                    </xsl:for-each>
394
                 </td>
395
              </xsl:when>
396
              <xsl:otherwise>
397
                <td colspan="1" align="center" class="{$stripes}">
398
                  &#160;   
399
                </td>
400
              </xsl:otherwise>
401
            </xsl:choose>
402
          </xsl:for-each>
403
        </xsl:when>
404
        <xsl:otherwise>
405
           <xsl:choose>
406
               <xsl:when test="accuracy!=''">
407
                 <td colspan="1" align="center" class="{$stripes}">
408
                    <xsl:for-each select="accuracy">
409
                          <xsl:value-of select="attributeAccuracyReport"/>
410
                    </xsl:for-each>
411
                 </td>
412
              </xsl:when>
413
              <xsl:otherwise>
414
                <td colspan="1" align="center" class="{$stripes}">
415
                  &#160;   
416
                </td>
417
              </xsl:otherwise>
418
            </xsl:choose>
419
        </xsl:otherwise>
420
     </xsl:choose>
421
  </xsl:for-each>
422
  </tr>
423
  
424
  <!-- The nineth row for quality accuracy accessment -->
425
  <tr><th colspan="1" width="{$attributefirstColWidth}" class="bordered">Accuracy Assessment</th>
426
     <xsl:for-each select="attribute">
427
     <xsl:variable name="stripes">
428
         <xsl:choose>
429
             <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
430
             <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
431
         </xsl:choose>
432
    </xsl:variable>
433
    <xsl:variable name="innerstripes">
434
              <xsl:choose>
435
                <xsl:when test="position() mod 2 = 0">innercoleven</xsl:when>
436
                <xsl:when test="position() mod 2 = 1">innercolodd</xsl:when>
437
              </xsl:choose>
438
     </xsl:variable>
439
     <xsl:choose>
440
         <xsl:when test="references!=''">
441
          <xsl:variable name="ref_id" select="references"/>
442
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
443
          <xsl:for-each select="$references">
444
            <xsl:choose>
445
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
446
                 <td colspan="1" align="center" class="{$stripes}">
447
                   <xsl:for-each select="accuracy">
448
                     <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
449
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
450
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Value</b></td>
451
                              <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
452
                          </tr>
453
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Expl</b></td>
454
                              <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
455
                          </tr>
456
                      </xsl:for-each>
457
                   </table>
458
                 </xsl:for-each>
459
               </td>
460
             </xsl:when>
461
             <xsl:otherwise>
462
                <td colspan="1" align="center" class="{$stripes}">
463
                  &#160;
464
                </td>
465
             </xsl:otherwise>
466
           </xsl:choose>
467
          </xsl:for-each>
468
        </xsl:when>
469
        <xsl:otherwise>
470
           <xsl:choose>
471
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
472
                 <td colspan="1" align="center" class="{$stripes}">
473
                   <xsl:for-each select="accuracy">
474
                     <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
475
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
476
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Value</b></td>
477
                              <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
478
                          </tr>
479
                          <tr><td width="{$firstColWidth}" class="{$innerstripes}"><b>Expl</b></td>
480
                              <td width="{$secondColWidth}" class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
481
                          </tr>
482
                      </xsl:for-each>
483
                   </table>
484
                 </xsl:for-each>
485
               </td>
486
             </xsl:when>
487
             <xsl:otherwise>
488
                <td colspan="1" align="center" class="{$stripes}">
489
                  &#160;
490
                </td>
491
             </xsl:otherwise>
492
           </xsl:choose>
493
        </xsl:otherwise>
494
     </xsl:choose>
495
  </xsl:for-each>
496
  </tr>
497
  
498
   <!-- The tenth row for coverage-->
499
  <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Coverage</th>
500
   <xsl:for-each select="attribute">
501
    <xsl:variable name="index" select="position()"/>
502
    <xsl:variable name="stripes">
503
              <xsl:choose>
504
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
505
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
506
              </xsl:choose>
507
    </xsl:variable>
508
    <xsl:choose>
509
         <xsl:when test="references!=''">
510
          <xsl:variable name="ref_id" select="references"/>
511
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
512
          <xsl:for-each select="$references">
513
            <xsl:choose>
514
               <xsl:when test="coverage!=''">
515
                  <td colspan="1" align="center" class="{$stripes}">
516
                    <xsl:for-each select="coverage">
517
                      <xsl:call-template name="attributecoverage">
518
                         <xsl:with-param name="docid" select="$docid"/>
519
                         <xsl:with-param name="entitytype" select="$entitytype"/>
520
                         <xsl:with-param name="entityindex" select="$entityindex"/>
521
                         <xsl:with-param name="attributeindex" select="$index"/>
522
                      </xsl:call-template>
523
                    </xsl:for-each>
524
                  </td>
525
               </xsl:when>
526
               <xsl:otherwise>
527
                  <td colspan="1" align="center" class="{$stripes}">
528
                   &#160;
529
                  </td>
530
               </xsl:otherwise>
531
            </xsl:choose>
532
         </xsl:for-each>
533
        </xsl:when>
534
        <xsl:otherwise>
535
          <xsl:choose>
536
               <xsl:when test="coverage!=''">
537
                  <td colspan="1" align="center" class="{$stripes}">
538
                    <xsl:for-each select="coverage">
539
                      <xsl:call-template name="attributecoverage">
540
                         <xsl:with-param name="docid" select="$docid"/>
541
                         <xsl:with-param name="entitytype" select="$entitytype"/>
542
                         <xsl:with-param name="entityindex" select="$entityindex"/>
543
                         <xsl:with-param name="attributeindex" select="$index"/>
544
                      </xsl:call-template>
545
                    </xsl:for-each>
546
                  </td>
547
               </xsl:when>
548
               <xsl:otherwise>
549
                  <td colspan="1" align="center" class="{$stripes}">
550
                   &#160;
551
                  </td>
552
               </xsl:otherwise>
553
            </xsl:choose>
554
        </xsl:otherwise>
555
     </xsl:choose>
556
   </xsl:for-each>
557
  </tr>
558
  
559

    
560
   <!-- The eleventh row for method-->
561
  <tr><th colspan="1" width="{$attributefirstColWidth}"  class="bordered">Method</th>
562
   <xsl:for-each select="attribute">
563
    <xsl:variable name="index" select="position()"/>
564
    <xsl:variable name="stripes">
565
              <xsl:choose>
566
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
567
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
568
              </xsl:choose>
569
    </xsl:variable>
570
    <xsl:choose>
571
         <xsl:when test="references!=''">
572
          <xsl:variable name="ref_id" select="references"/>
573
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
574
          <xsl:for-each select="$references">
575
            <xsl:choose>
576
               <xsl:when test="method!=''">
577
                 <td colspan="1" align="center" class="{$stripes}">
578
                   <xsl:for-each select="method">
579
                     <xsl:call-template name="attributemethod">
580
                       <xsl:with-param name="docid" select="$docid"/>
581
                       <xsl:with-param name="entitytype" select="$entitytype"/>
582
                       <xsl:with-param name="entityindex" select="$entityindex"/>
583
                       <xsl:with-param name="attributeindex" select="$index"/>
584
                     </xsl:call-template>
585
                   </xsl:for-each>
586
                 </td>
587
               </xsl:when>
588
               <xsl:otherwise>
589
                 <td colspan="1" align="center" class="{$stripes}">
590
                   &#160;
591
                 </td>
592
               </xsl:otherwise>
593
            </xsl:choose>
594
         </xsl:for-each>
595
        </xsl:when>
596
        <xsl:otherwise>
597
           <xsl:choose>
598
               <xsl:when test="method!=''">
599
                 <td colspan="1" align="center" class="{$stripes}">
600
                   <xsl:for-each select="method">
601
                     <xsl:call-template name="attributemethod">
602
                       <xsl:with-param name="docid" select="$docid"/>
603
                       <xsl:with-param name="entitytype" select="$entitytype"/>
604
                       <xsl:with-param name="entityindex" select="$entityindex"/>
605
                       <xsl:with-param name="attributeindex" select="$index"/>
606
                     </xsl:call-template>
607
                   </xsl:for-each>
608
                 </td>
609
               </xsl:when>
610
               <xsl:otherwise>
611
                 <td colspan="1" align="center" class="{$stripes}">
612
                   &#160;
613
                 </td>
614
               </xsl:otherwise>
615
            </xsl:choose>
616
        </xsl:otherwise>
617
     </xsl:choose>
618
   </xsl:for-each>
619
  </tr>
620
 </xsl:template>
621
 
622
 <xsl:template name="measurementscale">
623
   <xsl:param name="stripes"/>
624
   <xsl:param name="docid"/>
625
   <xsl:param name="entitytype"/>
626
   <xsl:param name="entityindex"/>
627
   <xsl:param name="attributeindex"/>
628
   <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
629
    <xsl:for-each select="nominal">
630
         <xsl:call-template name="attributenonnumericdomain">
631
               <xsl:with-param name="docid" select="$docid"/>
632
               <xsl:with-param name="entitytype" select="$entitytype"/>
633
               <xsl:with-param name="entityindex" select="$entityindex"/>
634
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
635
               <xsl:with-param name="stripes" select="$stripes"/>
636
       </xsl:call-template>
637
    </xsl:for-each>
638
    <xsl:for-each select="ordinal">
639
       <xsl:call-template name="attributenonnumericdomain">
640
               <xsl:with-param name="docid" select="$docid"/>
641
               <xsl:with-param name="entitytype" select="$entitytype"/>
642
               <xsl:with-param name="entityindex" select="$entityindex"/>
643
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
644
               <xsl:with-param name="stripes" select="$stripes"/>
645
       </xsl:call-template>
646
    </xsl:for-each>
647
    <xsl:for-each select="interval">
648
       <xsl:call-template name="intervalratio">
649
         <xsl:with-param name="stripes" select="$stripes"/>
650
       </xsl:call-template>
651
    </xsl:for-each>
652
    <xsl:for-each select="ratio">
653
       <xsl:call-template name="intervalratio">
654
         <xsl:with-param name="stripes" select="$stripes"/>
655
       </xsl:call-template>
656
    </xsl:for-each>
657
    <xsl:for-each select="datetime">
658
       <xsl:call-template name="datetime">
659
          <xsl:with-param name="stripes" select="$stripes"/>
660
       </xsl:call-template>
661
    </xsl:for-each>
662
   </table>
663
 </xsl:template>
664
 
665
 <xsl:template name="attributenonnumericdomain">
666
   <xsl:param name="stripes"/>
667
   <xsl:param name="docid"/>
668
   <xsl:param name="entitytype"/>
669
   <xsl:param name="entityindex"/>
670
   <xsl:param name="attributeindex"/>
671
   <xsl:for-each select="nonNumericDomain">
672
     <xsl:choose>
673
         <xsl:when test="references!=''">
674
          <xsl:variable name="ref_id" select="references"/>
675
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
676
          <xsl:for-each select="$references">
677
            <xsl:call-template name="attributenonnumericdomaincommon">
678
                <xsl:with-param name="docid" select="$docid"/>
679
                <xsl:with-param name="entitytype" select="$entitytype"/>
680
                <xsl:with-param name="entityindex" select="$entityindex"/>
681
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
682
                <xsl:with-param name="stripes" select="$stripes"/>
683
            </xsl:call-template>
684
         </xsl:for-each>
685
        </xsl:when>
686
        <xsl:otherwise>
687
            <xsl:call-template name="attributenonnumericdomaincommon">
688
               <xsl:with-param name="docid" select="$docid"/>
689
               <xsl:with-param name="entitytype" select="$entitytype"/>
690
               <xsl:with-param name="entityindex" select="$entityindex"/>
691
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
692
               <xsl:with-param name="stripes" select="$stripes"/>
693
            </xsl:call-template>
694
        </xsl:otherwise>
695
     </xsl:choose>
696
   </xsl:for-each>
697
 </xsl:template>
698
 
699
 <xsl:template name="attributenonnumericdomaincommon">
700
    <xsl:param name="stripes"/>
701
    <xsl:param name="docid"/>
702
    <xsl:param name="entitytype"/>
703
    <xsl:param name="entityindex"/>
704
    <xsl:param name="attributeindex"/>
705
    <!-- if numericdomain only has one test domain, 
706
        it will be displayed inline otherwith will be show a link-->
707
    <xsl:choose>
708
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">
709
        <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Def</b></td>
710
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
711
            </td>
712
        </tr>
713
        <xsl:for-each select="textDomain/parttern">
714
          <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Pattern</b></td>
715
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
716
            </td>
717
          </tr>
718
        </xsl:for-each>
719
        <xsl:for-each select="textDomain/source">
720
          <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Source</b></td>
721
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
722
            </td>
723
          </tr>
724
        </xsl:for-each>
725
      </xsl:when>
726
      <xsl:otherwise>
727
         <tr><td colspan="2" align="center" class="{$stripes}" >
728
           <a><xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=attributedomain&amp;entitytype=<xsl:value-of select="$entitytype"/>&amp;entityindex=<xsl:value-of select="$entityindex"/>&amp;attributeindex=<xsl:value-of select="$attributeindex"/></xsl:attribute>
729
           <b>Domain Info</b></a>
730
         </td></tr>
731
      </xsl:otherwise>
732
    </xsl:choose>
733
 </xsl:template>
734
 
735
 <xsl:template name="intervalratio">
736
    <xsl:param name="stripes"/>
737
    <xsl:if test="unit/standardUnit">
738
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Unit</b></td>
739
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
740
            </td>
741
      </tr>
742
    </xsl:if>
743
    <xsl:if test="unit/customUnit">
744
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Unit</b></td>
745
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
746
            </td>
747
      </tr>
748
   </xsl:if>
749
   <xsl:for-each select="precision">
750
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Precision</b></td>
751
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
752
            </td>
753
      </tr>
754
   </xsl:for-each>
755
   <xsl:for-each select="numericDomain">
756
      <xsl:call-template name="numericDomain">
757
         <xsl:with-param name="stripes" select="$stripes"/>
758
      </xsl:call-template>
759
    </xsl:for-each>
760
  </xsl:template>
761
  
762
  
763
 <xsl:template name="numericDomain">
764
     <xsl:param name="stripes"/>
765
       <xsl:choose>
766
         <xsl:when test="references!=''">
767
          <xsl:variable name="ref_id" select="references"/>
768
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
769
          <xsl:for-each select="$references">
770
            <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Type</b></td>
771
                <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="numberType"/>
772
                </td>
773
            </tr>
774
            <xsl:for-each select="bounds">
775
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Min</b></td>
776
                  <td width="{$secondColWidth}" class="{$stripes}">
777
                    <xsl:for-each select="minimum">
778
                      <xsl:value-of select="."/>&#160;
779
                    </xsl:for-each>
780
                  </td>
781
              </tr>
782
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Max</b></td>
783
                  <td width="{$secondColWidth}" class="{$stripes}">
784
                    <xsl:for-each select="maximum">
785
                      <xsl:value-of select="."/>&#160;
786
                    </xsl:for-each>
787
                  </td>
788
              </tr>
789
            </xsl:for-each>
790
          </xsl:for-each>
791
        </xsl:when>
792
        <xsl:otherwise>
793
          <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Type</b></td>
794
                <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="numberType"/>
795
                </td>
796
            </tr>
797
            <xsl:for-each select="bounds">
798
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Min</b></td>
799
                  <td width="{$secondColWidth}" class="{$stripes}">
800
                    <xsl:for-each select="minimum">
801
                      <xsl:value-of select="."/>&#160;
802
                    </xsl:for-each>
803
                  </td>
804
              </tr>
805
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Max</b></td>
806
                  <td width="{$secondColWidth}" class="{$stripes}">
807
                    <xsl:for-each select="maximum">
808
                      <xsl:value-of select="."/>&#160;
809
                    </xsl:for-each>
810
                  </td>
811
              </tr>
812
            </xsl:for-each>
813
        </xsl:otherwise>
814
      </xsl:choose>
815
  </xsl:template>
816
 
817
 <xsl:template name="datetime">
818
    <xsl:param name="stripes"/>
819
    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Format</b></td>
820
         <td width="{$secondColWidth}" class="{$stripes}">
821
            <xsl:value-of select="formatString"/>      
822
         </td>
823
    </tr>
824
     <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Precision</b></td>
825
         <td width="{$secondColWidth}" class="{$stripes}">
826
            <xsl:value-of select="dateTimePrecision"/>        
827
         </td>
828
    </tr>
829
    <xsl:call-template name="timedomain"/>     
830
 </xsl:template>
831
 
832
 
833
 <xsl:template name="timedomain">
834
    <xsl:param name="stripes"/>
835
      <xsl:choose>
836
         <xsl:when test="references!=''">
837
          <xsl:variable name="ref_id" select="references"/>
838
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
839
          <xsl:for-each select="$references">
840
            <xsl:for-each select="bounds">
841
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Min</b></td>
842
                  <td width="{$secondColWidth}" class="{$stripes}">
843
                    <xsl:for-each select="minimum">
844
                      <xsl:value-of select="."/>&#160;
845
                    </xsl:for-each>
846
                  </td>
847
              </tr>
848
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Max</b></td>
849
                  <td width="{$secondColWidth}" class="{$stripes}">
850
                    <xsl:for-each select="maximum">
851
                      <xsl:value-of select="."/>&#160;
852
                    </xsl:for-each>
853
                  </td>
854
              </tr>
855
            </xsl:for-each>
856
          </xsl:for-each>
857
        </xsl:when>
858
        <xsl:otherwise>
859
           <xsl:for-each select="bounds">
860
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Min</b></td>
861
                  <td width="{$secondColWidth}" class="{$stripes}">
862
                    <xsl:for-each select="minimum">
863
                      <xsl:value-of select="."/>&#160;
864
                    </xsl:for-each>
865
                  </td>
866
              </tr>
867
              <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Max</b></td>
868
                  <td width="{$secondColWidth}" class="{$stripes}">
869
                    <xsl:for-each select="maximum">
870
                      <xsl:value-of select="."/>&#160;
871
                    </xsl:for-each>
872
                  </td>
873
              </tr>
874
            </xsl:for-each>
875
        </xsl:otherwise>
876
      </xsl:choose>
877
  </xsl:template>
878
 
879
 <xsl:template name="attributecoverage">
880
    <xsl:param name="docid"/>
881
    <xsl:param name="entitytype"/>
882
    <xsl:param name="entityindex"/>
883
    <xsl:param name="attributeindex"/>
884
     <a><xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=attributecoverage&amp;entitytype=<xsl:value-of select="$entitytype"/>&amp;entityindex=<xsl:value-of select="$entityindex"/>&amp;attributeindex=<xsl:value-of select="$attributeindex"/></xsl:attribute>
885
           <b>Coverage Info</b></a>
886
 </xsl:template>
887
 
888
 <xsl:template name="attributemethod">
889
    <xsl:param name="docid"/>
890
    <xsl:param name="entitytype"/>
891
    <xsl:param name="entityindex"/>
892
    <xsl:param name="attributeindex"/>
893
     <a><xsl:attribute name="href"><xsl:value-of select="$tripleURI"/><xsl:value-of select="$docid"/>&amp;displaymodule=attributemethod&amp;entitytype=<xsl:value-of select="$entitytype"/>&amp;entityindex=<xsl:value-of select="$entityindex"/>&amp;attributeindex=<xsl:value-of select="$attributeindex"/></xsl:attribute>
894
           <b>Method Info</b></a>
895
 </xsl:template>
896

    
897
</xsl:stylesheet>
(5-5/30)