Project

General

Profile

metacat / lib / style / skins / metacatui / eml-2 / eml-attribute.xsl @ 10194

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: mecum $'
9
  *     '$Date: 2017-03-23 10:17:34 -0700 (Thu, 23 Mar 2017) $'
10
  * '$Revision: 10194 $'
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
			PLACEHOLDER
161
			<!--  
162
			<xsl:choose>
163
				<xsl:when test="references!=''">
164
		          <xsl:variable name="ref_id" select="references"/>
165
		          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
166
		          <xsl:for-each select="$references">
167
		            <xsl:value-of select="attributeName"/>
168
		          </xsl:for-each>
169
		        </xsl:when>
170
		        <xsl:otherwise>
171
		          <xsl:value-of select="attributeName"/>
172
		        </xsl:otherwise>
173
		     </xsl:choose>
174
		     -->
175
		</span>
176
	</div>	
177
  
178

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

    
282

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

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

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

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

    
437

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

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

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

    
577

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

    
635

    
636
<xsl:template name="singleattribute">
637
   <xsl:param name="docid"/>
638
   <xsl:param name="entitytype"/>
639
   <xsl:param name="entityindex"/>
640
   <xsl:param name="attributeindex"/>
641

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

    
668

    
669
<xsl:template name="singleattributecommon">
670
   <xsl:param name="docid"/>
671
   <xsl:param name="entitytype"/>
672
   <xsl:param name="entityindex"/>
673
   <xsl:param name="attributeindex"/>
674

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

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

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

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

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

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

    
917

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

    
987

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

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

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

    
1179

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

    
1244

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

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

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

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

    
1395

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

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

    
1465

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

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

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

    
1547
 </xsl:template>
1548

    
1549
</xsl:stylesheet>