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-06-30 18:44:43 -0700 (Mon, 30 Jun 2003) $'
10
  * '$Revision: 1707 $'
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" valign="center" align="center" 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" align="center"  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
             <td colspan="1" align="center" class="{$stripes}">
105
                 <xsl:for-each select="attributeLabel">
106
                   <xsl:value-of select="."/>
107
                    &#160;<br />
108
                </xsl:for-each>
109
              </td>
110
          </xsl:for-each>
111
        </xsl:when>
112
        <xsl:otherwise>
113
             <td colspan="1" align="center" class="{$stripes}">
114
                 <xsl:for-each select="attributeLabel">
115
                   <xsl:value-of select="."/>
116
                    &#160;<br />
117
                </xsl:for-each>
118
             </td>
119
        </xsl:otherwise>
120
     </xsl:choose>
121
   </xsl:for-each>
122
  </tr>
123
  
124
  <!-- Third row for attribute defination-->
125
  <tr><th colspan="1" align="center"  class="bordered">Meaning</th>
126
    <xsl:for-each select="attribute">
127
      <xsl:variable name="stripes">
128
              <xsl:choose>
129
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
130
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
131
              </xsl:choose>
132
      </xsl:variable>
133
      <xsl:choose>
134
         <xsl:when test="references!=''">
135
          <xsl:variable name="ref_id" select="references"/>
136
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
137
           <xsl:for-each select="$references">
138
             <td colspan="1" align="center" class="{$stripes}">
139
               <xsl:value-of select="attributeDefinition"/>
140
             </td>
141
           </xsl:for-each>
142
        </xsl:when>
143
        <xsl:otherwise>
144
          <td colspan="1" align="center" class="{$stripes}">
145
             <xsl:value-of select="attributeDefinition"/>
146
          </td>
147
        </xsl:otherwise>
148
     </xsl:choose>    
149
   </xsl:for-each>
150
  </tr>
151
  
152
  <!-- The fourth row for attribute storage type-->
153
   <tr><th colspan="1" align="center"  class="bordered">Type of Value</th>
154
     <xsl:for-each select="attribute">
155
      <xsl:variable name="stripes">
156
              <xsl:choose>
157
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
158
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
159
              </xsl:choose>
160
      </xsl:variable>
161
      <xsl:choose>
162
         <xsl:when test="references!=''">
163
          <xsl:variable name="ref_id" select="references"/>
164
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
165
          <xsl:for-each select="$references">
166
            <td colspan="1" align="center" class="{$stripes}">
167
              <xsl:value-of select="storageType"/>
168
            </td>
169
          </xsl:for-each>
170
        </xsl:when>
171
        <xsl:otherwise>
172
           <td colspan="1" align="center" class="{$stripes}">
173
             <xsl:value-of select="storageType"/>
174
           </td>
175
        </xsl:otherwise>
176
     </xsl:choose>
177
   </xsl:for-each>
178
  </tr>
179
  
180
  <!-- The fifth row for meaturement type-->
181
  <tr><th colspan="1" align="center"  class="bordered">Measurement Type</th>
182
   <xsl:for-each select="attribute">
183
    <xsl:variable name="stripes">
184
              <xsl:choose>
185
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
186
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
187
              </xsl:choose>
188
    </xsl:variable>
189
    <xsl:choose>
190
         <xsl:when test="references!=''">
191
          <xsl:variable name="ref_id" select="references"/>
192
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
193
          <xsl:for-each select="$references">
194
            <td colspan="1" align="center" class="{$stripes}">
195
              <xsl:for-each select="measurementScale">
196
                 <xsl:value-of select="local-name(./*)"/>
197
              </xsl:for-each>
198
            </td>
199
         </xsl:for-each>
200
        </xsl:when>
201
        <xsl:otherwise>
202
           <td colspan="1" align="center" class="{$stripes}">
203
              <xsl:for-each select="measurementScale">
204
                 <xsl:value-of select="local-name(./*)"/>
205
              </xsl:for-each>
206
           </td>
207
        </xsl:otherwise>
208
     </xsl:choose>
209
   </xsl:for-each>
210
  </tr>
211
  
212
  <!-- The sixth row for meaturement domain-->
213
  <tr><th colspan="1" align="center"  class="bordered">Measurement Domain</th>
214
   <xsl:for-each select="attribute">
215
    <xsl:variable name="stripes">
216
              <xsl:choose>
217
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
218
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
219
              </xsl:choose>
220
    </xsl:variable>
221
    <xsl:choose>
222
         <xsl:when test="references!=''">
223
          <xsl:variable name="ref_id" select="references"/>
224
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
225
          <xsl:for-each select="$references">
226
            <td colspan="1" align="center" class="{$stripes}">
227
              <xsl:for-each select="measurementScale">
228
                <xsl:call-template name="measurementscale">
229
                    <xsl:with-param name="docid" select="$docid"/>
230
                    <xsl:with-param name="entitytype" select="$entitytype"/>
231
                    <xsl:with-param name="entityindex" select="$entityindex"/>
232
                    <xsl:with-param name="attributeindex" select="position()"/>
233
                    <xsl:with-param name="stripes" select="$stripes"/>
234
                </xsl:call-template>
235
              </xsl:for-each>
236
            </td>
237
         </xsl:for-each>
238
        </xsl:when>
239
        <xsl:otherwise>
240
           <td colspan="1" align="center" class="{$stripes}">
241
              <xsl:for-each select="measurementScale">
242
                <xsl:call-template name="measurementscale">
243
                      <xsl:with-param name="docid" select="$docid"/>
244
                      <xsl:with-param name="entitytype" select="$entitytype"/>
245
                      <xsl:with-param name="entityindex" select="$entityindex"/>
246
                      <xsl:with-param name="attributeindex" select="position()"/>
247
                      <xsl:with-param name="stripes" select="$stripes"/>
248
                </xsl:call-template>
249
              </xsl:for-each>
250
           </td>
251
        </xsl:otherwise>
252
     </xsl:choose>
253
   </xsl:for-each>
254
  </tr>
255

    
256
 
257
  <!-- The seventh row for missing value code-->
258
  <tr><th colspan="1" align="center"  class="bordered">Missing Value Code</th>
259
    <xsl:for-each select="attribute">
260
      <xsl:variable name="stripes">
261
         <xsl:choose>
262
            <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
263
            <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
264
         </xsl:choose>
265
     </xsl:variable>
266
     <xsl:choose>
267
         <xsl:when test="references!=''">
268
          <xsl:variable name="ref_id" select="references"/>
269
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
270
          <xsl:for-each select="$references">
271
            <td colspan="1" align="center" class="{$stripes}">
272
              <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
273
                <xsl:for-each select="missingValueCode">
274
                 <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Code</b></td>
275
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="code"/></td></tr>
276
                  <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
277
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="codeExplanation"/></td>
278
                  </tr>
279
               </xsl:for-each>
280
             </table>
281
            </td>
282
          </xsl:for-each>
283
        </xsl:when>
284
        <xsl:otherwise>
285
           <td colspan="1" align="center" class="{$stripes}">
286
             <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
287
                <xsl:for-each select="missingValueCode">
288
                 <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Code</b></td>
289
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="code"/></td></tr>
290
                  <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
291
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="codeExplanation"/></td>
292
                  </tr>
293
               </xsl:for-each>
294
             </table>
295
          </td>
296
        </xsl:otherwise>
297
     </xsl:choose>
298
   </xsl:for-each>
299
  </tr>
300
 
301
 
302
  <!-- The eighth row for accuracy report-->
303
  <tr><th colspan="1" align="center"  class="bordered">Accuracy Report</th>
304
     <xsl:for-each select="attribute">
305
     <xsl:variable name="stripes">
306
         <xsl:choose>
307
             <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
308
             <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
309
         </xsl:choose>
310
    </xsl:variable>
311
    <xsl:choose>
312
         <xsl:when test="references!=''">
313
          <xsl:variable name="ref_id" select="references"/>
314
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
315
          <xsl:for-each select="$references">
316
            <td colspan="1" align="center" class="{$stripes}">
317
              <xsl:for-each select="accuracy">
318
                <xsl:value-of select="attributeAccuracyReport"/>
319
              </xsl:for-each>
320
            </td>
321
          </xsl:for-each>
322
        </xsl:when>
323
        <xsl:otherwise>
324
           <td colspan="1" align="center" class="{$stripes}">
325
              <xsl:for-each select="accuracy">
326
                <xsl:value-of select="attributeAccuracyReport"/>
327
             </xsl:for-each>
328
           </td>
329
        </xsl:otherwise>
330
     </xsl:choose>
331
  </xsl:for-each>
332
  </tr>
333
  
334
  <!-- The nineth row for quality accuracy accessment -->
335
  <tr><th colspan="1" align="center"  class="bordered">Accuracy Assessment</th>
336
     <xsl:for-each select="attribute">
337
     <xsl:variable name="stripes">
338
         <xsl:choose>
339
             <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
340
             <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
341
         </xsl:choose>
342
    </xsl:variable>
343
    <xsl:choose>
344
         <xsl:when test="references!=''">
345
          <xsl:variable name="ref_id" select="references"/>
346
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
347
          <xsl:for-each select="$references">
348
            <td colspan="1" align="center" class="{$stripes}">
349
              <xsl:for-each select="accuracy">
350
               <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
351
                  <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
352
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Value</b></td>
353
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
354
                    </tr>
355
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
356
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
357
                    </tr>
358
                  </xsl:for-each>
359
               </table>
360
             </xsl:for-each>
361
            </td>
362
          </xsl:for-each>
363
        </xsl:when>
364
        <xsl:otherwise>
365
           <td colspan="1" align="center" class="{$stripes}">
366
              <xsl:for-each select="accuracy">
367
                 <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
368
                   <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
369
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Value</b></td>
370
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
371
                    </tr>
372
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
373
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
374
                    </tr>
375
                  </xsl:for-each>
376
                </table>
377
             </xsl:for-each>
378
           </td>
379
        </xsl:otherwise>
380
     </xsl:choose>
381
  </xsl:for-each>
382
  </tr>
383
  
384
   <!-- The tenth row for coverage-->
385
  <tr><th colspan="1" align="center"  class="bordered">Coverage</th>
386
   <xsl:for-each select="attribute">
387
    <xsl:variable name="stripes">
388
              <xsl:choose>
389
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
390
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
391
              </xsl:choose>
392
    </xsl:variable>
393
    <xsl:choose>
394
         <xsl:when test="references!=''">
395
          <xsl:variable name="ref_id" select="references"/>
396
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
397
          <xsl:for-each select="$references">
398
            <td colspan="1" align="center" class="{$stripes}">
399
              <xsl:for-each select="coverage">
400
                <xsl:call-template name="attributecoverage"/>
401
              </xsl:for-each>
402
            </td>
403
         </xsl:for-each>
404
        </xsl:when>
405
        <xsl:otherwise>
406
           <td colspan="1" align="center" class="{$stripes}">
407
              <xsl:for-each select="coverage">
408
                <xsl:call-template name="attributecoverage">
409
                    <xsl:with-param name="docid" select="$docid"/>
410
                    <xsl:with-param name="entitytype" select="$entitytype"/>
411
                    <xsl:with-param name="entityindex" select="$entityindex"/>
412
                    <xsl:with-param name="attributeindex" select="position()"/>
413
                </xsl:call-template>
414
              </xsl:for-each>
415
           </td>
416
        </xsl:otherwise>
417
     </xsl:choose>
418
   </xsl:for-each>
419
  </tr>
420
  
421

    
422
   <!-- The eleventh row for method-->
423
  <tr><th colspan="1" align="center"  class="bordered">Method</th>
424
   <xsl:for-each select="attribute">
425
    <xsl:variable name="stripes">
426
              <xsl:choose>
427
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
428
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
429
              </xsl:choose>
430
    </xsl:variable>
431
    <xsl:choose>
432
         <xsl:when test="references!=''">
433
          <xsl:variable name="ref_id" select="references"/>
434
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
435
          <xsl:for-each select="$references">
436
            <td colspan="1" align="center" class="{$stripes}">
437
              <xsl:for-each select="method">
438
                <xsl:call-template name="attributemethod"/>
439
              </xsl:for-each>
440
            </td>
441
         </xsl:for-each>
442
        </xsl:when>
443
        <xsl:otherwise>
444
           <td colspan="1" align="center" class="{$stripes}">
445
              <xsl:for-each select="method">
446
                <xsl:call-template name="attributemethod">
447
                    <xsl:with-param name="docid" select="$docid"/>
448
                    <xsl:with-param name="entitytype" select="$entitytype"/>
449
                    <xsl:with-param name="entityindex" select="$entityindex"/>
450
                    <xsl:with-param name="attributeindex" select="position()"/>
451
                </xsl:call-template>
452
              </xsl:for-each>
453
           </td>
454
        </xsl:otherwise>
455
     </xsl:choose>
456
   </xsl:for-each>
457
  </tr>
458
 </xsl:template>
459
 
460
 <xsl:template name="measurementscale">
461
   <xsl:param name="stripes"/>
462
   <xsl:param name="docid"/>
463
   <xsl:param name="entitytype"/>
464
   <xsl:param name="entityindex"/>
465
   <xsl:param name="attributeindex"/>
466
   <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
467
    <xsl:for-each select="nominal">
468
         <xsl:call-template name="attributenonnumericdomain">
469
               <xsl:with-param name="docid" select="$docid"/>
470
               <xsl:with-param name="entitytype" select="$entitytype"/>
471
               <xsl:with-param name="entityindex" select="$entityindex"/>
472
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
473
               <xsl:with-param name="stripes" select="$stripes"/>
474
       </xsl:call-template>
475
    </xsl:for-each>
476
    <xsl:for-each select="ordinal">
477
       <xsl:call-template name="attributenonnumericdomain">
478
               <xsl:with-param name="docid" select="$docid"/>
479
               <xsl:with-param name="entitytype" select="$entitytype"/>
480
               <xsl:with-param name="entityindex" select="$entityindex"/>
481
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
482
               <xsl:with-param name="stripes" select="$stripes"/>
483
       </xsl:call-template>
484
    </xsl:for-each>
485
    <xsl:for-each select="interval">
486
       <xsl:call-template name="intervalratio">
487
         <xsl:with-param name="stripes" select="$stripes"/>
488
       </xsl:call-template>
489
    </xsl:for-each>
490
    <xsl:for-each select="ratio">
491
       <xsl:call-template name="intervalratio">
492
         <xsl:with-param name="stripes" select="$stripes"/>
493
       </xsl:call-template>
494
    </xsl:for-each>
495
    <xsl:for-each select="datetime">
496
       <xsl:call-template name="datetime">
497
          <xsl:with-param name="stripes" select="$stripes"/>
498
       </xsl:call-template>
499
    </xsl:for-each>
500
   </table>
501
 </xsl:template>
502
 
503
 <xsl:template name="attributenonnumericdomain">
504
   <xsl:param name="stripes"/>
505
   <xsl:param name="docid"/>
506
   <xsl:param name="entitytype"/>
507
   <xsl:param name="entityindex"/>
508
   <xsl:param name="attributeindex"/>
509
   <xsl:for-each select="nonNumericDomain">
510
     <xsl:choose>
511
         <xsl:when test="references!=''">
512
          <xsl:variable name="ref_id" select="references"/>
513
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
514
          <xsl:for-each select="$references">
515
            <xsl:call-template name="attributenonnumericdomaincommon">
516
                <xsl:with-param name="docid" select="$docid"/>
517
                <xsl:with-param name="entitytype" select="$entitytype"/>
518
                <xsl:with-param name="entityindex" select="$entityindex"/>
519
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
520
                <xsl:with-param name="stripes" select="$stripes"/>
521
            </xsl:call-template>
522
         </xsl:for-each>
523
        </xsl:when>
524
        <xsl:otherwise>
525
            <xsl:call-template name="attributenonnumericdomaincommon">
526
               <xsl:with-param name="docid" select="$docid"/>
527
               <xsl:with-param name="entitytype" select="$entitytype"/>
528
               <xsl:with-param name="entityindex" select="$entityindex"/>
529
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
530
               <xsl:with-param name="stripes" select="$stripes"/>
531
            </xsl:call-template>
532
        </xsl:otherwise>
533
     </xsl:choose>
534
   </xsl:for-each>
535
 </xsl:template>
536
 
537
 <xsl:template name="attributenonnumericdomaincommon">
538
    <xsl:param name="stripes"/>
539
    <xsl:param name="docid"/>
540
    <xsl:param name="entitytype"/>
541
    <xsl:param name="entityindex"/>
542
    <xsl:param name="attributeindex"/>
543
    <!-- if numericdomain only has one test domain, 
544
        it will be displayed inline otherwith will be show a link-->
545
    <xsl:choose>
546
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">
547
        <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Definition</b></td>
548
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
549
            </td>
550
        </tr>
551
        <xsl:for-each select="textDomain/parttern">
552
          <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Pattern</b></td>
553
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
554
            </td>
555
          </tr>
556
        </xsl:for-each>
557
        <xsl:for-each select="textDomain/source">
558
          <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Source</b></td>
559
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
560
            </td>
561
          </tr>
562
        </xsl:for-each>
563
      </xsl:when>
564
      <xsl:otherwise>
565
         <tr><td colspan="2" align="center" class="{$stripes}" >
566
           <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>
567
           <b>Domain Info</b></a>
568
         </td></tr>
569
      </xsl:otherwise>
570
    </xsl:choose>
571
 </xsl:template>
572
 
573
 <xsl:template name="intervalratio">
574
    <xsl:param name="stripes"/>
575
    <xsl:if test="unit/standardUnit">
576
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Unit</b></td>
577
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
578
            </td>
579
      </tr>
580
    </xsl:if>
581
    <xsl:if test="unit/customUnit">
582
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Unit</b></td>
583
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
584
            </td>
585
      </tr>
586
   </xsl:if>
587
   <xsl:for-each select="precision">
588
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Precision</b></td>
589
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
590
            </td>
591
      </tr>
592
   </xsl:for-each>
593
   <xsl:for-each select="numericDomain">
594
       <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Numeric</b></td>
595
            <td width="{$secondColWidth}" class="{$stripes}">
596
             <xsl:call-template name="numericDomain">
597
               <xsl:with-param name="stripes" select="$stripes"/>
598
             </xsl:call-template>
599
          </td>
600
      </tr>
601
   </xsl:for-each>
602
  </xsl:template>
603
  
604
  
605
 <xsl:template name="numericDomain">
606
     <xsl:param name="stripes"/>
607
     <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
608
        <xsl:choose>
609
         <xsl:when test="references!=''">
610
          <xsl:variable name="ref_id" select="references"/>
611
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
612
          <xsl:for-each select="$references">
613
            <tr><td width="{$firstColWidth}" class="{$stripes}">Type</td>
614
                <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="numberType"/>
615
                </td>
616
            </tr>
617
            <xsl:for-each select="bounds">
618
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
619
                  <td width="{$secondColWidth}" class="{$stripes}">
620
                    <xsl:for-each select="minimum">
621
                      <xsl:value-of select="."/>&#160;
622
                    </xsl:for-each>
623
                  </td>
624
              </tr>
625
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
626
                  <td width="{$secondColWidth}" class="{$stripes}">
627
                    <xsl:for-each select="maximum">
628
                      <xsl:value-of select="."/>&#160;
629
                    </xsl:for-each>
630
                  </td>
631
              </tr>
632
            </xsl:for-each>
633
          </xsl:for-each>
634
        </xsl:when>
635
        <xsl:otherwise>
636
          <tr><td width="{$firstColWidth}" class="{$stripes}">Type</td>
637
                <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="numberType"/>
638
                </td>
639
            </tr>
640
            <xsl:for-each select="bounds">
641
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
642
                  <td width="{$secondColWidth}" class="{$stripes}">
643
                    <xsl:for-each select="minimum">
644
                      <xsl:value-of select="."/>&#160;
645
                    </xsl:for-each>
646
                  </td>
647
              </tr>
648
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
649
                  <td width="{$secondColWidth}" class="{$stripes}">
650
                    <xsl:for-each select="maximum">
651
                      <xsl:value-of select="."/>&#160;
652
                    </xsl:for-each>
653
                  </td>
654
              </tr>
655
            </xsl:for-each>
656
        </xsl:otherwise>
657
      </xsl:choose>
658
  </table>
659
 </xsl:template>
660
 
661
 <xsl:template name="datetime">
662
    <xsl:param name="stripes"/>
663
    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Format</b></td>
664
         <td width="{$secondColWidth}" class="{$stripes}">
665
            <xsl:value-of select="formatString"/>      
666
         </td>
667
    </tr>
668
     <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Precision</b></td>
669
         <td width="{$secondColWidth}" class="{$stripes}">
670
            <xsl:value-of select="dateTimePrecision"/>        
671
         </td>
672
    </tr>
673
     <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Domain</b></td>
674
         <td width="{$secondColWidth}" class="{$stripes}">
675
           <xsl:call-template name="timedomain"/>     
676
         </td>
677
    </tr>
678
 </xsl:template>
679
 
680
 
681
 <xsl:template name="timedomain">
682
    <xsl:param name="stripes"/>
683
    <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
684
        <xsl:choose>
685
         <xsl:when test="references!=''">
686
          <xsl:variable name="ref_id" select="references"/>
687
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
688
          <xsl:for-each select="$references">
689
            <xsl:for-each select="bounds">
690
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
691
                  <td width="{$secondColWidth}" class="{$stripes}">
692
                    <xsl:for-each select="minimum">
693
                      <xsl:value-of select="."/>&#160;
694
                    </xsl:for-each>
695
                  </td>
696
              </tr>
697
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
698
                  <td width="{$secondColWidth}" class="{$stripes}">
699
                    <xsl:for-each select="maximum">
700
                      <xsl:value-of select="."/>&#160;
701
                    </xsl:for-each>
702
                  </td>
703
              </tr>
704
            </xsl:for-each>
705
          </xsl:for-each>
706
        </xsl:when>
707
        <xsl:otherwise>
708
           <xsl:for-each select="bounds">
709
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
710
                  <td width="{$secondColWidth}" class="{$stripes}">
711
                    <xsl:for-each select="minimum">
712
                      <xsl:value-of select="."/>&#160;
713
                    </xsl:for-each>
714
                  </td>
715
              </tr>
716
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
717
                  <td width="{$secondColWidth}" class="{$stripes}">
718
                    <xsl:for-each select="maximum">
719
                      <xsl:value-of select="."/>&#160;
720
                    </xsl:for-each>
721
                  </td>
722
              </tr>
723
            </xsl:for-each>
724
        </xsl:otherwise>
725
      </xsl:choose>
726
  </table>
727
 </xsl:template>
728
 
729
 <xsl:template name="attributecoverage">
730
    <xsl:param name="docid"/>
731
    <xsl:param name="entitytype"/>
732
    <xsl:param name="entityindex"/>
733
    <xsl:param name="attributeindex"/>
734
     <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>
735
           <b>Coverage Info</b></a>
736
 </xsl:template>
737
 
738
 <xsl:template name="attributemethod">
739
    <xsl:param name="docid"/>
740
    <xsl:param name="entitytype"/>
741
    <xsl:param name="entityindex"/>
742
    <xsl:param name="attributeindex"/>
743
     <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>
744
           <b>Coverage Info</b></a>
745
 </xsl:template>
746

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