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:param name="annotationId"/>              
40

    
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
  
147
  <!--another row for Semantics -->
148
  <xsl:if test="$annotationId != ''">
149
	  <tr><th class="rowodd">Measurement</th>
150
	  <xsl:for-each select="attribute">
151
		<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
					'showEntity': 'true'
187
				};
188
				load(
189
					'<xsl:value-of select="$contextURL" />/metacat',
190
					params, 
191
					'<xsl:value-of select="$finalAttributeName" />');
192
			</script>
193
		
194
		</td>
195
	  </xsl:for-each>
196
	  </tr>
197
	</xsl:if>
198
	
199
  <!-- Third row for attribute defination-->
200
  <tr><th class="rowodd">Definition</th>
201
    <xsl:for-each select="attribute">
202
      <xsl:variable name="stripes">
203
              <xsl:choose>
204
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
205
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
206
              </xsl:choose>
207
      </xsl:variable>
208
      <xsl:choose>
209
         <xsl:when test="references!=''">
210
          <xsl:variable name="ref_id" select="references"/>
211
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
212
           <xsl:for-each select="$references">
213
             <td colspan="1" align="center" class="{$stripes}">
214
               <xsl:value-of select="attributeDefinition"/>
215
             </td>
216
           </xsl:for-each>
217
        </xsl:when>
218
        <xsl:otherwise>
219
          <td colspan="1" align="center" class="{$stripes}">
220
             <xsl:value-of select="attributeDefinition"/>
221
          </td>
222
        </xsl:otherwise>
223
     </xsl:choose>
224
   </xsl:for-each>
225
  </tr>
226

    
227
  <!-- The fourth row for attribute storage type-->
228
   <tr><th class="rowodd">Type of Value</th>
229
     <xsl:for-each select="attribute">
230
      <xsl:variable name="stripes">
231
              <xsl:choose>
232
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
233
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
234
              </xsl:choose>
235
      </xsl:variable>
236
      <xsl:choose>
237
         <xsl:when test="references!=''">
238
          <xsl:variable name="ref_id" select="references"/>
239
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
240
          <xsl:for-each select="$references">
241
            <xsl:choose>
242
              <xsl:when test="storageType!=''">
243
                 <td colspan="1" align="center" class="{$stripes}">
244
                    <xsl:for-each select="storageType">
245
                      <xsl:value-of select="."/>
246
                       &#160;<br/>
247
                    </xsl:for-each>
248
                 </td>
249
              </xsl:when>
250
              <xsl:otherwise>
251
                  <td colspan="1" align="center" class="{$stripes}">
252
                       &#160;
253
                   </td>
254
              </xsl:otherwise>
255
            </xsl:choose>
256
          </xsl:for-each>
257
        </xsl:when>
258
        <xsl:otherwise>
259
           <xsl:choose>
260
              <xsl:when test="storageType!=''">
261
                 <td colspan="1" align="center" class="{$stripes}">
262
                    <xsl:for-each select="storageType">
263
                      <xsl:value-of select="."/>
264
                       &#160;<br/>
265
                    </xsl:for-each>
266
                 </td>
267
              </xsl:when>
268
              <xsl:otherwise>
269
                  <td colspan="1" align="center" class="{$stripes}">
270
                       &#160;
271
                   </td>
272
              </xsl:otherwise>
273
            </xsl:choose>
274
        </xsl:otherwise>
275
     </xsl:choose>
276
   </xsl:for-each>
277
  </tr>
278

    
279
  <!-- The fifth row for meaturement type-->
280
  <tr><th class="rowodd">Measurement Type</th>
281
   <xsl:for-each select="attribute">
282
    <xsl:variable name="stripes">
283
              <xsl:choose>
284
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
285
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
286
              </xsl:choose>
287
    </xsl:variable>
288
    <xsl:choose>
289
         <xsl:when test="references!=''">
290
          <xsl:variable name="ref_id" select="references"/>
291
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
292
          <xsl:for-each select="$references">
293
            <td colspan="1" align="center" class="{$stripes}">
294
              <xsl:for-each select="measurementScale">
295
                 <xsl:value-of select="local-name(./*)"/>
296
              </xsl:for-each>
297
            </td>
298
         </xsl:for-each>
299
        </xsl:when>
300
        <xsl:otherwise>
301
           <td colspan="1" align="center" class="{$stripes}">
302
              <xsl:for-each select="measurementScale">
303
                 <xsl:value-of select="local-name(./*)"/>
304
              </xsl:for-each>
305
           </td>
306
        </xsl:otherwise>
307
     </xsl:choose>
308
   </xsl:for-each>
309
  </tr>
310

    
311
  <!-- The sixth row for meaturement domain-->
312
  <tr><th class="rowodd">Measurement Domain</th>
313
   <xsl:for-each select="attribute">
314
    <xsl:variable name="stripes">
315
              <xsl:choose>
316
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
317
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
318
              </xsl:choose>
319
    </xsl:variable>
320
     <xsl:variable name="innerstripes">
321
              <xsl:choose>
322
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
323
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
324
              </xsl:choose>
325
    </xsl:variable>
326
    <xsl:choose>
327
         <xsl:when test="references!=''">
328
          <xsl:variable name="ref_id" select="references"/>
329
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
330
          <xsl:for-each select="$references">
331
            <td colspan="1" align="center" class="{$stripes}">
332
              <xsl:for-each select="measurementScale">
333
                <xsl:call-template name="measurementscale">
334
                    <xsl:with-param name="docid" select="$docid"/>
335
                    <xsl:with-param name="entitytype" select="$entitytype"/>
336
                    <xsl:with-param name="entityindex" select="$entityindex"/>
337
                    <xsl:with-param name="attributeindex" select="position()"/>
338
                    <xsl:with-param name="stripes" select="$innerstripes"/>
339
                </xsl:call-template>
340
              </xsl:for-each>
341
            </td>
342
         </xsl:for-each>
343
        </xsl:when>
344
        <xsl:otherwise>
345
           <td colspan="1" align="center" class="{$stripes}">
346
              <xsl:for-each select="measurementScale">
347
                <xsl:call-template name="measurementscale">
348
                      <xsl:with-param name="docid" select="$docid"/>
349
                      <xsl:with-param name="entitytype" select="$entitytype"/>
350
                      <xsl:with-param name="entityindex" select="$entityindex"/>
351
                      <xsl:with-param name="attributeindex" select="position()"/>
352
                      <xsl:with-param name="stripes" select="$innerstripes"/>
353
                </xsl:call-template>
354
              </xsl:for-each>
355
           </td>
356
        </xsl:otherwise>
357
     </xsl:choose>
358
   </xsl:for-each>
359
  </tr>
360

    
361

    
362
  <!-- The seventh row for missing value code-->
363
  <tr><th class="rowodd">Missing Value Code</th>
364
    <xsl:for-each select="attribute">
365
      <xsl:variable name="stripes">
366
              <xsl:choose>
367
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
368
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
369
              </xsl:choose>
370
     </xsl:variable>
371
     <xsl:variable name="innerstripes">
372
              <xsl:choose>
373
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
374
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
375
              </xsl:choose>
376
     </xsl:variable>
377
     <xsl:choose>
378
         <xsl:when test="references!=''">
379
          <xsl:variable name="ref_id" select="references"/>
380
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
381
          <xsl:for-each select="$references">
382
            <xsl:choose>
383
              <xsl:when test="missingValueCode!=''">
384
                 <td colspan="1" align="center" class="{$stripes}">
385
                    <table>
386
                       <xsl:for-each select="missingValueCode">
387
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
388
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
389
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
390
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
391
                          </tr>
392
                       </xsl:for-each>
393
                   </table>
394
                 </td>
395
              </xsl:when>
396
              <xsl:otherwise>
397
                <td colspan="1" class="{$stripes}">
398
                   &#160;
399
                </td>
400
              </xsl:otherwise>
401
            </xsl:choose>
402
          </xsl:for-each>
403
        </xsl:when>
404
        <xsl:otherwise>
405
           <xsl:choose>
406
              <xsl:when test="missingValueCode!=''">
407
                 <td colspan="1" align="center" class="{$stripes}">
408
                    <table>
409
                       <xsl:for-each select="missingValueCode">
410
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
411
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
412
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
413
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
414
                          </tr>
415
                       </xsl:for-each>
416
                   </table>
417
                 </td>
418
              </xsl:when>
419
              <xsl:otherwise>
420
                <td colspan="1" align="center" class="{$stripes}">
421
                   &#160;
422
                </td>
423
              </xsl:otherwise>
424
            </xsl:choose>
425
        </xsl:otherwise>
426
     </xsl:choose>
427
   </xsl:for-each>
428
  </tr>
429

    
430

    
431
  <!-- The eighth row for accuracy report-->
432
  <tr><th class="rowodd">Accuracy Report</th>
433
     <xsl:for-each select="attribute">
434
     <xsl:variable name="stripes">
435
         <xsl:choose>
436
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
437
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
438
         </xsl:choose>
439
    </xsl:variable>
440
    <xsl:choose>
441
         <xsl:when test="references!=''">
442
          <xsl:variable name="ref_id" select="references"/>
443
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
444
          <xsl:for-each select="$references">
445
            <xsl:choose>
446
               <xsl:when test="accuracy!=''">
447
                 <td colspan="1" align="center" class="{$stripes}">
448
                    <xsl:for-each select="accuracy">
449
                          <xsl:value-of select="attributeAccuracyReport"/>
450
                    </xsl:for-each>
451
                 </td>
452
              </xsl:when>
453
              <xsl:otherwise>
454
                <td colspan="1" align="center" class="{$stripes}">
455
                  &#160;
456
                </td>
457
              </xsl:otherwise>
458
            </xsl:choose>
459
          </xsl:for-each>
460
        </xsl:when>
461
        <xsl:otherwise>
462
           <xsl:choose>
463
               <xsl:when test="accuracy!=''">
464
                 <td colspan="1" align="center" class="{$stripes}">
465
                    <xsl:for-each select="accuracy">
466
                          <xsl:value-of select="attributeAccuracyReport"/>
467
                    </xsl:for-each>
468
                 </td>
469
              </xsl:when>
470
              <xsl:otherwise>
471
                <td colspan="1" align="center" class="{$stripes}">
472
                  &#160;
473
                </td>
474
              </xsl:otherwise>
475
            </xsl:choose>
476
        </xsl:otherwise>
477
     </xsl:choose>
478
  </xsl:for-each>
479
  </tr>
480

    
481
  <!-- The nineth row for quality accuracy accessment -->
482
  <tr><th class="rowodd">Accuracy Assessment</th>
483
     <xsl:for-each select="attribute">
484
     <xsl:variable name="stripes">
485
         <xsl:choose>
486
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
487
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
488
         </xsl:choose>
489
    </xsl:variable>
490
    <xsl:variable name="innerstripes">
491
              <xsl:choose>
492
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
493
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
494
              </xsl:choose>
495
     </xsl:variable>
496
     <xsl:choose>
497
         <xsl:when test="references!=''">
498
          <xsl:variable name="ref_id" select="references"/>
499
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
500
          <xsl:for-each select="$references">
501
            <xsl:choose>
502
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
503
                 <td colspan="1" align="center" class="{$stripes}">
504
                   <xsl:for-each select="accuracy">
505
                     <table>
506
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
507
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
508
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
509
                          </tr>
510
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
511
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
512
                          </tr>
513
                      </xsl:for-each>
514
                   </table>
515
                 </xsl:for-each>
516
               </td>
517
             </xsl:when>
518
             <xsl:otherwise>
519
                <td colspan="1" align="center" class="{$stripes}">
520
                  &#160;
521
                </td>
522
             </xsl:otherwise>
523
           </xsl:choose>
524
          </xsl:for-each>
525
        </xsl:when>
526
        <xsl:otherwise>
527
           <xsl:choose>
528
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
529
                 <td colspan="1" align="center" class="{$stripes}">
530
                   <xsl:for-each select="accuracy">
531
                     <table>
532
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
533
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
534
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
535
                          </tr>
536
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
537
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
538
                          </tr>
539
                      </xsl:for-each>
540
                   </table>
541
                 </xsl:for-each>
542
               </td>
543
             </xsl:when>
544
             <xsl:otherwise>
545
                <td colspan="1" align="center" class="{$stripes}">
546
                  &#160;
547
                </td>
548
             </xsl:otherwise>
549
           </xsl:choose>
550
        </xsl:otherwise>
551
     </xsl:choose>
552
  </xsl:for-each>
553
  </tr>
554

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

    
616

    
617
   <!-- The eleventh row for method-->
618
  <tr><th class="rowodd">Method</th>
619
   <xsl:for-each select="attribute">
620
    <xsl:variable name="index" select="position()"/>
621
    <xsl:variable name="stripes">
622
              <xsl:choose>
623
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
624
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
625
              </xsl:choose>
626
    </xsl:variable>
627
    <xsl:choose>
628
         <xsl:when test="references!=''">
629
          <xsl:variable name="ref_id" select="references"/>
630
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
631
          <xsl:for-each select="$references">
632
            <xsl:choose>
633
               <xsl:when test="method!=''">
634
                 <td colspan="1" align="center" class="{$stripes}">
635
                   <xsl:for-each select="method">
636
                     <xsl:call-template name="attributemethod">
637
                       <xsl:with-param name="docid" select="$docid"/>
638
                       <xsl:with-param name="entitytype" select="$entitytype"/>
639
                       <xsl:with-param name="entityindex" select="$entityindex"/>
640
                       <xsl:with-param name="attributeindex" select="$index"/>
641
                     </xsl:call-template>
642
                   </xsl:for-each>
643
                 </td>
644
               </xsl:when>
645
               <xsl:otherwise>
646
                 <td colspan="1" align="center" class="{$stripes}">
647
                   &#160;
648
                 </td>
649
               </xsl:otherwise>
650
            </xsl:choose>
651
         </xsl:for-each>
652
        </xsl:when>
653
        <xsl:otherwise>
654
           <xsl:choose>
655
               <xsl:when test="method!=''">
656
                 <td colspan="1" align="center" class="{$stripes}">
657
                   <xsl:for-each select="method">
658
                     <xsl:call-template name="attributemethod">
659
                       <xsl:with-param name="docid" select="$docid"/>
660
                       <xsl:with-param name="entitytype" select="$entitytype"/>
661
                       <xsl:with-param name="entityindex" select="$entityindex"/>
662
                       <xsl:with-param name="attributeindex" select="$index"/>
663
                     </xsl:call-template>
664
                   </xsl:for-each>
665
                 </td>
666
               </xsl:when>
667
               <xsl:otherwise>
668
                 <td colspan="1" align="center" class="{$stripes}">
669
                   &#160;
670
                 </td>
671
               </xsl:otherwise>
672
            </xsl:choose>
673
        </xsl:otherwise>
674
     </xsl:choose>
675
   </xsl:for-each>
676
  </tr>
677
 </xsl:template>
678

    
679

    
680
<xsl:template name="singleattribute">
681
   <xsl:param name="docid"/>
682
   <xsl:param name="entitytype"/>
683
   <xsl:param name="entityindex"/>
684
   <xsl:param name="attributeindex"/>
685

    
686
   <table class="{$tableattributeStyle}">
687
        <xsl:choose>
688
         <xsl:when test="references!=''">
689
          <xsl:variable name="ref_id" select="references"/>
690
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
691
          <xsl:for-each select="$references">
692
            <xsl:call-template name="singleattributecommon">
693
               <xsl:with-param name="docid" select="$docid"/>
694
               <xsl:with-param name="entitytype" select="$entitytype"/>
695
               <xsl:with-param name="entityindex" select="$entityindex"/>
696
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
697
            </xsl:call-template>
698
          </xsl:for-each>
699
        </xsl:when>
700
        <xsl:otherwise>
701
          <xsl:call-template name="singleattributecommon">
702
               <xsl:with-param name="docid" select="$docid"/>
703
               <xsl:with-param name="entitytype" select="$entitytype"/>
704
               <xsl:with-param name="entityindex" select="$entityindex"/>
705
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
706
          </xsl:call-template>
707
        </xsl:otherwise>
708
      </xsl:choose>
709
  </table>
710
</xsl:template>
711

    
712

    
713
<xsl:template name="singleattributecommon">
714
   <xsl:param name="docid"/>
715
   <xsl:param name="entitytype"/>
716
   <xsl:param name="entityindex"/>
717
   <xsl:param name="attributeindex"/>
718

    
719
  <!-- First row for attribute name-->
720
  <tr><th class="rowodd">Column Name</th>
721
  <xsl:for-each select="attribute">
722
   <xsl:if test="position() = $attributeindex">
723
      <xsl:choose>
724
         <xsl:when test="references!=''">
725
          <xsl:variable name="ref_id" select="references"/>
726
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
727
          <xsl:for-each select="$references">
728
            <th><xsl:value-of select="attributeName"/></th>
729
          </xsl:for-each>
730
        </xsl:when>
731
        <xsl:otherwise>
732
          <th><xsl:value-of select="attributeName"/></th>
733
        </xsl:otherwise>
734
     </xsl:choose>
735
   </xsl:if>
736
  </xsl:for-each>
737
  </tr>
738

    
739
  <!-- Second row for attribute label-->
740
  <tr><th class="rowodd">Column Label</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 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
746
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></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
             <xsl:choose>
755
                <xsl:when test="attributeLabel!=''">
756
                  <td colspan="1" align="center" class="{$stripes}">
757
                     <xsl:for-each select="attributeLabel">
758
                       <xsl:value-of select="."/>
759
                         &#160;<br />
760
                       </xsl:for-each>
761
                  </td>
762
                </xsl:when>
763
                <xsl:otherwise>
764
                   <td colspan="1" align="center" class="{$stripes}">
765
                       &#160;<br />
766
                   </td>
767
                </xsl:otherwise>
768
              </xsl:choose>
769
          </xsl:for-each>
770
        </xsl:when>
771
        <xsl:otherwise>
772
             <xsl:choose>
773
                <xsl:when test="attributeLabel!=''">
774
                  <td colspan="1" align="center" class="{$stripes}">
775
                     <xsl:for-each select="attributeLabel">
776
                       <xsl:value-of select="."/>
777
                         &#160;<br/>
778
                       </xsl:for-each>
779
                  </td>
780
                </xsl:when>
781
                <xsl:otherwise>
782
                   <td colspan="1" align="center" class="{$stripes}">
783
                       &#160;<br />
784
                   </td>
785
                </xsl:otherwise>
786
              </xsl:choose>
787
        </xsl:otherwise>
788
     </xsl:choose>
789
    </xsl:if>
790
   </xsl:for-each>
791
  </tr>
792

    
793
  <!-- Third row for attribute defination-->
794
  <tr><th class="rowodd">Definition</th>
795
    <xsl:for-each select="attribute">
796
     <xsl:if test="position() = $attributeindex">
797
      <xsl:variable name="stripes">
798
              <xsl:choose>
799
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
800
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
801
              </xsl:choose>
802
      </xsl:variable>
803
      <xsl:choose>
804
         <xsl:when test="references!=''">
805
          <xsl:variable name="ref_id" select="references"/>
806
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
807
           <xsl:for-each select="$references">
808
             <td colspan="1" align="center" class="{$stripes}">
809
               <xsl:value-of select="attributeDefinition"/>
810
             </td>
811
           </xsl:for-each>
812
        </xsl:when>
813
        <xsl:otherwise>
814
          <td colspan="1" align="center" class="{$stripes}">
815
             <xsl:value-of select="attributeDefinition"/>
816
          </td>
817
        </xsl:otherwise>
818
     </xsl:choose>
819
    </xsl:if>
820
   </xsl:for-each>
821
  </tr>
822

    
823
  <!-- The fourth row for attribute storage type-->
824
   <tr><th class="rowodd">Type of Value</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 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
830
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></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
            <xsl:choose>
839
              <xsl:when test="storageType!=''">
840
                 <td colspan="1" align="center" class="{$stripes}">
841
                    <xsl:for-each select="storageType">
842
                      <xsl:value-of select="."/>
843
                       &#160;<br/>
844
                    </xsl:for-each>
845
                 </td>
846
              </xsl:when>
847
              <xsl:otherwise>
848
                  <td colspan="1" align="center" class="{$stripes}">
849
                       &#160;
850
                   </td>
851
              </xsl:otherwise>
852
            </xsl:choose>
853
          </xsl:for-each>
854
        </xsl:when>
855
        <xsl:otherwise>
856
           <xsl:choose>
857
              <xsl:when test="storageType!=''">
858
                 <td colspan="1" align="center" class="{$stripes}">
859
                    <xsl:for-each select="storageType">
860
                      <xsl:value-of select="."/>
861
                       &#160;<br/>
862
                    </xsl:for-each>
863
                 </td>
864
              </xsl:when>
865
              <xsl:otherwise>
866
                  <td colspan="1" align="center" class="{$stripes}">
867
                       &#160;
868
                   </td>
869
              </xsl:otherwise>
870
            </xsl:choose>
871
        </xsl:otherwise>
872
     </xsl:choose>
873
    </xsl:if>
874
   </xsl:for-each>
875
  </tr>
876

    
877
  <!-- The fifth row for meaturement type-->
878
  <tr><th class="rowodd">Measurement Type</th>
879
   <xsl:for-each select="attribute">
880
    <xsl:if test="position() = $attributeindex">
881
    <xsl:variable name="stripes">
882
              <xsl:choose>
883
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
884
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
885
              </xsl:choose>
886
    </xsl:variable>
887
    <xsl:choose>
888
         <xsl:when test="references!=''">
889
          <xsl:variable name="ref_id" select="references"/>
890
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
891
          <xsl:for-each select="$references">
892
            <td colspan="1" align="center" class="{$stripes}">
893
              <xsl:for-each select="measurementScale">
894
                 <xsl:value-of select="local-name(./*)"/>
895
              </xsl:for-each>
896
            </td>
897
         </xsl:for-each>
898
        </xsl:when>
899
        <xsl:otherwise>
900
           <td colspan="1" align="center" class="{$stripes}">
901
              <xsl:for-each select="measurementScale">
902
                 <xsl:value-of select="local-name(./*)"/>
903
              </xsl:for-each>
904
           </td>
905
        </xsl:otherwise>
906
     </xsl:choose>
907
    </xsl:if>
908
   </xsl:for-each>
909
  </tr>
910

    
911
  <!-- The sixth row for meaturement domain-->
912
  <tr><th class="rowodd">Measurement Domain</th>
913
   <xsl:for-each select="attribute">
914
    <xsl:if test="position() = $attributeindex">
915
    <xsl:variable name="stripes">
916
              <xsl:choose>
917
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
918
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
919
              </xsl:choose>
920
    </xsl:variable>
921
     <xsl:variable name="innerstripes">
922
              <xsl:choose>
923
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
924
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
925
              </xsl:choose>
926
    </xsl:variable>
927
    <xsl:choose>
928
         <xsl:when test="references!=''">
929
          <xsl:variable name="ref_id" select="references"/>
930
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
931
          <xsl:for-each select="$references">
932
            <td colspan="1" align="center" class="{$stripes}">
933
              <xsl:for-each select="measurementScale">
934
                <xsl:call-template name="measurementscale">
935
                    <xsl:with-param name="docid" select="$docid"/>
936
                    <xsl:with-param name="entitytype" select="$entitytype"/>
937
                    <xsl:with-param name="entityindex" select="$entityindex"/>
938
                    <xsl:with-param name="attributeindex" select="position()"/>
939
                    <xsl:with-param name="stripes" select="$innerstripes"/>
940
                </xsl:call-template>
941
              </xsl:for-each>
942
            </td>
943
         </xsl:for-each>
944
        </xsl:when>
945
        <xsl:otherwise>
946
           <td colspan="1" align="center" class="{$stripes}">
947
              <xsl:for-each select="measurementScale">
948
                <xsl:call-template name="measurementscale">
949
                      <xsl:with-param name="docid" select="$docid"/>
950
                      <xsl:with-param name="entitytype" select="$entitytype"/>
951
                      <xsl:with-param name="entityindex" select="$entityindex"/>
952
                      <xsl:with-param name="attributeindex" select="position()"/>
953
                      <xsl:with-param name="stripes" select="$innerstripes"/>
954
                </xsl:call-template>
955
              </xsl:for-each>
956
           </td>
957
        </xsl:otherwise>
958
     </xsl:choose>
959
    </xsl:if>
960
   </xsl:for-each>
961
  </tr>
962

    
963

    
964
  <!-- The seventh row for missing value code-->
965
  <tr><th class="rowodd">Missing Value Code</th>
966
    <xsl:for-each select="attribute">
967
     <xsl:if test="position() = $attributeindex">
968
      <xsl:variable name="stripes">
969
              <xsl:choose>
970
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
971
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
972
              </xsl:choose>
973
     </xsl:variable>
974
     <xsl:variable name="innerstripes">
975
              <xsl:choose>
976
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
977
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
978
              </xsl:choose>
979
     </xsl:variable>
980
     <xsl:choose>
981
         <xsl:when test="references!=''">
982
          <xsl:variable name="ref_id" select="references"/>
983
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
984
          <xsl:for-each select="$references">
985
            <xsl:choose>
986
              <xsl:when test="missingValueCode!=''">
987
                 <td colspan="1" align="center" class="{$stripes}">
988
                    <table>
989
                       <xsl:for-each select="missingValueCode">
990
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
991
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
992
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
993
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
994
                          </tr>
995
                       </xsl:for-each>
996
                   </table>
997
                 </td>
998
              </xsl:when>
999
              <xsl:otherwise>
1000
                <td colspan="1" class="{$stripes}">
1001
                   &#160;
1002
                </td>
1003
              </xsl:otherwise>
1004
            </xsl:choose>
1005
          </xsl:for-each>
1006
        </xsl:when>
1007
        <xsl:otherwise>
1008
           <xsl:choose>
1009
              <xsl:when test="missingValueCode!=''">
1010
                 <td colspan="1" align="center" class="{$stripes}">
1011
                    <table>
1012
                       <xsl:for-each select="missingValueCode">
1013
                          <tr><td class="{$innerstripes}"><b>Code</b></td>                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
1014
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1015
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
1016
                          </tr>
1017
                       </xsl:for-each>
1018
                   </table>
1019
                 </td>
1020
              </xsl:when>
1021
              <xsl:otherwise>
1022
                <td colspan="1" align="center" class="{$stripes}">
1023
                   &#160;
1024
                </td>
1025
              </xsl:otherwise>
1026
            </xsl:choose>
1027
        </xsl:otherwise>
1028
     </xsl:choose>
1029
     </xsl:if>
1030
   </xsl:for-each>
1031
  </tr>
1032

    
1033

    
1034
  <!-- The eighth row for accuracy report-->
1035
  <tr><th class="rowodd">Accuracy Report</th>
1036
     <xsl:for-each select="attribute">
1037
     <xsl:if test="position() = $attributeindex">
1038
     <xsl:variable name="stripes">
1039
         <xsl:choose>
1040
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1041
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1042
         </xsl:choose>
1043
    </xsl:variable>
1044
    <xsl:choose>
1045
         <xsl:when test="references!=''">
1046
          <xsl:variable name="ref_id" select="references"/>
1047
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1048
          <xsl:for-each select="$references">
1049
            <xsl:choose>
1050
               <xsl:when test="accuracy!=''">
1051
                 <td colspan="1" align="center" class="{$stripes}">
1052
                    <xsl:for-each select="accuracy">
1053
                          <xsl:value-of select="attributeAccuracyReport"/>
1054
                    </xsl:for-each>
1055
                 </td>
1056
              </xsl:when>
1057
              <xsl:otherwise>
1058
                <td colspan="1" align="center" class="{$stripes}">
1059
                  &#160;
1060
                </td>
1061
              </xsl:otherwise>
1062
            </xsl:choose>
1063
          </xsl:for-each>
1064
        </xsl:when>
1065
        <xsl:otherwise>
1066
           <xsl:choose>
1067
               <xsl:when test="accuracy!=''">
1068
                 <td colspan="1" align="center" class="{$stripes}">
1069
                    <xsl:for-each select="accuracy">
1070
                          <xsl:value-of select="attributeAccuracyReport"/>
1071
                    </xsl:for-each>
1072
                 </td>
1073
              </xsl:when>
1074
              <xsl:otherwise>
1075
                <td colspan="1" align="center" class="{$stripes}">
1076
                  &#160;
1077
                </td>
1078
              </xsl:otherwise>
1079
            </xsl:choose>
1080
        </xsl:otherwise>
1081
     </xsl:choose>
1082
   </xsl:if>
1083
  </xsl:for-each>
1084
  </tr>
1085

    
1086
  <!-- The nineth row for quality accuracy accessment -->
1087
  <tr><th class="rowodd">Accuracy Assessment</th>
1088
     <xsl:for-each select="attribute">
1089
     <xsl:if test="position() = $attributeindex">
1090
     <xsl:variable name="stripes">
1091
         <xsl:choose>
1092
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1093
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1094
         </xsl:choose>
1095
    </xsl:variable>
1096
    <xsl:variable name="innerstripes">
1097
              <xsl:choose>
1098
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
1099
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
1100
              </xsl:choose>
1101
     </xsl:variable>
1102
     <xsl:choose>
1103
         <xsl:when test="references!=''">
1104
          <xsl:variable name="ref_id" select="references"/>
1105
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1106
          <xsl:for-each select="$references">
1107
            <xsl:choose>
1108
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1109
                 <td colspan="1" align="center" class="{$stripes}">
1110
                   <xsl:for-each select="accuracy">
1111
                     <table>
1112
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1113
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1114
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1115
                          </tr>
1116
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1117
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1118
                          </tr>
1119
                      </xsl:for-each>
1120
                   </table>
1121
                 </xsl:for-each>
1122
               </td>
1123
             </xsl:when>
1124
             <xsl:otherwise>
1125
                <td colspan="1" align="center" class="{$stripes}">
1126
                  &#160;
1127
                </td>
1128
             </xsl:otherwise>
1129
           </xsl:choose>
1130
          </xsl:for-each>
1131
        </xsl:when>
1132
        <xsl:otherwise>
1133
           <xsl:choose>
1134
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1135
                 <td colspan="1" align="center" class="{$stripes}">
1136
                   <xsl:for-each select="accuracy">
1137
                     <table>
1138
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1139
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1140
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1141
                          </tr>
1142
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1143
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1144
                          </tr>
1145
                      </xsl:for-each>
1146
                   </table>
1147
                 </xsl:for-each>
1148
               </td>
1149
             </xsl:when>
1150
             <xsl:otherwise>
1151
                <td colspan="1" align="center" class="{$stripes}">
1152
                  &#160;
1153
                </td>
1154
             </xsl:otherwise>
1155
           </xsl:choose>
1156
        </xsl:otherwise>
1157
     </xsl:choose>
1158
   </xsl:if>
1159
  </xsl:for-each>
1160
  </tr>
1161

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

    
1225

    
1226
   <!-- The eleventh row for method-->
1227
  <tr><th class="rowodd">Method</th>
1228
   <xsl:for-each select="attribute">
1229
    <xsl:if test="position() = $attributeindex">
1230
    <xsl:variable name="index" select="position()"/>
1231
    <xsl:variable name="stripes">
1232
              <xsl:choose>
1233
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1234
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1235
              </xsl:choose>
1236
    </xsl:variable>
1237
    <xsl:choose>
1238
         <xsl:when test="references!=''">
1239
          <xsl:variable name="ref_id" select="references"/>
1240
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1241
          <xsl:for-each select="$references">
1242
            <xsl:choose>
1243
               <xsl:when test="method!=''">
1244
                 <td colspan="1" align="center" class="{$stripes}">
1245
                   <xsl:for-each select="method">
1246
                     <xsl:call-template name="attributemethod">
1247
                       <xsl:with-param name="docid" select="$docid"/>
1248
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1249
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1250
                       <xsl:with-param name="attributeindex" select="$index"/>
1251
                     </xsl:call-template>
1252
                   </xsl:for-each>
1253
                 </td>
1254
               </xsl:when>
1255
               <xsl:otherwise>
1256
                 <td colspan="1" align="center" class="{$stripes}">
1257
                   &#160;
1258
                 </td>
1259
               </xsl:otherwise>
1260
            </xsl:choose>
1261
         </xsl:for-each>
1262
        </xsl:when>
1263
        <xsl:otherwise>
1264
           <xsl:choose>
1265
               <xsl:when test="method!=''">
1266
                 <td colspan="1" align="center" class="{$stripes}">
1267
                   <xsl:for-each select="method">
1268
                     <xsl:call-template name="attributemethod">
1269
                       <xsl:with-param name="docid" select="$docid"/>
1270
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1271
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1272
                       <xsl:with-param name="attributeindex" select="$index"/>
1273
                     </xsl:call-template>
1274
                   </xsl:for-each>
1275
                 </td>
1276
               </xsl:when>
1277
               <xsl:otherwise>
1278
                 <td colspan="1" align="center" class="{$stripes}">
1279
                   &#160;
1280
                 </td>
1281
               </xsl:otherwise>
1282
            </xsl:choose>
1283
        </xsl:otherwise>
1284
     </xsl:choose>
1285
    </xsl:if>
1286
   </xsl:for-each>
1287
  </tr>
1288
 </xsl:template>
1289

    
1290

    
1291
<xsl:template name="measurementscale">
1292
   <xsl:param name="stripes"/>
1293
   <xsl:param name="docid"/>
1294
   <xsl:param name="entitytype"/>
1295
   <xsl:param name="entityindex"/>
1296
   <xsl:param name="attributeindex"/>
1297
   <table>
1298
    <xsl:for-each select="nominal">
1299
         <xsl:call-template name="attributenonnumericdomain">
1300
               <xsl:with-param name="docid" select="$docid"/>
1301
               <xsl:with-param name="entitytype" select="$entitytype"/>
1302
               <xsl:with-param name="entityindex" select="$entityindex"/>
1303
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1304
               <xsl:with-param name="stripes" select="$stripes"/>
1305
       </xsl:call-template>
1306
    </xsl:for-each>
1307
    <xsl:for-each select="ordinal">
1308
       <xsl:call-template name="attributenonnumericdomain">
1309
               <xsl:with-param name="docid" select="$docid"/>
1310
               <xsl:with-param name="entitytype" select="$entitytype"/>
1311
               <xsl:with-param name="entityindex" select="$entityindex"/>
1312
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1313
               <xsl:with-param name="stripes" select="$stripes"/>
1314
       </xsl:call-template>
1315
    </xsl:for-each>
1316
    <xsl:for-each select="interval">
1317
       <xsl:call-template name="intervalratio">
1318
         <xsl:with-param name="stripes" select="$stripes"/>
1319
       </xsl:call-template>
1320
    </xsl:for-each>
1321
    <xsl:for-each select="ratio">
1322
       <xsl:call-template name="intervalratio">
1323
         <xsl:with-param name="stripes" select="$stripes"/>
1324
       </xsl:call-template>
1325
    </xsl:for-each>
1326
    <xsl:for-each select="datetime">
1327
       <xsl:call-template name="datetime">
1328
          <xsl:with-param name="stripes" select="$stripes"/>
1329
       </xsl:call-template>
1330
    </xsl:for-each>
1331
   </table>
1332
 </xsl:template>
1333

    
1334
 <xsl:template name="attributenonnumericdomain">
1335
   <xsl:param name="stripes"/>
1336
   <xsl:param name="docid"/>
1337
   <xsl:param name="entitytype"/>
1338
   <xsl:param name="entityindex"/>
1339
   <xsl:param name="attributeindex"/>
1340
   <xsl:for-each select="nonNumericDomain">
1341
     <xsl:choose>
1342
         <xsl:when test="references!=''">
1343
          <xsl:variable name="ref_id" select="references"/>
1344
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1345
          <xsl:for-each select="$references">
1346
            <xsl:call-template name="attributenonnumericdomaincommon">
1347
                <xsl:with-param name="docid" select="$docid"/>
1348
                <xsl:with-param name="entitytype" select="$entitytype"/>
1349
                <xsl:with-param name="entityindex" select="$entityindex"/>
1350
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
1351
                <xsl:with-param name="stripes" select="$stripes"/>
1352
            </xsl:call-template>
1353
         </xsl:for-each>
1354
        </xsl:when>
1355
        <xsl:otherwise>
1356
            <xsl:call-template name="attributenonnumericdomaincommon">
1357
               <xsl:with-param name="docid" select="$docid"/>
1358
               <xsl:with-param name="entitytype" select="$entitytype"/>
1359
               <xsl:with-param name="entityindex" select="$entityindex"/>
1360
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1361
               <xsl:with-param name="stripes" select="$stripes"/>
1362
            </xsl:call-template>
1363
        </xsl:otherwise>
1364
     </xsl:choose>
1365
   </xsl:for-each>
1366
 </xsl:template>
1367

    
1368
 <xsl:template name="attributenonnumericdomaincommon">
1369
    <xsl:param name="stripes"/>
1370
    <xsl:param name="docid"/>
1371
    <xsl:param name="entitytype"/>
1372
    <xsl:param name="entityindex"/>
1373
    <xsl:param name="attributeindex"/>
1374
    <!-- if numericdomain only has one test domain,
1375
        it will be displayed inline otherwith will be show a link-->
1376
    <xsl:choose>
1377
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">
1378
        <tr><td class="{$stripes}"><b>Def</b></td>
1379
            <td class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
1380
            </td>
1381
        </tr>
1382
        <xsl:for-each select="textDomain/parttern">
1383
          <tr><td class="{$stripes}"><b>Pattern</b></td>
1384
            <td class="{$stripes}"><xsl:value-of select="."/>
1385
            </td>
1386
          </tr>
1387
        </xsl:for-each>
1388
        <xsl:for-each select="textDomain/source">
1389
          <tr><td class="{$stripes}"><b>Source</b></td>
1390
            <td class="{$stripes}"><xsl:value-of select="."/>
1391
            </td>
1392
          </tr>
1393
        </xsl:for-each>
1394
      </xsl:when>
1395
      <xsl:otherwise>
1396
         <tr><td colspan="2" align="center" class="{$stripes}" >
1397
           <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>
1398
           <b>Domain Info</b></a>
1399
         </td></tr>
1400
      </xsl:otherwise>
1401
    </xsl:choose>
1402
 </xsl:template>
1403

    
1404
 <xsl:template name="intervalratio">
1405
    <xsl:param name="stripes"/>
1406
    <xsl:if test="unit/standardUnit">
1407
      <tr><td class="{$stripes}"><b>Unit</b></td>
1408
            <td class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
1409
            </td>
1410
      </tr>
1411
    </xsl:if>
1412
    <xsl:if test="unit/customUnit">
1413
      <tr><td class="{$stripes}"><b>Unit</b></td>
1414
            <td class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
1415
            </td>
1416
      </tr>
1417
   </xsl:if>
1418
   <xsl:for-each select="precision">
1419
      <tr><td class="{$stripes}"><b>Precision</b></td>
1420
            <td class="{$stripes}"><xsl:value-of select="."/>
1421
            </td>
1422
      </tr>
1423
   </xsl:for-each>
1424
   <xsl:for-each select="numericDomain">
1425
      <xsl:call-template name="numericDomain">
1426
         <xsl:with-param name="stripes" select="$stripes"/>
1427
      </xsl:call-template>
1428
    </xsl:for-each>
1429
  </xsl:template>
1430

    
1431

    
1432
 <xsl:template name="numericDomain">
1433
     <xsl:param name="stripes"/>
1434
       <xsl:choose>
1435
         <xsl:when test="references!=''">
1436
          <xsl:variable name="ref_id" select="references"/>
1437
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1438
          <xsl:for-each select="$references">
1439
            <tr><td class="{$stripes}"><b>Type</b></td>
1440
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1441
                </td>
1442
            </tr>
1443
            <xsl:for-each select="bounds">
1444
              <tr><td class="{$stripes}"><b>Min</b></td>
1445
                  <td class="{$stripes}">
1446
                    <xsl:for-each select="minimum">
1447
                      <xsl:value-of select="."/>&#160;
1448
                    </xsl:for-each>
1449
                  </td>
1450
              </tr>
1451
              <tr><td class="{$stripes}"><b>Max</b></td>
1452
                  <td class="{$stripes}">
1453
                    <xsl:for-each select="maximum">
1454
                      <xsl:value-of select="."/>&#160;
1455
                    </xsl:for-each>
1456
                  </td>
1457
              </tr>
1458
            </xsl:for-each>
1459
          </xsl:for-each>
1460
        </xsl:when>
1461
        <xsl:otherwise>
1462
          <tr><td class="{$stripes}"><b>Type</b></td>
1463
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1464
                </td>
1465
            </tr>
1466
            <xsl:for-each select="bounds">
1467
              <tr><td class="{$stripes}"><b>Min</b></td>
1468
                  <td class="{$stripes}">
1469
                    <xsl:for-each select="minimum">
1470
                      <xsl:value-of select="."/>&#160;
1471
                    </xsl:for-each>
1472
                  </td>
1473
              </tr>
1474
              <tr><td class="{$stripes}"><b>Max</b></td>
1475
                  <td class="{$stripes}">
1476
                    <xsl:for-each select="maximum">
1477
                      <xsl:value-of select="."/>&#160;
1478
                    </xsl:for-each>
1479
                  </td>
1480
              </tr>
1481
            </xsl:for-each>
1482
        </xsl:otherwise>
1483
      </xsl:choose>
1484
  </xsl:template>
1485

    
1486
 <xsl:template name="datetime">
1487
    <xsl:param name="stripes"/>
1488
    <tr><td class="{$stripes}"><b>Format</b></td>
1489
         <td class="{$stripes}">
1490
            <xsl:value-of select="formatString"/>
1491
         </td>
1492
    </tr>
1493
     <tr><td class="{$stripes}"><b>Precision</b></td>
1494
         <td class="{$stripes}">
1495
            <xsl:value-of select="dateTimePrecision"/>
1496
         </td>
1497
    </tr>
1498
    <xsl:call-template name="timedomain"/>
1499
 </xsl:template>
1500

    
1501

    
1502
 <xsl:template name="timedomain">
1503
    <xsl:param name="stripes"/>
1504
      <xsl:choose>
1505
         <xsl:when test="references!=''">
1506
          <xsl:variable name="ref_id" select="references"/>
1507
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1508
          <xsl:for-each select="$references">
1509
            <xsl:for-each select="bounds">
1510
              <tr><td class="{$stripes}"><b>Min</b></td>
1511
                  <td class="{$stripes}">
1512
                    <xsl:for-each select="minimum">
1513
                      <xsl:value-of select="."/>&#160;
1514
                    </xsl:for-each>
1515
                  </td>
1516
              </tr>
1517
              <tr><td class="{$stripes}"><b>Max</b></td>
1518
                  <td class="{$stripes}">
1519
                    <xsl:for-each select="maximum">
1520
                      <xsl:value-of select="."/>&#160;
1521
                    </xsl:for-each>
1522
                  </td>
1523
              </tr>
1524
            </xsl:for-each>
1525
          </xsl:for-each>
1526
        </xsl:when>
1527
        <xsl:otherwise>
1528
           <xsl:for-each select="bounds">
1529
              <tr><td class="{$stripes}"><b>Min</b></td>
1530
                  <td class="{$stripes}">
1531
                    <xsl:for-each select="minimum">
1532
                      <xsl:value-of select="."/>&#160;
1533
                    </xsl:for-each>
1534
                  </td>
1535
              </tr>
1536
              <tr><td class="{$stripes}"><b>Max</b></td>
1537
                  <td class="{$stripes}">
1538
                    <xsl:for-each select="maximum">
1539
                      <xsl:value-of select="."/>&#160;
1540
                    </xsl:for-each>
1541
                  </td>
1542
              </tr>
1543
            </xsl:for-each>
1544
        </xsl:otherwise>
1545
      </xsl:choose>
1546
  </xsl:template>
1547

    
1548
 <xsl:template name="attributecoverage">
1549
    <xsl:param name="docid"/>
1550
    <xsl:param name="entitytype"/>
1551
    <xsl:param name="entityindex"/>
1552
    <xsl:param name="attributeindex"/>
1553
     <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>
1554
           <b>Coverage Info</b></a>
1555
 </xsl:template>
1556

    
1557
 <xsl:template name="attributemethod">
1558
    <xsl:param name="docid"/>
1559
    <xsl:param name="entitytype"/>
1560
    <xsl:param name="entityindex"/>
1561
    <xsl:param name="attributeindex"/>
1562
     <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>
1563
           <b>Method Info</b></a>
1564
 </xsl:template>
1565

    
1566
</xsl:stylesheet>
(4-4/27)