Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile: eml-attribute-2.0.0.xsl,v $'
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: cjones $'
9
  *     '$Date: 2004/10/05 23:50:34 $'
10
  * '$Revision: 1.1 $'
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
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
36
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
37
              indent="yes" />  
38

    
39
<xsl:template name="attributelist">
40
   <xsl:param name="docid"/>
41
   <xsl:param name="entitytype"/>
42
   <xsl:param name="entityindex"/>
43

    
44
   <table class="{$tabledefaultStyle}">
45
        <xsl:choose>
46
         <xsl:when test="references!=''">
47
          <xsl:variable name="ref_id" select="references"/>
48
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
49
          <xsl:for-each select="$references">
50
            <xsl:call-template name="attributecommon">
51
               <xsl:with-param name="docid" select="$docid"/>
52
               <xsl:with-param name="entitytype" select="$entitytype"/>
53
               <xsl:with-param name="entityindex" select="$entityindex"/>
54
            </xsl:call-template>
55
          </xsl:for-each>
56
        </xsl:when>
57
        <xsl:otherwise>
58
          <xsl:call-template name="attributecommon">
59
               <xsl:with-param name="docid" select="$docid"/>
60
               <xsl:with-param name="entitytype" select="$entitytype"/>
61
               <xsl:with-param name="entityindex" select="$entityindex"/>
62
          </xsl:call-template>
63
        </xsl:otherwise>
64
      </xsl:choose>
65
  </table>
66
</xsl:template>
67

    
68

    
69
<xsl:template name="attributecommon">
70
   <xsl:param name="docid"/>
71
   <xsl:param name="entitytype"/>
72
   <xsl:param name="entityindex"/>
73

    
74

    
75
  <!-- First row for headers (attributeLabel) the pretty one. Element is optional,
76
   so could be empty. -->
77
  <!-- upper left cell has nbsp -->
78
   <tr><th>&#160;</th>
79
   <xsl:for-each select="attribute">
80
    <xsl:choose>
81
         <xsl:when test="references!=''">
82
          <xsl:variable name="ref_id" select="references"/>
83
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
84
          <xsl:for-each select="$references">
85
            <th><xsl:value-of select="attributeLabel"/></th>
86
          </xsl:for-each>
87
        </xsl:when>
88
        <xsl:otherwise>
89
          <th><xsl:value-of select="attributeLabel"/></th>
90
        </xsl:otherwise>
91
     </xsl:choose>
92
  </xsl:for-each>
93
 </tr>
94

    
95
  
96
  
97

    
98
  <!-- Second row for attribute label, the ugly one, element required -->
99
   <tr><th class="rowodd">Column Name</th>
100
  <xsl:for-each select="attribute">
101
    <xsl:variable name="stripes">
102
              <xsl:choose>
103
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
104
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
105
              </xsl:choose>
106
    </xsl:variable>
107
    <xsl:choose>
108
         <xsl:when test="references!=''">
109
          <xsl:variable name="ref_id" select="references"/>
110
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
111
          <xsl:for-each select="$references">
112
             <xsl:choose>
113
                <xsl:when test="attributeName!=''">
114
                  <td colspan="1" align="center" class="{$stripes}">
115
                     <xsl:for-each select="attributeName">
116
                       <xsl:value-of select="."/>
117
                         &#160;<br />
118
                       </xsl:for-each>
119
                  </td>
120
                </xsl:when>
121
                <xsl:otherwise>
122
                   <td colspan="1" align="center" class="{$stripes}">
123
                       &#160;<br />
124
                   </td>
125
                </xsl:otherwise>
126
              </xsl:choose>
127
          </xsl:for-each>
128
        </xsl:when>
129
        <xsl:otherwise>
130
             <xsl:choose>
131
                <xsl:when test="attributeName!=''">
132
                  <td colspan="1" align="center" class="{$stripes}">
133
                     <xsl:for-each select="attributeName">
134
                       <xsl:value-of select="."/>
135
                         &#160;<br/>
136
                       </xsl:for-each>
137
                  </td>
138
                </xsl:when>
139
                <xsl:otherwise>
140
                   <td colspan="1" align="center" class="{$stripes}">
141
                       &#160;<br />
142
                   </td>
143
                </xsl:otherwise>
144
              </xsl:choose>
145
        </xsl:otherwise>
146
     </xsl:choose>
147
   </xsl:for-each>
148
  </tr>
149
  
150
  
151

    
152
  <!-- Third row for attribute defination-->
153
  <tr><th class="rowodd">Definition</th>
154
    <xsl:for-each select="attribute">
155
      <xsl:variable name="stripes">
156
              <xsl:choose>
157
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
158
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></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="attributeDefinition"/>
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="attributeDefinition"/>
174
          </td>
175
        </xsl:otherwise>
176
     </xsl:choose>
177
   </xsl:for-each>
178
  </tr>
179

    
180
  <!-- The fourth row for attribute storage type-->
181
   <tr><th class="rowodd">Type of Value</th>
182
     <xsl:for-each select="attribute">
183
      <xsl:variable name="stripes">
184
              <xsl:choose>
185
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
186
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></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
            <xsl:choose>
195
              <xsl:when test="storageType!=''">
196
                 <td colspan="1" align="center" class="{$stripes}">
197
                    <xsl:for-each select="storageType">
198
                      <xsl:value-of select="."/>
199
                       &#160;<br/>
200
                    </xsl:for-each>
201
                 </td>
202
              </xsl:when>
203
              <xsl:otherwise>
204
                  <td colspan="1" align="center" class="{$stripes}">
205
                       &#160;
206
                   </td>
207
              </xsl:otherwise>
208
            </xsl:choose>
209
          </xsl:for-each>
210
        </xsl:when>
211
        <xsl:otherwise>
212
           <xsl:choose>
213
              <xsl:when test="storageType!=''">
214
                 <td colspan="1" align="center" class="{$stripes}">
215
                    <xsl:for-each select="storageType">
216
                      <xsl:value-of select="."/>
217
                       &#160;<br/>
218
                    </xsl:for-each>
219
                 </td>
220
              </xsl:when>
221
              <xsl:otherwise>
222
                  <td colspan="1" align="center" class="{$stripes}">
223
                       &#160;
224
                   </td>
225
              </xsl:otherwise>
226
            </xsl:choose>
227
        </xsl:otherwise>
228
     </xsl:choose>
229
   </xsl:for-each>
230
  </tr>
231

    
232
  <!-- The fifth row for meaturement type-->
233
  <tr><th class="rowodd">Measurement Type</th>
234
   <xsl:for-each select="attribute">
235
    <xsl:variable name="stripes">
236
              <xsl:choose>
237
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
238
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
239
              </xsl:choose>
240
    </xsl:variable>
241
    <xsl:choose>
242
         <xsl:when test="references!=''">
243
          <xsl:variable name="ref_id" select="references"/>
244
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
245
          <xsl:for-each select="$references">
246
            <td colspan="1" align="center" class="{$stripes}">
247
              <xsl:for-each select="measurementScale">
248
                 <xsl:value-of select="local-name(./*)"/>
249
              </xsl:for-each>
250
            </td>
251
         </xsl:for-each>
252
        </xsl:when>
253
        <xsl:otherwise>
254
           <td colspan="1" align="center" class="{$stripes}">
255
              <xsl:for-each select="measurementScale">
256
                 <xsl:value-of select="local-name(./*)"/>
257
              </xsl:for-each>
258
           </td>
259
        </xsl:otherwise>
260
     </xsl:choose>
261
   </xsl:for-each>
262
  </tr>
263

    
264
  <!-- The sixth row for meaturement domain-->
265
  <tr><th class="rowodd">Measurement Domain</th>
266
   <xsl:for-each select="attribute">
267
       <!-- mob added, pass this index to measurementscale, not position. should move this earlier? -->
268
   <xsl:variable name="attributeindex" select="position()"/>
269
   <xsl:variable name="stripes">
270
              <xsl:choose>
271
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
272
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
273
              </xsl:choose>
274
    </xsl:variable>
275
     <xsl:variable name="innerstripes">
276
              <xsl:choose>
277
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
278
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
279
              </xsl:choose>
280
    </xsl:variable>
281
    <xsl:choose>
282
         <xsl:when test="references!=''">
283
          <xsl:variable name="ref_id" select="references"/>
284
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
285
          <xsl:for-each select="$references">
286
            <td colspan="1" align="center" class="{$stripes}">
287
              <xsl:for-each select="measurementScale">
288
                <xsl:call-template name="measurementscale">
289
                    <xsl:with-param name="docid" select="$docid"/>
290
                    <xsl:with-param name="entitytype" select="$entitytype"/>
291
                    <xsl:with-param name="entityindex" select="$entityindex"/>
292
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
293
                    <xsl:with-param name="stripes" select="$innerstripes"/>
294
                </xsl:call-template>
295
              </xsl:for-each>
296
            </td>
297
         </xsl:for-each>
298
        </xsl:when>
299
        <xsl:otherwise>
300
           <td colspan="1" align="center" class="{$stripes}">
301
              <xsl:for-each select="measurementScale">
302
                <xsl:call-template name="measurementscale">
303
                      <xsl:with-param name="docid" select="$docid"/>
304
                      <xsl:with-param name="entitytype" select="$entitytype"/>
305
                      <xsl:with-param name="entityindex" select="$entityindex"/>
306
                      <xsl:with-param name="attributeindex" select="$attributeindex"/>
307
                      <xsl:with-param name="stripes" select="$innerstripes"/>
308
                </xsl:call-template>
309
              </xsl:for-each>
310
           </td>
311
        </xsl:otherwise>
312
     </xsl:choose>
313
   </xsl:for-each>
314
  </tr>
315

    
316

    
317
  <!-- The seventh row for missing value code-->
318
  <tr><th class="rowodd">Missing Value Code</th>
319
    <xsl:for-each select="attribute">
320
      <xsl:variable name="stripes">
321
              <xsl:choose>
322
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
323
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
324
              </xsl:choose>
325
     </xsl:variable>
326
     <xsl:variable name="innerstripes">
327
              <xsl:choose>
328
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
329
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
330
              </xsl:choose>
331
     </xsl:variable>
332
     <xsl:choose>
333
         <xsl:when test="references!=''">
334
          <xsl:variable name="ref_id" select="references"/>
335
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
336
          <xsl:for-each select="$references">
337
            <xsl:choose>
338
              <xsl:when test="missingValueCode!=''">
339
                 <td colspan="1" align="center" class="{$stripes}">
340
                    <table>
341
                       <xsl:for-each select="missingValueCode">
342
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
343
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
344
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
345
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
346
                          </tr>
347
                       </xsl:for-each>
348
                   </table>
349
                 </td>
350
              </xsl:when>
351
              <xsl:otherwise>
352
                <td colspan="1" class="{$stripes}">
353
                   &#160;
354
                </td>
355
              </xsl:otherwise>
356
            </xsl:choose>
357
          </xsl:for-each>
358
        </xsl:when>
359
        <xsl:otherwise>
360
           <xsl:choose>
361
              <xsl:when test="missingValueCode!=''">
362
                 <td colspan="1" align="center" class="{$stripes}">
363
                    <table>
364
                       <xsl:for-each select="missingValueCode">
365
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
366
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
367
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
368
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
369
                          </tr>
370
                       </xsl:for-each>
371
                   </table>
372
                 </td>
373
              </xsl:when>
374
              <xsl:otherwise>
375
                <td colspan="1" align="center" class="{$stripes}">
376
                   &#160;
377
                </td>
378
              </xsl:otherwise>
379
            </xsl:choose>
380
        </xsl:otherwise>
381
     </xsl:choose>
382
   </xsl:for-each>
383
  </tr>
384

    
385

    
386
  <!-- The eighth row for accuracy report-->
387
  <tr><th class="rowodd">Accuracy Report</th>
388
     <xsl:for-each select="attribute">
389
     <xsl:variable name="stripes">
390
         <xsl:choose>
391
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
392
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
393
         </xsl:choose>
394
    </xsl:variable>
395
    <xsl:choose>
396
         <xsl:when test="references!=''">
397
          <xsl:variable name="ref_id" select="references"/>
398
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
399
          <xsl:for-each select="$references">
400
            <xsl:choose>
401
               <xsl:when test="accuracy!=''">
402
                 <td colspan="1" align="center" class="{$stripes}">
403
                    <xsl:for-each select="accuracy">
404
                          <xsl:value-of select="attributeAccuracyReport"/>
405
                    </xsl:for-each>
406
                 </td>
407
              </xsl:when>
408
              <xsl:otherwise>
409
                <td colspan="1" align="center" class="{$stripes}">
410
                  &#160;
411
                </td>
412
              </xsl:otherwise>
413
            </xsl:choose>
414
          </xsl:for-each>
415
        </xsl:when>
416
        <xsl:otherwise>
417
           <xsl:choose>
418
               <xsl:when test="accuracy!=''">
419
                 <td colspan="1" align="center" class="{$stripes}">
420
                    <xsl:for-each select="accuracy">
421
                          <xsl:value-of select="attributeAccuracyReport"/>
422
                    </xsl:for-each>
423
                 </td>
424
              </xsl:when>
425
              <xsl:otherwise>
426
                <td colspan="1" align="center" class="{$stripes}">
427
                  &#160;
428
                </td>
429
              </xsl:otherwise>
430
            </xsl:choose>
431
        </xsl:otherwise>
432
     </xsl:choose>
433
  </xsl:for-each>
434
  </tr>
435

    
436
  <!-- The nineth row for quality accuracy accessment -->
437
  <tr><th class="rowodd">Accuracy Assessment</th>
438
     <xsl:for-each select="attribute">
439
     <xsl:variable name="stripes">
440
         <xsl:choose>
441
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
442
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
443
         </xsl:choose>
444
    </xsl:variable>
445
    <xsl:variable name="innerstripes">
446
              <xsl:choose>
447
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
448
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
449
              </xsl:choose>
450
     </xsl:variable>
451
     <xsl:choose>
452
         <xsl:when test="references!=''">
453
          <xsl:variable name="ref_id" select="references"/>
454
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
455
          <xsl:for-each select="$references">
456
            <xsl:choose>
457
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
458
                 <td colspan="1" align="center" class="{$stripes}">
459
                   <xsl:for-each select="accuracy">
460
                     <table>
461
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
462
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
463
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
464
                          </tr>
465
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
466
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
467
                          </tr>
468
                      </xsl:for-each>
469
                   </table>
470
                 </xsl:for-each>
471
               </td>
472
             </xsl:when>
473
             <xsl:otherwise>
474
                <td colspan="1" align="center" class="{$stripes}">
475
                  &#160;
476
                </td>
477
             </xsl:otherwise>
478
           </xsl:choose>
479
          </xsl:for-each>
480
        </xsl:when>
481
        <xsl:otherwise>
482
           <xsl:choose>
483
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
484
                 <td colspan="1" align="center" class="{$stripes}">
485
                   <xsl:for-each select="accuracy">
486
                     <table>
487
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
488
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
489
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
490
                          </tr>
491
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
492
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
493
                          </tr>
494
                      </xsl:for-each>
495
                   </table>
496
                 </xsl:for-each>
497
               </td>
498
             </xsl:when>
499
             <xsl:otherwise>
500
                <td colspan="1" align="center" class="{$stripes}">
501
                  &#160;
502
                </td>
503
             </xsl:otherwise>
504
           </xsl:choose>
505
        </xsl:otherwise>
506
     </xsl:choose>
507
  </xsl:for-each>
508
  </tr>
509

    
510
   <!-- The tenth row for coverage-->
511
  <tr><th class="rowodd">Coverage</th>
512
   <xsl:for-each select="attribute">
513
    <xsl:variable name="index" select="position()"/>
514
    <xsl:variable name="stripes">
515
              <xsl:choose>
516
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
517
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
518
              </xsl:choose>
519
    </xsl:variable>
520
    <xsl:choose>
521
         <xsl:when test="references!=''">
522
          <xsl:variable name="ref_id" select="references"/>
523
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
524
          <xsl:for-each select="$references">
525
            <xsl:choose>
526
               <xsl:when test="coverage!=''">
527
                  <td colspan="1" align="center" class="{$stripes}">
528
                    <xsl:for-each select="coverage">
529
                      <xsl:call-template name="attributecoverage">
530
                         <xsl:with-param name="docid" select="$docid"/>
531
                         <xsl:with-param name="entitytype" select="$entitytype"/>
532
                         <xsl:with-param name="entityindex" select="$entityindex"/>
533
                         <xsl:with-param name="attributeindex" select="$index"/>
534
                      </xsl:call-template>
535
                    </xsl:for-each>
536
                  </td>
537
               </xsl:when>
538
               <xsl:otherwise>
539
                  <td colspan="1" align="center" class="{$stripes}">
540
                   &#160;
541
                  </td>
542
               </xsl:otherwise>
543
            </xsl:choose>
544
         </xsl:for-each>
545
        </xsl:when>
546
        <xsl:otherwise>
547
          <xsl:choose>
548
               <xsl:when test="coverage!=''">
549
                  <td colspan="1" align="center" class="{$stripes}">
550
                    <xsl:for-each select="coverage">
551
                      <xsl:call-template name="attributecoverage">
552
                         <xsl:with-param name="docid" select="$docid"/>
553
                         <xsl:with-param name="entitytype" select="$entitytype"/>
554
                         <xsl:with-param name="entityindex" select="$entityindex"/>
555
                         <xsl:with-param name="attributeindex" select="$index"/>
556
                      </xsl:call-template>
557
                    </xsl:for-each>
558
                  </td>
559
               </xsl:when>
560
               <xsl:otherwise>
561
                  <td colspan="1" align="center" class="{$stripes}">
562
                   &#160;
563
                  </td>
564
               </xsl:otherwise>
565
            </xsl:choose>
566
        </xsl:otherwise>
567
     </xsl:choose>
568
   </xsl:for-each>
569
  </tr>
570

    
571

    
572
   <!-- The eleventh row for method-->
573
  <tr><th class="rowodd">Method</th>
574
   <xsl:for-each select="attribute">
575
    <xsl:variable name="index" select="position()"/>
576
    <xsl:variable name="stripes">
577
              <xsl:choose>
578
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
579
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
580
              </xsl:choose>
581
    </xsl:variable>
582
    <xsl:choose>
583
         <xsl:when test="references!=''">
584
          <xsl:variable name="ref_id" select="references"/>
585
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
586
          <xsl:for-each select="$references">
587
            <xsl:choose>
588
               <xsl:when test="method!=''">
589
                 <td colspan="1" align="center" class="{$stripes}">
590
                   <xsl:for-each select="method">
591
                     <xsl:call-template name="attributemethod">
592
                       <xsl:with-param name="docid" select="$docid"/>
593
                       <xsl:with-param name="entitytype" select="$entitytype"/>
594
                       <xsl:with-param name="entityindex" select="$entityindex"/>
595
                       <xsl:with-param name="attributeindex" select="$index"/>
596
                     </xsl:call-template>
597
                   </xsl:for-each>
598
                 </td>
599
               </xsl:when>
600
               <xsl:otherwise>
601
                 <td colspan="1" align="center" class="{$stripes}">
602
                   &#160;
603
                 </td>
604
               </xsl:otherwise>
605
            </xsl:choose>
606
         </xsl:for-each>
607
        </xsl:when>
608
        <xsl:otherwise>
609
           <xsl:choose>
610
               <xsl:when test="method!=''">
611
                 <td colspan="1" align="center" class="{$stripes}">
612
                   <xsl:for-each select="method">
613
                     <xsl:call-template name="attributemethod">
614
                       <xsl:with-param name="docid" select="$docid"/>
615
                       <xsl:with-param name="entitytype" select="$entitytype"/>
616
                       <xsl:with-param name="entityindex" select="$entityindex"/>
617
                       <xsl:with-param name="attributeindex" select="$index"/>
618
                     </xsl:call-template>
619
                   </xsl:for-each>
620
                 </td>
621
               </xsl:when>
622
               <xsl:otherwise>
623
                 <td colspan="1" align="center" class="{$stripes}">
624
                   &#160;
625
                 </td>
626
               </xsl:otherwise>
627
            </xsl:choose>
628
        </xsl:otherwise>
629
     </xsl:choose>
630
   </xsl:for-each>
631
  </tr>
632
 </xsl:template>
633

    
634

    
635
<xsl:template name="singleattribute">
636
   <xsl:param name="docid"/>
637
   <xsl:param name="entitytype"/>
638
   <xsl:param name="entityindex"/>
639
   <xsl:param name="attributeindex"/>
640

    
641
   <table class="{$tableattributeStyle}">
642
        <xsl:choose>
643
         <xsl:when test="references!=''">
644
          <xsl:variable name="ref_id" select="references"/>
645
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
646
          <xsl:for-each select="$references">
647
            <xsl:call-template name="singleattributecommon">
648
               <xsl:with-param name="docid" select="$docid"/>
649
               <xsl:with-param name="entitytype" select="$entitytype"/>
650
               <xsl:with-param name="entityindex" select="$entityindex"/>
651
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
652
            </xsl:call-template>
653
          </xsl:for-each>
654
        </xsl:when>
655
        <xsl:otherwise>
656
          <xsl:call-template name="singleattributecommon">
657
               <xsl:with-param name="docid" select="$docid"/>
658
               <xsl:with-param name="entitytype" select="$entitytype"/>
659
               <xsl:with-param name="entityindex" select="$entityindex"/>
660
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
661
          </xsl:call-template>
662
        </xsl:otherwise>
663
      </xsl:choose>
664
  </table>
665
</xsl:template>
666

    
667

    
668
<xsl:template name="singleattributecommon">
669
   <xsl:param name="docid"/>
670
   <xsl:param name="entitytype"/>
671
   <xsl:param name="entityindex"/>
672
   <xsl:param name="attributeindex"/>
673

    
674
  <!-- First row for attribute name-->
675
  <tr><th class="rowodd">Column Name</th>
676
  <xsl:for-each select="attribute">
677
   <xsl:if test="position() = $attributeindex">
678
      <xsl:choose>
679
         <xsl:when test="references!=''">
680
          <xsl:variable name="ref_id" select="references"/>
681
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
682
          <xsl:for-each select="$references">
683
            <th><xsl:value-of select="attributeName"/></th>
684
          </xsl:for-each>
685
        </xsl:when>
686
        <xsl:otherwise>
687
          <th><xsl:value-of select="attributeName"/></th>
688
        </xsl:otherwise>
689
     </xsl:choose>
690
   </xsl:if>
691
  </xsl:for-each>
692
  </tr>
693

    
694
  <!-- Second row for attribute label-->
695
  <tr><th class="rowodd">Column Label</th>
696
   <xsl:for-each select="attribute">
697
    <xsl:if test="position() = $attributeindex">
698
    <xsl:variable name="stripes">
699
              <xsl:choose>
700
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
701
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
702
              </xsl:choose>
703
    </xsl:variable>
704
    <xsl:choose>
705
         <xsl:when test="references!=''">
706
          <xsl:variable name="ref_id" select="references"/>
707
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
708
          <xsl:for-each select="$references">
709
             <xsl:choose>
710
                <xsl:when test="attributeLabel!=''">
711
                  <td colspan="1" align="center" class="{$stripes}">
712
                     <xsl:for-each select="attributeLabel">
713
                       <xsl:value-of select="."/>
714
                         &#160;<br />
715
                       </xsl:for-each>
716
                  </td>
717
                </xsl:when>
718
                <xsl:otherwise>
719
                   <td colspan="1" align="center" class="{$stripes}">
720
                       &#160;<br />
721
                   </td>
722
                </xsl:otherwise>
723
              </xsl:choose>
724
          </xsl:for-each>
725
        </xsl:when>
726
        <xsl:otherwise>
727
             <xsl:choose>
728
                <xsl:when test="attributeLabel!=''">
729
                  <td colspan="1" align="center" class="{$stripes}">
730
                     <xsl:for-each select="attributeLabel">
731
                       <xsl:value-of select="."/>
732
                         &#160;<br/>
733
                       </xsl:for-each>
734
                  </td>
735
                </xsl:when>
736
                <xsl:otherwise>
737
                   <td colspan="1" align="center" class="{$stripes}">
738
                       &#160;<br />
739
                   </td>
740
                </xsl:otherwise>
741
              </xsl:choose>
742
        </xsl:otherwise>
743
     </xsl:choose>
744
    </xsl:if>
745
   </xsl:for-each>
746
  </tr>
747

    
748
  <!-- Third row for attribute defination-->
749
  <tr><th class="rowodd">Definition</th>
750
    <xsl:for-each select="attribute">
751
     <xsl:if test="position() = $attributeindex">
752
      <xsl:variable name="stripes">
753
              <xsl:choose>
754
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
755
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
756
              </xsl:choose>
757
      </xsl:variable>
758
      <xsl:choose>
759
         <xsl:when test="references!=''">
760
          <xsl:variable name="ref_id" select="references"/>
761
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
762
           <xsl:for-each select="$references">
763
             <td colspan="1" align="center" class="{$stripes}">
764
               <xsl:value-of select="attributeDefinition"/>
765
             </td>
766
           </xsl:for-each>
767
        </xsl:when>
768
        <xsl:otherwise>
769
          <td colspan="1" align="center" class="{$stripes}">
770
             <xsl:value-of select="attributeDefinition"/>
771
          </td>
772
        </xsl:otherwise>
773
     </xsl:choose>
774
    </xsl:if>
775
   </xsl:for-each>
776
  </tr>
777

    
778
  <!-- The fourth row for attribute storage type-->
779
   <tr><th class="rowodd">Type of Value</th>
780
     <xsl:for-each select="attribute">
781
      <xsl:if test="position() = $attributeindex">
782
      <xsl:variable name="stripes">
783
              <xsl:choose>
784
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
785
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
786
              </xsl:choose>
787
      </xsl:variable>
788
      <xsl:choose>
789
         <xsl:when test="references!=''">
790
          <xsl:variable name="ref_id" select="references"/>
791
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
792
          <xsl:for-each select="$references">
793
            <xsl:choose>
794
              <xsl:when test="storageType!=''">
795
                 <td colspan="1" align="center" class="{$stripes}">
796
                    <xsl:for-each select="storageType">
797
                      <xsl:value-of select="."/>
798
                       &#160;<br/>
799
                    </xsl:for-each>
800
                 </td>
801
              </xsl:when>
802
              <xsl:otherwise>
803
                  <td colspan="1" align="center" class="{$stripes}">
804
                       &#160;
805
                   </td>
806
              </xsl:otherwise>
807
            </xsl:choose>
808
          </xsl:for-each>
809
        </xsl:when>
810
        <xsl:otherwise>
811
           <xsl:choose>
812
              <xsl:when test="storageType!=''">
813
                 <td colspan="1" align="center" class="{$stripes}">
814
                    <xsl:for-each select="storageType">
815
                      <xsl:value-of select="."/>
816
                       &#160;<br/>
817
                    </xsl:for-each>
818
                 </td>
819
              </xsl:when>
820
              <xsl:otherwise>
821
                  <td colspan="1" align="center" class="{$stripes}">
822
                       &#160;
823
                   </td>
824
              </xsl:otherwise>
825
            </xsl:choose>
826
        </xsl:otherwise>
827
     </xsl:choose>
828
    </xsl:if>
829
   </xsl:for-each>
830
  </tr>
831

    
832
  <!-- The fifth row for meaturement type-->
833
  <tr><th class="rowodd">Measurement Type</th>
834
   <xsl:for-each select="attribute">
835
    <xsl:if test="position() = $attributeindex">
836
    <xsl:variable name="stripes">
837
              <xsl:choose>
838
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
839
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
840
              </xsl:choose>
841
    </xsl:variable>
842
    <xsl:choose>
843
         <xsl:when test="references!=''">
844
          <xsl:variable name="ref_id" select="references"/>
845
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
846
          <xsl:for-each select="$references">
847
            <td colspan="1" align="center" class="{$stripes}">
848
              <xsl:for-each select="measurementScale">
849
                 <xsl:value-of select="local-name(./*)"/>
850
              </xsl:for-each>
851
            </td>
852
         </xsl:for-each>
853
        </xsl:when>
854
        <xsl:otherwise>
855
           <td colspan="1" align="center" class="{$stripes}">
856
              <xsl:for-each select="measurementScale">
857
                 <xsl:value-of select="local-name(./*)"/>
858
              </xsl:for-each>
859
           </td>
860
        </xsl:otherwise>
861
     </xsl:choose>
862
    </xsl:if>
863
   </xsl:for-each>
864
  </tr>
865

    
866
  <!-- The sixth row for meaturement domain-->
867
  <tr><th class="rowodd">Measurement Domain</th>
868
   <xsl:for-each select="attribute">
869
    <xsl:if test="position() = $attributeindex">
870
    <xsl:variable name="stripes">
871
              <xsl:choose>
872
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
873
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
874
              </xsl:choose>
875
    </xsl:variable>
876
     <xsl:variable name="innerstripes">
877
              <xsl:choose>
878
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
879
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
880
              </xsl:choose>
881
    </xsl:variable>
882
    <xsl:choose>
883
         <xsl:when test="references!=''">
884
          <xsl:variable name="ref_id" select="references"/>
885
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
886
          <xsl:for-each select="$references">
887
            <td colspan="1" align="center" class="{$stripes}">
888
              <xsl:for-each select="measurementScale">
889
                <xsl:call-template name="measurementscale">
890
                    <xsl:with-param name="docid" select="$docid"/>
891
                    <xsl:with-param name="entitytype" select="$entitytype"/>
892
                    <xsl:with-param name="entityindex" select="$entityindex"/>
893
                    <xsl:with-param name="attributeindex" select="position()"/>
894
                    <xsl:with-param name="stripes" select="$innerstripes"/>
895
                </xsl:call-template>
896
              </xsl:for-each>
897
            </td>
898
         </xsl:for-each>
899
        </xsl:when>
900
        <xsl:otherwise>
901
           <td colspan="1" align="center" class="{$stripes}">
902
              <xsl:for-each select="measurementScale">
903
                <xsl:call-template name="measurementscale">
904
                      <xsl:with-param name="docid" select="$docid"/>
905
                      <xsl:with-param name="entitytype" select="$entitytype"/>
906
                      <xsl:with-param name="entityindex" select="$entityindex"/>
907
                      <xsl:with-param name="attributeindex" select="position()"/>
908
                      <xsl:with-param name="stripes" select="$innerstripes"/>
909
                </xsl:call-template>
910
              </xsl:for-each>
911
           </td>
912
        </xsl:otherwise>
913
     </xsl:choose>
914
    </xsl:if>
915
   </xsl:for-each>
916
  </tr>
917

    
918

    
919
  <!-- The seventh row for missing value code-->
920
  <tr><th class="rowodd">Missing Value Code</th>
921
    <xsl:for-each select="attribute">
922
     <xsl:if test="position() = $attributeindex">
923
      <xsl:variable name="stripes">
924
              <xsl:choose>
925
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
926
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
927
              </xsl:choose>
928
     </xsl:variable>
929
     <xsl:variable name="innerstripes">
930
              <xsl:choose>
931
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
932
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
933
              </xsl:choose>
934
     </xsl:variable>
935
     <xsl:choose>
936
         <xsl:when test="references!=''">
937
          <xsl:variable name="ref_id" select="references"/>
938
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
939
          <xsl:for-each select="$references">
940
            <xsl:choose>
941
              <xsl:when test="missingValueCode!=''">
942
                 <td colspan="1" align="center" class="{$stripes}">
943
                    <table>
944
                       <xsl:for-each select="missingValueCode">
945
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
946
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
947
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
948
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
949
                          </tr>
950
                       </xsl:for-each>
951
                   </table>
952
                 </td>
953
              </xsl:when>
954
              <xsl:otherwise>
955
                <td colspan="1" class="{$stripes}">
956
                   &#160;
957
                </td>
958
              </xsl:otherwise>
959
            </xsl:choose>
960
          </xsl:for-each>
961
        </xsl:when>
962
        <xsl:otherwise>
963
           <xsl:choose>
964
              <xsl:when test="missingValueCode!=''">
965
                 <td colspan="1" align="center" class="{$stripes}">
966
                    <table>
967
                       <xsl:for-each select="missingValueCode">
968
                          <tr><td class="{$innerstripes}"><b>Code</b></td>                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
969
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
970
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
971
                          </tr>
972
                       </xsl:for-each>
973
                   </table>
974
                 </td>
975
              </xsl:when>
976
              <xsl:otherwise>
977
                <td colspan="1" align="center" class="{$stripes}">
978
                   &#160;
979
                </td>
980
              </xsl:otherwise>
981
            </xsl:choose>
982
        </xsl:otherwise>
983
     </xsl:choose>
984
     </xsl:if>
985
   </xsl:for-each>
986
  </tr>
987

    
988

    
989
  <!-- The eighth row for accuracy report-->
990
  <tr><th class="rowodd">Accuracy Report</th>
991
     <xsl:for-each select="attribute">
992
     <xsl:if test="position() = $attributeindex">
993
     <xsl:variable name="stripes">
994
         <xsl:choose>
995
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
996
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
997
         </xsl:choose>
998
    </xsl:variable>
999
    <xsl:choose>
1000
         <xsl:when test="references!=''">
1001
          <xsl:variable name="ref_id" select="references"/>
1002
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1003
          <xsl:for-each select="$references">
1004
            <xsl:choose>
1005
               <xsl:when test="accuracy!=''">
1006
                 <td colspan="1" align="center" class="{$stripes}">
1007
                    <xsl:for-each select="accuracy">
1008
                          <xsl:value-of select="attributeAccuracyReport"/>
1009
                    </xsl:for-each>
1010
                 </td>
1011
              </xsl:when>
1012
              <xsl:otherwise>
1013
                <td colspan="1" align="center" class="{$stripes}">
1014
                  &#160;
1015
                </td>
1016
              </xsl:otherwise>
1017
            </xsl:choose>
1018
          </xsl:for-each>
1019
        </xsl:when>
1020
        <xsl:otherwise>
1021
           <xsl:choose>
1022
               <xsl:when test="accuracy!=''">
1023
                 <td colspan="1" align="center" class="{$stripes}">
1024
                    <xsl:for-each select="accuracy">
1025
                          <xsl:value-of select="attributeAccuracyReport"/>
1026
                    </xsl:for-each>
1027
                 </td>
1028
              </xsl:when>
1029
              <xsl:otherwise>
1030
                <td colspan="1" align="center" class="{$stripes}">
1031
                  &#160;
1032
                </td>
1033
              </xsl:otherwise>
1034
            </xsl:choose>
1035
        </xsl:otherwise>
1036
     </xsl:choose>
1037
   </xsl:if>
1038
  </xsl:for-each>
1039
  </tr>
1040

    
1041
  <!-- The nineth row for quality accuracy accessment -->
1042
  <tr><th class="rowodd">Accuracy Assessment</th>
1043
     <xsl:for-each select="attribute">
1044
     <xsl:if test="position() = $attributeindex">
1045
     <xsl:variable name="stripes">
1046
         <xsl:choose>
1047
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1048
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1049
         </xsl:choose>
1050
    </xsl:variable>
1051
    <xsl:variable name="innerstripes">
1052
              <xsl:choose>
1053
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
1054
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
1055
              </xsl:choose>
1056
     </xsl:variable>
1057
     <xsl:choose>
1058
         <xsl:when test="references!=''">
1059
          <xsl:variable name="ref_id" select="references"/>
1060
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1061
          <xsl:for-each select="$references">
1062
            <xsl:choose>
1063
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1064
                 <td colspan="1" align="center" class="{$stripes}">
1065
                   <xsl:for-each select="accuracy">
1066
                     <table>
1067
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1068
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1069
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1070
                          </tr>
1071
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1072
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1073
                          </tr>
1074
                      </xsl:for-each>
1075
                   </table>
1076
                 </xsl:for-each>
1077
               </td>
1078
             </xsl:when>
1079
             <xsl:otherwise>
1080
                <td colspan="1" align="center" class="{$stripes}">
1081
                  &#160;
1082
                </td>
1083
             </xsl:otherwise>
1084
           </xsl:choose>
1085
          </xsl:for-each>
1086
        </xsl:when>
1087
        <xsl:otherwise>
1088
           <xsl:choose>
1089
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1090
                 <td colspan="1" align="center" class="{$stripes}">
1091
                   <xsl:for-each select="accuracy">
1092
                     <table>
1093
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1094
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1095
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1096
                          </tr>
1097
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1098
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1099
                          </tr>
1100
                      </xsl:for-each>
1101
                   </table>
1102
                 </xsl:for-each>
1103
               </td>
1104
             </xsl:when>
1105
             <xsl:otherwise>
1106
                <td colspan="1" align="center" class="{$stripes}">
1107
                  &#160;
1108
                </td>
1109
             </xsl:otherwise>
1110
           </xsl:choose>
1111
        </xsl:otherwise>
1112
     </xsl:choose>
1113
   </xsl:if>
1114
  </xsl:for-each>
1115
  </tr>
1116

    
1117
   <!-- The tenth row for coverage-->
1118
  <tr><th class="rowodd">Coverage</th>
1119
   <xsl:for-each select="attribute">
1120
    <xsl:if test="position() = $attributeindex">
1121
    <xsl:variable name="index" select="position()"/>
1122
    <xsl:variable name="stripes">
1123
              <xsl:choose>
1124
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1125
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1126
              </xsl:choose>
1127
    </xsl:variable>
1128
    <xsl:choose>
1129
         <xsl:when test="references!=''">
1130
          <xsl:variable name="ref_id" select="references"/>
1131
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1132
          <xsl:for-each select="$references">
1133
            <xsl:choose>
1134
               <xsl:when test="coverage!=''">
1135
                  <td colspan="1" align="center" class="{$stripes}">
1136
                    <xsl:for-each select="coverage">
1137
                      <xsl:call-template name="attributecoverage">
1138
                         <xsl:with-param name="docid" select="$docid"/>
1139
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1140
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1141
                         <xsl:with-param name="attributeindex" select="$index"/>
1142
                      </xsl:call-template>
1143
                    </xsl:for-each>
1144
                  </td>
1145
               </xsl:when>
1146
               <xsl:otherwise>
1147
                  <td colspan="1" align="center" class="{$stripes}">
1148
                   &#160;
1149
                  </td>
1150
               </xsl:otherwise>
1151
            </xsl:choose>
1152
         </xsl:for-each>
1153
        </xsl:when>
1154
        <xsl:otherwise>
1155
          <xsl:choose>
1156
               <xsl:when test="coverage!=''">
1157
                  <td colspan="1" align="center" class="{$stripes}">
1158
                    <xsl:for-each select="coverage">
1159
                      <xsl:call-template name="attributecoverage">
1160
                         <xsl:with-param name="docid" select="$docid"/>
1161
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1162
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1163
                         <xsl:with-param name="attributeindex" select="$index"/>
1164
                      </xsl:call-template>
1165
                    </xsl:for-each>
1166
                  </td>
1167
               </xsl:when>
1168
               <xsl:otherwise>
1169
                  <td colspan="1" align="center" class="{$stripes}">
1170
                   &#160;
1171
                  </td>
1172
               </xsl:otherwise>
1173
            </xsl:choose>
1174
        </xsl:otherwise>
1175
     </xsl:choose>
1176
    </xsl:if>
1177
   </xsl:for-each>
1178
  </tr>
1179

    
1180

    
1181
   <!-- The eleventh row for method-->
1182
  <tr><th class="rowodd">Method</th>
1183
   <xsl:for-each select="attribute">
1184
    <xsl:if test="position() = $attributeindex">
1185
    <xsl:variable name="index" select="position()"/>
1186
    <xsl:variable name="stripes">
1187
              <xsl:choose>
1188
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1189
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1190
              </xsl:choose>
1191
    </xsl:variable>
1192
    <xsl:choose>
1193
         <xsl:when test="references!=''">
1194
          <xsl:variable name="ref_id" select="references"/>
1195
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1196
          <xsl:for-each select="$references">
1197
            <xsl:choose>
1198
               <xsl:when test="method!=''">
1199
                 <td colspan="1" align="center" class="{$stripes}">
1200
                   <xsl:for-each select="method">
1201
                     <xsl:call-template name="attributemethod">
1202
                       <xsl:with-param name="docid" select="$docid"/>
1203
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1204
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1205
                       <xsl:with-param name="attributeindex" select="$index"/>
1206
                     </xsl:call-template>
1207
                   </xsl:for-each>
1208
                 </td>
1209
               </xsl:when>
1210
               <xsl:otherwise>
1211
                 <td colspan="1" align="center" class="{$stripes}">
1212
                   &#160;
1213
                 </td>
1214
               </xsl:otherwise>
1215
            </xsl:choose>
1216
         </xsl:for-each>
1217
        </xsl:when>
1218
        <xsl:otherwise>
1219
           <xsl:choose>
1220
               <xsl:when test="method!=''">
1221
                 <td colspan="1" align="center" class="{$stripes}">
1222
                   <xsl:for-each select="method">
1223
                     <xsl:call-template name="attributemethod">
1224
                       <xsl:with-param name="docid" select="$docid"/>
1225
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1226
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1227
                       <xsl:with-param name="attributeindex" select="$index"/>
1228
                     </xsl:call-template>
1229
                   </xsl:for-each>
1230
                 </td>
1231
               </xsl:when>
1232
               <xsl:otherwise>
1233
                 <td colspan="1" align="center" class="{$stripes}">
1234
                   &#160;
1235
                 </td>
1236
               </xsl:otherwise>
1237
            </xsl:choose>
1238
        </xsl:otherwise>
1239
     </xsl:choose>
1240
    </xsl:if>
1241
   </xsl:for-each>
1242
  </tr>
1243
 </xsl:template>
1244

    
1245

    
1246
<xsl:template name="measurementscale">
1247
   <xsl:param name="stripes"/>
1248
   <xsl:param name="docid"/>
1249
   <xsl:param name="entitytype"/>
1250
   <xsl:param name="entityindex"/>
1251
   <xsl:param name="attributeindex"/>
1252
   <table>
1253
    <xsl:for-each select="nominal">
1254
         <xsl:call-template name="attributenonnumericdomain">
1255
               <xsl:with-param name="docid" select="$docid"/>
1256
               <xsl:with-param name="entitytype" select="$entitytype"/>
1257
               <xsl:with-param name="entityindex" select="$entityindex"/>
1258
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1259
               <xsl:with-param name="stripes" select="$stripes"/>
1260
       </xsl:call-template>
1261
    </xsl:for-each>
1262
    <xsl:for-each select="ordinal">
1263
       <xsl:call-template name="attributenonnumericdomain">
1264
               <xsl:with-param name="docid" select="$docid"/>
1265
               <xsl:with-param name="entitytype" select="$entitytype"/>
1266
               <xsl:with-param name="entityindex" select="$entityindex"/>
1267
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1268
               <xsl:with-param name="stripes" select="$stripes"/>
1269
       </xsl:call-template>
1270
    </xsl:for-each>
1271
    <xsl:for-each select="interval">
1272
       <xsl:call-template name="intervalratio">
1273
         <xsl:with-param name="stripes" select="$stripes"/>
1274
       </xsl:call-template>
1275
    </xsl:for-each>
1276
    <xsl:for-each select="ratio">
1277
       <xsl:call-template name="intervalratio">
1278
         <xsl:with-param name="stripes" select="$stripes"/>
1279
       </xsl:call-template>
1280
    </xsl:for-each>
1281
    <xsl:for-each select="datetime">
1282
       <xsl:call-template name="datetime">
1283
          <xsl:with-param name="stripes" select="$stripes"/>
1284
       </xsl:call-template>
1285
    </xsl:for-each>
1286
   </table>
1287
 </xsl:template>
1288

    
1289
 <xsl:template name="attributenonnumericdomain">
1290
   <xsl:param name="stripes"/>
1291
   <xsl:param name="docid"/>
1292
   <xsl:param name="entitytype"/>
1293
   <xsl:param name="entityindex"/>
1294
   <xsl:param name="attributeindex"/>
1295
   <xsl:for-each select="nonNumericDomain">
1296
     <xsl:choose>
1297
         <xsl:when test="references!=''">
1298
          <xsl:variable name="ref_id" select="references"/>
1299
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1300
          <xsl:for-each select="$references">
1301
            <xsl:call-template name="attributenonnumericdomaincommon">
1302
                <xsl:with-param name="docid" select="$docid"/>
1303
                <xsl:with-param name="entitytype" select="$entitytype"/>
1304
                <xsl:with-param name="entityindex" select="$entityindex"/>
1305
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
1306
                <xsl:with-param name="stripes" select="$stripes"/>
1307
            </xsl:call-template>
1308
         </xsl:for-each>
1309
        </xsl:when>
1310
        <xsl:otherwise>
1311
            <xsl:call-template name="attributenonnumericdomaincommon">
1312
               <xsl:with-param name="docid" select="$docid"/>
1313
               <xsl:with-param name="entitytype" select="$entitytype"/>
1314
               <xsl:with-param name="entityindex" select="$entityindex"/>
1315
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1316
               <xsl:with-param name="stripes" select="$stripes"/>
1317
            </xsl:call-template>
1318
        </xsl:otherwise>
1319
     </xsl:choose>
1320
   </xsl:for-each>
1321
 </xsl:template>
1322

    
1323
 <xsl:template name="attributenonnumericdomaincommon">
1324
    <xsl:param name="stripes"/>
1325
    <xsl:param name="docid"/>
1326
    <xsl:param name="entitytype"/>
1327
    <xsl:param name="entityindex"/>
1328
    <xsl:param name="attributeindex"/>
1329
    <!-- if numericdomain only has one test domain,
1330
        it will be displayed inline otherwith will be show a link-->
1331
    <xsl:choose>
1332
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">
1333
        <tr><td class="{$stripes}"><b>Def</b></td>
1334
            <td class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
1335
            </td>
1336
        </tr>
1337
        <xsl:for-each select="textDomain/parttern">
1338
          <tr><td class="{$stripes}"><b>Pattern</b></td>
1339
            <td class="{$stripes}"><xsl:value-of select="."/>
1340
            </td>
1341
          </tr>
1342
        </xsl:for-each>
1343
        <xsl:for-each select="textDomain/source">
1344
          <tr><td class="{$stripes}"><b>Source</b></td>
1345
            <td class="{$stripes}"><xsl:value-of select="."/>
1346
            </td>
1347
          </tr>
1348
        </xsl:for-each>
1349
      </xsl:when>
1350
      <xsl:otherwise>
1351
         <tr><td colspan="2" align="center" class="{$stripes}" >
1352
           <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>
1353
           <b>Domain Info</b></a>
1354
         </td></tr>
1355
      </xsl:otherwise>
1356
    </xsl:choose>
1357
 </xsl:template>
1358

    
1359
 <xsl:template name="intervalratio">
1360
    <xsl:param name="stripes"/>
1361
    <xsl:if test="unit/standardUnit">
1362
      <tr><td class="{$stripes}"><b>Unit</b></td>
1363
            <td class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
1364
            </td>
1365
      </tr>
1366
    </xsl:if>
1367
    <xsl:if test="unit/customUnit">
1368
      <tr><td class="{$stripes}"><b>Unit</b></td>
1369
            <td class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
1370
            </td>
1371
      </tr>
1372
   </xsl:if>
1373
   <xsl:for-each select="precision">
1374
      <tr><td class="{$stripes}"><b>Precision</b></td>
1375
            <td class="{$stripes}"><xsl:value-of select="."/>
1376
            </td>
1377
      </tr>
1378
   </xsl:for-each>
1379
   <xsl:for-each select="numericDomain">
1380
      <xsl:call-template name="numericDomain">
1381
         <xsl:with-param name="stripes" select="$stripes"/>
1382
      </xsl:call-template>
1383
    </xsl:for-each>
1384
  </xsl:template>
1385

    
1386

    
1387
 <xsl:template name="numericDomain">
1388
     <xsl:param name="stripes"/>
1389
       <xsl:choose>
1390
         <xsl:when test="references!=''">
1391
          <xsl:variable name="ref_id" select="references"/>
1392
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1393
          <xsl:for-each select="$references">
1394
            <tr><td class="{$stripes}"><b>Type</b></td>
1395
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1396
                </td>
1397
            </tr>
1398
            <xsl:for-each select="bounds">
1399
              <tr><td class="{$stripes}"><b>Min</b></td>
1400
                  <td class="{$stripes}">
1401
                    <xsl:for-each select="minimum">
1402
                      <xsl:value-of select="."/>&#160;
1403
                    </xsl:for-each>
1404
                  </td>
1405
              </tr>
1406
              <tr><td class="{$stripes}"><b>Max</b></td>
1407
                  <td class="{$stripes}">
1408
                    <xsl:for-each select="maximum">
1409
                      <xsl:value-of select="."/>&#160;
1410
                    </xsl:for-each>
1411
                  </td>
1412
              </tr>
1413
            </xsl:for-each>
1414
          </xsl:for-each>
1415
        </xsl:when>
1416
        <xsl:otherwise>
1417
          <tr><td class="{$stripes}"><b>Type</b></td>
1418
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1419
                </td>
1420
            </tr>
1421
            <xsl:for-each select="bounds">
1422
              <tr><td class="{$stripes}"><b>Min</b></td>
1423
                  <td class="{$stripes}">
1424
                    <xsl:for-each select="minimum">
1425
                      <xsl:value-of select="."/>&#160;
1426
                    </xsl:for-each>
1427
                  </td>
1428
              </tr>
1429
              <tr><td class="{$stripes}"><b>Max</b></td>
1430
                  <td class="{$stripes}">
1431
                    <xsl:for-each select="maximum">
1432
                      <xsl:value-of select="."/>&#160;
1433
                    </xsl:for-each>
1434
                  </td>
1435
              </tr>
1436
            </xsl:for-each>
1437
        </xsl:otherwise>
1438
      </xsl:choose>
1439
  </xsl:template>
1440

    
1441
 <xsl:template name="datetime">
1442
    <xsl:param name="stripes"/>
1443
    <tr><td class="{$stripes}"><b>Format</b></td>
1444
         <td class="{$stripes}">
1445
            <xsl:value-of select="formatString"/>
1446
         </td>
1447
    </tr>
1448
     <tr><td class="{$stripes}"><b>Precision</b></td>
1449
         <td class="{$stripes}">
1450
            <xsl:value-of select="dateTimePrecision"/>
1451
         </td>
1452
    </tr>
1453
    <xsl:call-template name="timedomain"/>
1454
 </xsl:template>
1455

    
1456

    
1457
 <xsl:template name="timedomain">
1458
    <xsl:param name="stripes"/>
1459
      <xsl:choose>
1460
         <xsl:when test="references!=''">
1461
          <xsl:variable name="ref_id" select="references"/>
1462
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1463
          <xsl:for-each select="$references">
1464
            <xsl:for-each select="bounds">
1465
              <tr><td class="{$stripes}"><b>Min</b></td>
1466
                  <td class="{$stripes}">
1467
                    <xsl:for-each select="minimum">
1468
                      <xsl:value-of select="."/>&#160;
1469
                    </xsl:for-each>
1470
                  </td>
1471
              </tr>
1472
              <tr><td class="{$stripes}"><b>Max</b></td>
1473
                  <td class="{$stripes}">
1474
                    <xsl:for-each select="maximum">
1475
                      <xsl:value-of select="."/>&#160;
1476
                    </xsl:for-each>
1477
                  </td>
1478
              </tr>
1479
            </xsl:for-each>
1480
          </xsl:for-each>
1481
        </xsl:when>
1482
        <xsl:otherwise>
1483
           <xsl:for-each select="bounds">
1484
              <tr><td class="{$stripes}"><b>Min</b></td>
1485
                  <td class="{$stripes}">
1486
                    <xsl:for-each select="minimum">
1487
                      <xsl:value-of select="."/>&#160;
1488
                    </xsl:for-each>
1489
                  </td>
1490
              </tr>
1491
              <tr><td class="{$stripes}"><b>Max</b></td>
1492
                  <td class="{$stripes}">
1493
                    <xsl:for-each select="maximum">
1494
                      <xsl:value-of select="."/>&#160;
1495
                    </xsl:for-each>
1496
                  </td>
1497
              </tr>
1498
            </xsl:for-each>
1499
        </xsl:otherwise>
1500
      </xsl:choose>
1501
  </xsl:template>
1502

    
1503
 <xsl:template name="attributecoverage">
1504
    <xsl:param name="docid"/>
1505
    <xsl:param name="entitytype"/>
1506
    <xsl:param name="entityindex"/>
1507
    <xsl:param name="attributeindex"/>
1508
     <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>
1509
           <b>Coverage Info</b></a>
1510
 </xsl:template>
1511

    
1512
 <xsl:template name="attributemethod">
1513
    <xsl:param name="docid"/>
1514
    <xsl:param name="entitytype"/>
1515
    <xsl:param name="entityindex"/>
1516
    <xsl:param name="attributeindex"/>
1517
     <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>
1518
           <b>Method Info</b></a>
1519
 </xsl:template>
1520

    
1521
</xsl:stylesheet>
(4-4/31)