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-16 13:01:16 -0700 (Tue, 16 Jul 2013) $'
10
  * '$Revision: 8001 $'
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
        <xsl:choose>
47
         <xsl:when test="references!=''">
48
          <xsl:variable name="ref_id" select="references"/>
49
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
50
          <xsl:for-each select="$references">
51
            <xsl:call-template name="attributecommon">
52
               <xsl:with-param name="docid" select="$docid"/>
53
               <xsl:with-param name="entitytype" select="$entitytype"/>
54
               <xsl:with-param name="entityindex" select="$entityindex"/>
55
            </xsl:call-template>
56
          </xsl:for-each>
57
        </xsl:when>
58
        <xsl:otherwise>
59
          <xsl:call-template name="attributecommon">
60
               <xsl:with-param name="docid" select="$docid"/>
61
               <xsl:with-param name="entitytype" select="$entitytype"/>
62
               <xsl:with-param name="entityindex" select="$entityindex"/>
63
          </xsl:call-template>
64
        </xsl:otherwise>
65
      </xsl:choose>
66
      
67
</xsl:template>
68

    
69

    
70
<xsl:template name="attributecommon">
71
   <xsl:param name="docid"/>
72
   <xsl:param name="entitytype"/>
73
   <xsl:param name="entityindex"/>
74

    
75

    
76
	<div class="row-fluid">
77
		<div class="span2">
78
			<!-- render the side nav -->
79
			<ul class="nav nav-list" id="attributeTabs">
80
			  <li class="nav-header">Variables</li>
81
				<xsl:for-each select="attribute">
82
					<xsl:variable name="attributeindex" select="position()"/>
83
					<li>
84
						<xsl:if test="position() = 1">
85
							<xsl:attribute name="class">active</xsl:attribute>
86
						</xsl:if>
87
						<a data-toggle="tab">
88
							<xsl:attribute name="href">#entity_<xsl:value-of select="$entityindex"/>_attribute_<xsl:value-of select="$attributeindex"/></xsl:attribute>
89
						    <xsl:choose>
90
						         <xsl:when test="references!=''">
91
						          <xsl:variable name="ref_id" select="references"/>
92
						          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
93
						          <xsl:for-each select="$references">
94
						            <xsl:value-of select="attributeName"/>
95
						          </xsl:for-each>
96
						        </xsl:when>
97
						        <xsl:otherwise>
98
						          <xsl:value-of select="attributeName"/>
99
						        </xsl:otherwise>
100
							</xsl:choose>
101
							
102
						</a>
103
					</li>
104
				</xsl:for-each>
105
			</ul>
106
		</div>	
107
		
108
		<div class="tab-content span10">
109
		
110
		
111
  <!-- render the attributes in order-->  
112
  <xsl:for-each select="attribute">
113
  	<xsl:variable name="attributeindex" select="position()"/>
114
  	
115
  	<!-- Mark each attribute section -->
116
	<div class="tab-pane">
117
		<xsl:attribute name="id">entity_<xsl:value-of select="$entityindex"/>_attribute_<xsl:value-of select="$attributeindex"/></xsl:attribute>
118
		<xsl:if test="position() = 1">
119
			<xsl:attribute name="class">tab-pane active</xsl:attribute>
120
		</xsl:if>
121

    
122

    
123
  	<!--  Name -->
124
  	<div class="control-group">
125
		<label class="control-label">Name</label>
126
		<div class="controls controls-well">
127
			<xsl:choose>
128
				<xsl:when test="references!=''">
129
		          <xsl:variable name="ref_id" select="references"/>
130
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
131
		          <xsl:for-each select="$references">
132
		            <xsl:value-of select="attributeName"/>
133
		          </xsl:for-each>
134
		        </xsl:when>
135
		        <xsl:otherwise>
136
		          <xsl:value-of select="attributeName"/>
137
		        </xsl:otherwise>
138
		     </xsl:choose>
139
		</div>
140
	</div>	
141
    
142
  
143

    
144
	<!-- attribute label-->
145
	<div class="control-group">
146
		<label class="control-label">Label</label>
147
		<div class="controls controls-well">
148
		    <xsl:choose>
149
		         <xsl:when test="references!=''">
150
		          <xsl:variable name="ref_id" select="references"/>
151
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
152
		          <xsl:for-each select="$references">
153
		             <xsl:choose>
154
		                <xsl:when test="attributeLabel!=''">
155
		                     <xsl:for-each select="attributeLabel">
156
		                       <xsl:value-of select="."/>
157
		                         &#160;<br />
158
		                       </xsl:for-each>
159
		                </xsl:when>
160
		                <xsl:otherwise>
161
		                       &#160;
162
		                </xsl:otherwise>
163
		              </xsl:choose>
164
		          </xsl:for-each>
165
		        </xsl:when>
166
		        <xsl:otherwise>
167
		             <xsl:choose>
168
		                <xsl:when test="attributeLabel!=''">
169
		                     <xsl:for-each select="attributeLabel">
170
		                       <xsl:value-of select="."/>
171
		                         &#160;<br/>
172
		                       </xsl:for-each>
173
		                </xsl:when>
174
		                <xsl:otherwise>
175
		                       &#160;
176
		                </xsl:otherwise>
177
		              </xsl:choose>
178
		        </xsl:otherwise>
179
		     </xsl:choose>
180
     	</div>
181
	</div>
182
  
183
  <!--another row for Semantics -->
184
  <xsl:if test="$annotationId != ''">
185
	  <div class="control-group">
186
		<label class="control-label">Measurement</label>
187
		<div class="controls controls-well">
188
			<!-- handle references -->
189
			<xsl:variable name="finalAttributeName">
190
				<xsl:choose>
191
					<xsl:when test="references!=''">
192
						<xsl:variable name="ref_id" select="references"/>
193
						<xsl:variable name="references" select="$ids[@id=$ref_id]" />
194
						<!-- test this - should only be a single value -->
195
						<xsl:value-of select="$references/attributeName"/>
196
					</xsl:when>
197
			        <xsl:otherwise>
198
			          	<xsl:value-of select="attributeName"/>
199
					</xsl:otherwise>
200
				</xsl:choose>
201
			</xsl:variable>
202
			<!-- load annotation detail for attribute -->
203
			<div>
204
           		<xsl:attribute name="id">
205
           			<xsl:value-of select="$finalAttributeName"/>
206
           		</xsl:attribute>
207
           		Loading information for: <xsl:value-of select="$finalAttributeName"/>
208
           	</div>
209
           	<script language="JavaScript">
210
          			var params = 
211
				{
212
					'action': 'read',
213
					'docid': '<xsl:value-of select="$annotationId" />',
214
					'qformat': '<xsl:value-of select="$qformat" />',
215
					'attributeLabel': '<xsl:value-of select="$finalAttributeName" />',
216
					'showEntity': 'true'
217
				};
218
				load(
219
					'<xsl:value-of select="$contextURL" />/metacat',
220
					params, 
221
					'<xsl:value-of select="$finalAttributeName" />');
222
			</script>
223
		</div>
224
	</div>	
225
		
226
	</xsl:if>
227
	
228
  <!-- Third row for attribute defination-->
229
  <div class="control-group">
230
		<label class="control-label">Definition</label>
231
		<div class="controls controls-well">
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:value-of select="attributeDefinition"/>
238
	           </xsl:for-each>
239
	        </xsl:when>
240
	        <xsl:otherwise>
241
	             <xsl:value-of select="attributeDefinition"/>
242
	        </xsl:otherwise>
243
	     </xsl:choose>
244
     </div>
245
    </div>
246

    
247

    
248
  <!-- The fourth row for attribute storage type-->
249
   <div class="control-group">
250
		<label class="control-label">Storage Type</label>
251
		<div class="controls controls-well">
252
	      <xsl:choose>
253
	         <xsl:when test="references!=''">
254
	          <xsl:variable name="ref_id" select="references"/>
255
	          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
256
	          <xsl:for-each select="$references">
257
	            <xsl:choose>
258
	              <xsl:when test="storageType!=''">
259
	                    <xsl:for-each select="storageType">
260
	                      <xsl:value-of select="."/>
261
	                       &#160;<br/>
262
	                    </xsl:for-each>
263
	              </xsl:when>
264
	              <xsl:otherwise>
265
	                       &#160;
266
	              </xsl:otherwise>
267
	            </xsl:choose>
268
	          </xsl:for-each>
269
	        </xsl:when>
270
	        <xsl:otherwise>
271
	           <xsl:choose>
272
	              <xsl:when test="storageType!=''">
273
	                    <xsl:for-each select="storageType">
274
	                      <xsl:value-of select="."/>
275
	                       &#160;<br/>
276
	                    </xsl:for-each>
277
	              </xsl:when>
278
	              <xsl:otherwise>
279
	                       &#160;
280
	              </xsl:otherwise>
281
	            </xsl:choose>
282
	        </xsl:otherwise>
283
	     </xsl:choose>
284
     </div>
285
    </div>
286

    
287
  <!-- The fifth row for meaturement type-->
288
  <div class="control-group">
289
		<label class="control-label">Measurement Type</label>
290
		<div class="controls controls-well">
291
		    <xsl:choose>
292
		         <xsl:when test="references!=''">
293
		          <xsl:variable name="ref_id" select="references"/>
294
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
295
		          <xsl:for-each select="$references">
296
		              <xsl:for-each select="measurementScale">
297
		                 <xsl:value-of select="local-name(./*)"/>
298
		              </xsl:for-each>
299
		         </xsl:for-each>
300
		        </xsl:when>
301
		        <xsl:otherwise>
302
		              <xsl:for-each select="measurementScale">
303
		                 <xsl:value-of select="local-name(./*)"/>
304
		              </xsl:for-each>
305
		        </xsl:otherwise>
306
		     </xsl:choose>
307
	     </div>
308
     </div>
309

    
310
  <!-- The sixth row for meaturement domain-->
311
  <div class="control-group">
312
		<label class="control-label">Measurement Domain</label>
313
		<div class="controls controls-well">
314
		    <xsl:choose>
315
		         <xsl:when test="references!=''">
316
		          <xsl:variable name="ref_id" select="references"/>
317
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
318
		          <xsl:for-each select="$references">
319
		              <xsl:for-each select="measurementScale">
320
		                <xsl:call-template name="measurementscale">
321
		                    <xsl:with-param name="docid" select="$docid"/>
322
		                    <xsl:with-param name="entitytype" select="$entitytype"/>
323
		                    <xsl:with-param name="entityindex" select="$entityindex"/>
324
		                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
325
		                </xsl:call-template>
326
		              </xsl:for-each>
327
		         </xsl:for-each>
328
		        </xsl:when>
329
		        <xsl:otherwise>
330
		              <xsl:for-each select="measurementScale">
331
		                <xsl:call-template name="measurementscale">
332
		                      <xsl:with-param name="docid" select="$docid"/>
333
		                      <xsl:with-param name="entitytype" select="$entitytype"/>
334
		                      <xsl:with-param name="entityindex" select="$entityindex"/>
335
		                      <xsl:with-param name="attributeindex" select="$attributeindex"/>
336
		                </xsl:call-template>
337
		              </xsl:for-each>
338
		        </xsl:otherwise>
339
		     </xsl:choose>
340
	     </div>
341
     </div>
342

    
343
  <!-- The seventh row for missing value code-->
344
  <div class="control-group">
345
		<label class="control-label">Missing Value Code</label>
346
		<div class="controls controls-well">
347
		     <xsl:choose>
348
		         <xsl:when test="references!=''">
349
		          <xsl:variable name="ref_id" select="references"/>
350
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
351
		          <xsl:for-each select="$references">
352
		            <xsl:choose>
353
		              <xsl:when test="missingValueCode!=''">
354
		                    <table class="table table-striped">
355
		                    	<thead>
356
		                    		<tr>
357
		                    			<th>Code</th>
358
		                              	<th>Explanation</th>
359
		                            </tr>
360
		                        </thead>
361
		                       <xsl:for-each select="missingValueCode">
362
		                          <tr>
363
		                              <td><xsl:value-of select="code"/></td>
364
		                              <td><xsl:value-of select="codeExplanation"/></td>
365
		                          </tr>
366
		                       </xsl:for-each>
367
		                   </table>
368
		              </xsl:when>
369
		              <xsl:otherwise>
370
		                   &#160;
371
		              </xsl:otherwise>
372
		            </xsl:choose>
373
		          </xsl:for-each>
374
		        </xsl:when>
375
		        <xsl:otherwise>
376
		           <xsl:choose>
377
		              <xsl:when test="missingValueCode!=''">
378
		                    <table class="table table-striped">
379
		                    	<thead>
380
		                    		<tr>
381
		                    			<th>Code</th>
382
		                              	<th>Explanation</th>
383
		                            </tr>
384
		                        </thead>
385
		                       <xsl:for-each select="missingValueCode">
386
		                          <tr>
387
		                              <td><xsl:value-of select="code"/></td>
388
		                              <td><xsl:value-of select="codeExplanation"/></td>
389
		                          </tr>
390
		                       </xsl:for-each>
391
		                   </table>
392
		              </xsl:when>
393
		              <xsl:otherwise>
394
		                   &#160;
395
		              </xsl:otherwise>
396
		            </xsl:choose>
397
		        </xsl:otherwise>
398
		     </xsl:choose>
399
	     </div>
400
     </div>
401

    
402

    
403
  <!-- The eighth row for accuracy report-->
404
  <div class="control-group">
405
		<label class="control-label">Accuracy Report</label>
406
		<div class="controls controls-well">
407
		    <xsl:choose>
408
		         <xsl:when test="references!=''">
409
		          <xsl:variable name="ref_id" select="references"/>
410
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
411
		          <xsl:for-each select="$references">
412
		            <xsl:choose>
413
		               <xsl:when test="accuracy!=''">
414
		                    <xsl:for-each select="accuracy">
415
		                          <xsl:value-of select="attributeAccuracyReport"/>
416
		                    </xsl:for-each>
417
		              </xsl:when>
418
		              <xsl:otherwise>
419
		                  &#160;
420
		              </xsl:otherwise>
421
		            </xsl:choose>
422
		          </xsl:for-each>
423
		        </xsl:when>
424
		        <xsl:otherwise>
425
		           <xsl:choose>
426
		               <xsl:when test="accuracy!=''">
427
		                    <xsl:for-each select="accuracy">
428
		                          <xsl:value-of select="attributeAccuracyReport"/>
429
		                    </xsl:for-each>
430
		              </xsl:when>
431
		              <xsl:otherwise>
432
		                  &#160;
433
		              </xsl:otherwise>
434
		            </xsl:choose>
435
		        </xsl:otherwise>
436
		     </xsl:choose>
437
	     </div>
438
     </div>
439

    
440
  <!-- The nineth row for quality accuracy accessment -->
441
  <div class="control-group">
442
		<label class="control-label">Accuracy Assessment</label>
443
		<div class="controls controls-well">
444
		     <xsl:choose>
445
		         <xsl:when test="references!=''">
446
		          <xsl:variable name="ref_id" select="references"/>
447
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
448
		          <xsl:for-each select="$references">
449
		            <xsl:choose>
450
		               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
451
		                   <xsl:for-each select="accuracy">
452
		                     <table class="table table-striped">
453
		                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
454
		                          <tr><td>Value</td>
455
		                              <td><xsl:value-of select="attributeAccuracyValue"/></td>
456
		                          </tr>
457
		                          <tr><td>Expl</td>
458
		                              <td><xsl:value-of select="attributeAccuracyExplanation"/></td>
459
		                          </tr>
460
		                      </xsl:for-each>
461
		                   </table>
462
		                 </xsl:for-each>
463
		             </xsl:when>
464
		             <xsl:otherwise>
465
		                  &#160;
466
		             </xsl:otherwise>
467
		           </xsl:choose>
468
		          </xsl:for-each>
469
		        </xsl:when>
470
		        <xsl:otherwise>
471
		           <xsl:choose>
472
		               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
473
		                   <xsl:for-each select="accuracy">
474
		                     <table class="table table-striped">
475
		                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
476
		                          <tr><td>Value</td>
477
		                              <td><xsl:value-of select="attributeAccuracyValue"/></td>
478
		                          </tr>
479
		                          <tr><td>Expl</td>
480
		                              <td><xsl:value-of select="attributeAccuracyExplanation"/></td>
481
		                          </tr>
482
		                      </xsl:for-each>
483
		                   </table>
484
		                 </xsl:for-each>
485
		             </xsl:when>
486
		             <xsl:otherwise>
487
		                  &#160;
488
		             </xsl:otherwise>
489
		           </xsl:choose>
490
		        </xsl:otherwise>
491
		     </xsl:choose>
492
	     </div>
493
     </div>
494

    
495
   <!-- The tenth row for coverage-->
496
  <div class="control-group">
497
		<label class="control-label">Coverage</label>
498
		<div class="controls controls-well">
499
		    <xsl:choose>
500
		         <xsl:when test="references!=''">
501
		          <xsl:variable name="ref_id" select="references"/>
502
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
503
		          <xsl:for-each select="$references">
504
		            <xsl:choose>
505
		               <xsl:when test="coverage!=''">
506
		                    <xsl:for-each select="coverage">
507
		                      <xsl:call-template name="attributecoverage">
508
		                         <xsl:with-param name="docid" select="$docid"/>
509
		                         <xsl:with-param name="entitytype" select="$entitytype"/>
510
		                         <xsl:with-param name="entityindex" select="$entityindex"/>
511
		                         <xsl:with-param name="attributeindex" select="$attributeindex"/>
512
		                      </xsl:call-template>
513
		                    </xsl:for-each>
514
		               </xsl:when>
515
		               <xsl:otherwise>
516
		                   &#160;
517
		               </xsl:otherwise>
518
		            </xsl:choose>
519
		         </xsl:for-each>
520
		        </xsl:when>
521
		        <xsl:otherwise>
522
		          <xsl:choose>
523
		               <xsl:when test="coverage!=''">
524
		                    <xsl:for-each select="coverage">
525
		                      <xsl:call-template name="attributecoverage">
526
		                         <xsl:with-param name="docid" select="$docid"/>
527
		                         <xsl:with-param name="entitytype" select="$entitytype"/>
528
		                         <xsl:with-param name="entityindex" select="$entityindex"/>
529
		                         <xsl:with-param name="attributeindex" select="$attributeindex"/>
530
		                      </xsl:call-template>
531
		                    </xsl:for-each>
532
		               </xsl:when>
533
		               <xsl:otherwise>
534
		                   &#160;
535
		               </xsl:otherwise>
536
		            </xsl:choose>
537
		        </xsl:otherwise>
538
		     </xsl:choose>
539
	     </div>
540
     </div>
541

    
542

    
543
   <!-- The eleventh row for method-->
544
  <div class="control-group">
545
		<label class="control-label">Method</label>
546
		<div class="controls controls-well">
547
		    <xsl:choose>
548
		         <xsl:when test="references!=''">
549
		          <xsl:variable name="ref_id" select="references"/>
550
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
551
		          <xsl:for-each select="$references">
552
		            <xsl:choose>
553
		               <xsl:when test="method!=''">
554
		                   <xsl:for-each select="method">
555
		                     <xsl:call-template name="attributemethod">
556
		                       <xsl:with-param name="docid" select="$docid"/>
557
		                       <xsl:with-param name="entitytype" select="$entitytype"/>
558
		                       <xsl:with-param name="entityindex" select="$entityindex"/>
559
		                       <xsl:with-param name="attributeindex" select="$attributeindex"/>
560
		                     </xsl:call-template>
561
		                   </xsl:for-each>
562
		               </xsl:when>
563
		               <xsl:otherwise>
564
		                   &#160;
565
		               </xsl:otherwise>
566
		            </xsl:choose>
567
		         </xsl:for-each>
568
		        </xsl:when>
569
		        <xsl:otherwise>
570
		           <xsl:choose>
571
		               <xsl:when test="method!=''">
572
		                   <xsl:for-each select="method">
573
		                     <xsl:call-template name="attributemethod">
574
		                       <xsl:with-param name="docid" select="$docid"/>
575
		                       <xsl:with-param name="entitytype" select="$entitytype"/>
576
		                       <xsl:with-param name="entityindex" select="$entityindex"/>
577
		                       <xsl:with-param name="attributeindex" select="$attributeindex"/>
578
		                     </xsl:call-template>
579
		                   </xsl:for-each>
580
		               </xsl:when>
581
		               <xsl:otherwise>
582
		                   &#160;
583
		               </xsl:otherwise>
584
		            </xsl:choose>
585
		        </xsl:otherwise>
586
		     </xsl:choose>
587
	     </div>
588
     </div>
589
     
590
     </div> <!-- end the attribute section -->
591
     
592
     </xsl:for-each>
593
  
594
  	</div>
595
  	
596
  </div>
597
  
598
 </xsl:template>
599

    
600

    
601
<xsl:template name="singleattribute">
602
   <xsl:param name="docid"/>
603
   <xsl:param name="entitytype"/>
604
   <xsl:param name="entityindex"/>
605
   <xsl:param name="attributeindex"/>
606

    
607
   <table class="{$tableattributeStyle}">
608
        <xsl:choose>
609
         <xsl:when test="references!=''">
610
          <xsl:variable name="ref_id" select="references"/>
611
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
612
          <xsl:for-each select="$references">
613
            <xsl:call-template name="singleattributecommon">
614
               <xsl:with-param name="docid" select="$docid"/>
615
               <xsl:with-param name="entitytype" select="$entitytype"/>
616
               <xsl:with-param name="entityindex" select="$entityindex"/>
617
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
618
            </xsl:call-template>
619
          </xsl:for-each>
620
        </xsl:when>
621
        <xsl:otherwise>
622
          <xsl:call-template name="singleattributecommon">
623
               <xsl:with-param name="docid" select="$docid"/>
624
               <xsl:with-param name="entitytype" select="$entitytype"/>
625
               <xsl:with-param name="entityindex" select="$entityindex"/>
626
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
627
          </xsl:call-template>
628
        </xsl:otherwise>
629
      </xsl:choose>
630
  </table>
631
</xsl:template>
632

    
633

    
634
<xsl:template name="singleattributecommon">
635
   <xsl:param name="docid"/>
636
   <xsl:param name="entitytype"/>
637
   <xsl:param name="entityindex"/>
638
   <xsl:param name="attributeindex"/>
639

    
640
  <!-- First row for attribute name-->
641
  <tr><th class="rowodd">Column Name</th>
642
  <xsl:for-each select="attribute">
643
   <xsl:if test="position() = $attributeindex">
644
      <xsl:choose>
645
         <xsl:when test="references!=''">
646
          <xsl:variable name="ref_id" select="references"/>
647
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
648
          <xsl:for-each select="$references">
649
            <th><xsl:value-of select="attributeName"/></th>
650
          </xsl:for-each>
651
        </xsl:when>
652
        <xsl:otherwise>
653
          <th><xsl:value-of select="attributeName"/></th>
654
        </xsl:otherwise>
655
     </xsl:choose>
656
   </xsl:if>
657
  </xsl:for-each>
658
  </tr>
659

    
660
  <!-- Second row for attribute label-->
661
  <tr><th class="rowodd">Column Label</th>
662
   <xsl:for-each select="attribute">
663
    <xsl:if test="position() = $attributeindex">
664
    <xsl:variable name="stripes">
665
              <xsl:choose>
666
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
667
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
668
              </xsl:choose>
669
    </xsl:variable>
670
    <xsl:choose>
671
         <xsl:when test="references!=''">
672
          <xsl:variable name="ref_id" select="references"/>
673
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
674
          <xsl:for-each select="$references">
675
             <xsl:choose>
676
                <xsl:when test="attributeLabel!=''">
677
                  <td colspan="1" align="center" class="{$stripes}">
678
                     <xsl:for-each select="attributeLabel">
679
                       <xsl:value-of select="."/>
680
                         &#160;<br />
681
                       </xsl:for-each>
682
                  </td>
683
                </xsl:when>
684
                <xsl:otherwise>
685
                   <td colspan="1" align="center" class="{$stripes}">
686
                       &#160;<br />
687
                   </td>
688
                </xsl:otherwise>
689
              </xsl:choose>
690
          </xsl:for-each>
691
        </xsl:when>
692
        <xsl:otherwise>
693
             <xsl:choose>
694
                <xsl:when test="attributeLabel!=''">
695
                  <td colspan="1" align="center" class="{$stripes}">
696
                     <xsl:for-each select="attributeLabel">
697
                       <xsl:value-of select="."/>
698
                         &#160;<br/>
699
                       </xsl:for-each>
700
                  </td>
701
                </xsl:when>
702
                <xsl:otherwise>
703
                   <td colspan="1" align="center" class="{$stripes}">
704
                       &#160;<br />
705
                   </td>
706
                </xsl:otherwise>
707
              </xsl:choose>
708
        </xsl:otherwise>
709
     </xsl:choose>
710
    </xsl:if>
711
   </xsl:for-each>
712
  </tr>
713

    
714
  <!-- Third row for attribute defination-->
715
  <tr><th class="rowodd">Definition</th>
716
    <xsl:for-each select="attribute">
717
     <xsl:if test="position() = $attributeindex">
718
      <xsl:variable name="stripes">
719
              <xsl:choose>
720
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
721
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
722
              </xsl:choose>
723
      </xsl:variable>
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
             <td colspan="1" align="center" class="{$stripes}">
730
               <xsl:value-of select="attributeDefinition"/>
731
             </td>
732
           </xsl:for-each>
733
        </xsl:when>
734
        <xsl:otherwise>
735
          <td colspan="1" align="center" class="{$stripes}">
736
             <xsl:value-of select="attributeDefinition"/>
737
          </td>
738
        </xsl:otherwise>
739
     </xsl:choose>
740
    </xsl:if>
741
   </xsl:for-each>
742
  </tr>
743

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

    
798
  <!-- The fifth row for meaturement type-->
799
  <tr><th class="rowodd">Measurement Type</th>
800
   <xsl:for-each select="attribute">
801
    <xsl:if test="position() = $attributeindex">
802
    <xsl:variable name="stripes">
803
              <xsl:choose>
804
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
805
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
806
              </xsl:choose>
807
    </xsl:variable>
808
    <xsl:choose>
809
         <xsl:when test="references!=''">
810
          <xsl:variable name="ref_id" select="references"/>
811
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
812
          <xsl:for-each select="$references">
813
            <td colspan="1" align="center" class="{$stripes}">
814
              <xsl:for-each select="measurementScale">
815
                 <xsl:value-of select="local-name(./*)"/>
816
              </xsl:for-each>
817
            </td>
818
         </xsl:for-each>
819
        </xsl:when>
820
        <xsl:otherwise>
821
           <td colspan="1" align="center" class="{$stripes}">
822
              <xsl:for-each select="measurementScale">
823
                 <xsl:value-of select="local-name(./*)"/>
824
              </xsl:for-each>
825
           </td>
826
        </xsl:otherwise>
827
     </xsl:choose>
828
    </xsl:if>
829
   </xsl:for-each>
830
  </tr>
831

    
832
  <!-- The sixth row for meaturement domain-->
833
  <tr><th class="rowodd">Measurement Domain</th>
834
   <xsl:for-each select="attribute">
835
    <xsl:if test="position() = $attributeindex">
836
    <xsl:variable name="stripes">
837
              <xsl:choose>
838
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
839
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
840
              </xsl:choose>
841
    </xsl:variable>
842
     <xsl:variable name="innerstripes">
843
              <xsl:choose>
844
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
845
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
846
              </xsl:choose>
847
    </xsl:variable>
848
    <xsl:choose>
849
         <xsl:when test="references!=''">
850
          <xsl:variable name="ref_id" select="references"/>
851
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
852
          <xsl:for-each select="$references">
853
            <td colspan="1" align="center" class="{$stripes}">
854
              <xsl:for-each select="measurementScale">
855
                <xsl:call-template name="measurementscale">
856
                    <xsl:with-param name="docid" select="$docid"/>
857
                    <xsl:with-param name="entitytype" select="$entitytype"/>
858
                    <xsl:with-param name="entityindex" select="$entityindex"/>
859
                    <xsl:with-param name="attributeindex" select="position()"/>
860
                </xsl:call-template>
861
              </xsl:for-each>
862
            </td>
863
         </xsl:for-each>
864
        </xsl:when>
865
        <xsl:otherwise>
866
           <td colspan="1" align="center" class="{$stripes}">
867
              <xsl:for-each select="measurementScale">
868
                <xsl:call-template name="measurementscale">
869
                      <xsl:with-param name="docid" select="$docid"/>
870
                      <xsl:with-param name="entitytype" select="$entitytype"/>
871
                      <xsl:with-param name="entityindex" select="$entityindex"/>
872
                      <xsl:with-param name="attributeindex" select="position()"/>
873
                </xsl:call-template>
874
              </xsl:for-each>
875
           </td>
876
        </xsl:otherwise>
877
     </xsl:choose>
878
    </xsl:if>
879
   </xsl:for-each>
880
  </tr>
881

    
882

    
883
  <!-- The seventh row for missing value code-->
884
  <tr><th class="rowodd">Missing Value Code</th>
885
    <xsl:for-each select="attribute">
886
     <xsl:if test="position() = $attributeindex">
887
      <xsl:variable name="stripes">
888
              <xsl:choose>
889
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
890
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
891
              </xsl:choose>
892
     </xsl:variable>
893
     <xsl:variable name="innerstripes">
894
              <xsl:choose>
895
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
896
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
897
              </xsl:choose>
898
     </xsl:variable>
899
     <xsl:choose>
900
         <xsl:when test="references!=''">
901
          <xsl:variable name="ref_id" select="references"/>
902
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
903
          <xsl:for-each select="$references">
904
            <xsl:choose>
905
              <xsl:when test="missingValueCode!=''">
906
                 <td colspan="1" align="center" class="{$stripes}">
907
                    <table>
908
                       <xsl:for-each select="missingValueCode">
909
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
910
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
911
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
912
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
913
                          </tr>
914
                       </xsl:for-each>
915
                   </table>
916
                 </td>
917
              </xsl:when>
918
              <xsl:otherwise>
919
                <td colspan="1" class="{$stripes}">
920
                   &#160;
921
                </td>
922
              </xsl:otherwise>
923
            </xsl:choose>
924
          </xsl:for-each>
925
        </xsl:when>
926
        <xsl:otherwise>
927
           <xsl:choose>
928
              <xsl:when test="missingValueCode!=''">
929
                 <td colspan="1" align="center" class="{$stripes}">
930
                    <table>
931
                       <xsl:for-each select="missingValueCode">
932
                          <tr><td class="{$innerstripes}"><b>Code</b></td>                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
933
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
934
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
935
                          </tr>
936
                       </xsl:for-each>
937
                   </table>
938
                 </td>
939
              </xsl:when>
940
              <xsl:otherwise>
941
                <td colspan="1" align="center" class="{$stripes}">
942
                   &#160;
943
                </td>
944
              </xsl:otherwise>
945
            </xsl:choose>
946
        </xsl:otherwise>
947
     </xsl:choose>
948
     </xsl:if>
949
   </xsl:for-each>
950
  </tr>
951

    
952

    
953
  <!-- The eighth row for accuracy report-->
954
  <tr><th class="rowodd">Accuracy Report</th>
955
     <xsl:for-each select="attribute">
956
     <xsl:if test="position() = $attributeindex">
957
     <xsl:variable name="stripes">
958
         <xsl:choose>
959
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
960
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
961
         </xsl:choose>
962
    </xsl:variable>
963
    <xsl:choose>
964
         <xsl:when test="references!=''">
965
          <xsl:variable name="ref_id" select="references"/>
966
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
967
          <xsl:for-each select="$references">
968
            <xsl:choose>
969
               <xsl:when test="accuracy!=''">
970
                 <td colspan="1" align="center" class="{$stripes}">
971
                    <xsl:for-each select="accuracy">
972
                          <xsl:value-of select="attributeAccuracyReport"/>
973
                    </xsl:for-each>
974
                 </td>
975
              </xsl:when>
976
              <xsl:otherwise>
977
                <td colspan="1" align="center" class="{$stripes}">
978
                  &#160;
979
                </td>
980
              </xsl:otherwise>
981
            </xsl:choose>
982
          </xsl:for-each>
983
        </xsl:when>
984
        <xsl:otherwise>
985
           <xsl:choose>
986
               <xsl:when test="accuracy!=''">
987
                 <td colspan="1" align="center" class="{$stripes}">
988
                    <xsl:for-each select="accuracy">
989
                          <xsl:value-of select="attributeAccuracyReport"/>
990
                    </xsl:for-each>
991
                 </td>
992
              </xsl:when>
993
              <xsl:otherwise>
994
                <td colspan="1" align="center" class="{$stripes}">
995
                  &#160;
996
                </td>
997
              </xsl:otherwise>
998
            </xsl:choose>
999
        </xsl:otherwise>
1000
     </xsl:choose>
1001
   </xsl:if>
1002
  </xsl:for-each>
1003
  </tr>
1004

    
1005
  <!-- The nineth row for quality accuracy accessment -->
1006
  <tr><th class="rowodd">Accuracy Assessment</th>
1007
     <xsl:for-each select="attribute">
1008
     <xsl:if test="position() = $attributeindex">
1009
     <xsl:variable name="stripes">
1010
         <xsl:choose>
1011
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1012
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1013
         </xsl:choose>
1014
    </xsl:variable>
1015
    <xsl:variable name="innerstripes">
1016
              <xsl:choose>
1017
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
1018
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
1019
              </xsl:choose>
1020
     </xsl:variable>
1021
     <xsl:choose>
1022
         <xsl:when test="references!=''">
1023
          <xsl:variable name="ref_id" select="references"/>
1024
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1025
          <xsl:for-each select="$references">
1026
            <xsl:choose>
1027
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1028
                 <td colspan="1" align="center" class="{$stripes}">
1029
                   <xsl:for-each select="accuracy">
1030
                     <table>
1031
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1032
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1033
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1034
                          </tr>
1035
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1036
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1037
                          </tr>
1038
                      </xsl:for-each>
1039
                   </table>
1040
                 </xsl:for-each>
1041
               </td>
1042
             </xsl:when>
1043
             <xsl:otherwise>
1044
                <td colspan="1" align="center" class="{$stripes}">
1045
                  &#160;
1046
                </td>
1047
             </xsl:otherwise>
1048
           </xsl:choose>
1049
          </xsl:for-each>
1050
        </xsl:when>
1051
        <xsl:otherwise>
1052
           <xsl:choose>
1053
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1054
                 <td colspan="1" align="center" class="{$stripes}">
1055
                   <xsl:for-each select="accuracy">
1056
                     <table>
1057
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1058
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1059
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1060
                          </tr>
1061
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1062
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1063
                          </tr>
1064
                      </xsl:for-each>
1065
                   </table>
1066
                 </xsl:for-each>
1067
               </td>
1068
             </xsl:when>
1069
             <xsl:otherwise>
1070
                <td colspan="1" align="center" class="{$stripes}">
1071
                  &#160;
1072
                </td>
1073
             </xsl:otherwise>
1074
           </xsl:choose>
1075
        </xsl:otherwise>
1076
     </xsl:choose>
1077
   </xsl:if>
1078
  </xsl:for-each>
1079
  </tr>
1080

    
1081
   <!-- The tenth row for coverage-->
1082
  <tr><th class="rowodd">Coverage</th>
1083
   <xsl:for-each select="attribute">
1084
    <xsl:if test="position() = $attributeindex">
1085
    <xsl:variable name="index" select="position()"/>
1086
    <xsl:variable name="stripes">
1087
              <xsl:choose>
1088
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1089
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1090
              </xsl:choose>
1091
    </xsl:variable>
1092
    <xsl:choose>
1093
         <xsl:when test="references!=''">
1094
          <xsl:variable name="ref_id" select="references"/>
1095
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1096
          <xsl:for-each select="$references">
1097
            <xsl:choose>
1098
               <xsl:when test="coverage!=''">
1099
                  <td colspan="1" align="center" class="{$stripes}">
1100
                    <xsl:for-each select="coverage">
1101
                      <xsl:call-template name="attributecoverage">
1102
                         <xsl:with-param name="docid" select="$docid"/>
1103
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1104
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1105
                         <xsl:with-param name="attributeindex" select="$index"/>
1106
                      </xsl:call-template>
1107
                    </xsl:for-each>
1108
                  </td>
1109
               </xsl:when>
1110
               <xsl:otherwise>
1111
                  <td colspan="1" align="center" class="{$stripes}">
1112
                   &#160;
1113
                  </td>
1114
               </xsl:otherwise>
1115
            </xsl:choose>
1116
         </xsl:for-each>
1117
        </xsl:when>
1118
        <xsl:otherwise>
1119
          <xsl:choose>
1120
               <xsl:when test="coverage!=''">
1121
                  <td colspan="1" align="center" class="{$stripes}">
1122
                    <xsl:for-each select="coverage">
1123
                      <xsl:call-template name="attributecoverage">
1124
                         <xsl:with-param name="docid" select="$docid"/>
1125
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1126
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1127
                         <xsl:with-param name="attributeindex" select="$index"/>
1128
                      </xsl:call-template>
1129
                    </xsl:for-each>
1130
                  </td>
1131
               </xsl:when>
1132
               <xsl:otherwise>
1133
                  <td colspan="1" align="center" class="{$stripes}">
1134
                   &#160;
1135
                  </td>
1136
               </xsl:otherwise>
1137
            </xsl:choose>
1138
        </xsl:otherwise>
1139
     </xsl:choose>
1140
    </xsl:if>
1141
   </xsl:for-each>
1142
  </tr>
1143

    
1144

    
1145
   <!-- The eleventh row for method-->
1146
  <tr><th class="rowodd">Method</th>
1147
   <xsl:for-each select="attribute">
1148
    <xsl:if test="position() = $attributeindex">
1149
    <xsl:variable name="index" select="position()"/>
1150
    <xsl:variable name="stripes">
1151
              <xsl:choose>
1152
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1153
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1154
              </xsl:choose>
1155
    </xsl:variable>
1156
    <xsl:choose>
1157
         <xsl:when test="references!=''">
1158
          <xsl:variable name="ref_id" select="references"/>
1159
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1160
          <xsl:for-each select="$references">
1161
            <xsl:choose>
1162
               <xsl:when test="method!=''">
1163
                 <td colspan="1" align="center" class="{$stripes}">
1164
                   <xsl:for-each select="method">
1165
                     <xsl:call-template name="attributemethod">
1166
                       <xsl:with-param name="docid" select="$docid"/>
1167
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1168
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1169
                       <xsl:with-param name="attributeindex" select="$index"/>
1170
                     </xsl:call-template>
1171
                   </xsl:for-each>
1172
                 </td>
1173
               </xsl:when>
1174
               <xsl:otherwise>
1175
                 <td colspan="1" align="center" class="{$stripes}">
1176
                   &#160;
1177
                 </td>
1178
               </xsl:otherwise>
1179
            </xsl:choose>
1180
         </xsl:for-each>
1181
        </xsl:when>
1182
        <xsl:otherwise>
1183
           <xsl:choose>
1184
               <xsl:when test="method!=''">
1185
                 <td colspan="1" align="center" class="{$stripes}">
1186
                   <xsl:for-each select="method">
1187
                     <xsl:call-template name="attributemethod">
1188
                       <xsl:with-param name="docid" select="$docid"/>
1189
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1190
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1191
                       <xsl:with-param name="attributeindex" select="$index"/>
1192
                     </xsl:call-template>
1193
                   </xsl:for-each>
1194
                 </td>
1195
               </xsl:when>
1196
               <xsl:otherwise>
1197
                 <td colspan="1" align="center" class="{$stripes}">
1198
                   &#160;
1199
                 </td>
1200
               </xsl:otherwise>
1201
            </xsl:choose>
1202
        </xsl:otherwise>
1203
     </xsl:choose>
1204
    </xsl:if>
1205
   </xsl:for-each>
1206
  </tr>
1207
 </xsl:template>
1208

    
1209

    
1210
<xsl:template name="measurementscale">
1211
   <xsl:param name="stripes"/>
1212
   <xsl:param name="docid"/>
1213
   <xsl:param name="entitytype"/>
1214
   <xsl:param name="entityindex"/>
1215
   <xsl:param name="attributeindex"/>
1216
   <table class="table table-striped">
1217
    <xsl:for-each select="nominal">
1218
         <xsl:call-template name="attributenonnumericdomain">
1219
               <xsl:with-param name="docid" select="$docid"/>
1220
               <xsl:with-param name="entitytype" select="$entitytype"/>
1221
               <xsl:with-param name="entityindex" select="$entityindex"/>
1222
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1223
               <xsl:with-param name="stripes" select="$stripes"/>
1224
       </xsl:call-template>
1225
    </xsl:for-each>
1226
    <xsl:for-each select="ordinal">
1227
       <xsl:call-template name="attributenonnumericdomain">
1228
               <xsl:with-param name="docid" select="$docid"/>
1229
               <xsl:with-param name="entitytype" select="$entitytype"/>
1230
               <xsl:with-param name="entityindex" select="$entityindex"/>
1231
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1232
               <xsl:with-param name="stripes" select="$stripes"/>
1233
       </xsl:call-template>
1234
    </xsl:for-each>
1235
    <xsl:for-each select="interval">
1236
       <xsl:call-template name="intervalratio">
1237
         <xsl:with-param name="stripes" select="$stripes"/>
1238
       </xsl:call-template>
1239
    </xsl:for-each>
1240
    <xsl:for-each select="ratio">
1241
       <xsl:call-template name="intervalratio">
1242
         <xsl:with-param name="stripes" select="$stripes"/>
1243
       </xsl:call-template>
1244
    </xsl:for-each>
1245
    <xsl:for-each select="datetime">
1246
       <xsl:call-template name="datetime">
1247
          <xsl:with-param name="stripes" select="$stripes"/>
1248
       </xsl:call-template>
1249
    </xsl:for-each>
1250
   </table>
1251
 </xsl:template>
1252

    
1253
 <xsl:template name="attributenonnumericdomain">
1254
   <xsl:param name="stripes"/>
1255
   <xsl:param name="docid"/>
1256
   <xsl:param name="entitytype"/>
1257
   <xsl:param name="entityindex"/>
1258
   <xsl:param name="attributeindex"/>
1259
   <xsl:for-each select="nonNumericDomain">
1260
     <xsl:choose>
1261
         <xsl:when test="references!=''">
1262
          <xsl:variable name="ref_id" select="references"/>
1263
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1264
          <xsl:for-each select="$references">
1265
            <xsl:call-template name="attributenonnumericdomaincommon">
1266
                <xsl:with-param name="docid" select="$docid"/>
1267
                <xsl:with-param name="entitytype" select="$entitytype"/>
1268
                <xsl:with-param name="entityindex" select="$entityindex"/>
1269
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
1270
                <xsl:with-param name="stripes" select="$stripes"/>
1271
            </xsl:call-template>
1272
         </xsl:for-each>
1273
        </xsl:when>
1274
        <xsl:otherwise>
1275
            <xsl:call-template name="attributenonnumericdomaincommon">
1276
               <xsl:with-param name="docid" select="$docid"/>
1277
               <xsl:with-param name="entitytype" select="$entitytype"/>
1278
               <xsl:with-param name="entityindex" select="$entityindex"/>
1279
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1280
               <xsl:with-param name="stripes" select="$stripes"/>
1281
            </xsl:call-template>
1282
        </xsl:otherwise>
1283
     </xsl:choose>
1284
   </xsl:for-each>
1285
 </xsl:template>
1286

    
1287
 <xsl:template name="attributenonnumericdomaincommon">
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
    <!-- if numericdomain only has one test domain,
1294
        it will be displayed inline otherwith will be show a link-->
1295
    <xsl:choose>
1296
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">
1297
        <tr><td class="{$stripes}">Definition</td>
1298
            <td class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
1299
            </td>
1300
        </tr>
1301
        <xsl:for-each select="textDomain/parttern">
1302
          <tr><td class="{$stripes}">Pattern</td>
1303
            <td class="{$stripes}"><xsl:value-of select="."/>
1304
            </td>
1305
          </tr>
1306
        </xsl:for-each>
1307
        <xsl:for-each select="textDomain/source">
1308
          <tr><td class="{$stripes}">Source</td>
1309
            <td class="{$stripes}"><xsl:value-of select="."/>
1310
            </td>
1311
          </tr>
1312
        </xsl:for-each>
1313
      </xsl:when>
1314
      <xsl:otherwise>
1315
           <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>
1316
           Domain Info</a>
1317
      </xsl:otherwise>
1318
    </xsl:choose>
1319
 </xsl:template>
1320

    
1321
 <xsl:template name="intervalratio">
1322
    <xsl:param name="stripes"/>
1323
    <xsl:if test="unit/standardUnit">
1324
      <tr><td class="{$stripes}"><b>Unit</b></td>
1325
            <td class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
1326
            </td>
1327
      </tr>
1328
    </xsl:if>
1329
    <xsl:if test="unit/customUnit">
1330
      <tr><td class="{$stripes}"><b>Unit</b></td>
1331
            <td class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
1332
            </td>
1333
      </tr>
1334
   </xsl:if>
1335
   <xsl:for-each select="precision">
1336
      <tr><td class="{$stripes}"><b>Precision</b></td>
1337
            <td class="{$stripes}"><xsl:value-of select="."/>
1338
            </td>
1339
      </tr>
1340
   </xsl:for-each>
1341
   <xsl:for-each select="numericDomain">
1342
      <xsl:call-template name="numericDomain">
1343
         <xsl:with-param name="stripes" select="$stripes"/>
1344
      </xsl:call-template>
1345
    </xsl:for-each>
1346
  </xsl:template>
1347

    
1348

    
1349
 <xsl:template name="numericDomain">
1350
     <xsl:param name="stripes"/>
1351
       <xsl:choose>
1352
         <xsl:when test="references!=''">
1353
          <xsl:variable name="ref_id" select="references"/>
1354
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1355
          <xsl:for-each select="$references">
1356
            <tr><td class="{$stripes}"><b>Type</b></td>
1357
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1358
                </td>
1359
            </tr>
1360
            <xsl:for-each select="bounds">
1361
              <tr><td class="{$stripes}"><b>Min</b></td>
1362
                  <td class="{$stripes}">
1363
                    <xsl:for-each select="minimum">
1364
                      <xsl:value-of select="."/>&#160;
1365
                    </xsl:for-each>
1366
                  </td>
1367
              </tr>
1368
              <tr><td class="{$stripes}"><b>Max</b></td>
1369
                  <td class="{$stripes}">
1370
                    <xsl:for-each select="maximum">
1371
                      <xsl:value-of select="."/>&#160;
1372
                    </xsl:for-each>
1373
                  </td>
1374
              </tr>
1375
            </xsl:for-each>
1376
          </xsl:for-each>
1377
        </xsl:when>
1378
        <xsl:otherwise>
1379
          <tr><td class="{$stripes}"><b>Type</b></td>
1380
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1381
                </td>
1382
            </tr>
1383
            <xsl:for-each select="bounds">
1384
              <tr><td class="{$stripes}"><b>Min</b></td>
1385
                  <td class="{$stripes}">
1386
                    <xsl:for-each select="minimum">
1387
                      <xsl:value-of select="."/>&#160;
1388
                    </xsl:for-each>
1389
                  </td>
1390
              </tr>
1391
              <tr><td class="{$stripes}"><b>Max</b></td>
1392
                  <td class="{$stripes}">
1393
                    <xsl:for-each select="maximum">
1394
                      <xsl:value-of select="."/>&#160;
1395
                    </xsl:for-each>
1396
                  </td>
1397
              </tr>
1398
            </xsl:for-each>
1399
        </xsl:otherwise>
1400
      </xsl:choose>
1401
  </xsl:template>
1402

    
1403
 <xsl:template name="datetime">
1404
    <xsl:param name="stripes"/>
1405
    <tr><td class="{$stripes}"><b>Format</b></td>
1406
         <td class="{$stripes}">
1407
            <xsl:value-of select="formatString"/>
1408
         </td>
1409
    </tr>
1410
     <tr><td class="{$stripes}"><b>Precision</b></td>
1411
         <td class="{$stripes}">
1412
            <xsl:value-of select="dateTimePrecision"/>
1413
         </td>
1414
    </tr>
1415
    <xsl:call-template name="timedomain"/>
1416
 </xsl:template>
1417

    
1418

    
1419
 <xsl:template name="timedomain">
1420
    <xsl:param name="stripes"/>
1421
      <xsl:choose>
1422
         <xsl:when test="references!=''">
1423
          <xsl:variable name="ref_id" select="references"/>
1424
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1425
          <xsl:for-each select="$references">
1426
            <xsl:for-each select="bounds">
1427
              <tr><td class="{$stripes}"><b>Min</b></td>
1428
                  <td class="{$stripes}">
1429
                    <xsl:for-each select="minimum">
1430
                      <xsl:value-of select="."/>&#160;
1431
                    </xsl:for-each>
1432
                  </td>
1433
              </tr>
1434
              <tr><td class="{$stripes}"><b>Max</b></td>
1435
                  <td class="{$stripes}">
1436
                    <xsl:for-each select="maximum">
1437
                      <xsl:value-of select="."/>&#160;
1438
                    </xsl:for-each>
1439
                  </td>
1440
              </tr>
1441
            </xsl:for-each>
1442
          </xsl:for-each>
1443
        </xsl:when>
1444
        <xsl:otherwise>
1445
           <xsl:for-each select="bounds">
1446
              <tr><td class="{$stripes}"><b>Min</b></td>
1447
                  <td class="{$stripes}">
1448
                    <xsl:for-each select="minimum">
1449
                      <xsl:value-of select="."/>&#160;
1450
                    </xsl:for-each>
1451
                  </td>
1452
              </tr>
1453
              <tr><td class="{$stripes}"><b>Max</b></td>
1454
                  <td class="{$stripes}">
1455
                    <xsl:for-each select="maximum">
1456
                      <xsl:value-of select="."/>&#160;
1457
                    </xsl:for-each>
1458
                  </td>
1459
              </tr>
1460
            </xsl:for-each>
1461
        </xsl:otherwise>
1462
      </xsl:choose>
1463
  </xsl:template>
1464

    
1465
 <xsl:template name="attributecoverage">
1466
    <xsl:param name="docid"/>
1467
    <xsl:param name="entitytype"/>
1468
    <xsl:param name="entityindex"/>
1469
    <xsl:param name="attributeindex"/>
1470
     <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>
1471
           <b>Coverage Info</b></a>
1472
 </xsl:template>
1473

    
1474
 <xsl:template name="attributemethod">
1475
    <xsl:param name="docid"/>
1476
    <xsl:param name="entitytype"/>
1477
    <xsl:param name="entityindex"/>
1478
    <xsl:param name="attributeindex"/>
1479
     <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>
1480
           <b>Method Info</b></a>
1481
 </xsl:template>
1482

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