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: walker $'
9
  *     '$Date: 2016-09-02 11:14:53 -0700 (Fri, 02 Sep 2016) $'
10
  * '$Revision: 9905 $'
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

    
135
 	<!--  Name -->
136
  	<div class="control-group">
137
		<label class="control-label">Name</label>
138
		<div class="controls controls-well">
139
			<xsl:choose>
140
				<xsl:when test="references!=''">
141
		          <xsl:variable name="ref_id" select="references"/>
142
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
143
		          <xsl:for-each select="$references">
144
		            <xsl:value-of select="attributeName"/>
145
		          </xsl:for-each>
146
		        </xsl:when>
147
		        <xsl:otherwise>
148
		          <xsl:value-of select="attributeName"/>
149
		        </xsl:otherwise>
150
		     </xsl:choose>
151
		</div>
152
	</div>	
153
	
154
	<!--  Header for the section and annotation target -->
155
	<div class="annotation-target">
156
		<xsl:attribute name="id">sem_entity_<xsl:value-of select="$entityindex"/>_attribute_<xsl:value-of select="$attributeindex"/></xsl:attribute>
157
		<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$attributeindex"/>])</xsl:attribute>
158
		
159
		<span class="annotation-attribute-name">
160
			<xsl:choose>
161
				<xsl:when test="references!=''">
162
		          <xsl:variable name="ref_id" select="references"/>
163
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
164
		          <xsl:for-each select="$references">
165
		            <xsl:value-of select="attributeName"/>
166
		          </xsl:for-each>
167
		        </xsl:when>
168
		        <xsl:otherwise>
169
		          <xsl:value-of select="attributeName"/>
170
		        </xsl:otherwise>
171
		     </xsl:choose>
172
		</span>
173
	</div>	
174
  
175

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

    
279

    
280
  <!-- The fourth row for attribute storage type-->
281
   <div class="control-group">
282
		<label class="control-label">Storage Type</label>
283
		<div class="controls controls-well">
284
	      <xsl:choose>
285
	         <xsl:when test="references!=''">
286
	          <xsl:variable name="ref_id" select="references"/>
287
	          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
288
	          <xsl:for-each select="$references">
289
	            <xsl:choose>
290
	              <xsl:when test="storageType!=''">
291
	                    <xsl:for-each select="storageType">
292
	                      <xsl:value-of select="."/>
293
	                       &#160;<br/>
294
	                    </xsl:for-each>
295
	              </xsl:when>
296
	              <xsl:otherwise>
297
	                       &#160;
298
	              </xsl:otherwise>
299
	            </xsl:choose>
300
	          </xsl:for-each>
301
	        </xsl:when>
302
	        <xsl:otherwise>
303
	           <xsl:choose>
304
	              <xsl:when test="storageType!=''">
305
	                    <xsl:for-each select="storageType">
306
	                      <xsl:value-of select="."/>
307
	                       &#160;<br/>
308
	                    </xsl:for-each>
309
	              </xsl:when>
310
	              <xsl:otherwise>
311
	                       &#160;
312
	              </xsl:otherwise>
313
	            </xsl:choose>
314
	        </xsl:otherwise>
315
	     </xsl:choose>
316
     </div>
317
    </div>
318

    
319
  <!-- The fifth row for meaturement type-->
320
  <div class="control-group">
321
		<label class="control-label">Measurement Type</label>
322
		<div class="controls controls-well">
323
		    <xsl:choose>
324
		         <xsl:when test="references!=''">
325
		          <xsl:variable name="ref_id" select="references"/>
326
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
327
		          <xsl:for-each select="$references">
328
		              <xsl:for-each select="measurementScale">
329
		                 <xsl:value-of select="local-name(./*)"/>
330
		              </xsl:for-each>
331
		         </xsl:for-each>
332
		        </xsl:when>
333
		        <xsl:otherwise>
334
		              <xsl:for-each select="measurementScale">
335
		                 <xsl:value-of select="local-name(./*)"/>
336
		              </xsl:for-each>
337
		        </xsl:otherwise>
338
		     </xsl:choose>
339
	     </div>
340
     </div>
341

    
342
  <!-- The sixth row for meaturement domain-->
343
  <div class="control-group">
344
		<label class="control-label">Measurement Domain</label>
345
		<div class="controls controls-well">
346
		    <xsl:choose>
347
		         <xsl:when test="references!=''">
348
		          <xsl:variable name="ref_id" select="references"/>
349
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
350
		          <xsl:for-each select="$references">
351
		              <xsl:for-each select="measurementScale">
352
		                <xsl:call-template name="measurementscale">
353
		                    <xsl:with-param name="docid" select="$docid"/>
354
		                    <xsl:with-param name="entitytype" select="$entitytype"/>
355
		                    <xsl:with-param name="entityindex" select="$entityindex"/>
356
		                    <xsl:with-param name="attributeindex" select="$attributeindex"/>
357
		                </xsl:call-template>
358
		              </xsl:for-each>
359
		         </xsl:for-each>
360
		        </xsl:when>
361
		        <xsl:otherwise>
362
		              <xsl:for-each select="measurementScale">
363
		                <xsl:call-template name="measurementscale">
364
		                      <xsl:with-param name="docid" select="$docid"/>
365
		                      <xsl:with-param name="entitytype" select="$entitytype"/>
366
		                      <xsl:with-param name="entityindex" select="$entityindex"/>
367
		                      <xsl:with-param name="attributeindex" select="$attributeindex"/>
368
		                </xsl:call-template>
369
		              </xsl:for-each>
370
		        </xsl:otherwise>
371
		     </xsl:choose>
372
	     </div>
373
     </div>
374

    
375
  <!-- The seventh row for missing value code-->
376
  <div class="control-group">
377
		<label class="control-label">Missing Value Code</label>
378
		<div class="controls controls-well">
379
		     <xsl:choose>
380
		         <xsl:when test="references!=''">
381
		          <xsl:variable name="ref_id" select="references"/>
382
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
383
		          <xsl:for-each select="$references">
384
		            <xsl:choose>
385
		              <xsl:when test="missingValueCode!=''">
386
		                    <table class="table table-striped">
387
		                    	<thead>
388
		                    		<tr>
389
		                    			<th>Code</th>
390
		                              	<th>Explanation</th>
391
		                            </tr>
392
		                        </thead>
393
		                       <xsl:for-each select="missingValueCode">
394
		                          <tr>
395
		                              <td><xsl:value-of select="code"/></td>
396
		                              <td><xsl:value-of select="codeExplanation"/></td>
397
		                          </tr>
398
		                       </xsl:for-each>
399
		                   </table>
400
		              </xsl:when>
401
		              <xsl:otherwise>
402
		                   &#160;
403
		              </xsl:otherwise>
404
		            </xsl:choose>
405
		          </xsl:for-each>
406
		        </xsl:when>
407
		        <xsl:otherwise>
408
		           <xsl:choose>
409
		              <xsl:when test="missingValueCode!=''">
410
		                    <table class="table table-striped">
411
		                    	<thead>
412
		                    		<tr>
413
		                    			<th>Code</th>
414
		                              	<th>Explanation</th>
415
		                            </tr>
416
		                        </thead>
417
		                       <xsl:for-each select="missingValueCode">
418
		                          <tr>
419
		                              <td><xsl:value-of select="code"/></td>
420
		                              <td><xsl:value-of select="codeExplanation"/></td>
421
		                          </tr>
422
		                       </xsl:for-each>
423
		                   </table>
424
		              </xsl:when>
425
		              <xsl:otherwise>
426
		                   &#160;
427
		              </xsl:otherwise>
428
		            </xsl:choose>
429
		        </xsl:otherwise>
430
		     </xsl:choose>
431
	     </div>
432
     </div>
433

    
434

    
435
  <!-- The eighth row for accuracy report-->
436
  <div class="control-group">
437
		<label class="control-label">Accuracy Report</label>
438
		<div class="controls controls-well">
439
		    <xsl:choose>
440
		         <xsl:when test="references!=''">
441
		          <xsl:variable name="ref_id" select="references"/>
442
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
443
		          <xsl:for-each select="$references">
444
		            <xsl:choose>
445
		               <xsl:when test="accuracy!=''">
446
		                    <xsl:for-each select="accuracy">
447
		                          <xsl:value-of select="attributeAccuracyReport"/>
448
		                    </xsl:for-each>
449
		              </xsl:when>
450
		              <xsl:otherwise>
451
		                  &#160;
452
		              </xsl:otherwise>
453
		            </xsl:choose>
454
		          </xsl:for-each>
455
		        </xsl:when>
456
		        <xsl:otherwise>
457
		           <xsl:choose>
458
		               <xsl:when test="accuracy!=''">
459
		                    <xsl:for-each select="accuracy">
460
		                          <xsl:value-of select="attributeAccuracyReport"/>
461
		                    </xsl:for-each>
462
		              </xsl:when>
463
		              <xsl:otherwise>
464
		                  &#160;
465
		              </xsl:otherwise>
466
		            </xsl:choose>
467
		        </xsl:otherwise>
468
		     </xsl:choose>
469
	     </div>
470
     </div>
471

    
472
  <!-- The nineth row for quality accuracy accessment -->
473
  <div class="control-group">
474
		<label class="control-label">Accuracy Assessment</label>
475
		<div class="controls controls-well">
476
		     <xsl:choose>
477
		         <xsl:when test="references!=''">
478
		          <xsl:variable name="ref_id" select="references"/>
479
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
480
		          <xsl:for-each select="$references">
481
		            <xsl:choose>
482
		               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
483
		                   <xsl:for-each select="accuracy">
484
		                     <table class="table table-striped">
485
		                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
486
		                          <tr><td>Value</td>
487
		                              <td><xsl:value-of select="attributeAccuracyValue"/></td>
488
		                          </tr>
489
		                          <tr><td>Expl</td>
490
		                              <td><xsl:value-of select="attributeAccuracyExplanation"/></td>
491
		                          </tr>
492
		                      </xsl:for-each>
493
		                   </table>
494
		                 </xsl:for-each>
495
		             </xsl:when>
496
		             <xsl:otherwise>
497
		                  &#160;
498
		             </xsl:otherwise>
499
		           </xsl:choose>
500
		          </xsl:for-each>
501
		        </xsl:when>
502
		        <xsl:otherwise>
503
		           <xsl:choose>
504
		               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
505
		                   <xsl:for-each select="accuracy">
506
		                     <table class="table table-striped">
507
		                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
508
		                          <tr><td>Value</td>
509
		                              <td><xsl:value-of select="attributeAccuracyValue"/></td>
510
		                          </tr>
511
		                          <tr><td>Expl</td>
512
		                              <td><xsl:value-of select="attributeAccuracyExplanation"/></td>
513
		                          </tr>
514
		                      </xsl:for-each>
515
		                   </table>
516
		                 </xsl:for-each>
517
		             </xsl:when>
518
		             <xsl:otherwise>
519
		                  &#160;
520
		             </xsl:otherwise>
521
		           </xsl:choose>
522
		        </xsl:otherwise>
523
		     </xsl:choose>
524
	     </div>
525
     </div>
526

    
527
   <!-- The tenth row for coverage-->
528
  <div class="control-group">
529
		<label class="control-label">Coverage</label>
530
		<div class="controls controls-well">
531
		    <xsl:choose>
532
		         <xsl:when test="references!=''">
533
		          <xsl:variable name="ref_id" select="references"/>
534
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
535
		          <xsl:for-each select="$references">
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:for-each>
552
		        </xsl:when>
553
		        <xsl:otherwise>
554
		          <xsl:choose>
555
		               <xsl:when test="coverage!=''">
556
		                    <xsl:for-each select="coverage">
557
		                      <xsl:call-template name="attributecoverage">
558
		                         <xsl:with-param name="docid" select="$docid"/>
559
		                         <xsl:with-param name="entitytype" select="$entitytype"/>
560
		                         <xsl:with-param name="entityindex" select="$entityindex"/>
561
		                         <xsl:with-param name="attributeindex" select="$attributeindex"/>
562
		                      </xsl:call-template>
563
		                    </xsl:for-each>
564
		               </xsl:when>
565
		               <xsl:otherwise>
566
		                   &#160;
567
		               </xsl:otherwise>
568
		            </xsl:choose>
569
		        </xsl:otherwise>
570
		     </xsl:choose>
571
	     </div>
572
     </div>
573

    
574

    
575
   <!-- The eleventh row for method-->
576
  <div class="control-group">
577
		<label class="control-label">Method</label>
578
		<div class="controls controls-well">
579
		    <xsl:choose>
580
		         <xsl:when test="references!=''">
581
		          <xsl:variable name="ref_id" select="references"/>
582
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
583
		          <xsl:for-each select="$references">
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:for-each>
600
		        </xsl:when>
601
		        <xsl:otherwise>
602
		           <xsl:choose>
603
		               <xsl:when test="method!=''">
604
		                   <xsl:for-each select="method">
605
		                     <xsl:call-template name="attributemethod">
606
		                       <xsl:with-param name="docid" select="$docid"/>
607
		                       <xsl:with-param name="entitytype" select="$entitytype"/>
608
		                       <xsl:with-param name="entityindex" select="$entityindex"/>
609
		                       <xsl:with-param name="attributeindex" select="$attributeindex"/>
610
		                     </xsl:call-template>
611
		                   </xsl:for-each>
612
		               </xsl:when>
613
		               <xsl:otherwise>
614
		                   &#160;
615
		               </xsl:otherwise>
616
		            </xsl:choose>
617
		        </xsl:otherwise>
618
		     </xsl:choose>
619
	     </div>
620
     </div>
621
     
622
     </div> <!-- end the attribute section -->
623
     
624
     </xsl:for-each>
625
  
626
  	</div>
627
  	
628
  </div>
629
  
630
 </xsl:template>
631

    
632

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

    
639
   <table class="{$tableattributeStyle}">
640
        <xsl:choose>
641
         <xsl:when test="references!=''">
642
          <xsl:variable name="ref_id" select="references"/>
643
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
644
          <xsl:for-each select="$references">
645
            <xsl:call-template name="singleattributecommon">
646
               <xsl:with-param name="docid" select="$docid"/>
647
               <xsl:with-param name="entitytype" select="$entitytype"/>
648
               <xsl:with-param name="entityindex" select="$entityindex"/>
649
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
650
            </xsl:call-template>
651
          </xsl:for-each>
652
        </xsl:when>
653
        <xsl:otherwise>
654
          <xsl:call-template name="singleattributecommon">
655
               <xsl:with-param name="docid" select="$docid"/>
656
               <xsl:with-param name="entitytype" select="$entitytype"/>
657
               <xsl:with-param name="entityindex" select="$entityindex"/>
658
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
659
          </xsl:call-template>
660
        </xsl:otherwise>
661
      </xsl:choose>
662
  </table>
663
</xsl:template>
664

    
665

    
666
<xsl:template name="singleattributecommon">
667
   <xsl:param name="docid"/>
668
   <xsl:param name="entitytype"/>
669
   <xsl:param name="entityindex"/>
670
   <xsl:param name="attributeindex"/>
671

    
672
  <!-- First row for attribute name-->
673
  <tr><th class="rowodd">Column Name</th>
674
  <xsl:for-each select="attribute">
675
   <xsl:if test="position() = $attributeindex">
676
      <xsl:choose>
677
         <xsl:when test="references!=''">
678
          <xsl:variable name="ref_id" select="references"/>
679
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
680
          <xsl:for-each select="$references">
681
            <th><xsl:value-of select="attributeName"/></th>
682
          </xsl:for-each>
683
        </xsl:when>
684
        <xsl:otherwise>
685
          <th><xsl:value-of select="attributeName"/></th>
686
        </xsl:otherwise>
687
     </xsl:choose>
688
   </xsl:if>
689
  </xsl:for-each>
690
  </tr>
691

    
692
  <!-- Second row for attribute label-->
693
  <tr><th class="rowodd">Column Label</th>
694
   <xsl:for-each select="attribute">
695
    <xsl:if test="position() = $attributeindex">
696
    <xsl:variable name="stripes">
697
              <xsl:choose>
698
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
699
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
700
              </xsl:choose>
701
    </xsl:variable>
702
    <xsl:choose>
703
         <xsl:when test="references!=''">
704
          <xsl:variable name="ref_id" select="references"/>
705
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
706
          <xsl:for-each select="$references">
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:for-each>
723
        </xsl:when>
724
        <xsl:otherwise>
725
             <xsl:choose>
726
                <xsl:when test="attributeLabel!=''">
727
                  <td colspan="1" align="center" class="{$stripes}">
728
                     <xsl:for-each select="attributeLabel">
729
                       <xsl:value-of select="."/>
730
                         &#160;<br/>
731
                       </xsl:for-each>
732
                  </td>
733
                </xsl:when>
734
                <xsl:otherwise>
735
                   <td colspan="1" align="center" class="{$stripes}">
736
                       &#160;<br />
737
                   </td>
738
                </xsl:otherwise>
739
              </xsl:choose>
740
        </xsl:otherwise>
741
     </xsl:choose>
742
    </xsl:if>
743
   </xsl:for-each>
744
  </tr>
745

    
746
  <!-- Third row for attribute defination-->
747
  <tr><th class="rowodd">Definition</th>
748
    <xsl:for-each select="attribute">
749
     <xsl:if test="position() = $attributeindex">
750
      <xsl:variable name="stripes">
751
              <xsl:choose>
752
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
753
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
754
              </xsl:choose>
755
      </xsl:variable>
756
      <xsl:choose>
757
         <xsl:when test="references!=''">
758
          <xsl:variable name="ref_id" select="references"/>
759
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
760
           <xsl:for-each select="$references">
761
             <td colspan="1" align="center" class="{$stripes}">
762
               <xsl:value-of select="attributeDefinition"/>
763
             </td>
764
           </xsl:for-each>
765
        </xsl:when>
766
        <xsl:otherwise>
767
          <td colspan="1" align="center" class="{$stripes}">
768
             <xsl:value-of select="attributeDefinition"/>
769
          </td>
770
        </xsl:otherwise>
771
     </xsl:choose>
772
    </xsl:if>
773
   </xsl:for-each>
774
  </tr>
775

    
776
  <!-- The fourth row for attribute storage type-->
777
   <tr><th class="rowodd">Type of Value</th>
778
     <xsl:for-each select="attribute">
779
      <xsl:if test="position() = $attributeindex">
780
      <xsl:variable name="stripes">
781
              <xsl:choose>
782
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
783
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
784
              </xsl:choose>
785
      </xsl:variable>
786
      <xsl:choose>
787
         <xsl:when test="references!=''">
788
          <xsl:variable name="ref_id" select="references"/>
789
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
790
          <xsl:for-each select="$references">
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:for-each>
807
        </xsl:when>
808
        <xsl:otherwise>
809
           <xsl:choose>
810
              <xsl:when test="storageType!=''">
811
                 <td colspan="1" align="center" class="{$stripes}">
812
                    <xsl:for-each select="storageType">
813
                      <xsl:value-of select="."/>
814
                       &#160;<br/>
815
                    </xsl:for-each>
816
                 </td>
817
              </xsl:when>
818
              <xsl:otherwise>
819
                  <td colspan="1" align="center" class="{$stripes}">
820
                       &#160;
821
                   </td>
822
              </xsl:otherwise>
823
            </xsl:choose>
824
        </xsl:otherwise>
825
     </xsl:choose>
826
    </xsl:if>
827
   </xsl:for-each>
828
  </tr>
829

    
830
  <!-- The fifth row for meaturement type-->
831
  <tr><th class="rowodd">Measurement Type</th>
832
   <xsl:for-each select="attribute">
833
    <xsl:if test="position() = $attributeindex">
834
    <xsl:variable name="stripes">
835
              <xsl:choose>
836
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
837
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
838
              </xsl:choose>
839
    </xsl:variable>
840
    <xsl:choose>
841
         <xsl:when test="references!=''">
842
          <xsl:variable name="ref_id" select="references"/>
843
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
844
          <xsl:for-each select="$references">
845
            <td colspan="1" align="center" class="{$stripes}">
846
              <xsl:for-each select="measurementScale">
847
                 <xsl:value-of select="local-name(./*)"/>
848
              </xsl:for-each>
849
            </td>
850
         </xsl:for-each>
851
        </xsl:when>
852
        <xsl:otherwise>
853
           <td colspan="1" align="center" class="{$stripes}">
854
              <xsl:for-each select="measurementScale">
855
                 <xsl:value-of select="local-name(./*)"/>
856
              </xsl:for-each>
857
           </td>
858
        </xsl:otherwise>
859
     </xsl:choose>
860
    </xsl:if>
861
   </xsl:for-each>
862
  </tr>
863

    
864
  <!-- The sixth row for meaturement domain-->
865
  <tr><th class="rowodd">Measurement Domain</th>
866
   <xsl:for-each select="attribute">
867
    <xsl:if test="position() = $attributeindex">
868
    <xsl:variable name="stripes">
869
              <xsl:choose>
870
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
871
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
872
              </xsl:choose>
873
    </xsl:variable>
874
     <xsl:variable name="innerstripes">
875
              <xsl:choose>
876
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
877
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
878
              </xsl:choose>
879
    </xsl:variable>
880
    <xsl:choose>
881
         <xsl:when test="references!=''">
882
          <xsl:variable name="ref_id" select="references"/>
883
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
884
          <xsl:for-each select="$references">
885
            <td colspan="1" align="center" class="{$stripes}">
886
              <xsl:for-each select="measurementScale">
887
                <xsl:call-template name="measurementscale">
888
                    <xsl:with-param name="docid" select="$docid"/>
889
                    <xsl:with-param name="entitytype" select="$entitytype"/>
890
                    <xsl:with-param name="entityindex" select="$entityindex"/>
891
                    <xsl:with-param name="attributeindex" select="position()"/>
892
                </xsl:call-template>
893
              </xsl:for-each>
894
            </td>
895
         </xsl:for-each>
896
        </xsl:when>
897
        <xsl:otherwise>
898
           <td colspan="1" align="center" class="{$stripes}">
899
              <xsl:for-each select="measurementScale">
900
                <xsl:call-template name="measurementscale">
901
                      <xsl:with-param name="docid" select="$docid"/>
902
                      <xsl:with-param name="entitytype" select="$entitytype"/>
903
                      <xsl:with-param name="entityindex" select="$entityindex"/>
904
                      <xsl:with-param name="attributeindex" select="position()"/>
905
                </xsl:call-template>
906
              </xsl:for-each>
907
           </td>
908
        </xsl:otherwise>
909
     </xsl:choose>
910
    </xsl:if>
911
   </xsl:for-each>
912
  </tr>
913

    
914

    
915
  <!-- The seventh row for missing value code-->
916
  <tr><th class="rowodd">Missing Value Code</th>
917
    <xsl:for-each select="attribute">
918
     <xsl:if test="position() = $attributeindex">
919
      <xsl:variable name="stripes">
920
              <xsl:choose>
921
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
922
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
923
              </xsl:choose>
924
     </xsl:variable>
925
     <xsl:variable name="innerstripes">
926
              <xsl:choose>
927
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
928
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
929
              </xsl:choose>
930
     </xsl:variable>
931
     <xsl:choose>
932
         <xsl:when test="references!=''">
933
          <xsl:variable name="ref_id" select="references"/>
934
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
935
          <xsl:for-each select="$references">
936
            <xsl:choose>
937
              <xsl:when test="missingValueCode!=''">
938
                 <td colspan="1" align="center" class="{$stripes}">
939
                    <table>
940
                       <xsl:for-each select="missingValueCode">
941
                          <tr><td class="{$innerstripes}"><b>Code</b></td>
942
                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
943
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
944
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
945
                          </tr>
946
                       </xsl:for-each>
947
                   </table>
948
                 </td>
949
              </xsl:when>
950
              <xsl:otherwise>
951
                <td colspan="1" class="{$stripes}">
952
                   &#160;
953
                </td>
954
              </xsl:otherwise>
955
            </xsl:choose>
956
          </xsl:for-each>
957
        </xsl:when>
958
        <xsl:otherwise>
959
           <xsl:choose>
960
              <xsl:when test="missingValueCode!=''">
961
                 <td colspan="1" align="center" class="{$stripes}">
962
                    <table>
963
                       <xsl:for-each select="missingValueCode">
964
                          <tr><td class="{$innerstripes}"><b>Code</b></td>                              <td class="{$innerstripes}"><xsl:value-of select="code"/></td></tr>
965
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
966
                               <td class="{$innerstripes}"><xsl:value-of select="codeExplanation"/></td>
967
                          </tr>
968
                       </xsl:for-each>
969
                   </table>
970
                 </td>
971
              </xsl:when>
972
              <xsl:otherwise>
973
                <td colspan="1" align="center" class="{$stripes}">
974
                   &#160;
975
                </td>
976
              </xsl:otherwise>
977
            </xsl:choose>
978
        </xsl:otherwise>
979
     </xsl:choose>
980
     </xsl:if>
981
   </xsl:for-each>
982
  </tr>
983

    
984

    
985
  <!-- The eighth row for accuracy report-->
986
  <tr><th class="rowodd">Accuracy Report</th>
987
     <xsl:for-each select="attribute">
988
     <xsl:if test="position() = $attributeindex">
989
     <xsl:variable name="stripes">
990
         <xsl:choose>
991
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
992
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
993
         </xsl:choose>
994
    </xsl:variable>
995
    <xsl:choose>
996
         <xsl:when test="references!=''">
997
          <xsl:variable name="ref_id" select="references"/>
998
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
999
          <xsl:for-each select="$references">
1000
            <xsl:choose>
1001
               <xsl:when test="accuracy!=''">
1002
                 <td colspan="1" align="center" class="{$stripes}">
1003
                    <xsl:for-each select="accuracy">
1004
                          <xsl:value-of select="attributeAccuracyReport"/>
1005
                    </xsl:for-each>
1006
                 </td>
1007
              </xsl:when>
1008
              <xsl:otherwise>
1009
                <td colspan="1" align="center" class="{$stripes}">
1010
                  &#160;
1011
                </td>
1012
              </xsl:otherwise>
1013
            </xsl:choose>
1014
          </xsl:for-each>
1015
        </xsl:when>
1016
        <xsl:otherwise>
1017
           <xsl:choose>
1018
               <xsl:when test="accuracy!=''">
1019
                 <td colspan="1" align="center" class="{$stripes}">
1020
                    <xsl:for-each select="accuracy">
1021
                          <xsl:value-of select="attributeAccuracyReport"/>
1022
                    </xsl:for-each>
1023
                 </td>
1024
              </xsl:when>
1025
              <xsl:otherwise>
1026
                <td colspan="1" align="center" class="{$stripes}">
1027
                  &#160;
1028
                </td>
1029
              </xsl:otherwise>
1030
            </xsl:choose>
1031
        </xsl:otherwise>
1032
     </xsl:choose>
1033
   </xsl:if>
1034
  </xsl:for-each>
1035
  </tr>
1036

    
1037
  <!-- The nineth row for quality accuracy accessment -->
1038
  <tr><th class="rowodd">Accuracy Assessment</th>
1039
     <xsl:for-each select="attribute">
1040
     <xsl:if test="position() = $attributeindex">
1041
     <xsl:variable name="stripes">
1042
         <xsl:choose>
1043
             <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1044
             <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1045
         </xsl:choose>
1046
    </xsl:variable>
1047
    <xsl:variable name="innerstripes">
1048
              <xsl:choose>
1049
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$innercolevenStyle"/></xsl:when>
1050
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$innercoloddStyle"/></xsl:when>
1051
              </xsl:choose>
1052
     </xsl:variable>
1053
     <xsl:choose>
1054
         <xsl:when test="references!=''">
1055
          <xsl:variable name="ref_id" select="references"/>
1056
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1057
          <xsl:for-each select="$references">
1058
            <xsl:choose>
1059
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1060
                 <td colspan="1" align="center" class="{$stripes}">
1061
                   <xsl:for-each select="accuracy">
1062
                     <table>
1063
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1064
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1065
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1066
                          </tr>
1067
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1068
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1069
                          </tr>
1070
                      </xsl:for-each>
1071
                   </table>
1072
                 </xsl:for-each>
1073
               </td>
1074
             </xsl:when>
1075
             <xsl:otherwise>
1076
                <td colspan="1" align="center" class="{$stripes}">
1077
                  &#160;
1078
                </td>
1079
             </xsl:otherwise>
1080
           </xsl:choose>
1081
          </xsl:for-each>
1082
        </xsl:when>
1083
        <xsl:otherwise>
1084
           <xsl:choose>
1085
               <xsl:when test="accuracy/quantitativeAttributeAccuracyAssessment!=''">
1086
                 <td colspan="1" align="center" class="{$stripes}">
1087
                   <xsl:for-each select="accuracy">
1088
                     <table>
1089
                       <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
1090
                          <tr><td class="{$innerstripes}"><b>Value</b></td>
1091
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
1092
                          </tr>
1093
                          <tr><td class="{$innerstripes}"><b>Expl</b></td>
1094
                              <td class="{$innerstripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
1095
                          </tr>
1096
                      </xsl:for-each>
1097
                   </table>
1098
                 </xsl:for-each>
1099
               </td>
1100
             </xsl:when>
1101
             <xsl:otherwise>
1102
                <td colspan="1" align="center" class="{$stripes}">
1103
                  &#160;
1104
                </td>
1105
             </xsl:otherwise>
1106
           </xsl:choose>
1107
        </xsl:otherwise>
1108
     </xsl:choose>
1109
   </xsl:if>
1110
  </xsl:for-each>
1111
  </tr>
1112

    
1113
   <!-- The tenth row for coverage-->
1114
  <tr><th class="rowodd">Coverage</th>
1115
   <xsl:for-each select="attribute">
1116
    <xsl:if test="position() = $attributeindex">
1117
    <xsl:variable name="index" select="position()"/>
1118
    <xsl:variable name="stripes">
1119
              <xsl:choose>
1120
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1121
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1122
              </xsl:choose>
1123
    </xsl:variable>
1124
    <xsl:choose>
1125
         <xsl:when test="references!=''">
1126
          <xsl:variable name="ref_id" select="references"/>
1127
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1128
          <xsl:for-each select="$references">
1129
            <xsl:choose>
1130
               <xsl:when test="coverage!=''">
1131
                  <td colspan="1" align="center" class="{$stripes}">
1132
                    <xsl:for-each select="coverage">
1133
                      <xsl:call-template name="attributecoverage">
1134
                         <xsl:with-param name="docid" select="$docid"/>
1135
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1136
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1137
                         <xsl:with-param name="attributeindex" select="$index"/>
1138
                      </xsl:call-template>
1139
                    </xsl:for-each>
1140
                  </td>
1141
               </xsl:when>
1142
               <xsl:otherwise>
1143
                  <td colspan="1" align="center" class="{$stripes}">
1144
                   &#160;
1145
                  </td>
1146
               </xsl:otherwise>
1147
            </xsl:choose>
1148
         </xsl:for-each>
1149
        </xsl:when>
1150
        <xsl:otherwise>
1151
          <xsl:choose>
1152
               <xsl:when test="coverage!=''">
1153
                  <td colspan="1" align="center" class="{$stripes}">
1154
                    <xsl:for-each select="coverage">
1155
                      <xsl:call-template name="attributecoverage">
1156
                         <xsl:with-param name="docid" select="$docid"/>
1157
                         <xsl:with-param name="entitytype" select="$entitytype"/>
1158
                         <xsl:with-param name="entityindex" select="$entityindex"/>
1159
                         <xsl:with-param name="attributeindex" select="$index"/>
1160
                      </xsl:call-template>
1161
                    </xsl:for-each>
1162
                  </td>
1163
               </xsl:when>
1164
               <xsl:otherwise>
1165
                  <td colspan="1" align="center" class="{$stripes}">
1166
                   &#160;
1167
                  </td>
1168
               </xsl:otherwise>
1169
            </xsl:choose>
1170
        </xsl:otherwise>
1171
     </xsl:choose>
1172
    </xsl:if>
1173
   </xsl:for-each>
1174
  </tr>
1175

    
1176

    
1177
   <!-- The eleventh row for method-->
1178
  <tr><th class="rowodd">Method</th>
1179
   <xsl:for-each select="attribute">
1180
    <xsl:if test="position() = $attributeindex">
1181
    <xsl:variable name="index" select="position()"/>
1182
    <xsl:variable name="stripes">
1183
              <xsl:choose>
1184
                <xsl:when test="position() mod 2 = 0"><xsl:value-of select="$colevenStyle"/></xsl:when>
1185
                <xsl:when test="position() mod 2 = 1"><xsl:value-of select="$coloddStyle"/></xsl:when>
1186
              </xsl:choose>
1187
    </xsl:variable>
1188
    <xsl:choose>
1189
         <xsl:when test="references!=''">
1190
          <xsl:variable name="ref_id" select="references"/>
1191
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1192
          <xsl:for-each select="$references">
1193
            <xsl:choose>
1194
               <xsl:when test="method!=''">
1195
                 <td colspan="1" align="center" class="{$stripes}">
1196
                   <xsl:for-each select="method">
1197
                     <xsl:call-template name="attributemethod">
1198
                       <xsl:with-param name="docid" select="$docid"/>
1199
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1200
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1201
                       <xsl:with-param name="attributeindex" select="$index"/>
1202
                     </xsl:call-template>
1203
                   </xsl:for-each>
1204
                 </td>
1205
               </xsl:when>
1206
               <xsl:otherwise>
1207
                 <td colspan="1" align="center" class="{$stripes}">
1208
                   &#160;
1209
                 </td>
1210
               </xsl:otherwise>
1211
            </xsl:choose>
1212
         </xsl:for-each>
1213
        </xsl:when>
1214
        <xsl:otherwise>
1215
           <xsl:choose>
1216
               <xsl:when test="method!=''">
1217
                 <td colspan="1" align="center" class="{$stripes}">
1218
                   <xsl:for-each select="method">
1219
                     <xsl:call-template name="attributemethod">
1220
                       <xsl:with-param name="docid" select="$docid"/>
1221
                       <xsl:with-param name="entitytype" select="$entitytype"/>
1222
                       <xsl:with-param name="entityindex" select="$entityindex"/>
1223
                       <xsl:with-param name="attributeindex" select="$index"/>
1224
                     </xsl:call-template>
1225
                   </xsl:for-each>
1226
                 </td>
1227
               </xsl:when>
1228
               <xsl:otherwise>
1229
                 <td colspan="1" align="center" class="{$stripes}">
1230
                   &#160;
1231
                 </td>
1232
               </xsl:otherwise>
1233
            </xsl:choose>
1234
        </xsl:otherwise>
1235
     </xsl:choose>
1236
    </xsl:if>
1237
   </xsl:for-each>
1238
  </tr>
1239
 </xsl:template>
1240

    
1241

    
1242
<xsl:template name="measurementscale">
1243
   <xsl:param name="stripes"/>
1244
   <xsl:param name="docid"/>
1245
   <xsl:param name="entitytype"/>
1246
   <xsl:param name="entityindex"/>
1247
   <xsl:param name="attributeindex"/>
1248
   <table class="table table-striped">
1249
    <xsl:for-each select="nominal">
1250
         <xsl:call-template name="attributenonnumericdomain">
1251
               <xsl:with-param name="docid" select="$docid"/>
1252
               <xsl:with-param name="entitytype" select="$entitytype"/>
1253
               <xsl:with-param name="entityindex" select="$entityindex"/>
1254
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1255
               <xsl:with-param name="stripes" select="$stripes"/>
1256
       </xsl:call-template>
1257
    </xsl:for-each>
1258
    <xsl:for-each select="ordinal">
1259
       <xsl:call-template name="attributenonnumericdomain">
1260
               <xsl:with-param name="docid" select="$docid"/>
1261
               <xsl:with-param name="entitytype" select="$entitytype"/>
1262
               <xsl:with-param name="entityindex" select="$entityindex"/>
1263
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1264
               <xsl:with-param name="stripes" select="$stripes"/>
1265
       </xsl:call-template>
1266
    </xsl:for-each>
1267
    <xsl:for-each select="interval">
1268
       <xsl:call-template name="intervalratio">
1269
         <xsl:with-param name="stripes" select="$stripes"/>
1270
       </xsl:call-template>
1271
    </xsl:for-each>
1272
    <xsl:for-each select="ratio">
1273
       <xsl:call-template name="intervalratio">
1274
         <xsl:with-param name="stripes" select="$stripes"/>
1275
       </xsl:call-template>
1276
    </xsl:for-each>
1277
    <xsl:for-each select="datetime">
1278
       <xsl:call-template name="datetime">
1279
          <xsl:with-param name="stripes" select="$stripes"/>
1280
       </xsl:call-template>
1281
    </xsl:for-each>
1282
   </table>
1283
 </xsl:template>
1284

    
1285
 <xsl:template name="attributenonnumericdomain">
1286
   <xsl:param name="stripes"/>
1287
   <xsl:param name="docid"/>
1288
   <xsl:param name="entitytype"/>
1289
   <xsl:param name="entityindex"/>
1290
   <xsl:param name="attributeindex"/>
1291
   <xsl:for-each select="nonNumericDomain">
1292
     <xsl:choose>
1293
         <xsl:when test="references!=''">
1294
          <xsl:variable name="ref_id" select="references"/>
1295
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1296
          <xsl:for-each select="$references">
1297
            <xsl:call-template name="attributenonnumericdomaincommon">
1298
                <xsl:with-param name="docid" select="$docid"/>
1299
                <xsl:with-param name="entitytype" select="$entitytype"/>
1300
                <xsl:with-param name="entityindex" select="$entityindex"/>
1301
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
1302
                <xsl:with-param name="stripes" select="$stripes"/>
1303
            </xsl:call-template>
1304
         </xsl:for-each>
1305
        </xsl:when>
1306
        <xsl:otherwise>
1307
            <xsl:call-template name="attributenonnumericdomaincommon">
1308
               <xsl:with-param name="docid" select="$docid"/>
1309
               <xsl:with-param name="entitytype" select="$entitytype"/>
1310
               <xsl:with-param name="entityindex" select="$entityindex"/>
1311
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
1312
               <xsl:with-param name="stripes" select="$stripes"/>
1313
            </xsl:call-template>
1314
        </xsl:otherwise>
1315
     </xsl:choose>
1316
   </xsl:for-each>
1317
 </xsl:template>
1318

    
1319
 <xsl:template name="attributenonnumericdomaincommon">
1320
    <xsl:param name="stripes"/>
1321
    <xsl:param name="docid"/>
1322
    <xsl:param name="entitytype"/>
1323
    <xsl:param name="entityindex"/>
1324
    <xsl:param name="attributeindex"/>
1325
    <!-- if numericdomain only has one text domain,
1326
        it will be displayed inline otherwise will show a link-->
1327
    <xsl:choose>
1328
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">      
1329
        <tr><td class="{$stripes}">Definition</td>
1330
            <td class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
1331
            </td>
1332
        </tr>
1333
        <xsl:for-each select="textDomain/pattern">
1334
          <tr><td class="{$stripes}">Pattern</td>
1335
            <td class="{$stripes}"><xsl:value-of select="."/>
1336
            </td>
1337
          </tr>
1338
        </xsl:for-each>
1339
        <xsl:for-each select="textDomain/source">
1340
          <tr><td class="{$stripes}">Source</td>
1341
            <td class="{$stripes}"><xsl:value-of select="."/>
1342
            </td>
1343
          </tr>
1344
        </xsl:for-each>
1345
      </xsl:when>
1346
      <xsl:otherwise>
1347
      	<xsl:choose>
1348
      		<xsl:when test="$displaymodule='printall'">
1349
      			<!-- Show it all -->
1350
				<xsl:for-each select="enumeratedDomain">
1351
					<xsl:call-template name="enumeratedDomain">
1352
						<xsl:with-param name="nondomainfirstColStyle" select="$firstColStyle"/>
1353
					</xsl:call-template>
1354
				</xsl:for-each>
1355
      		</xsl:when>
1356
      		<xsl:otherwise>
1357
      			<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>
1358
				Domain Info</a>
1359
      		</xsl:otherwise>
1360
      	</xsl:choose>
1361
      </xsl:otherwise>
1362
    </xsl:choose>
1363
 </xsl:template>
1364

    
1365
 <xsl:template name="intervalratio">
1366
    <xsl:param name="stripes"/>
1367
    <xsl:if test="unit/standardUnit">
1368
      <tr><td class="{$stripes}"><b>Unit</b></td>
1369
            <td class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
1370
            </td>
1371
      </tr>
1372
    </xsl:if>
1373
    <xsl:if test="unit/customUnit">
1374
      <tr><td class="{$stripes}"><b>Unit</b></td>
1375
            <td class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
1376
            </td>
1377
      </tr>
1378
   </xsl:if>
1379
   <xsl:for-each select="precision">
1380
      <tr><td class="{$stripes}"><b>Precision</b></td>
1381
            <td class="{$stripes}"><xsl:value-of select="."/>
1382
            </td>
1383
      </tr>
1384
   </xsl:for-each>
1385
   <xsl:for-each select="numericDomain">
1386
      <xsl:call-template name="numericDomain">
1387
         <xsl:with-param name="stripes" select="$stripes"/>
1388
      </xsl:call-template>
1389
    </xsl:for-each>
1390
  </xsl:template>
1391

    
1392

    
1393
 <xsl:template name="numericDomain">
1394
     <xsl:param name="stripes"/>
1395
       <xsl:choose>
1396
         <xsl:when test="references!=''">
1397
          <xsl:variable name="ref_id" select="references"/>
1398
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1399
          <xsl:for-each select="$references">
1400
            <tr><td class="{$stripes}"><b>Type</b></td>
1401
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1402
                </td>
1403
            </tr>
1404
            <xsl:for-each select="bounds">
1405
              <tr><td class="{$stripes}"><b>Min</b></td>
1406
                  <td class="{$stripes}">
1407
                    <xsl:for-each select="minimum">
1408
                      <xsl:value-of select="."/>&#160;
1409
                    </xsl:for-each>
1410
                  </td>
1411
              </tr>
1412
              <tr><td class="{$stripes}"><b>Max</b></td>
1413
                  <td class="{$stripes}">
1414
                    <xsl:for-each select="maximum">
1415
                      <xsl:value-of select="."/>&#160;
1416
                    </xsl:for-each>
1417
                  </td>
1418
              </tr>
1419
            </xsl:for-each>
1420
          </xsl:for-each>
1421
        </xsl:when>
1422
        <xsl:otherwise>
1423
          <tr><td class="{$stripes}"><b>Type</b></td>
1424
                <td class="{$stripes}"><xsl:value-of select="numberType"/>
1425
                </td>
1426
            </tr>
1427
            <xsl:for-each select="bounds">
1428
              <tr><td class="{$stripes}"><b>Min</b></td>
1429
                  <td class="{$stripes}">
1430
                    <xsl:for-each select="minimum">
1431
                      <xsl:value-of select="."/>&#160;
1432
                    </xsl:for-each>
1433
                  </td>
1434
              </tr>
1435
              <tr><td class="{$stripes}"><b>Max</b></td>
1436
                  <td class="{$stripes}">
1437
                    <xsl:for-each select="maximum">
1438
                      <xsl:value-of select="."/>&#160;
1439
                    </xsl:for-each>
1440
                  </td>
1441
              </tr>
1442
            </xsl:for-each>
1443
        </xsl:otherwise>
1444
      </xsl:choose>
1445
  </xsl:template>
1446

    
1447
 <xsl:template name="datetime">
1448
    <xsl:param name="stripes"/>
1449
    <tr><td class="{$stripes}"><b>Format</b></td>
1450
         <td class="{$stripes}">
1451
            <xsl:value-of select="formatString"/>
1452
         </td>
1453
    </tr>
1454
     <tr><td class="{$stripes}"><b>Precision</b></td>
1455
         <td class="{$stripes}">
1456
            <xsl:value-of select="dateTimePrecision"/>
1457
         </td>
1458
    </tr>
1459
    <xsl:call-template name="timedomain"/>
1460
 </xsl:template>
1461

    
1462

    
1463
 <xsl:template name="timedomain">
1464
    <xsl:param name="stripes"/>
1465
      <xsl:choose>
1466
         <xsl:when test="references!=''">
1467
          <xsl:variable name="ref_id" select="references"/>
1468
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
1469
          <xsl:for-each select="$references">
1470
            <xsl:for-each select="bounds">
1471
              <tr><td class="{$stripes}"><b>Min</b></td>
1472
                  <td class="{$stripes}">
1473
                    <xsl:for-each select="minimum">
1474
                      <xsl:value-of select="."/>&#160;
1475
                    </xsl:for-each>
1476
                  </td>
1477
              </tr>
1478
              <tr><td class="{$stripes}"><b>Max</b></td>
1479
                  <td class="{$stripes}">
1480
                    <xsl:for-each select="maximum">
1481
                      <xsl:value-of select="."/>&#160;
1482
                    </xsl:for-each>
1483
                  </td>
1484
              </tr>
1485
            </xsl:for-each>
1486
          </xsl:for-each>
1487
        </xsl:when>
1488
        <xsl:otherwise>
1489
           <xsl:for-each select="bounds">
1490
              <tr><td class="{$stripes}"><b>Min</b></td>
1491
                  <td class="{$stripes}">
1492
                    <xsl:for-each select="minimum">
1493
                      <xsl:value-of select="."/>&#160;
1494
                    </xsl:for-each>
1495
                  </td>
1496
              </tr>
1497
              <tr><td class="{$stripes}"><b>Max</b></td>
1498
                  <td class="{$stripes}">
1499
                    <xsl:for-each select="maximum">
1500
                      <xsl:value-of select="."/>&#160;
1501
                    </xsl:for-each>
1502
                  </td>
1503
              </tr>
1504
            </xsl:for-each>
1505
        </xsl:otherwise>
1506
      </xsl:choose>
1507
  </xsl:template>
1508

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

    
1526
 <xsl:template name="attributemethod">
1527
    <xsl:param name="docid"/>
1528
    <xsl:param name="entitytype"/>
1529
    <xsl:param name="entityindex"/>
1530
    <xsl:param name="attributeindex"/>
1531
    <xsl:choose>
1532
    	<xsl:when test="$displaymodule='printall'">
1533
			<xsl:call-template name="method">
1534
				<xsl:with-param name="methodfirstColStyle" select="$firstColStyle"/>
1535
				<xsl:with-param name="methodsubHeaderStyle" select="$firstColStyle"/>
1536
			</xsl:call-template>
1537
    	</xsl:when>
1538
    	<xsl:otherwise>
1539
			<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>
1540
			<b>Method Info</b></a>
1541
    	</xsl:otherwise>
1542
    </xsl:choose>
1543

    
1544
 </xsl:template>
1545

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