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
	    <xsl:choose>
158
	         <xsl:when test="references!=''">
159
	          <xsl:variable name="ref_id" select="references"/>
160
	          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
161
	          <xsl:for-each select="$references">
162
	            <td class="{$stripes}">
163
	            	(Ref) Loading information for: <xsl:value-of select="attributeName"/>
164
	            </td>
165
	          </xsl:for-each>
166
	        </xsl:when>
167
	        <xsl:otherwise>
168
	          <td class="{$stripes}">
169
	          	<div>
170
	            		<xsl:attribute name="id">
171
	            			<xsl:value-of select="attributeName"/>
172
	            		</xsl:attribute>
173
	            		Loading information for: <xsl:value-of select="attributeName"/>
174
	            	</div>
175
	            	<script language="JavaScript">
176
            			var params = 
177
						{
178
							'action': 'read',
179
							'docid': '<xsl:value-of select="$annotationId" />',
180
							'qformat': '<xsl:value-of select="$qformat" />',
181
							'attributeLabel': '<xsl:value-of select="attributeName" />'
182
						};
183
						load(
184
							'<xsl:value-of select="$contextURL" />/metacat',
185
							params, 
186
							'<xsl:value-of select="attributeName" />');
187
					</script>
188
	          </td>
189
	        </xsl:otherwise>
190
	     </xsl:choose>
191
	  </xsl:for-each>
192
	  </tr>
193
	</xsl:if>
194
	
195
  <!-- Third row for attribute defination-->
196
  <tr><th class="rowodd">Definition</th>
197
    <xsl:for-each select="attribute">
198
      <xsl:variable name="stripes">
199
              <xsl:choose>
200
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
201
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
202
              </xsl:choose>
203
      </xsl:variable>
204
      <xsl:choose>
205
         <xsl:when test="references!=''">
206
          <xsl:variable name="ref_id" select="references"/>
207
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
208
           <xsl:for-each select="$references">
209
             <td colspan="1" align="center" class="{$stripes}">
210
               <xsl:value-of select="attributeDefinition"/>
211
             </td>
212
           </xsl:for-each>
213
        </xsl:when>
214
        <xsl:otherwise>
215
          <td colspan="1" align="center" class="{$stripes}">
216
             <xsl:value-of select="attributeDefinition"/>
217
          </td>
218
        </xsl:otherwise>
219
     </xsl:choose>
220
   </xsl:for-each>
221
  </tr>
222

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

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

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

    
357

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

    
426

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

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

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

    
612

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

    
675

    
676
<xsl:template name="singleattribute">
677
   <xsl:param name="docid"/>
678
   <xsl:param name="entitytype"/>
679
   <xsl:param name="entityindex"/>
680
   <xsl:param name="attributeindex"/>
681

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

    
708

    
709
<xsl:template name="singleattributecommon">
710
   <xsl:param name="docid"/>
711
   <xsl:param name="entitytype"/>
712
   <xsl:param name="entityindex"/>
713
   <xsl:param name="attributeindex"/>
714

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

    
735
  <!-- Second row for attribute label-->
736
  <tr><th class="rowodd">Column Label</th>
737
   <xsl:for-each select="attribute">
738
    <xsl:if test="position() = $attributeindex">
739
    <xsl:variable name="stripes">
740
              <xsl:choose>
741
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
742
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
743
              </xsl:choose>
744
    </xsl:variable>
745
    <xsl:choose>
746
         <xsl:when test="references!=''">
747
          <xsl:variable name="ref_id" select="references"/>
748
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
749
          <xsl:for-each select="$references">
750
             <xsl:choose>
751
                <xsl:when test="attributeLabel!=''">
752
                  <td colspan="1" align="center" class="{$stripes}">
753
                     <xsl:for-each select="attributeLabel">
754
                       <xsl:value-of select="."/>
755
                         &#160;<br />
756
                       </xsl:for-each>
757
                  </td>
758
                </xsl:when>
759
                <xsl:otherwise>
760
                   <td colspan="1" align="center" class="{$stripes}">
761
                       &#160;<br />
762
                   </td>
763
                </xsl:otherwise>
764
              </xsl:choose>
765
          </xsl:for-each>
766
        </xsl:when>
767
        <xsl:otherwise>
768
             <xsl:choose>
769
                <xsl:when test="attributeLabel!=''">
770
                  <td colspan="1" align="center" class="{$stripes}">
771
                     <xsl:for-each select="attributeLabel">
772
                       <xsl:value-of select="."/>
773
                         &#160;<br/>
774
                       </xsl:for-each>
775
                  </td>
776
                </xsl:when>
777
                <xsl:otherwise>
778
                   <td colspan="1" align="center" class="{$stripes}">
779
                       &#160;<br />
780
                   </td>
781
                </xsl:otherwise>
782
              </xsl:choose>
783
        </xsl:otherwise>
784
     </xsl:choose>
785
    </xsl:if>
786
   </xsl:for-each>
787
  </tr>
788

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

    
819
  <!-- The fourth row for attribute storage type-->
820
   <tr><th class="rowodd">Type of Value</th>
821
     <xsl:for-each select="attribute">
822
      <xsl:if test="position() = $attributeindex">
823
      <xsl:variable name="stripes">
824
              <xsl:choose>
825
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
826
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
827
              </xsl:choose>
828
      </xsl:variable>
829
      <xsl:choose>
830
         <xsl:when test="references!=''">
831
          <xsl:variable name="ref_id" select="references"/>
832
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
833
          <xsl:for-each select="$references">
834
            <xsl:choose>
835
              <xsl:when test="storageType!=''">
836
                 <td colspan="1" align="center" class="{$stripes}">
837
                    <xsl:for-each select="storageType">
838
                      <xsl:value-of select="."/>
839
                       &#160;<br/>
840
                    </xsl:for-each>
841
                 </td>
842
              </xsl:when>
843
              <xsl:otherwise>
844
                  <td colspan="1" align="center" class="{$stripes}">
845
                       &#160;
846
                   </td>
847
              </xsl:otherwise>
848
            </xsl:choose>
849
          </xsl:for-each>
850
        </xsl:when>
851
        <xsl:otherwise>
852
           <xsl:choose>
853
              <xsl:when test="storageType!=''">
854
                 <td colspan="1" align="center" class="{$stripes}">
855
                    <xsl:for-each select="storageType">
856
                      <xsl:value-of select="."/>
857
                       &#160;<br/>
858
                    </xsl:for-each>
859
                 </td>
860
              </xsl:when>
861
              <xsl:otherwise>
862
                  <td colspan="1" align="center" class="{$stripes}">
863
                       &#160;
864
                   </td>
865
              </xsl:otherwise>
866
            </xsl:choose>
867
        </xsl:otherwise>
868
     </xsl:choose>
869
    </xsl:if>
870
   </xsl:for-each>
871
  </tr>
872

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

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

    
959

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

    
1029

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

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

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

    
1221

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

    
1286

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

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

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

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

    
1427

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

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

    
1497

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

    
1544
 <xsl:template name="attributecoverage">
1545
    <xsl:param name="docid"/>
1546
    <xsl:param name="entitytype"/>
1547
    <xsl:param name="entityindex"/>
1548
    <xsl:param name="attributeindex"/>
1549
     <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>
1550
           <b>Coverage Info</b></a>
1551
 </xsl:template>
1552

    
1553
 <xsl:template name="attributemethod">
1554
    <xsl:param name="docid"/>
1555
    <xsl:param name="entitytype"/>
1556
    <xsl:param name="entityindex"/>
1557
    <xsl:param name="attributeindex"/>
1558
     <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>
1559
           <b>Method Info</b></a>
1560
 </xsl:template>
1561

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