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: 2014-09-19 16:15:58 -0700 (Fri, 19 Sep 2014) $'
10
  * '$Revision: 8871 $'
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="UTF-8"
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
		<!-- for annotating this section -->
123
		<xsl:variable name="absolutePath" >
124
         	<xsl:for-each select="ancestor-or-self::*">
125
         		<xsl:text>/</xsl:text>			         	
126
         		<xsl:value-of select="local-name()" /> 
127
         		<xsl:if test="local-name() = 'dataTable'">
128
         			<xsl:text>[</xsl:text>
129
         				<xsl:value-of select="$entityindex" /> 
130
         			<xsl:text>]</xsl:text>			         	
131
         		</xsl:if>        		
132
         	</xsl:for-each>
133
         </xsl:variable>
134
		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$attributeindex"/>])</xsl:attribute>
135
		
136

    
137
  	<!--  Name -->
138
  	<div class="control-group">
139
		<label class="control-label">Name</label>
140
		<div class="controls controls-well">
141
			<xsl:choose>
142
				<xsl:when test="references!=''">
143
		          <xsl:variable name="ref_id" select="references"/>
144
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
145
		          <xsl:for-each select="$references">
146
		            <xsl:value-of select="attributeName"/>
147
		          </xsl:for-each>
148
		        </xsl:when>
149
		        <xsl:otherwise>
150
		          <xsl:value-of select="attributeName"/>
151
		        </xsl:otherwise>
152
		     </xsl:choose>
153
		</div>
154
	</div>	
155
    
156
  
157

    
158
	<!-- attribute label-->
159
	<div class="control-group">
160
		<label class="control-label">Label</label>
161
		<div class="controls controls-well">
162
		    <xsl:choose>
163
		         <xsl:when test="references!=''">
164
		          <xsl:variable name="ref_id" select="references"/>
165
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
166
		          <xsl:for-each select="$references">
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:for-each>
179
		        </xsl:when>
180
		        <xsl:otherwise>
181
		             <xsl:choose>
182
		                <xsl:when test="attributeLabel!=''">
183
		                     <xsl:for-each select="attributeLabel">
184
		                       <xsl:value-of select="."/>
185
		                         &#160;<br/>
186
		                       </xsl:for-each>
187
		                </xsl:when>
188
		                <xsl:otherwise>
189
		                       &#160;
190
		                </xsl:otherwise>
191
		              </xsl:choose>
192
		        </xsl:otherwise>
193
		     </xsl:choose>
194
     	</div>
195
	</div>
196
  
197
  <!--another row for Semantics -->
198
  <xsl:if test="$annotationId != ''">
199
	  <div class="control-group">
200
		<label class="control-label">Measurement</label>
201
		<div class="controls controls-well">
202
			<!-- handle references -->
203
			<xsl:variable name="finalAttributeName">
204
				<xsl:choose>
205
					<xsl:when test="references!=''">
206
						<xsl:variable name="ref_id" select="references"/>
207
						<xsl:variable name="references" select="$ids[@id=$ref_id]" />
208
						<!-- test this - should only be a single value -->
209
						<xsl:value-of select="$references/attributeName"/>
210
					</xsl:when>
211
			        <xsl:otherwise>
212
			          	<xsl:value-of select="attributeName"/>
213
					</xsl:otherwise>
214
				</xsl:choose>
215
			</xsl:variable>
216
			<!-- load annotation detail for attribute -->
217
			<div>
218
           		<xsl:attribute name="id">
219
           			<xsl:value-of select="$finalAttributeName"/>
220
           		</xsl:attribute>
221
           		Loading information for: <xsl:value-of select="$finalAttributeName"/>
222
           	</div>
223
           	<script language="JavaScript">
224
          			var params = 
225
				{
226
					'action': 'read',
227
					'docid': '<xsl:value-of select="$annotationId" />',
228
					'qformat': '<xsl:value-of select="$qformat" />',
229
					'attributeLabel': '<xsl:value-of select="$finalAttributeName" />',
230
					'showEntity': 'true'
231
				};
232
				load(
233
					'<xsl:value-of select="$contextURL" />/metacat',
234
					params, 
235
					'<xsl:value-of select="$finalAttributeName" />');
236
			</script>
237
		</div>
238
	</div>	
239
		
240
	</xsl:if>
241
	
242
  <!-- Third row for attribute defination-->
243
  <div class="control-group">
244
		<label class="control-label">Definition</label>
245
		<div class="controls controls-well">
246
	      <xsl:choose>
247
	         <xsl:when test="references!=''">
248
	          <xsl:variable name="ref_id" select="references"/>
249
	          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
250
	           <xsl:for-each select="$references">
251
	               <xsl:value-of select="attributeDefinition"/>
252
	           </xsl:for-each>
253
	        </xsl:when>
254
	        <xsl:otherwise>
255
	             <xsl:value-of select="attributeDefinition"/>
256
	        </xsl:otherwise>
257
	     </xsl:choose>
258
     </div>
259
    </div>
260

    
261

    
262
  <!-- The fourth row for attribute storage type-->
263
   <div class="control-group">
264
		<label class="control-label">Storage Type</label>
265
		<div class="controls controls-well">
266
	      <xsl:choose>
267
	         <xsl:when test="references!=''">
268
	          <xsl:variable name="ref_id" select="references"/>
269
	          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
270
	          <xsl:for-each select="$references">
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:for-each>
283
	        </xsl:when>
284
	        <xsl:otherwise>
285
	           <xsl:choose>
286
	              <xsl:when test="storageType!=''">
287
	                    <xsl:for-each select="storageType">
288
	                      <xsl:value-of select="."/>
289
	                       &#160;<br/>
290
	                    </xsl:for-each>
291
	              </xsl:when>
292
	              <xsl:otherwise>
293
	                       &#160;
294
	              </xsl:otherwise>
295
	            </xsl:choose>
296
	        </xsl:otherwise>
297
	     </xsl:choose>
298
     </div>
299
    </div>
300

    
301
  <!-- The fifth row for meaturement type-->
302
  <div class="control-group">
303
		<label class="control-label">Measurement Type</label>
304
		<div class="controls controls-well">
305
		    <xsl:choose>
306
		         <xsl:when test="references!=''">
307
		          <xsl:variable name="ref_id" select="references"/>
308
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
309
		          <xsl:for-each select="$references">
310
		              <xsl:for-each select="measurementScale">
311
		                 <xsl:value-of select="local-name(./*)"/>
312
		              </xsl:for-each>
313
		         </xsl:for-each>
314
		        </xsl:when>
315
		        <xsl:otherwise>
316
		              <xsl:for-each select="measurementScale">
317
		                 <xsl:value-of select="local-name(./*)"/>
318
		              </xsl:for-each>
319
		        </xsl:otherwise>
320
		     </xsl:choose>
321
	     </div>
322
     </div>
323

    
324
  <!-- The sixth row for meaturement domain-->
325
  <div class="control-group">
326
		<label class="control-label">Measurement Domain</label>
327
		<div class="controls controls-well">
328
		    <xsl:choose>
329
		         <xsl:when test="references!=''">
330
		          <xsl:variable name="ref_id" select="references"/>
331
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
332
		          <xsl:for-each select="$references">
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:call-template>
340
		              </xsl:for-each>
341
		         </xsl:for-each>
342
		        </xsl:when>
343
		        <xsl:otherwise>
344
		              <xsl:for-each select="measurementScale">
345
		                <xsl:call-template name="measurementscale">
346
		                      <xsl:with-param name="docid" select="$docid"/>
347
		                      <xsl:with-param name="entitytype" select="$entitytype"/>
348
		                      <xsl:with-param name="entityindex" select="$entityindex"/>
349
		                      <xsl:with-param name="attributeindex" select="$attributeindex"/>
350
		                </xsl:call-template>
351
		              </xsl:for-each>
352
		        </xsl:otherwise>
353
		     </xsl:choose>
354
	     </div>
355
     </div>
356

    
357
  <!-- The seventh row for missing value code-->
358
  <div class="control-group">
359
		<label class="control-label">Missing Value Code</label>
360
		<div class="controls controls-well">
361
		     <xsl:choose>
362
		         <xsl:when test="references!=''">
363
		          <xsl:variable name="ref_id" select="references"/>
364
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
365
		          <xsl:for-each select="$references">
366
		            <xsl:choose>
367
		              <xsl:when test="missingValueCode!=''">
368
		                    <table class="table table-striped">
369
		                    	<thead>
370
		                    		<tr>
371
		                    			<th>Code</th>
372
		                              	<th>Explanation</th>
373
		                            </tr>
374
		                        </thead>
375
		                       <xsl:for-each select="missingValueCode">
376
		                          <tr>
377
		                              <td><xsl:value-of select="code"/></td>
378
		                              <td><xsl:value-of select="codeExplanation"/></td>
379
		                          </tr>
380
		                       </xsl:for-each>
381
		                   </table>
382
		              </xsl:when>
383
		              <xsl:otherwise>
384
		                   &#160;
385
		              </xsl:otherwise>
386
		            </xsl:choose>
387
		          </xsl:for-each>
388
		        </xsl:when>
389
		        <xsl:otherwise>
390
		           <xsl:choose>
391
		              <xsl:when test="missingValueCode!=''">
392
		                    <table class="table table-striped">
393
		                    	<thead>
394
		                    		<tr>
395
		                    			<th>Code</th>
396
		                              	<th>Explanation</th>
397
		                            </tr>
398
		                        </thead>
399
		                       <xsl:for-each select="missingValueCode">
400
		                          <tr>
401
		                              <td><xsl:value-of select="code"/></td>
402
		                              <td><xsl:value-of select="codeExplanation"/></td>
403
		                          </tr>
404
		                       </xsl:for-each>
405
		                   </table>
406
		              </xsl:when>
407
		              <xsl:otherwise>
408
		                   &#160;
409
		              </xsl:otherwise>
410
		            </xsl:choose>
411
		        </xsl:otherwise>
412
		     </xsl:choose>
413
	     </div>
414
     </div>
415

    
416

    
417
  <!-- The eighth row for accuracy report-->
418
  <div class="control-group">
419
		<label class="control-label">Accuracy Report</label>
420
		<div class="controls controls-well">
421
		    <xsl:choose>
422
		         <xsl:when test="references!=''">
423
		          <xsl:variable name="ref_id" select="references"/>
424
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
425
		          <xsl:for-each select="$references">
426
		            <xsl:choose>
427
		               <xsl:when test="accuracy!=''">
428
		                    <xsl:for-each select="accuracy">
429
		                          <xsl:value-of select="attributeAccuracyReport"/>
430
		                    </xsl:for-each>
431
		              </xsl:when>
432
		              <xsl:otherwise>
433
		                  &#160;
434
		              </xsl:otherwise>
435
		            </xsl:choose>
436
		          </xsl:for-each>
437
		        </xsl:when>
438
		        <xsl:otherwise>
439
		           <xsl:choose>
440
		               <xsl:when test="accuracy!=''">
441
		                    <xsl:for-each select="accuracy">
442
		                          <xsl:value-of select="attributeAccuracyReport"/>
443
		                    </xsl:for-each>
444
		              </xsl:when>
445
		              <xsl:otherwise>
446
		                  &#160;
447
		              </xsl:otherwise>
448
		            </xsl:choose>
449
		        </xsl:otherwise>
450
		     </xsl:choose>
451
	     </div>
452
     </div>
453

    
454
  <!-- The nineth row for quality accuracy accessment -->
455
  <div class="control-group">
456
		<label class="control-label">Accuracy Assessment</label>
457
		<div class="controls controls-well">
458
		     <xsl:choose>
459
		         <xsl:when test="references!=''">
460
		          <xsl:variable name="ref_id" select="references"/>
461
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
462
		          <xsl:for-each select="$references">
463
		            <xsl:choose>
464
		               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
465
		                   <xsl:for-each select="accuracy">
466
		                     <table class="table table-striped">
467
		                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
468
		                          <tr><td>Value</td>
469
		                              <td><xsl:value-of select="attributeAccuracyValue"/></td>
470
		                          </tr>
471
		                          <tr><td>Expl</td>
472
		                              <td><xsl:value-of select="attributeAccuracyExplanation"/></td>
473
		                          </tr>
474
		                      </xsl:for-each>
475
		                   </table>
476
		                 </xsl:for-each>
477
		             </xsl:when>
478
		             <xsl:otherwise>
479
		                  &#160;
480
		             </xsl:otherwise>
481
		           </xsl:choose>
482
		          </xsl:for-each>
483
		        </xsl:when>
484
		        <xsl:otherwise>
485
		           <xsl:choose>
486
		               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
487
		                   <xsl:for-each select="accuracy">
488
		                     <table class="table table-striped">
489
		                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
490
		                          <tr><td>Value</td>
491
		                              <td><xsl:value-of select="attributeAccuracyValue"/></td>
492
		                          </tr>
493
		                          <tr><td>Expl</td>
494
		                              <td><xsl:value-of select="attributeAccuracyExplanation"/></td>
495
		                          </tr>
496
		                      </xsl:for-each>
497
		                   </table>
498
		                 </xsl:for-each>
499
		             </xsl:when>
500
		             <xsl:otherwise>
501
		                  &#160;
502
		             </xsl:otherwise>
503
		           </xsl:choose>
504
		        </xsl:otherwise>
505
		     </xsl:choose>
506
	     </div>
507
     </div>
508

    
509
   <!-- The tenth row for coverage-->
510
  <div class="control-group">
511
		<label class="control-label">Coverage</label>
512
		<div class="controls controls-well">
513
		    <xsl:choose>
514
		         <xsl:when test="references!=''">
515
		          <xsl:variable name="ref_id" select="references"/>
516
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
517
		          <xsl:for-each select="$references">
518
		            <xsl:choose>
519
		               <xsl:when test="coverage!=''">
520
		                    <xsl:for-each select="coverage">
521
		                      <xsl:call-template name="attributecoverage">
522
		                         <xsl:with-param name="docid" select="$docid"/>
523
		                         <xsl:with-param name="entitytype" select="$entitytype"/>
524
		                         <xsl:with-param name="entityindex" select="$entityindex"/>
525
		                         <xsl:with-param name="attributeindex" select="$attributeindex"/>
526
		                      </xsl:call-template>
527
		                    </xsl:for-each>
528
		               </xsl:when>
529
		               <xsl:otherwise>
530
		                   &#160;
531
		               </xsl:otherwise>
532
		            </xsl:choose>
533
		         </xsl:for-each>
534
		        </xsl:when>
535
		        <xsl:otherwise>
536
		          <xsl:choose>
537
		               <xsl:when test="coverage!=''">
538
		                    <xsl:for-each select="coverage">
539
		                      <xsl:call-template name="attributecoverage">
540
		                         <xsl:with-param name="docid" select="$docid"/>
541
		                         <xsl:with-param name="entitytype" select="$entitytype"/>
542
		                         <xsl:with-param name="entityindex" select="$entityindex"/>
543
		                         <xsl:with-param name="attributeindex" select="$attributeindex"/>
544
		                      </xsl:call-template>
545
		                    </xsl:for-each>
546
		               </xsl:when>
547
		               <xsl:otherwise>
548
		                   &#160;
549
		               </xsl:otherwise>
550
		            </xsl:choose>
551
		        </xsl:otherwise>
552
		     </xsl:choose>
553
	     </div>
554
     </div>
555

    
556

    
557
   <!-- The eleventh row for method-->
558
  <div class="control-group">
559
		<label class="control-label">Method</label>
560
		<div class="controls controls-well">
561
		    <xsl:choose>
562
		         <xsl:when test="references!=''">
563
		          <xsl:variable name="ref_id" select="references"/>
564
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
565
		          <xsl:for-each select="$references">
566
		            <xsl:choose>
567
		               <xsl:when test="method!=''">
568
		                   <xsl:for-each select="method">
569
		                     <xsl:call-template name="attributemethod">
570
		                       <xsl:with-param name="docid" select="$docid"/>
571
		                       <xsl:with-param name="entitytype" select="$entitytype"/>
572
		                       <xsl:with-param name="entityindex" select="$entityindex"/>
573
		                       <xsl:with-param name="attributeindex" select="$attributeindex"/>
574
		                     </xsl:call-template>
575
		                   </xsl:for-each>
576
		               </xsl:when>
577
		               <xsl:otherwise>
578
		                   &#160;
579
		               </xsl:otherwise>
580
		            </xsl:choose>
581
		         </xsl:for-each>
582
		        </xsl:when>
583
		        <xsl:otherwise>
584
		           <xsl:choose>
585
		               <xsl:when test="method!=''">
586
		                   <xsl:for-each select="method">
587
		                     <xsl:call-template name="attributemethod">
588
		                       <xsl:with-param name="docid" select="$docid"/>
589
		                       <xsl:with-param name="entitytype" select="$entitytype"/>
590
		                       <xsl:with-param name="entityindex" select="$entityindex"/>
591
		                       <xsl:with-param name="attributeindex" select="$attributeindex"/>
592
		                     </xsl:call-template>
593
		                   </xsl:for-each>
594
		               </xsl:when>
595
		               <xsl:otherwise>
596
		                   &#160;
597
		               </xsl:otherwise>
598
		            </xsl:choose>
599
		        </xsl:otherwise>
600
		     </xsl:choose>
601
	     </div>
602
     </div>
603
     
604
     </div> <!-- end the attribute section -->
605
     
606
     </xsl:for-each>
607
  
608
  	</div>
609
  	
610
  </div>
611
  
612
 </xsl:template>
613

    
614

    
615
<xsl:template name="singleattribute">
616
   <xsl:param name="docid"/>
617
   <xsl:param name="entitytype"/>
618
   <xsl:param name="entityindex"/>
619
   <xsl:param name="attributeindex"/>
620

    
621
   <table class="{$tableattributeStyle}">
622
        <xsl:choose>
623
         <xsl:when test="references!=''">
624
          <xsl:variable name="ref_id" select="references"/>
625
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
626
          <xsl:for-each select="$references">
627
            <xsl:call-template name="singleattributecommon">
628
               <xsl:with-param name="docid" select="$docid"/>
629
               <xsl:with-param name="entitytype" select="$entitytype"/>
630
               <xsl:with-param name="entityindex" select="$entityindex"/>
631
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
632
            </xsl:call-template>
633
          </xsl:for-each>
634
        </xsl:when>
635
        <xsl:otherwise>
636
          <xsl:call-template name="singleattributecommon">
637
               <xsl:with-param name="docid" select="$docid"/>
638
               <xsl:with-param name="entitytype" select="$entitytype"/>
639
               <xsl:with-param name="entityindex" select="$entityindex"/>
640
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
641
          </xsl:call-template>
642
        </xsl:otherwise>
643
      </xsl:choose>
644
  </table>
645
</xsl:template>
646

    
647

    
648
<xsl:template name="singleattributecommon">
649
   <xsl:param name="docid"/>
650
   <xsl:param name="entitytype"/>
651
   <xsl:param name="entityindex"/>
652
   <xsl:param name="attributeindex"/>
653

    
654
  <!-- First row for attribute name-->
655
  <tr><th class="rowodd">Column Name</th>
656
  <xsl:for-each select="attribute">
657
   <xsl:if test="position() = $attributeindex">
658
      <xsl:choose>
659
         <xsl:when test="references!=''">
660
          <xsl:variable name="ref_id" select="references"/>
661
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
662
          <xsl:for-each select="$references">
663
            <th><xsl:value-of select="attributeName"/></th>
664
          </xsl:for-each>
665
        </xsl:when>
666
        <xsl:otherwise>
667
          <th><xsl:value-of select="attributeName"/></th>
668
        </xsl:otherwise>
669
     </xsl:choose>
670
   </xsl:if>
671
  </xsl:for-each>
672
  </tr>
673

    
674
  <!-- Second row for attribute label-->
675
  <tr><th class="rowodd">Column Label</th>
676
   <xsl:for-each select="attribute">
677
    <xsl:if test="position() = $attributeindex">
678
    <xsl:variable name="stripes">
679
              <xsl:choose>
680
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
681
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
682
              </xsl:choose>
683
    </xsl:variable>
684
    <xsl:choose>
685
         <xsl:when test="references!=''">
686
          <xsl:variable name="ref_id" select="references"/>
687
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
688
          <xsl:for-each select="$references">
689
             <xsl:choose>
690
                <xsl:when test="attributeLabel!=''">
691
                  <td colspan="1" align="center" class="{$stripes}">
692
                     <xsl:for-each select="attributeLabel">
693
                       <xsl:value-of select="."/>
694
                         &#160;<br />
695
                       </xsl:for-each>
696
                  </td>
697
                </xsl:when>
698
                <xsl:otherwise>
699
                   <td colspan="1" align="center" class="{$stripes}">
700
                       &#160;<br />
701
                   </td>
702
                </xsl:otherwise>
703
              </xsl:choose>
704
          </xsl:for-each>
705
        </xsl:when>
706
        <xsl:otherwise>
707
             <xsl:choose>
708
                <xsl:when test="attributeLabel!=''">
709
                  <td colspan="1" align="center" class="{$stripes}">
710
                     <xsl:for-each select="attributeLabel">
711
                       <xsl:value-of select="."/>
712
                         &#160;<br/>
713
                       </xsl:for-each>
714
                  </td>
715
                </xsl:when>
716
                <xsl:otherwise>
717
                   <td colspan="1" align="center" class="{$stripes}">
718
                       &#160;<br />
719
                   </td>
720
                </xsl:otherwise>
721
              </xsl:choose>
722
        </xsl:otherwise>
723
     </xsl:choose>
724
    </xsl:if>
725
   </xsl:for-each>
726
  </tr>
727

    
728
  <!-- Third row for attribute defination-->
729
  <tr><th class="rowodd">Definition</th>
730
    <xsl:for-each select="attribute">
731
     <xsl:if test="position() = $attributeindex">
732
      <xsl:variable name="stripes">
733
              <xsl:choose>
734
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
735
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
736
              </xsl:choose>
737
      </xsl:variable>
738
      <xsl:choose>
739
         <xsl:when test="references!=''">
740
          <xsl:variable name="ref_id" select="references"/>
741
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
742
           <xsl:for-each select="$references">
743
             <td colspan="1" align="center" class="{$stripes}">
744
               <xsl:value-of select="attributeDefinition"/>
745
             </td>
746
           </xsl:for-each>
747
        </xsl:when>
748
        <xsl:otherwise>
749
          <td colspan="1" align="center" class="{$stripes}">
750
             <xsl:value-of select="attributeDefinition"/>
751
          </td>
752
        </xsl:otherwise>
753
     </xsl:choose>
754
    </xsl:if>
755
   </xsl:for-each>
756
  </tr>
757

    
758
  <!-- The fourth row for attribute storage type-->
759
   <tr><th class="rowodd">Type of Value</th>
760
     <xsl:for-each select="attribute">
761
      <xsl:if test="position() = $attributeindex">
762
      <xsl:variable name="stripes">
763
              <xsl:choose>
764
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
765
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
766
              </xsl:choose>
767
      </xsl:variable>
768
      <xsl:choose>
769
         <xsl:when test="references!=''">
770
          <xsl:variable name="ref_id" select="references"/>
771
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
772
          <xsl:for-each select="$references">
773
            <xsl:choose>
774
              <xsl:when test="storageType!=''">
775
                 <td colspan="1" align="center" class="{$stripes}">
776
                    <xsl:for-each select="storageType">
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;
785
                   </td>
786
              </xsl:otherwise>
787
            </xsl:choose>
788
          </xsl:for-each>
789
        </xsl:when>
790
        <xsl:otherwise>
791
           <xsl:choose>
792
              <xsl:when test="storageType!=''">
793
                 <td colspan="1" align="center" class="{$stripes}">
794
                    <xsl:for-each select="storageType">
795
                      <xsl:value-of select="."/>
796
                       &#160;<br/>
797
                    </xsl:for-each>
798
                 </td>
799
              </xsl:when>
800
              <xsl:otherwise>
801
                  <td colspan="1" align="center" class="{$stripes}">
802
                       &#160;
803
                   </td>
804
              </xsl:otherwise>
805
            </xsl:choose>
806
        </xsl:otherwise>
807
     </xsl:choose>
808
    </xsl:if>
809
   </xsl:for-each>
810
  </tr>
811

    
812
  <!-- The fifth row for meaturement type-->
813
  <tr><th class="rowodd">Measurement Type</th>
814
   <xsl:for-each select="attribute">
815
    <xsl:if test="position() = $attributeindex">
816
    <xsl:variable name="stripes">
817
              <xsl:choose>
818
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
819
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
820
              </xsl:choose>
821
    </xsl:variable>
822
    <xsl:choose>
823
         <xsl:when test="references!=''">
824
          <xsl:variable name="ref_id" select="references"/>
825
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
826
          <xsl:for-each select="$references">
827
            <td colspan="1" align="center" class="{$stripes}">
828
              <xsl:for-each select="measurementScale">
829
                 <xsl:value-of select="local-name(./*)"/>
830
              </xsl:for-each>
831
            </td>
832
         </xsl:for-each>
833
        </xsl:when>
834
        <xsl:otherwise>
835
           <td colspan="1" align="center" class="{$stripes}">
836
              <xsl:for-each select="measurementScale">
837
                 <xsl:value-of select="local-name(./*)"/>
838
              </xsl:for-each>
839
           </td>
840
        </xsl:otherwise>
841
     </xsl:choose>
842
    </xsl:if>
843
   </xsl:for-each>
844
  </tr>
845

    
846
  <!-- The sixth row for meaturement domain-->
847
  <tr><th class="rowodd">Measurement Domain</th>
848
   <xsl:for-each select="attribute">
849
    <xsl:if test="position() = $attributeindex">
850
    <xsl:variable name="stripes">
851
              <xsl:choose>
852
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
853
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
854
              </xsl:choose>
855
    </xsl:variable>
856
     <xsl:variable name="innerstripes">
857
              <xsl:choose>
858
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
859
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
860
              </xsl:choose>
861
    </xsl:variable>
862
    <xsl:choose>
863
         <xsl:when test="references!=''">
864
          <xsl:variable name="ref_id" select="references"/>
865
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
866
          <xsl:for-each select="$references">
867
            <td colspan="1" align="center" class="{$stripes}">
868
              <xsl:for-each select="measurementScale">
869
                <xsl:call-template name="measurementscale">
870
                    <xsl:with-param name="docid" select="$docid"/>
871
                    <xsl:with-param name="entitytype" select="$entitytype"/>
872
                    <xsl:with-param name="entityindex" select="$entityindex"/>
873
                    <xsl:with-param name="attributeindex" select="position()"/>
874
                </xsl:call-template>
875
              </xsl:for-each>
876
            </td>
877
         </xsl:for-each>
878
        </xsl:when>
879
        <xsl:otherwise>
880
           <td colspan="1" align="center" class="{$stripes}">
881
              <xsl:for-each select="measurementScale">
882
                <xsl:call-template name="measurementscale">
883
                      <xsl:with-param name="docid" select="$docid"/>
884
                      <xsl:with-param name="entitytype" select="$entitytype"/>
885
                      <xsl:with-param name="entityindex" select="$entityindex"/>
886
                      <xsl:with-param name="attributeindex" select="position()"/>
887
                </xsl:call-template>
888
              </xsl:for-each>
889
           </td>
890
        </xsl:otherwise>
891
     </xsl:choose>
892
    </xsl:if>
893
   </xsl:for-each>
894
  </tr>
895

    
896

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

    
966

    
967
  <!-- The eighth row for accuracy report-->
968
  <tr><th class="rowodd">Accuracy Report</th>
969
     <xsl:for-each select="attribute">
970
     <xsl:if test="position() = $attributeindex">
971
     <xsl:variable name="stripes">
972
         <xsl:choose>
973
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
974
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
975
         </xsl:choose>
976
    </xsl:variable>
977
    <xsl:choose>
978
         <xsl:when test="references!=''">
979
          <xsl:variable name="ref_id" select="references"/>
980
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
981
          <xsl:for-each select="$references">
982
            <xsl:choose>
983
               <xsl:when test="accuracy!=''">
984
                 <td colspan="1" align="center" class="{$stripes}">
985
                    <xsl:for-each select="accuracy">
986
                          <xsl:value-of select="attributeAccuracyReport"/>
987
                    </xsl:for-each>
988
                 </td>
989
              </xsl:when>
990
              <xsl:otherwise>
991
                <td colspan="1" align="center" class="{$stripes}">
992
                  &#160;
993
                </td>
994
              </xsl:otherwise>
995
            </xsl:choose>
996
          </xsl:for-each>
997
        </xsl:when>
998
        <xsl:otherwise>
999
           <xsl:choose>
1000
               <xsl:when test="accuracy!=''">
1001
                 <td colspan="1" align="center" class="{$stripes}">
1002
                    <xsl:for-each select="accuracy">
1003
                          <xsl:value-of select="attributeAccuracyReport"/>
1004
                    </xsl:for-each>
1005
                 </td>
1006
              </xsl:when>
1007
              <xsl:otherwise>
1008
                <td colspan="1" align="center" class="{$stripes}">
1009
                  &#160;
1010
                </td>
1011
              </xsl:otherwise>
1012
            </xsl:choose>
1013
        </xsl:otherwise>
1014
     </xsl:choose>
1015
   </xsl:if>
1016
  </xsl:for-each>
1017
  </tr>
1018

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

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

    
1158

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

    
1223

    
1224
<xsl:template name="measurementscale">
1225
   <xsl:param name="stripes"/>
1226
   <xsl:param name="docid"/>
1227
   <xsl:param name="entitytype"/>
1228
   <xsl:param name="entityindex"/>
1229
   <xsl:param name="attributeindex"/>
1230
   <table class="table table-striped">
1231
    <xsl:for-each select="nominal">
1232
         <xsl:call-template name="attributenonnumericdomain">
1233
               <xsl:with-param name="docid" select="$docid"/>
1234
               <xsl:with-param name="entitytype" select="$entitytype"/>
1235
               <xsl:with-param name="entityindex" select="$entityindex"/>
1236
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1237
               <xsl:with-param name="stripes" select="$stripes"/>
1238
       </xsl:call-template>
1239
    </xsl:for-each>
1240
    <xsl:for-each select="ordinal">
1241
       <xsl:call-template name="attributenonnumericdomain">
1242
               <xsl:with-param name="docid" select="$docid"/>
1243
               <xsl:with-param name="entitytype" select="$entitytype"/>
1244
               <xsl:with-param name="entityindex" select="$entityindex"/>
1245
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1246
               <xsl:with-param name="stripes" select="$stripes"/>
1247
       </xsl:call-template>
1248
    </xsl:for-each>
1249
    <xsl:for-each select="interval">
1250
       <xsl:call-template name="intervalratio">
1251
         <xsl:with-param name="stripes" select="$stripes"/>
1252
       </xsl:call-template>
1253
    </xsl:for-each>
1254
    <xsl:for-each select="ratio">
1255
       <xsl:call-template name="intervalratio">
1256
         <xsl:with-param name="stripes" select="$stripes"/>
1257
       </xsl:call-template>
1258
    </xsl:for-each>
1259
    <xsl:for-each select="datetime">
1260
       <xsl:call-template name="datetime">
1261
          <xsl:with-param name="stripes" select="$stripes"/>
1262
       </xsl:call-template>
1263
    </xsl:for-each>
1264
   </table>
1265
 </xsl:template>
1266

    
1267
 <xsl:template name="attributenonnumericdomain">
1268
   <xsl:param name="stripes"/>
1269
   <xsl:param name="docid"/>
1270
   <xsl:param name="entitytype"/>
1271
   <xsl:param name="entityindex"/>
1272
   <xsl:param name="attributeindex"/>
1273
   <xsl:for-each select="nonNumericDomain">
1274
     <xsl:choose>
1275
         <xsl:when test="references!=''">
1276
          <xsl:variable name="ref_id" select="references"/>
1277
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1278
          <xsl:for-each select="$references">
1279
            <xsl:call-template name="attributenonnumericdomaincommon">
1280
                <xsl:with-param name="docid" select="$docid"/>
1281
                <xsl:with-param name="entitytype" select="$entitytype"/>
1282
                <xsl:with-param name="entityindex" select="$entityindex"/>
1283
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
1284
                <xsl:with-param name="stripes" select="$stripes"/>
1285
            </xsl:call-template>
1286
         </xsl:for-each>
1287
        </xsl:when>
1288
        <xsl:otherwise>
1289
            <xsl:call-template name="attributenonnumericdomaincommon">
1290
               <xsl:with-param name="docid" select="$docid"/>
1291
               <xsl:with-param name="entitytype" select="$entitytype"/>
1292
               <xsl:with-param name="entityindex" select="$entityindex"/>
1293
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1294
               <xsl:with-param name="stripes" select="$stripes"/>
1295
            </xsl:call-template>
1296
        </xsl:otherwise>
1297
     </xsl:choose>
1298
   </xsl:for-each>
1299
 </xsl:template>
1300

    
1301
 <xsl:template name="attributenonnumericdomaincommon">
1302
    <xsl:param name="stripes"/>
1303
    <xsl:param name="docid"/>
1304
    <xsl:param name="entitytype"/>
1305
    <xsl:param name="entityindex"/>
1306
    <xsl:param name="attributeindex"/>
1307
    <!-- if numericdomain only has one text domain,
1308
        it will be displayed inline otherwise will show a link-->
1309
    <xsl:choose>
1310
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">      
1311
        <tr><td class="{$stripes}">Definition</td>
1312
            <td class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
1313
            </td>
1314
        </tr>
1315
        <xsl:for-each select="textDomain/pattern">
1316
          <tr><td class="{$stripes}">Pattern</td>
1317
            <td class="{$stripes}"><xsl:value-of select="."/>
1318
            </td>
1319
          </tr>
1320
        </xsl:for-each>
1321
        <xsl:for-each select="textDomain/source">
1322
          <tr><td class="{$stripes}">Source</td>
1323
            <td class="{$stripes}"><xsl:value-of select="."/>
1324
            </td>
1325
          </tr>
1326
        </xsl:for-each>
1327
      </xsl:when>
1328
      <xsl:otherwise>
1329
      	<xsl:choose>
1330
      		<xsl:when test="$displaymodule='printall'">
1331
      			<!-- Show it all -->
1332
				<xsl:for-each select="enumeratedDomain">
1333
					<xsl:call-template name="enumeratedDomain">
1334
						<xsl:with-param name="nondomainfirstColStyle" select="$firstColStyle"/>
1335
					</xsl:call-template>
1336
				</xsl:for-each>
1337
      		</xsl:when>
1338
      		<xsl:otherwise>
1339
      			<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>
1340
				Domain Info</a>
1341
      		</xsl:otherwise>
1342
      	</xsl:choose>
1343
      </xsl:otherwise>
1344
    </xsl:choose>
1345
 </xsl:template>
1346

    
1347
 <xsl:template name="intervalratio">
1348
    <xsl:param name="stripes"/>
1349
    <xsl:if test="unit/standardUnit">
1350
      <tr><td class="{$stripes}"><b>Unit</b></td>
1351
            <td class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
1352
            </td>
1353
      </tr>
1354
    </xsl:if>
1355
    <xsl:if test="unit/customUnit">
1356
      <tr><td class="{$stripes}"><b>Unit</b></td>
1357
            <td class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
1358
            </td>
1359
      </tr>
1360
   </xsl:if>
1361
   <xsl:for-each select="precision">
1362
      <tr><td class="{$stripes}"><b>Precision</b></td>
1363
            <td class="{$stripes}"><xsl:value-of select="."/>
1364
            </td>
1365
      </tr>
1366
   </xsl:for-each>
1367
   <xsl:for-each select="numericDomain">
1368
      <xsl:call-template name="numericDomain">
1369
         <xsl:with-param name="stripes" select="$stripes"/>
1370
      </xsl:call-template>
1371
    </xsl:for-each>
1372
  </xsl:template>
1373

    
1374

    
1375
 <xsl:template name="numericDomain">
1376
     <xsl:param name="stripes"/>
1377
       <xsl:choose>
1378
         <xsl:when test="references!=''">
1379
          <xsl:variable name="ref_id" select="references"/>
1380
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1381
          <xsl:for-each select="$references">
1382
            <tr><td class="{$stripes}"><b>Type</b></td>
1383
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1384
                </td>
1385
            </tr>
1386
            <xsl:for-each select="bounds">
1387
              <tr><td class="{$stripes}"><b>Min</b></td>
1388
                  <td class="{$stripes}">
1389
                    <xsl:for-each select="minimum">
1390
                      <xsl:value-of select="."/>&#160;
1391
                    </xsl:for-each>
1392
                  </td>
1393
              </tr>
1394
              <tr><td class="{$stripes}"><b>Max</b></td>
1395
                  <td class="{$stripes}">
1396
                    <xsl:for-each select="maximum">
1397
                      <xsl:value-of select="."/>&#160;
1398
                    </xsl:for-each>
1399
                  </td>
1400
              </tr>
1401
            </xsl:for-each>
1402
          </xsl:for-each>
1403
        </xsl:when>
1404
        <xsl:otherwise>
1405
          <tr><td class="{$stripes}"><b>Type</b></td>
1406
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1407
                </td>
1408
            </tr>
1409
            <xsl:for-each select="bounds">
1410
              <tr><td class="{$stripes}"><b>Min</b></td>
1411
                  <td class="{$stripes}">
1412
                    <xsl:for-each select="minimum">
1413
                      <xsl:value-of select="."/>&#160;
1414
                    </xsl:for-each>
1415
                  </td>
1416
              </tr>
1417
              <tr><td class="{$stripes}"><b>Max</b></td>
1418
                  <td class="{$stripes}">
1419
                    <xsl:for-each select="maximum">
1420
                      <xsl:value-of select="."/>&#160;
1421
                    </xsl:for-each>
1422
                  </td>
1423
              </tr>
1424
            </xsl:for-each>
1425
        </xsl:otherwise>
1426
      </xsl:choose>
1427
  </xsl:template>
1428

    
1429
 <xsl:template name="datetime">
1430
    <xsl:param name="stripes"/>
1431
    <tr><td class="{$stripes}"><b>Format</b></td>
1432
         <td class="{$stripes}">
1433
            <xsl:value-of select="formatString"/>
1434
         </td>
1435
    </tr>
1436
     <tr><td class="{$stripes}"><b>Precision</b></td>
1437
         <td class="{$stripes}">
1438
            <xsl:value-of select="dateTimePrecision"/>
1439
         </td>
1440
    </tr>
1441
    <xsl:call-template name="timedomain"/>
1442
 </xsl:template>
1443

    
1444

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

    
1491
 <xsl:template name="attributecoverage">
1492
    <xsl:param name="docid"/>
1493
    <xsl:param name="entitytype"/>
1494
    <xsl:param name="entityindex"/>
1495
    <xsl:param name="attributeindex"/>
1496
    <xsl:choose>
1497
    	<xsl:when test="$displaymodule='printall'">
1498
			<xsl:call-template name="coverage"></xsl:call-template>
1499
    	</xsl:when>
1500
    	<xsl:otherwise>
1501
			<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>
1502
			<b>Coverage Info</b></a>
1503
    	</xsl:otherwise>
1504
    </xsl:choose>
1505
 
1506
 </xsl:template>
1507

    
1508
 <xsl:template name="attributemethod">
1509
    <xsl:param name="docid"/>
1510
    <xsl:param name="entitytype"/>
1511
    <xsl:param name="entityindex"/>
1512
    <xsl:param name="attributeindex"/>
1513
    <xsl:choose>
1514
    	<xsl:when test="$displaymodule='printall'">
1515
			<xsl:call-template name="method">
1516
				<xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
1517
				<xsl:with-param name="methodsubHeaderStyle" select="$firstColStyle"/>
1518
			</xsl:call-template>
1519
    	</xsl:when>
1520
    	<xsl:otherwise>
1521
			<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>
1522
			<b>Method Info</b></a>
1523
    	</xsl:otherwise>
1524
    </xsl:choose>
1525

    
1526
 </xsl:template>
1527

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