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: leinfelder $'
9
  *     '$Date: 2013-07-15 10:37:09 -0700 (Mon, 15 Jul 2013) $'
10
  * '$Revision: 7982 $'
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="attributeindex" select="position()"/>
315
    <xsl:variable name="stripes">
316
              <xsl:choose>
317
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
318
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
319
              </xsl:choose>
320
    </xsl:variable>
321
     <xsl:variable name="innerstripes">
322
              <xsl:choose>
323
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
324
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
325
              </xsl:choose>
326
    </xsl:variable>
327
    <xsl:choose>
328
         <xsl:when test="references!=''">
329
          <xsl:variable name="ref_id" select="references"/>
330
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
331
          <xsl:for-each select="$references">
332
            <td colspan="1" align="center" class="{$stripes}">
333
              <xsl:for-each select="measurementScale">
334
                <xsl:call-template name="measurementscale">
335
                    <xsl:with-param name="docid" select="$docid"/>
336
                    <xsl:with-param name="entitytype" select="$entitytype"/>
337
                    <xsl:with-param name="entityindex" select="$entityindex"/>
338
                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
339
                    <xsl:with-param name="stripes" select="$innerstripes"/>
340
                </xsl:call-template>
341
              </xsl:for-each>
342
            </td>
343
         </xsl:for-each>
344
        </xsl:when>
345
        <xsl:otherwise>
346
           <td colspan="1" align="center" class="{$stripes}">
347
              <xsl:for-each select="measurementScale">
348
                <xsl:call-template name="measurementscale">
349
                      <xsl:with-param name="docid" select="$docid"/>
350
                      <xsl:with-param name="entitytype" select="$entitytype"/>
351
                      <xsl:with-param name="entityindex" select="$entityindex"/>
352
                      <xsl:with-param name="attributeindex" select="$attributeindex"/>
353
                      <xsl:with-param name="stripes" select="$innerstripes"/>
354
                </xsl:call-template>
355
              </xsl:for-each>
356
           </td>
357
        </xsl:otherwise>
358
     </xsl:choose>
359
   </xsl:for-each>
360
  </tr>
361

    
362

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

    
431

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

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

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

    
617

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

    
680

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

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

    
713

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

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

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

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

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

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

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

    
964

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

    
1034

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

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

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

    
1226

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

    
1291

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

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

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

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

    
1432

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

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

    
1502

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

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

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

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