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: cjones $'
9
  *     '$Date: 2006-11-17 13:37:07 -0800 (Fri, 17 Nov 2006) $'
10
  * '$Revision: 3094 $'
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 attribute name-->
76
  <tr><th class="rowodd">Name</th>
77
  <xsl:for-each select="attribute">
78
    <xsl:choose>
79
         <xsl:when test="references!=''">
80
          <xsl:variable name="ref_id" select="references"/>
81
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
82
          <xsl:for-each select="$references">
83
            <th><xsl:value-of select="attributeName"/></th>
84
          </xsl:for-each>
85
        </xsl:when>
86
        <xsl:otherwise>
87
          <th><xsl:value-of select="attributeName"/></th>
88
        </xsl:otherwise>
89
     </xsl:choose>
90
  </xsl:for-each>
91
  </tr>
92

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

    
145
  <!-- Third row for attribute defination-->
146
  <tr><th class="rowodd">Definition</th>
147
    <xsl:for-each select="attribute">
148
      <xsl:variable name="stripes">
149
              <xsl:choose>
150
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
151
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
152
              </xsl:choose>
153
      </xsl:variable>
154
      <xsl:choose>
155
         <xsl:when test="references!=''">
156
          <xsl:variable name="ref_id" select="references"/>
157
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
158
           <xsl:for-each select="$references">
159
             <td colspan="1" align="center" class="{$stripes}">
160
               <xsl:value-of select="attributeDefinition"/>
161
             </td>
162
           </xsl:for-each>
163
        </xsl:when>
164
        <xsl:otherwise>
165
          <td colspan="1" align="center" class="{$stripes}">
166
             <xsl:value-of select="attributeDefinition"/>
167
          </td>
168
        </xsl:otherwise>
169
     </xsl:choose>
170
   </xsl:for-each>
171
  </tr>
172

    
173
  <!-- The fourth row for attribute storage type-->
174
   <tr><th class="rowodd">Type of Value</th>
175
     <xsl:for-each select="attribute">
176
      <xsl:variable name="stripes">
177
              <xsl:choose>
178
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
179
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
180
              </xsl:choose>
181
      </xsl:variable>
182
      <xsl:choose>
183
         <xsl:when test="references!=''">
184
          <xsl:variable name="ref_id" select="references"/>
185
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
186
          <xsl:for-each select="$references">
187
            <xsl:choose>
188
              <xsl:when test="storageType!=''">
189
                 <td colspan="1" align="center" class="{$stripes}">
190
                    <xsl:for-each select="storageType">
191
                      <xsl:value-of select="."/>
192
                       &#160;<br/>
193
                    </xsl:for-each>
194
                 </td>
195
              </xsl:when>
196
              <xsl:otherwise>
197
                  <td colspan="1" align="center" class="{$stripes}">
198
                       &#160;
199
                   </td>
200
              </xsl:otherwise>
201
            </xsl:choose>
202
          </xsl:for-each>
203
        </xsl:when>
204
        <xsl:otherwise>
205
           <xsl:choose>
206
              <xsl:when test="storageType!=''">
207
                 <td colspan="1" align="center" class="{$stripes}">
208
                    <xsl:for-each select="storageType">
209
                      <xsl:value-of select="."/>
210
                       &#160;<br/>
211
                    </xsl:for-each>
212
                 </td>
213
              </xsl:when>
214
              <xsl:otherwise>
215
                  <td colspan="1" align="center" class="{$stripes}">
216
                       &#160;
217
                   </td>
218
              </xsl:otherwise>
219
            </xsl:choose>
220
        </xsl:otherwise>
221
     </xsl:choose>
222
   </xsl:for-each>
223
  </tr>
224

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

    
257
  <!-- The sixth row for meaturement domain-->
258
  <tr><th class="rowodd">Measurement Domain</th>
259
   <xsl:for-each select="attribute">
260
    <xsl:variable name="stripes">
261
              <xsl:choose>
262
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
263
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
264
              </xsl:choose>
265
    </xsl:variable>
266
     <xsl:variable name="innerstripes">
267
              <xsl:choose>
268
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
269
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
270
              </xsl:choose>
271
    </xsl:variable>
272
    <xsl:choose>
273
         <xsl:when test="references!=''">
274
          <xsl:variable name="ref_id" select="references"/>
275
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
276
          <xsl:for-each select="$references">
277
            <td colspan="1" align="center" class="{$stripes}">
278
              <xsl:for-each select="measurementScale">
279
                <xsl:call-template name="measurementscale">
280
                    <xsl:with-param name="docid" select="$docid"/>
281
                    <xsl:with-param name="entitytype" select="$entitytype"/>
282
                    <xsl:with-param name="entityindex" select="$entityindex"/>
283
                    <xsl:with-param name="attributeindex" select="position()"/>
284
                    <xsl:with-param name="stripes" select="$innerstripes"/>
285
                </xsl:call-template>
286
              </xsl:for-each>
287
            </td>
288
         </xsl:for-each>
289
        </xsl:when>
290
        <xsl:otherwise>
291
           <td colspan="1" align="center" class="{$stripes}">
292
              <xsl:for-each select="measurementScale">
293
                <xsl:call-template name="measurementscale">
294
                      <xsl:with-param name="docid" select="$docid"/>
295
                      <xsl:with-param name="entitytype" select="$entitytype"/>
296
                      <xsl:with-param name="entityindex" select="$entityindex"/>
297
                      <xsl:with-param name="attributeindex" select="position()"/>
298
                      <xsl:with-param name="stripes" select="$innerstripes"/>
299
                </xsl:call-template>
300
              </xsl:for-each>
301
           </td>
302
        </xsl:otherwise>
303
     </xsl:choose>
304
   </xsl:for-each>
305
  </tr>
306

    
307

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

    
376

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

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

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

    
562

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

    
625

    
626
<xsl:template name="singleattribute">
627
   <xsl:param name="docid"/>
628
   <xsl:param name="entitytype"/>
629
   <xsl:param name="entityindex"/>
630
   <xsl:param name="attributeindex"/>
631

    
632
   <table class="{$tableattributeStyle}">
633
        <xsl:choose>
634
         <xsl:when test="references!=''">
635
          <xsl:variable name="ref_id" select="references"/>
636
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
637
          <xsl:for-each select="$references">
638
            <xsl:call-template name="singleattributecommon">
639
               <xsl:with-param name="docid" select="$docid"/>
640
               <xsl:with-param name="entitytype" select="$entitytype"/>
641
               <xsl:with-param name="entityindex" select="$entityindex"/>
642
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
643
            </xsl:call-template>
644
          </xsl:for-each>
645
        </xsl:when>
646
        <xsl:otherwise>
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:otherwise>
654
      </xsl:choose>
655
  </table>
656
</xsl:template>
657

    
658

    
659
<xsl:template name="singleattributecommon">
660
   <xsl:param name="docid"/>
661
   <xsl:param name="entitytype"/>
662
   <xsl:param name="entityindex"/>
663
   <xsl:param name="attributeindex"/>
664

    
665
  <!-- First row for attribute name-->
666
  <tr><th class="rowodd">Column Name</th>
667
  <xsl:for-each select="attribute">
668
   <xsl:if test="position() = $attributeindex">
669
      <xsl:choose>
670
         <xsl:when test="references!=''">
671
          <xsl:variable name="ref_id" select="references"/>
672
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
673
          <xsl:for-each select="$references">
674
            <th><xsl:value-of select="attributeName"/></th>
675
          </xsl:for-each>
676
        </xsl:when>
677
        <xsl:otherwise>
678
          <th><xsl:value-of select="attributeName"/></th>
679
        </xsl:otherwise>
680
     </xsl:choose>
681
   </xsl:if>
682
  </xsl:for-each>
683
  </tr>
684

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

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

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

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

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

    
909

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

    
979

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

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

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

    
1171

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

    
1236

    
1237
<xsl:template name="measurementscale">
1238
   <xsl:param name="stripes"/>
1239
   <xsl:param name="docid"/>
1240
   <xsl:param name="entitytype"/>
1241
   <xsl:param name="entityindex"/>
1242
   <xsl:param name="attributeindex"/>
1243
   <table>
1244
    <xsl:for-each select="nominal">
1245
         <xsl:call-template name="attributenonnumericdomain">
1246
               <xsl:with-param name="docid" select="$docid"/>
1247
               <xsl:with-param name="entitytype" select="$entitytype"/>
1248
               <xsl:with-param name="entityindex" select="$entityindex"/>
1249
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1250
               <xsl:with-param name="stripes" select="$stripes"/>
1251
       </xsl:call-template>
1252
    </xsl:for-each>
1253
    <xsl:for-each select="ordinal">
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="interval">
1263
       <xsl:call-template name="intervalratio">
1264
         <xsl:with-param name="stripes" select="$stripes"/>
1265
       </xsl:call-template>
1266
    </xsl:for-each>
1267
    <xsl:for-each select="ratio">
1268
       <xsl:call-template name="intervalratio">
1269
         <xsl:with-param name="stripes" select="$stripes"/>
1270
       </xsl:call-template>
1271
    </xsl:for-each>
1272
    <xsl:for-each select="datetime">
1273
       <xsl:call-template name="datetime">
1274
          <xsl:with-param name="stripes" select="$stripes"/>
1275
       </xsl:call-template>
1276
    </xsl:for-each>
1277
   </table>
1278
 </xsl:template>
1279

    
1280
 <xsl:template name="attributenonnumericdomain">
1281
   <xsl:param name="stripes"/>
1282
   <xsl:param name="docid"/>
1283
   <xsl:param name="entitytype"/>
1284
   <xsl:param name="entityindex"/>
1285
   <xsl:param name="attributeindex"/>
1286
   <xsl:for-each select="nonNumericDomain">
1287
     <xsl:choose>
1288
         <xsl:when test="references!=''">
1289
          <xsl:variable name="ref_id" select="references"/>
1290
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1291
          <xsl:for-each select="$references">
1292
            <xsl:call-template name="attributenonnumericdomaincommon">
1293
                <xsl:with-param name="docid" select="$docid"/>
1294
                <xsl:with-param name="entitytype" select="$entitytype"/>
1295
                <xsl:with-param name="entityindex" select="$entityindex"/>
1296
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
1297
                <xsl:with-param name="stripes" select="$stripes"/>
1298
            </xsl:call-template>
1299
         </xsl:for-each>
1300
        </xsl:when>
1301
        <xsl:otherwise>
1302
            <xsl:call-template name="attributenonnumericdomaincommon">
1303
               <xsl:with-param name="docid" select="$docid"/>
1304
               <xsl:with-param name="entitytype" select="$entitytype"/>
1305
               <xsl:with-param name="entityindex" select="$entityindex"/>
1306
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1307
               <xsl:with-param name="stripes" select="$stripes"/>
1308
            </xsl:call-template>
1309
        </xsl:otherwise>
1310
     </xsl:choose>
1311
   </xsl:for-each>
1312
 </xsl:template>
1313

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

    
1350
 <xsl:template name="intervalratio">
1351
    <xsl:param name="stripes"/>
1352
    <xsl:if test="unit/standardUnit">
1353
      <tr><td class="{$stripes}"><b>Unit</b></td>
1354
            <td class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
1355
            </td>
1356
      </tr>
1357
    </xsl:if>
1358
    <xsl:if test="unit/customUnit">
1359
      <tr><td class="{$stripes}"><b>Unit</b></td>
1360
            <td class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
1361
            </td>
1362
      </tr>
1363
   </xsl:if>
1364
   <xsl:for-each select="precision">
1365
      <tr><td class="{$stripes}"><b>Precision</b></td>
1366
            <td class="{$stripes}"><xsl:value-of select="."/>
1367
            </td>
1368
      </tr>
1369
   </xsl:for-each>
1370
   <xsl:for-each select="numericDomain">
1371
      <xsl:call-template name="numericDomain">
1372
         <xsl:with-param name="stripes" select="$stripes"/>
1373
      </xsl:call-template>
1374
    </xsl:for-each>
1375
  </xsl:template>
1376

    
1377

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

    
1432
 <xsl:template name="datetime">
1433
    <xsl:param name="stripes"/>
1434
    <tr><td class="{$stripes}"><b>Format</b></td>
1435
         <td class="{$stripes}">
1436
            <xsl:value-of select="formatString"/>
1437
         </td>
1438
    </tr>
1439
     <tr><td class="{$stripes}"><b>Precision</b></td>
1440
         <td class="{$stripes}">
1441
            <xsl:value-of select="dateTimePrecision"/>
1442
         </td>
1443
    </tr>
1444
    <xsl:call-template name="timedomain"/>
1445
 </xsl:template>
1446

    
1447

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

    
1494
 <xsl:template name="attributecoverage">
1495
    <xsl:param name="docid"/>
1496
    <xsl:param name="entitytype"/>
1497
    <xsl:param name="entityindex"/>
1498
    <xsl:param name="attributeindex"/>
1499
     <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>
1500
           <b>Coverage Info</b></a>
1501
 </xsl:template>
1502

    
1503
 <xsl:template name="attributemethod">
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=attributemethod&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>Method Info</b></a>
1510
 </xsl:template>
1511

    
1512
</xsl:stylesheet>
(4-4/28)