Project

General

Profile

1 4823 daigle
<?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 5723 leinfelder
39
<xsl:param name="annotationId"/>
40 4823 daigle
41
<xsl:template name="attributelist">
42
   <xsl:param name="docid"/>
43
   <xsl:param name="entitytype"/>
44
   <xsl:param name="entityindex"/>
45
46
   <table class="{$tabledefaultStyle}">
47
        <xsl:choose>
48
         <xsl:when test="references!=''">
49
          <xsl:variable name="ref_id" select="references"/>
50
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
51
          <xsl:for-each select="$references">
52
            <xsl:call-template name="attributecommon">
53
               <xsl:with-param name="docid" select="$docid"/>
54
               <xsl:with-param name="entitytype" select="$entitytype"/>
55
               <xsl:with-param name="entityindex" select="$entityindex"/>
56
            </xsl:call-template>
57
          </xsl:for-each>
58
        </xsl:when>
59
        <xsl:otherwise>
60
          <xsl:call-template name="attributecommon">
61
               <xsl:with-param name="docid" select="$docid"/>
62
               <xsl:with-param name="entitytype" select="$entitytype"/>
63
               <xsl:with-param name="entityindex" select="$entityindex"/>
64
          </xsl:call-template>
65
        </xsl:otherwise>
66
      </xsl:choose>
67
  </table>
68
</xsl:template>
69
70
71
<xsl:template name="attributecommon">
72
   <xsl:param name="docid"/>
73
   <xsl:param name="entitytype"/>
74
   <xsl:param name="entityindex"/>
75
76
77
  <!-- First row for attribute name-->
78
  <tr><th class="rowodd">Name</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="attributeName"/></th>
86
          </xsl:for-each>
87
        </xsl:when>
88
        <xsl:otherwise>
89
          <th><xsl:value-of select="attributeName"/></th>
90
        </xsl:otherwise>
91
     </xsl:choose>
92
  </xsl:for-each>
93
  </tr>
94
95
  <!-- Second row for attribute label-->
96
  <tr><th class="rowodd">Column Label</th>
97
   <xsl:for-each select="attribute">
98
    <xsl:variable name="stripes">
99
              <xsl:choose>
100
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
101
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
102
              </xsl:choose>
103
    </xsl:variable>
104
    <xsl:choose>
105
         <xsl:when test="references!=''">
106
          <xsl:variable name="ref_id" select="references"/>
107
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
108
          <xsl:for-each select="$references">
109
             <xsl:choose>
110
                <xsl:when test="attributeLabel!=''">
111
                  <td colspan="1" align="center" class="{$stripes}">
112
                     <xsl:for-each select="attributeLabel">
113
                       <xsl:value-of select="."/>
114
                         &#160;<br />
115
                       </xsl:for-each>
116
                  </td>
117
                </xsl:when>
118
                <xsl:otherwise>
119
                   <td colspan="1" align="center" class="{$stripes}">
120
                       &#160;<br />
121
                   </td>
122
                </xsl:otherwise>
123
              </xsl:choose>
124
          </xsl:for-each>
125
        </xsl:when>
126
        <xsl:otherwise>
127
             <xsl:choose>
128
                <xsl:when test="attributeLabel!=''">
129
                  <td colspan="1" align="center" class="{$stripes}">
130
                     <xsl:for-each select="attributeLabel">
131
                       <xsl:value-of select="."/>
132
                         &#160;<br/>
133
                       </xsl:for-each>
134
                  </td>
135
                </xsl:when>
136
                <xsl:otherwise>
137
                   <td colspan="1" align="center" class="{$stripes}">
138
                       &#160;<br />
139
                   </td>
140
                </xsl:otherwise>
141
              </xsl:choose>
142
        </xsl:otherwise>
143
     </xsl:choose>
144
   </xsl:for-each>
145
  </tr>
146 5723 leinfelder
147
  <!--another row for Semantics -->
148
  <xsl:if test="$annotationId != ''">
149
	  <tr><th class="rowodd">Measurement</th>
150
	  <xsl:for-each select="attribute">
151 5724 leinfelder
		<xsl:variable name="stripes">
152
			<xsl:choose>
153
				<xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
154
				<xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
155
			</xsl:choose>
156
		</xsl:variable>
157
		<td class="{$stripes}">
158
			<!-- handle references -->
159
			<xsl:variable name="finalAttributeName">
160
				<xsl:choose>
161
					<xsl:when test="references!=''">
162
						<xsl:variable name="ref_id" select="references"/>
163
						<xsl:variable name="references" select="$ids[@id=$ref_id]" />
164
						<!-- test this - should only be a single value -->
165
						<xsl:value-of select="$references/attributeName"/>
166
					</xsl:when>
167
			        <xsl:otherwise>
168
			          	<xsl:value-of select="attributeName"/>
169
					</xsl:otherwise>
170
				</xsl:choose>
171
			</xsl:variable>
172
			<!-- load annotion detail for attribute -->
173
			<div>
174
           		<xsl:attribute name="id">
175
           			<xsl:value-of select="$finalAttributeName"/>
176
           		</xsl:attribute>
177
           		Loading information for: <xsl:value-of select="$finalAttributeName"/>
178
           	</div>
179
           	<script language="JavaScript">
180
          			var params =
181
				{
182
					'action': 'read',
183
					'docid': '<xsl:value-of select="$annotationId" />',
184
					'qformat': '<xsl:value-of select="$qformat" />',
185
					'attributeLabel': '<xsl:value-of select="$finalAttributeName" />'
186
				};
187
				load(
188
					'<xsl:value-of select="$contextURL" />/metacat',
189
					params,
190
					'<xsl:value-of select="$finalAttributeName" />');
191
			</script>
192
193
		</td>
194 5723 leinfelder
	  </xsl:for-each>
195
	  </tr>
196
	</xsl:if>
197
198 4823 daigle
  <!-- Third row for attribute defination-->
199
  <tr><th class="rowodd">Definition</th>
200
    <xsl:for-each select="attribute">
201
      <xsl:variable name="stripes">
202
              <xsl:choose>
203
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
204
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
205
              </xsl:choose>
206
      </xsl:variable>
207
      <xsl:choose>
208
         <xsl:when test="references!=''">
209
          <xsl:variable name="ref_id" select="references"/>
210
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
211
           <xsl:for-each select="$references">
212
             <td colspan="1" align="center" class="{$stripes}">
213
               <xsl:value-of select="attributeDefinition"/>
214
             </td>
215
           </xsl:for-each>
216
        </xsl:when>
217
        <xsl:otherwise>
218
          <td colspan="1" align="center" class="{$stripes}">
219
             <xsl:value-of select="attributeDefinition"/>
220
          </td>
221
        </xsl:otherwise>
222
     </xsl:choose>
223
   </xsl:for-each>
224
  </tr>
225
226
  <!-- The fourth row for attribute storage type-->
227
   <tr><th class="rowodd">Type of Value</th>
228
     <xsl:for-each select="attribute">
229
      <xsl:variable name="stripes">
230
              <xsl:choose>
231
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
232
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
233
              </xsl:choose>
234
      </xsl:variable>
235
      <xsl:choose>
236
         <xsl:when test="references!=''">
237
          <xsl:variable name="ref_id" select="references"/>
238
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
239
          <xsl:for-each select="$references">
240
            <xsl:choose>
241
              <xsl:when test="storageType!=''">
242
                 <td colspan="1" align="center" class="{$stripes}">
243
                    <xsl:for-each select="storageType">
244
                      <xsl:value-of select="."/>
245
                       &#160;<br/>
246
                    </xsl:for-each>
247
                 </td>
248
              </xsl:when>
249
              <xsl:otherwise>
250
                  <td colspan="1" align="center" class="{$stripes}">
251
                       &#160;
252
                   </td>
253
              </xsl:otherwise>
254
            </xsl:choose>
255
          </xsl:for-each>
256
        </xsl:when>
257
        <xsl:otherwise>
258
           <xsl:choose>
259
              <xsl:when test="storageType!=''">
260
                 <td colspan="1" align="center" class="{$stripes}">
261
                    <xsl:for-each select="storageType">
262
                      <xsl:value-of select="."/>
263
                       &#160;<br/>
264
                    </xsl:for-each>
265
                 </td>
266
              </xsl:when>
267
              <xsl:otherwise>
268
                  <td colspan="1" align="center" class="{$stripes}">
269
                       &#160;
270
                   </td>
271
              </xsl:otherwise>
272
            </xsl:choose>
273
        </xsl:otherwise>
274
     </xsl:choose>
275
   </xsl:for-each>
276
  </tr>
277
278
  <!-- The fifth row for meaturement type-->
279
  <tr><th class="rowodd">Measurement Type</th>
280
   <xsl:for-each select="attribute">
281
    <xsl:variable name="stripes">
282
              <xsl:choose>
283
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
284
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
285
              </xsl:choose>
286
    </xsl:variable>
287
    <xsl:choose>
288
         <xsl:when test="references!=''">
289
          <xsl:variable name="ref_id" select="references"/>
290
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
291
          <xsl:for-each select="$references">
292
            <td colspan="1" align="center" class="{$stripes}">
293
              <xsl:for-each select="measurementScale">
294
                 <xsl:value-of select="local-name(./*)"/>
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:value-of select="local-name(./*)"/>
303
              </xsl:for-each>
304
           </td>
305
        </xsl:otherwise>
306
     </xsl:choose>
307
   </xsl:for-each>
308
  </tr>
309
310
  <!-- The sixth row for meaturement domain-->
311
  <tr><th class="rowodd">Measurement Domain</th>
312
   <xsl:for-each select="attribute">
313
    <xsl:variable name="stripes">
314
              <xsl:choose>
315
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
316
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
317
              </xsl:choose>
318
    </xsl:variable>
319
     <xsl:variable name="innerstripes">
320
              <xsl:choose>
321
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
322
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
323
              </xsl:choose>
324
    </xsl:variable>
325
    <xsl:choose>
326
         <xsl:when test="references!=''">
327
          <xsl:variable name="ref_id" select="references"/>
328
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
329
          <xsl:for-each select="$references">
330
            <td colspan="1" align="center" class="{$stripes}">
331
              <xsl:for-each select="measurementScale">
332
                <xsl:call-template name="measurementscale">
333
                    <xsl:with-param name="docid" select="$docid"/>
334
                    <xsl:with-param name="entitytype" select="$entitytype"/>
335
                    <xsl:with-param name="entityindex" select="$entityindex"/>
336
                    <xsl:with-param name="attributeindex" select="position()"/>
337
                    <xsl:with-param name="stripes" select="$innerstripes"/>
338
                </xsl:call-template>
339
              </xsl:for-each>
340
            </td>
341
         </xsl:for-each>
342
        </xsl:when>
343
        <xsl:otherwise>
344
           <td colspan="1" align="center" class="{$stripes}">
345
              <xsl:for-each select="measurementScale">
346
                <xsl:call-template name="measurementscale">
347
                      <xsl:with-param name="docid" select="$docid"/>
348
                      <xsl:with-param name="entitytype" select="$entitytype"/>
349
                      <xsl:with-param name="entityindex" select="$entityindex"/>
350
                      <xsl:with-param name="attributeindex" select="position()"/>
351
                      <xsl:with-param name="stripes" select="$innerstripes"/>
352
                </xsl:call-template>
353
              </xsl:for-each>
354
           </td>
355
        </xsl:otherwise>
356
     </xsl:choose>
357
   </xsl:for-each>
358
  </tr>
359
360
361
  <!-- The seventh row for missing value code-->
362
  <tr><th class="rowodd">Missing Value Code</th>
363
    <xsl:for-each select="attribute">
364
      <xsl:variable name="stripes">
365
              <xsl:choose>
366
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
367
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
368
              </xsl:choose>
369
     </xsl:variable>
370
     <xsl:variable name="innerstripes">
371
              <xsl:choose>
372
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
373
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
374
              </xsl:choose>
375
     </xsl:variable>
376
     <xsl:choose>
377
         <xsl:when test="references!=''">
378
          <xsl:variable name="ref_id" select="references"/>
379
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
380
          <xsl:for-each select="$references">
381
            <xsl:choose>
382
              <xsl:when test="missingValueCode!=''">
383
                 <td colspan="1" align="center" class="{$stripes}">
384
                    <table>
385
                       <xsl:for-each select="missingValueCode">
386
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
387
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
388
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
389
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
390
                          </tr>
391
                       </xsl:for-each>
392
                   </table>
393
                 </td>
394
              </xsl:when>
395
              <xsl:otherwise>
396
                <td colspan="1" class="{$stripes}">
397
                   &#160;
398
                </td>
399
              </xsl:otherwise>
400
            </xsl:choose>
401
          </xsl:for-each>
402
        </xsl:when>
403
        <xsl:otherwise>
404
           <xsl:choose>
405
              <xsl:when test="missingValueCode!=''">
406
                 <td colspan="1" align="center" class="{$stripes}">
407
                    <table>
408
                       <xsl:for-each select="missingValueCode">
409
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
410
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
411
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
412
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
413
                          </tr>
414
                       </xsl:for-each>
415
                   </table>
416
                 </td>
417
              </xsl:when>
418
              <xsl:otherwise>
419
                <td colspan="1" align="center" class="{$stripes}">
420
                   &#160;
421
                </td>
422
              </xsl:otherwise>
423
            </xsl:choose>
424
        </xsl:otherwise>
425
     </xsl:choose>
426
   </xsl:for-each>
427
  </tr>
428
429
430
  <!-- The eighth row for accuracy report-->
431
  <tr><th class="rowodd">Accuracy Report</th>
432
     <xsl:for-each select="attribute">
433
     <xsl:variable name="stripes">
434
         <xsl:choose>
435
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
436
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
437
         </xsl:choose>
438
    </xsl:variable>
439
    <xsl:choose>
440
         <xsl:when test="references!=''">
441
          <xsl:variable name="ref_id" select="references"/>
442
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
443
          <xsl:for-each select="$references">
444
            <xsl:choose>
445
               <xsl:when test="accuracy!=''">
446
                 <td colspan="1" align="center" class="{$stripes}">
447
                    <xsl:for-each select="accuracy">
448
                          <xsl:value-of select="attributeAccuracyReport"/>
449
                    </xsl:for-each>
450
                 </td>
451
              </xsl:when>
452
              <xsl:otherwise>
453
                <td colspan="1" align="center" class="{$stripes}">
454
                  &#160;
455
                </td>
456
              </xsl:otherwise>
457
            </xsl:choose>
458
          </xsl:for-each>
459
        </xsl:when>
460
        <xsl:otherwise>
461
           <xsl:choose>
462
               <xsl:when test="accuracy!=''">
463
                 <td colspan="1" align="center" class="{$stripes}">
464
                    <xsl:for-each select="accuracy">
465
                          <xsl:value-of select="attributeAccuracyReport"/>
466
                    </xsl:for-each>
467
                 </td>
468
              </xsl:when>
469
              <xsl:otherwise>
470
                <td colspan="1" align="center" class="{$stripes}">
471
                  &#160;
472
                </td>
473
              </xsl:otherwise>
474
            </xsl:choose>
475
        </xsl:otherwise>
476
     </xsl:choose>
477
  </xsl:for-each>
478
  </tr>
479
480
  <!-- The nineth row for quality accuracy accessment -->
481
  <tr><th class="rowodd">Accuracy Assessment</th>
482
     <xsl:for-each select="attribute">
483
     <xsl:variable name="stripes">
484
         <xsl:choose>
485
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
486
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
487
         </xsl:choose>
488
    </xsl:variable>
489
    <xsl:variable name="innerstripes">
490
              <xsl:choose>
491
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
492
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
493
              </xsl:choose>
494
     </xsl:variable>
495
     <xsl:choose>
496
         <xsl:when test="references!=''">
497
          <xsl:variable name="ref_id" select="references"/>
498
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
499
          <xsl:for-each select="$references">
500
            <xsl:choose>
501
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
502
                 <td colspan="1" align="center" class="{$stripes}">
503
                   <xsl:for-each select="accuracy">
504
                     <table>
505
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
506
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
507
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
508
                          </tr>
509
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
510
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
511
                          </tr>
512
                      </xsl:for-each>
513
                   </table>
514
                 </xsl:for-each>
515
               </td>
516
             </xsl:when>
517
             <xsl:otherwise>
518
                <td colspan="1" align="center" class="{$stripes}">
519
                  &#160;
520
                </td>
521
             </xsl:otherwise>
522
           </xsl:choose>
523
          </xsl:for-each>
524
        </xsl:when>
525
        <xsl:otherwise>
526
           <xsl:choose>
527
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
528
                 <td colspan="1" align="center" class="{$stripes}">
529
                   <xsl:for-each select="accuracy">
530
                     <table>
531
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
532
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
533
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
534
                          </tr>
535
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
536
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
537
                          </tr>
538
                      </xsl:for-each>
539
                   </table>
540
                 </xsl:for-each>
541
               </td>
542
             </xsl:when>
543
             <xsl:otherwise>
544
                <td colspan="1" align="center" class="{$stripes}">
545
                  &#160;
546
                </td>
547
             </xsl:otherwise>
548
           </xsl:choose>
549
        </xsl:otherwise>
550
     </xsl:choose>
551
  </xsl:for-each>
552
  </tr>
553
554
   <!-- The tenth row for coverage-->
555
  <tr><th class="rowodd">Coverage</th>
556
   <xsl:for-each select="attribute">
557
    <xsl:variable name="index" select="position()"/>
558
    <xsl:variable name="stripes">
559
              <xsl:choose>
560
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
561
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
562
              </xsl:choose>
563
    </xsl:variable>
564
    <xsl:choose>
565
         <xsl:when test="references!=''">
566
          <xsl:variable name="ref_id" select="references"/>
567
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
568
          <xsl:for-each select="$references">
569
            <xsl:choose>
570
               <xsl:when test="coverage!=''">
571
                  <td colspan="1" align="center" class="{$stripes}">
572
                    <xsl:for-each select="coverage">
573
                      <xsl:call-template name="attributecoverage">
574
                         <xsl:with-param name="docid" select="$docid"/>
575
                         <xsl:with-param name="entitytype" select="$entitytype"/>
576
                         <xsl:with-param name="entityindex" select="$entityindex"/>
577
                         <xsl:with-param name="attributeindex" select="$index"/>
578
                      </xsl:call-template>
579
                    </xsl:for-each>
580
                  </td>
581
               </xsl:when>
582
               <xsl:otherwise>
583
                  <td colspan="1" align="center" class="{$stripes}">
584
                   &#160;
585
                  </td>
586
               </xsl:otherwise>
587
            </xsl:choose>
588
         </xsl:for-each>
589
        </xsl:when>
590
        <xsl:otherwise>
591
          <xsl:choose>
592
               <xsl:when test="coverage!=''">
593
                  <td colspan="1" align="center" class="{$stripes}">
594
                    <xsl:for-each select="coverage">
595
                      <xsl:call-template name="attributecoverage">
596
                         <xsl:with-param name="docid" select="$docid"/>
597
                         <xsl:with-param name="entitytype" select="$entitytype"/>
598
                         <xsl:with-param name="entityindex" select="$entityindex"/>
599
                         <xsl:with-param name="attributeindex" select="$index"/>
600
                      </xsl:call-template>
601
                    </xsl:for-each>
602
                  </td>
603
               </xsl:when>
604
               <xsl:otherwise>
605
                  <td colspan="1" align="center" class="{$stripes}">
606
                   &#160;
607
                  </td>
608
               </xsl:otherwise>
609
            </xsl:choose>
610
        </xsl:otherwise>
611
     </xsl:choose>
612
   </xsl:for-each>
613
  </tr>
614
615
616
   <!-- The eleventh row for method-->
617
  <tr><th class="rowodd">Method</th>
618
   <xsl:for-each select="attribute">
619
    <xsl:variable name="index" select="position()"/>
620
    <xsl:variable name="stripes">
621
              <xsl:choose>
622
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
623
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
624
              </xsl:choose>
625
    </xsl:variable>
626
    <xsl:choose>
627
         <xsl:when test="references!=''">
628
          <xsl:variable name="ref_id" select="references"/>
629
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
630
          <xsl:for-each select="$references">
631
            <xsl:choose>
632
               <xsl:when test="method!=''">
633
                 <td colspan="1" align="center" class="{$stripes}">
634
                   <xsl:for-each select="method">
635
                     <xsl:call-template name="attributemethod">
636
                       <xsl:with-param name="docid" select="$docid"/>
637
                       <xsl:with-param name="entitytype" select="$entitytype"/>
638
                       <xsl:with-param name="entityindex" select="$entityindex"/>
639
                       <xsl:with-param name="attributeindex" select="$index"/>
640
                     </xsl:call-template>
641
                   </xsl:for-each>
642
                 </td>
643
               </xsl:when>
644
               <xsl:otherwise>
645
                 <td colspan="1" align="center" class="{$stripes}">
646
                   &#160;
647
                 </td>
648
               </xsl:otherwise>
649
            </xsl:choose>
650
         </xsl:for-each>
651
        </xsl:when>
652
        <xsl:otherwise>
653
           <xsl:choose>
654
               <xsl:when test="method!=''">
655
                 <td colspan="1" align="center" class="{$stripes}">
656
                   <xsl:for-each select="method">
657
                     <xsl:call-template name="attributemethod">
658
                       <xsl:with-param name="docid" select="$docid"/>
659
                       <xsl:with-param name="entitytype" select="$entitytype"/>
660
                       <xsl:with-param name="entityindex" select="$entityindex"/>
661
                       <xsl:with-param name="attributeindex" select="$index"/>
662
                     </xsl:call-template>
663
                   </xsl:for-each>
664
                 </td>
665
               </xsl:when>
666
               <xsl:otherwise>
667
                 <td colspan="1" align="center" class="{$stripes}">
668
                   &#160;
669
                 </td>
670
               </xsl:otherwise>
671
            </xsl:choose>
672
        </xsl:otherwise>
673
     </xsl:choose>
674
   </xsl:for-each>
675
  </tr>
676
 </xsl:template>
677
678
679
<xsl:template name="singleattribute">
680
   <xsl:param name="docid"/>
681
   <xsl:param name="entitytype"/>
682
   <xsl:param name="entityindex"/>
683
   <xsl:param name="attributeindex"/>
684
685
   <table class="{$tableattributeStyle}">
686
        <xsl:choose>
687
         <xsl:when test="references!=''">
688
          <xsl:variable name="ref_id" select="references"/>
689
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
690
          <xsl:for-each select="$references">
691
            <xsl:call-template name="singleattributecommon">
692
               <xsl:with-param name="docid" select="$docid"/>
693
               <xsl:with-param name="entitytype" select="$entitytype"/>
694
               <xsl:with-param name="entityindex" select="$entityindex"/>
695
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
696
            </xsl:call-template>
697
          </xsl:for-each>
698
        </xsl:when>
699
        <xsl:otherwise>
700
          <xsl:call-template name="singleattributecommon">
701
               <xsl:with-param name="docid" select="$docid"/>
702
               <xsl:with-param name="entitytype" select="$entitytype"/>
703
               <xsl:with-param name="entityindex" select="$entityindex"/>
704
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
705
          </xsl:call-template>
706
        </xsl:otherwise>
707
      </xsl:choose>
708
  </table>
709
</xsl:template>
710
711
712
<xsl:template name="singleattributecommon">
713
   <xsl:param name="docid"/>
714
   <xsl:param name="entitytype"/>
715
   <xsl:param name="entityindex"/>
716
   <xsl:param name="attributeindex"/>
717
718
  <!-- First row for attribute name-->
719
  <tr><th class="rowodd">Column Name</th>
720
  <xsl:for-each select="attribute">
721
   <xsl:if test="position() = $attributeindex">
722
      <xsl:choose>
723
         <xsl:when test="references!=''">
724
          <xsl:variable name="ref_id" select="references"/>
725
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
726
          <xsl:for-each select="$references">
727
            <th><xsl:value-of select="attributeName"/></th>
728
          </xsl:for-each>
729
        </xsl:when>
730
        <xsl:otherwise>
731
          <th><xsl:value-of select="attributeName"/></th>
732
        </xsl:otherwise>
733
     </xsl:choose>
734
   </xsl:if>
735
  </xsl:for-each>
736
  </tr>
737
738
  <!-- Second row for attribute label-->
739
  <tr><th class="rowodd">Column Label</th>
740
   <xsl:for-each select="attribute">
741
    <xsl:if test="position() = $attributeindex">
742
    <xsl:variable name="stripes">
743
              <xsl:choose>
744
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
745
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
746
              </xsl:choose>
747
    </xsl:variable>
748
    <xsl:choose>
749
         <xsl:when test="references!=''">
750
          <xsl:variable name="ref_id" select="references"/>
751
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
752
          <xsl:for-each select="$references">
753
             <xsl:choose>
754
                <xsl:when test="attributeLabel!=''">
755
                  <td colspan="1" align="center" class="{$stripes}">
756
                     <xsl:for-each select="attributeLabel">
757
                       <xsl:value-of select="."/>
758
                         &#160;<br />
759
                       </xsl:for-each>
760
                  </td>
761
                </xsl:when>
762
                <xsl:otherwise>
763
                   <td colspan="1" align="center" class="{$stripes}">
764
                       &#160;<br />
765
                   </td>
766
                </xsl:otherwise>
767
              </xsl:choose>
768
          </xsl:for-each>
769
        </xsl:when>
770
        <xsl:otherwise>
771
             <xsl:choose>
772
                <xsl:when test="attributeLabel!=''">
773
                  <td colspan="1" align="center" class="{$stripes}">
774
                     <xsl:for-each select="attributeLabel">
775
                       <xsl:value-of select="."/>
776
                         &#160;<br/>
777
                       </xsl:for-each>
778
                  </td>
779
                </xsl:when>
780
                <xsl:otherwise>
781
                   <td colspan="1" align="center" class="{$stripes}">
782
                       &#160;<br />
783
                   </td>
784
                </xsl:otherwise>
785
              </xsl:choose>
786
        </xsl:otherwise>
787
     </xsl:choose>
788
    </xsl:if>
789
   </xsl:for-each>
790
  </tr>
791
792
  <!-- Third row for attribute defination-->
793
  <tr><th class="rowodd">Definition</th>
794
    <xsl:for-each select="attribute">
795
     <xsl:if test="position() = $attributeindex">
796
      <xsl:variable name="stripes">
797
              <xsl:choose>
798
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
799
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
800
              </xsl:choose>
801
      </xsl:variable>
802
      <xsl:choose>
803
         <xsl:when test="references!=''">
804
          <xsl:variable name="ref_id" select="references"/>
805
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
806
           <xsl:for-each select="$references">
807
             <td colspan="1" align="center" class="{$stripes}">
808
               <xsl:value-of select="attributeDefinition"/>
809
             </td>
810
           </xsl:for-each>
811
        </xsl:when>
812
        <xsl:otherwise>
813
          <td colspan="1" align="center" class="{$stripes}">
814
             <xsl:value-of select="attributeDefinition"/>
815
          </td>
816
        </xsl:otherwise>
817
     </xsl:choose>
818
    </xsl:if>
819
   </xsl:for-each>
820
  </tr>
821
822
  <!-- The fourth row for attribute storage type-->
823
   <tr><th class="rowodd">Type of Value</th>
824
     <xsl:for-each select="attribute">
825
      <xsl:if test="position() = $attributeindex">
826
      <xsl:variable name="stripes">
827
              <xsl:choose>
828
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
829
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
830
              </xsl:choose>
831
      </xsl:variable>
832
      <xsl:choose>
833
         <xsl:when test="references!=''">
834
          <xsl:variable name="ref_id" select="references"/>
835
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
836
          <xsl:for-each select="$references">
837
            <xsl:choose>
838
              <xsl:when test="storageType!=''">
839
                 <td colspan="1" align="center" class="{$stripes}">
840
                    <xsl:for-each select="storageType">
841
                      <xsl:value-of select="."/>
842
                       &#160;<br/>
843
                    </xsl:for-each>
844
                 </td>
845
              </xsl:when>
846
              <xsl:otherwise>
847
                  <td colspan="1" align="center" class="{$stripes}">
848
                       &#160;
849
                   </td>
850
              </xsl:otherwise>
851
            </xsl:choose>
852
          </xsl:for-each>
853
        </xsl:when>
854
        <xsl:otherwise>
855
           <xsl:choose>
856
              <xsl:when test="storageType!=''">
857
                 <td colspan="1" align="center" class="{$stripes}">
858
                    <xsl:for-each select="storageType">
859
                      <xsl:value-of select="."/>
860
                       &#160;<br/>
861
                    </xsl:for-each>
862
                 </td>
863
              </xsl:when>
864
              <xsl:otherwise>
865
                  <td colspan="1" align="center" class="{$stripes}">
866
                       &#160;
867
                   </td>
868
              </xsl:otherwise>
869
            </xsl:choose>
870
        </xsl:otherwise>
871
     </xsl:choose>
872
    </xsl:if>
873
   </xsl:for-each>
874
  </tr>
875
876
  <!-- The fifth row for meaturement type-->
877
  <tr><th class="rowodd">Measurement Type</th>
878
   <xsl:for-each select="attribute">
879
    <xsl:if test="position() = $attributeindex">
880
    <xsl:variable name="stripes">
881
              <xsl:choose>
882
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
883
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
884
              </xsl:choose>
885
    </xsl:variable>
886
    <xsl:choose>
887
         <xsl:when test="references!=''">
888
          <xsl:variable name="ref_id" select="references"/>
889
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
890
          <xsl:for-each select="$references">
891
            <td colspan="1" align="center" class="{$stripes}">
892
              <xsl:for-each select="measurementScale">
893
                 <xsl:value-of select="local-name(./*)"/>
894
              </xsl:for-each>
895
            </td>
896
         </xsl:for-each>
897
        </xsl:when>
898
        <xsl:otherwise>
899
           <td colspan="1" align="center" class="{$stripes}">
900
              <xsl:for-each select="measurementScale">
901
                 <xsl:value-of select="local-name(./*)"/>
902
              </xsl:for-each>
903
           </td>
904
        </xsl:otherwise>
905
     </xsl:choose>
906
    </xsl:if>
907
   </xsl:for-each>
908
  </tr>
909
910
  <!-- The sixth row for meaturement domain-->
911
  <tr><th class="rowodd">Measurement Domain</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
            <td colspan="1" align="center" class="{$stripes}">
932
              <xsl:for-each select="measurementScale">
933
                <xsl:call-template name="measurementscale">
934
                    <xsl:with-param name="docid" select="$docid"/>
935
                    <xsl:with-param name="entitytype" select="$entitytype"/>
936
                    <xsl:with-param name="entityindex" select="$entityindex"/>
937
                    <xsl:with-param name="attributeindex" select="position()"/>
938
                    <xsl:with-param name="stripes" select="$innerstripes"/>
939
                </xsl:call-template>
940
              </xsl:for-each>
941
            </td>
942
         </xsl:for-each>
943
        </xsl:when>
944
        <xsl:otherwise>
945
           <td colspan="1" align="center" class="{$stripes}">
946
              <xsl:for-each select="measurementScale">
947
                <xsl:call-template name="measurementscale">
948
                      <xsl:with-param name="docid" select="$docid"/>
949
                      <xsl:with-param name="entitytype" select="$entitytype"/>
950
                      <xsl:with-param name="entityindex" select="$entityindex"/>
951
                      <xsl:with-param name="attributeindex" select="position()"/>
952
                      <xsl:with-param name="stripes" select="$innerstripes"/>
953
                </xsl:call-template>
954
              </xsl:for-each>
955
           </td>
956
        </xsl:otherwise>
957
     </xsl:choose>
958
    </xsl:if>
959
   </xsl:for-each>
960
  </tr>
961
962
963
  <!-- The seventh row for missing value code-->
964
  <tr><th class="rowodd">Missing Value Code</th>
965
    <xsl:for-each select="attribute">
966
     <xsl:if test="position() = $attributeindex">
967
      <xsl:variable name="stripes">
968
              <xsl:choose>
969
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
970
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
971
              </xsl:choose>
972
     </xsl:variable>
973
     <xsl:variable name="innerstripes">
974
              <xsl:choose>
975
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
976
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
977
              </xsl:choose>
978
     </xsl:variable>
979
     <xsl:choose>
980
         <xsl:when test="references!=''">
981
          <xsl:variable name="ref_id" select="references"/>
982
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
983
          <xsl:for-each select="$references">
984
            <xsl:choose>
985
              <xsl:when test="missingValueCode!=''">
986
                 <td colspan="1" align="center" class="{$stripes}">
987
                    <table>
988
                       <xsl:for-each select="missingValueCode">
989
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
990
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
991
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
992
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
993
                          </tr>
994
                       </xsl:for-each>
995
                   </table>
996
                 </td>
997
              </xsl:when>
998
              <xsl:otherwise>
999
                <td colspan="1" class="{$stripes}">
1000
                   &#160;
1001
                </td>
1002
              </xsl:otherwise>
1003
            </xsl:choose>
1004
          </xsl:for-each>
1005
        </xsl:when>
1006
        <xsl:otherwise>
1007
           <xsl:choose>
1008
              <xsl:when test="missingValueCode!=''">
1009
                 <td colspan="1" align="center" class="{$stripes}">
1010
                    <table>
1011
                       <xsl:for-each select="missingValueCode">
1012
                          <tr><td class="{$innerstripes}"><b>Code</b></td>                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
1013
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1014
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
1015
                          </tr>
1016
                       </xsl:for-each>
1017
                   </table>
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
1033
  <!-- The eighth row for accuracy report-->
1034
  <tr><th class="rowodd">Accuracy Report</th>
1035
     <xsl:for-each select="attribute">
1036
     <xsl:if test="position() = $attributeindex">
1037
     <xsl:variable name="stripes">
1038
         <xsl:choose>
1039
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1040
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1041
         </xsl:choose>
1042
    </xsl:variable>
1043
    <xsl:choose>
1044
         <xsl:when test="references!=''">
1045
          <xsl:variable name="ref_id" select="references"/>
1046
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1047
          <xsl:for-each select="$references">
1048
            <xsl:choose>
1049
               <xsl:when test="accuracy!=''">
1050
                 <td colspan="1" align="center" class="{$stripes}">
1051
                    <xsl:for-each select="accuracy">
1052
                          <xsl:value-of select="attributeAccuracyReport"/>
1053
                    </xsl:for-each>
1054
                 </td>
1055
              </xsl:when>
1056
              <xsl:otherwise>
1057
                <td colspan="1" align="center" class="{$stripes}">
1058
                  &#160;
1059
                </td>
1060
              </xsl:otherwise>
1061
            </xsl:choose>
1062
          </xsl:for-each>
1063
        </xsl:when>
1064
        <xsl:otherwise>
1065
           <xsl:choose>
1066
               <xsl:when test="accuracy!=''">
1067
                 <td colspan="1" align="center" class="{$stripes}">
1068
                    <xsl:for-each select="accuracy">
1069
                          <xsl:value-of select="attributeAccuracyReport"/>
1070
                    </xsl:for-each>
1071
                 </td>
1072
              </xsl:when>
1073
              <xsl:otherwise>
1074
                <td colspan="1" align="center" class="{$stripes}">
1075
                  &#160;
1076
                </td>
1077
              </xsl:otherwise>
1078
            </xsl:choose>
1079
        </xsl:otherwise>
1080
     </xsl:choose>
1081
   </xsl:if>
1082
  </xsl:for-each>
1083
  </tr>
1084
1085
  <!-- The nineth row for quality accuracy accessment -->
1086
  <tr><th class="rowodd">Accuracy Assessment</th>
1087
     <xsl:for-each select="attribute">
1088
     <xsl:if test="position() = $attributeindex">
1089
     <xsl:variable name="stripes">
1090
         <xsl:choose>
1091
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1092
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1093
         </xsl:choose>
1094
    </xsl:variable>
1095
    <xsl:variable name="innerstripes">
1096
              <xsl:choose>
1097
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
1098
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
1099
              </xsl:choose>
1100
     </xsl:variable>
1101
     <xsl:choose>
1102
         <xsl:when test="references!=''">
1103
          <xsl:variable name="ref_id" select="references"/>
1104
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1105
          <xsl:for-each select="$references">
1106
            <xsl:choose>
1107
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1108
                 <td colspan="1" align="center" class="{$stripes}">
1109
                   <xsl:for-each select="accuracy">
1110
                     <table>
1111
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1112
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1113
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1114
                          </tr>
1115
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1116
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1117
                          </tr>
1118
                      </xsl:for-each>
1119
                   </table>
1120
                 </xsl:for-each>
1121
               </td>
1122
             </xsl:when>
1123
             <xsl:otherwise>
1124
                <td colspan="1" align="center" class="{$stripes}">
1125
                  &#160;
1126
                </td>
1127
             </xsl:otherwise>
1128
           </xsl:choose>
1129
          </xsl:for-each>
1130
        </xsl:when>
1131
        <xsl:otherwise>
1132
           <xsl:choose>
1133
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1134
                 <td colspan="1" align="center" class="{$stripes}">
1135
                   <xsl:for-each select="accuracy">
1136
                     <table>
1137
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1138
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1139
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1140
                          </tr>
1141
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1142
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1143
                          </tr>
1144
                      </xsl:for-each>
1145
                   </table>
1146
                 </xsl:for-each>
1147
               </td>
1148
             </xsl:when>
1149
             <xsl:otherwise>
1150
                <td colspan="1" align="center" class="{$stripes}">
1151
                  &#160;
1152
                </td>
1153
             </xsl:otherwise>
1154
           </xsl:choose>
1155
        </xsl:otherwise>
1156
     </xsl:choose>
1157
   </xsl:if>
1158
  </xsl:for-each>
1159
  </tr>
1160
1161
   <!-- The tenth row for coverage-->
1162
  <tr><th class="rowodd">Coverage</th>
1163
   <xsl:for-each select="attribute">
1164
    <xsl:if test="position() = $attributeindex">
1165
    <xsl:variable name="index" select="position()"/>
1166
    <xsl:variable name="stripes">
1167
              <xsl:choose>
1168
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1169
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1170
              </xsl:choose>
1171
    </xsl:variable>
1172
    <xsl:choose>
1173
         <xsl:when test="references!=''">
1174
          <xsl:variable name="ref_id" select="references"/>
1175
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1176
          <xsl:for-each select="$references">
1177
            <xsl:choose>
1178
               <xsl:when test="coverage!=''">
1179
                  <td colspan="1" align="center" class="{$stripes}">
1180
                    <xsl:for-each select="coverage">
1181
                      <xsl:call-template name="attributecoverage">
1182
                         <xsl:with-param name="docid" select="$docid"/>
1183
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1184
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1185
                         <xsl:with-param name="attributeindex" select="$index"/>
1186
                      </xsl:call-template>
1187
                    </xsl:for-each>
1188
                  </td>
1189
               </xsl:when>
1190
               <xsl:otherwise>
1191
                  <td colspan="1" align="center" class="{$stripes}">
1192
                   &#160;
1193
                  </td>
1194
               </xsl:otherwise>
1195
            </xsl:choose>
1196
         </xsl:for-each>
1197
        </xsl:when>
1198
        <xsl:otherwise>
1199
          <xsl:choose>
1200
               <xsl:when test="coverage!=''">
1201
                  <td colspan="1" align="center" class="{$stripes}">
1202
                    <xsl:for-each select="coverage">
1203
                      <xsl:call-template name="attributecoverage">
1204
                         <xsl:with-param name="docid" select="$docid"/>
1205
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1206
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1207
                         <xsl:with-param name="attributeindex" select="$index"/>
1208
                      </xsl:call-template>
1209
                    </xsl:for-each>
1210
                  </td>
1211
               </xsl:when>
1212
               <xsl:otherwise>
1213
                  <td colspan="1" align="center" class="{$stripes}">
1214
                   &#160;
1215
                  </td>
1216
               </xsl:otherwise>
1217
            </xsl:choose>
1218
        </xsl:otherwise>
1219
     </xsl:choose>
1220
    </xsl:if>
1221
   </xsl:for-each>
1222
  </tr>
1223
1224
1225
   <!-- The eleventh row for method-->
1226
  <tr><th class="rowodd">Method</th>
1227
   <xsl:for-each select="attribute">
1228
    <xsl:if test="position() = $attributeindex">
1229
    <xsl:variable name="index" select="position()"/>
1230
    <xsl:variable name="stripes">
1231
              <xsl:choose>
1232
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1233
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1234
              </xsl:choose>
1235
    </xsl:variable>
1236
    <xsl:choose>
1237
         <xsl:when test="references!=''">
1238
          <xsl:variable name="ref_id" select="references"/>
1239
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1240
          <xsl:for-each select="$references">
1241
            <xsl:choose>
1242
               <xsl:when test="method!=''">
1243
                 <td colspan="1" align="center" class="{$stripes}">
1244
                   <xsl:for-each select="method">
1245
                     <xsl:call-template name="attributemethod">
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="$index"/>
1250
                     </xsl:call-template>
1251
                   </xsl:for-each>
1252
                 </td>
1253
               </xsl:when>
1254
               <xsl:otherwise>
1255
                 <td colspan="1" align="center" class="{$stripes}">
1256
                   &#160;
1257
                 </td>
1258
               </xsl:otherwise>
1259
            </xsl:choose>
1260
         </xsl:for-each>
1261
        </xsl:when>
1262
        <xsl:otherwise>
1263
           <xsl:choose>
1264
               <xsl:when test="method!=''">
1265
                 <td colspan="1" align="center" class="{$stripes}">
1266
                   <xsl:for-each select="method">
1267
                     <xsl:call-template name="attributemethod">
1268
                       <xsl:with-param name="docid" select="$docid"/>
1269
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1270
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1271
                       <xsl:with-param name="attributeindex" select="$index"/>
1272
                     </xsl:call-template>
1273
                   </xsl:for-each>
1274
                 </td>
1275
               </xsl:when>
1276
               <xsl:otherwise>
1277
                 <td colspan="1" align="center" class="{$stripes}">
1278
                   &#160;
1279
                 </td>
1280
               </xsl:otherwise>
1281
            </xsl:choose>
1282
        </xsl:otherwise>
1283
     </xsl:choose>
1284
    </xsl:if>
1285
   </xsl:for-each>
1286
  </tr>
1287
 </xsl:template>
1288
1289
1290
<xsl:template name="measurementscale">
1291
   <xsl:param name="stripes"/>
1292
   <xsl:param name="docid"/>
1293
   <xsl:param name="entitytype"/>
1294
   <xsl:param name="entityindex"/>
1295
   <xsl:param name="attributeindex"/>
1296
   <table>
1297
    <xsl:for-each select="nominal">
1298
         <xsl:call-template name="attributenonnumericdomain">
1299
               <xsl:with-param name="docid" select="$docid"/>
1300
               <xsl:with-param name="entitytype" select="$entitytype"/>
1301
               <xsl:with-param name="entityindex" select="$entityindex"/>
1302
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1303
               <xsl:with-param name="stripes" select="$stripes"/>
1304
       </xsl:call-template>
1305
    </xsl:for-each>
1306
    <xsl:for-each select="ordinal">
1307
       <xsl:call-template name="attributenonnumericdomain">
1308
               <xsl:with-param name="docid" select="$docid"/>
1309
               <xsl:with-param name="entitytype" select="$entitytype"/>
1310
               <xsl:with-param name="entityindex" select="$entityindex"/>
1311
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1312
               <xsl:with-param name="stripes" select="$stripes"/>
1313
       </xsl:call-template>
1314
    </xsl:for-each>
1315
    <xsl:for-each select="interval">
1316
       <xsl:call-template name="intervalratio">
1317
         <xsl:with-param name="stripes" select="$stripes"/>
1318
       </xsl:call-template>
1319
    </xsl:for-each>
1320
    <xsl:for-each select="ratio">
1321
       <xsl:call-template name="intervalratio">
1322
         <xsl:with-param name="stripes" select="$stripes"/>
1323
       </xsl:call-template>
1324
    </xsl:for-each>
1325
    <xsl:for-each select="datetime">
1326
       <xsl:call-template name="datetime">
1327
          <xsl:with-param name="stripes" select="$stripes"/>
1328
       </xsl:call-template>
1329
    </xsl:for-each>
1330
   </table>
1331
 </xsl:template>
1332
1333
 <xsl:template name="attributenonnumericdomain">
1334
   <xsl:param name="stripes"/>
1335
   <xsl:param name="docid"/>
1336
   <xsl:param name="entitytype"/>
1337
   <xsl:param name="entityindex"/>
1338
   <xsl:param name="attributeindex"/>
1339
   <xsl:for-each select="nonNumericDomain">
1340
     <xsl:choose>
1341
         <xsl:when test="references!=''">
1342
          <xsl:variable name="ref_id" select="references"/>
1343
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1344
          <xsl:for-each select="$references">
1345
            <xsl:call-template name="attributenonnumericdomaincommon">
1346
                <xsl:with-param name="docid" select="$docid"/>
1347
                <xsl:with-param name="entitytype" select="$entitytype"/>
1348
                <xsl:with-param name="entityindex" select="$entityindex"/>
1349
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
1350
                <xsl:with-param name="stripes" select="$stripes"/>
1351
            </xsl:call-template>
1352
         </xsl:for-each>
1353
        </xsl:when>
1354
        <xsl:otherwise>
1355
            <xsl:call-template name="attributenonnumericdomaincommon">
1356
               <xsl:with-param name="docid" select="$docid"/>
1357
               <xsl:with-param name="entitytype" select="$entitytype"/>
1358
               <xsl:with-param name="entityindex" select="$entityindex"/>
1359
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1360
               <xsl:with-param name="stripes" select="$stripes"/>
1361
            </xsl:call-template>
1362
        </xsl:otherwise>
1363
     </xsl:choose>
1364
   </xsl:for-each>
1365
 </xsl:template>
1366
1367
 <xsl:template name="attributenonnumericdomaincommon">
1368
    <xsl:param name="stripes"/>
1369
    <xsl:param name="docid"/>
1370
    <xsl:param name="entitytype"/>
1371
    <xsl:param name="entityindex"/>
1372
    <xsl:param name="attributeindex"/>
1373
    <!-- if numericdomain only has one test domain,
1374
        it will be displayed inline otherwith will be show a link-->
1375
    <xsl:choose>
1376
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">
1377
        <tr><td class="{$stripes}"><b>Def</b></td>
1378
            <td class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
1379
            </td>
1380
        </tr>
1381
        <xsl:for-each select="textDomain/parttern">
1382
          <tr><td class="{$stripes}"><b>Pattern</b></td>
1383
            <td class="{$stripes}"><xsl:value-of select="."/>
1384
            </td>
1385
          </tr>
1386
        </xsl:for-each>
1387
        <xsl:for-each select="textDomain/source">
1388
          <tr><td class="{$stripes}"><b>Source</b></td>
1389
            <td class="{$stripes}"><xsl:value-of select="."/>
1390
            </td>
1391
          </tr>
1392
        </xsl:for-each>
1393
      </xsl:when>
1394
      <xsl:otherwise>
1395
         <tr><td colspan="2" align="center" class="{$stripes}" >
1396
           <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>
1397
           <b>Domain Info</b></a>
1398
         </td></tr>
1399
      </xsl:otherwise>
1400
    </xsl:choose>
1401
 </xsl:template>
1402
1403
 <xsl:template name="intervalratio">
1404
    <xsl:param name="stripes"/>
1405
    <xsl:if test="unit/standardUnit">
1406
      <tr><td class="{$stripes}"><b>Unit</b></td>
1407
            <td class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
1408
            </td>
1409
      </tr>
1410
    </xsl:if>
1411
    <xsl:if test="unit/customUnit">
1412
      <tr><td class="{$stripes}"><b>Unit</b></td>
1413
            <td class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
1414
            </td>
1415
      </tr>
1416
   </xsl:if>
1417
   <xsl:for-each select="precision">
1418
      <tr><td class="{$stripes}"><b>Precision</b></td>
1419
            <td class="{$stripes}"><xsl:value-of select="."/>
1420
            </td>
1421
      </tr>
1422
   </xsl:for-each>
1423
   <xsl:for-each select="numericDomain">
1424
      <xsl:call-template name="numericDomain">
1425
         <xsl:with-param name="stripes" select="$stripes"/>
1426
      </xsl:call-template>
1427
    </xsl:for-each>
1428
  </xsl:template>
1429
1430
1431
 <xsl:template name="numericDomain">
1432
     <xsl:param name="stripes"/>
1433
       <xsl:choose>
1434
         <xsl:when test="references!=''">
1435
          <xsl:variable name="ref_id" select="references"/>
1436
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1437
          <xsl:for-each select="$references">
1438
            <tr><td class="{$stripes}"><b>Type</b></td>
1439
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1440
                </td>
1441
            </tr>
1442
            <xsl:for-each select="bounds">
1443
              <tr><td class="{$stripes}"><b>Min</b></td>
1444
                  <td class="{$stripes}">
1445
                    <xsl:for-each select="minimum">
1446
                      <xsl:value-of select="."/>&#160;
1447
                    </xsl:for-each>
1448
                  </td>
1449
              </tr>
1450
              <tr><td class="{$stripes}"><b>Max</b></td>
1451
                  <td class="{$stripes}">
1452
                    <xsl:for-each select="maximum">
1453
                      <xsl:value-of select="."/>&#160;
1454
                    </xsl:for-each>
1455
                  </td>
1456
              </tr>
1457
            </xsl:for-each>
1458
          </xsl:for-each>
1459
        </xsl:when>
1460
        <xsl:otherwise>
1461
          <tr><td class="{$stripes}"><b>Type</b></td>
1462
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1463
                </td>
1464
            </tr>
1465
            <xsl:for-each select="bounds">
1466
              <tr><td class="{$stripes}"><b>Min</b></td>
1467
                  <td class="{$stripes}">
1468
                    <xsl:for-each select="minimum">
1469
                      <xsl:value-of select="."/>&#160;
1470
                    </xsl:for-each>
1471
                  </td>
1472
              </tr>
1473
              <tr><td class="{$stripes}"><b>Max</b></td>
1474
                  <td class="{$stripes}">
1475
                    <xsl:for-each select="maximum">
1476
                      <xsl:value-of select="."/>&#160;
1477
                    </xsl:for-each>
1478
                  </td>
1479
              </tr>
1480
            </xsl:for-each>
1481
        </xsl:otherwise>
1482
      </xsl:choose>
1483
  </xsl:template>
1484
1485
 <xsl:template name="datetime">
1486
    <xsl:param name="stripes"/>
1487
    <tr><td class="{$stripes}"><b>Format</b></td>
1488
         <td class="{$stripes}">
1489
            <xsl:value-of select="formatString"/>
1490
         </td>
1491
    </tr>
1492
     <tr><td class="{$stripes}"><b>Precision</b></td>
1493
         <td class="{$stripes}">
1494
            <xsl:value-of select="dateTimePrecision"/>
1495
         </td>
1496
    </tr>
1497
    <xsl:call-template name="timedomain"/>
1498
 </xsl:template>
1499
1500
1501
 <xsl:template name="timedomain">
1502
    <xsl:param name="stripes"/>
1503
      <xsl:choose>
1504
         <xsl:when test="references!=''">
1505
          <xsl:variable name="ref_id" select="references"/>
1506
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1507
          <xsl:for-each select="$references">
1508
            <xsl:for-each select="bounds">
1509
              <tr><td class="{$stripes}"><b>Min</b></td>
1510
                  <td class="{$stripes}">
1511
                    <xsl:for-each select="minimum">
1512
                      <xsl:value-of select="."/>&#160;
1513
                    </xsl:for-each>
1514
                  </td>
1515
              </tr>
1516
              <tr><td class="{$stripes}"><b>Max</b></td>
1517
                  <td class="{$stripes}">
1518
                    <xsl:for-each select="maximum">
1519
                      <xsl:value-of select="."/>&#160;
1520
                    </xsl:for-each>
1521
                  </td>
1522
              </tr>
1523
            </xsl:for-each>
1524
          </xsl:for-each>
1525
        </xsl:when>
1526
        <xsl:otherwise>
1527
           <xsl:for-each select="bounds">
1528
              <tr><td class="{$stripes}"><b>Min</b></td>
1529
                  <td class="{$stripes}">
1530
                    <xsl:for-each select="minimum">
1531
                      <xsl:value-of select="."/>&#160;
1532
                    </xsl:for-each>
1533
                  </td>
1534
              </tr>
1535
              <tr><td class="{$stripes}"><b>Max</b></td>
1536
                  <td class="{$stripes}">
1537
                    <xsl:for-each select="maximum">
1538
                      <xsl:value-of select="."/>&#160;
1539
                    </xsl:for-each>
1540
                  </td>
1541
              </tr>
1542
            </xsl:for-each>
1543
        </xsl:otherwise>
1544
      </xsl:choose>
1545
  </xsl:template>
1546
1547
 <xsl:template name="attributecoverage">
1548
    <xsl:param name="docid"/>
1549
    <xsl:param name="entitytype"/>
1550
    <xsl:param name="entityindex"/>
1551
    <xsl:param name="attributeindex"/>
1552
     <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>
1553
           <b>Coverage Info</b></a>
1554
 </xsl:template>
1555
1556
 <xsl:template name="attributemethod">
1557
    <xsl:param name="docid"/>
1558
    <xsl:param name="entitytype"/>
1559
    <xsl:param name="entityindex"/>
1560
    <xsl:param name="attributeindex"/>
1561
     <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>
1562
           <b>Method Info</b></a>
1563
 </xsl:template>
1564
1565
</xsl:stylesheet>