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: 2015-11-16 11:33:07 -0800 (Mon, 16 Nov 2015) $'
10
  * '$Revision: 9404 $'
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
		<!--  Header for the section and annotation target -->
136
		<div class="annotation-target">
137
			<xsl:attribute name="id">sem_entity_<xsl:value-of select="$entityindex"/>_attribute_<xsl:value-of select="$attributeindex"/></xsl:attribute>
138
			<xsl:attribute name="resource">#xpointer(<xsl:value-of select="$absolutePath"/>[<xsl:value-of select="$attributeindex"/>])</xsl:attribute>
139
			
140
			<xsl:choose>
141
				<xsl:when test="references!=''">
142
		          <xsl:variable name="ref_id" select="references"/>
143
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
144
		          <xsl:for-each select="$references">
145
		            <xsl:value-of select="attributeName"/>
146
		          </xsl:for-each>
147
		        </xsl:when>
148
		        <xsl:otherwise>
149
		          <xsl:value-of select="attributeName"/>
150
		        </xsl:otherwise>
151
		     </xsl:choose>
152
		</div>	
153

    
154
  	<!--  Name -->
155
  	<div class="control-group">
156
		<label class="control-label">Name</label>
157
		<div class="controls controls-well">
158
			<xsl:choose>
159
				<xsl:when test="references!=''">
160
		          <xsl:variable name="ref_id" select="references"/>
161
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
162
		          <xsl:for-each select="$references">
163
		            <xsl:value-of select="attributeName"/>
164
		          </xsl:for-each>
165
		        </xsl:when>
166
		        <xsl:otherwise>
167
		          <xsl:value-of select="attributeName"/>
168
		        </xsl:otherwise>
169
		     </xsl:choose>
170
		</div>
171
	</div>	
172
    
173
  
174

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

    
278

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

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

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

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

    
433

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

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

    
526
   <!-- The tenth row for coverage-->
527
  <div class="control-group">
528
		<label class="control-label">Coverage</label>
529
		<div class="controls controls-well">
530
		    <xsl:choose>
531
		         <xsl:when test="references!=''">
532
		          <xsl:variable name="ref_id" select="references"/>
533
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
534
		          <xsl:for-each select="$references">
535
		            <xsl:choose>
536
		               <xsl:when test="coverage!=''">
537
		                    <xsl:for-each select="coverage">
538
		                      <xsl:call-template name="attributecoverage">
539
		                         <xsl:with-param name="docid" select="$docid"/>
540
		                         <xsl:with-param name="entitytype" select="$entitytype"/>
541
		                         <xsl:with-param name="entityindex" select="$entityindex"/>
542
		                         <xsl:with-param name="attributeindex" select="$attributeindex"/>
543
		                      </xsl:call-template>
544
		                    </xsl:for-each>
545
		               </xsl:when>
546
		               <xsl:otherwise>
547
		                   &#160;
548
		               </xsl:otherwise>
549
		            </xsl:choose>
550
		         </xsl:for-each>
551
		        </xsl:when>
552
		        <xsl:otherwise>
553
		          <xsl:choose>
554
		               <xsl:when test="coverage!=''">
555
		                    <xsl:for-each select="coverage">
556
		                      <xsl:call-template name="attributecoverage">
557
		                         <xsl:with-param name="docid" select="$docid"/>
558
		                         <xsl:with-param name="entitytype" select="$entitytype"/>
559
		                         <xsl:with-param name="entityindex" select="$entityindex"/>
560
		                         <xsl:with-param name="attributeindex" select="$attributeindex"/>
561
		                      </xsl:call-template>
562
		                    </xsl:for-each>
563
		               </xsl:when>
564
		               <xsl:otherwise>
565
		                   &#160;
566
		               </xsl:otherwise>
567
		            </xsl:choose>
568
		        </xsl:otherwise>
569
		     </xsl:choose>
570
	     </div>
571
     </div>
572

    
573

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

    
631

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

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

    
664

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

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

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

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

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

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

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

    
913

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

    
983

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

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

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

    
1175

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

    
1240

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

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

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

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

    
1391

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

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

    
1461

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

    
1508
 <xsl:template name="attributecoverage">
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="coverage"></xsl:call-template>
1516
    	</xsl:when>
1517
    	<xsl:otherwise>
1518
			<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>
1519
			<b>Coverage Info</b></a>
1520
    	</xsl:otherwise>
1521
    </xsl:choose>
1522
 
1523
 </xsl:template>
1524

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

    
1543
 </xsl:template>
1544

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