Project

General

Profile

1 553 tao
<?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$'
9
  *     '$Date$'
10
  * '$Revision$'
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 1632 tao
34 553 tao
<xsl:output method="html" encoding="iso-8859-1"/>
35
36 1632 tao
<xsl:template name="attributelist">
37
   <xsl:param name="docid"/>
38
   <xsl:param name="entitytype"/>
39
   <xsl:param name="entityindex"/>
40
41 1707 tao
   <table xsl:use-attribute-sets="cellspacing" class="tableattribute" width="100%">
42 1632 tao
        <xsl:choose>
43
         <xsl:when test="references!=''">
44
          <xsl:variable name="ref_id" select="references"/>
45
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
46
          <xsl:for-each select="$references">
47
            <xsl:call-template name="attributecommon">
48
               <xsl:with-param name="docid" select="$docid"/>
49
               <xsl:with-param name="entitytype" select="$entitytype"/>
50
               <xsl:with-param name="entityindex" select="$entityindex"/>
51
            </xsl:call-template>
52
          </xsl:for-each>
53
        </xsl:when>
54
        <xsl:otherwise>
55
          <xsl:call-template name="attributecommon">
56
               <xsl:with-param name="docid" select="$docid"/>
57
               <xsl:with-param name="entitytype" select="$entitytype"/>
58
               <xsl:with-param name="entityindex" select="$entityindex"/>
59
          </xsl:call-template>
60
        </xsl:otherwise>
61
      </xsl:choose>
62
  </table>
63
</xsl:template>
64 553 tao
65
66 1632 tao
<xsl:template name="attributecommon">
67
   <xsl:param name="docid"/>
68
   <xsl:param name="entitytype"/>
69
   <xsl:param name="entityindex"/>
70
71
72
  <!-- First row for attribute name-->
73 1659 tao
  <tr><th colspan="1" valign="center" align="center" class="bordered">Attribute Names</th>
74 1632 tao
  <xsl:for-each select="attribute">
75
    <xsl:choose>
76
         <xsl:when test="references!=''">
77
          <xsl:variable name="ref_id" select="references"/>
78
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
79
          <xsl:for-each select="$references">
80
            <th colspan="1" align="center"  class="bordered"><xsl:value-of select="attributeName"/></th>
81
          </xsl:for-each>
82
        </xsl:when>
83
        <xsl:otherwise>
84
          <th colspan="1" align="center"  class="bordered"><xsl:value-of select="attributeName"/></th>
85
        </xsl:otherwise>
86
     </xsl:choose>
87 553 tao
  </xsl:for-each>
88
  </tr>
89 1632 tao
90
  <!-- Second row for attribute label-->
91 553 tao
  <tr><th colspan="1" align="center"  class="bordered" >Label(s) of the Column</th>
92 1632 tao
   <xsl:for-each select="attribute">
93
    <xsl:variable name="stripes">
94 553 tao
              <xsl:choose>
95 1707 tao
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
96 553 tao
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
97
              </xsl:choose>
98 1632 tao
    </xsl:variable>
99
    <xsl:choose>
100
         <xsl:when test="references!=''">
101
          <xsl:variable name="ref_id" select="references"/>
102
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
103
          <xsl:for-each select="$references">
104
             <td colspan="1" align="center" class="{$stripes}">
105
                 <xsl:for-each select="attributeLabel">
106
                   <xsl:value-of select="."/>
107
                    &#160;<br />
108
                </xsl:for-each>
109
              </td>
110
          </xsl:for-each>
111
        </xsl:when>
112
        <xsl:otherwise>
113
             <td colspan="1" align="center" class="{$stripes}">
114
                 <xsl:for-each select="attributeLabel">
115
                   <xsl:value-of select="."/>
116
                    &#160;<br />
117
                </xsl:for-each>
118
             </td>
119
        </xsl:otherwise>
120
     </xsl:choose>
121
   </xsl:for-each>
122 553 tao
  </tr>
123 1632 tao
124
  <!-- Third row for attribute defination-->
125 553 tao
  <tr><th colspan="1" align="center"  class="bordered">Meaning</th>
126 1632 tao
    <xsl:for-each select="attribute">
127 553 tao
      <xsl:variable name="stripes">
128
              <xsl:choose>
129
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
130 1707 tao
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
131 553 tao
              </xsl:choose>
132 1632 tao
      </xsl:variable>
133
      <xsl:choose>
134
         <xsl:when test="references!=''">
135
          <xsl:variable name="ref_id" select="references"/>
136
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
137
           <xsl:for-each select="$references">
138
             <td colspan="1" align="center" class="{$stripes}">
139
               <xsl:value-of select="attributeDefinition"/>
140
             </td>
141
           </xsl:for-each>
142
        </xsl:when>
143
        <xsl:otherwise>
144
          <td colspan="1" align="center" class="{$stripes}">
145
             <xsl:value-of select="attributeDefinition"/>
146
          </td>
147
        </xsl:otherwise>
148
     </xsl:choose>
149
   </xsl:for-each>
150 553 tao
  </tr>
151 1632 tao
152
  <!-- The fourth row for attribute storage type-->
153
   <tr><th colspan="1" align="center"  class="bordered">Type of Value</th>
154
     <xsl:for-each select="attribute">
155
      <xsl:variable name="stripes">
156 553 tao
              <xsl:choose>
157 1707 tao
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
158 553 tao
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
159
              </xsl:choose>
160 1632 tao
      </xsl:variable>
161
      <xsl:choose>
162
         <xsl:when test="references!=''">
163
          <xsl:variable name="ref_id" select="references"/>
164
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
165
          <xsl:for-each select="$references">
166
            <td colspan="1" align="center" class="{$stripes}">
167
              <xsl:value-of select="storageType"/>
168
            </td>
169
          </xsl:for-each>
170
        </xsl:when>
171
        <xsl:otherwise>
172
           <td colspan="1" align="center" class="{$stripes}">
173
             <xsl:value-of select="storageType"/>
174
           </td>
175
        </xsl:otherwise>
176
     </xsl:choose>
177
   </xsl:for-each>
178 553 tao
  </tr>
179 1632 tao
180 1707 tao
  <!-- The fifth row for meaturement type-->
181
  <tr><th colspan="1" align="center"  class="bordered">Measurement Type</th>
182 1632 tao
   <xsl:for-each select="attribute">
183
    <xsl:variable name="stripes">
184 553 tao
              <xsl:choose>
185
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
186 1707 tao
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
187 553 tao
              </xsl:choose>
188 1632 tao
    </xsl:variable>
189
    <xsl:choose>
190
         <xsl:when test="references!=''">
191
          <xsl:variable name="ref_id" select="references"/>
192
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
193
          <xsl:for-each select="$references">
194
            <td colspan="1" align="center" class="{$stripes}">
195
              <xsl:for-each select="measurementScale">
196 1707 tao
                 <xsl:value-of select="local-name(./*)"/>
197
              </xsl:for-each>
198
            </td>
199
         </xsl:for-each>
200
        </xsl:when>
201
        <xsl:otherwise>
202
           <td colspan="1" align="center" class="{$stripes}">
203
              <xsl:for-each select="measurementScale">
204
                 <xsl:value-of select="local-name(./*)"/>
205
              </xsl:for-each>
206
           </td>
207
        </xsl:otherwise>
208
     </xsl:choose>
209
   </xsl:for-each>
210
  </tr>
211
212
  <!-- The sixth row for meaturement domain-->
213
  <tr><th colspan="1" align="center"  class="bordered">Measurement Domain</th>
214
   <xsl:for-each select="attribute">
215
    <xsl:variable name="stripes">
216
              <xsl:choose>
217
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
218
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
219
              </xsl:choose>
220
    </xsl:variable>
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
          <xsl:for-each select="$references">
226
            <td colspan="1" align="center" class="{$stripes}">
227
              <xsl:for-each select="measurementScale">
228 1632 tao
                <xsl:call-template name="measurementscale">
229
                    <xsl:with-param name="docid" select="$docid"/>
230
                    <xsl:with-param name="entitytype" select="$entitytype"/>
231
                    <xsl:with-param name="entityindex" select="$entityindex"/>
232
                    <xsl:with-param name="attributeindex" select="position()"/>
233 1707 tao
                    <xsl:with-param name="stripes" select="$stripes"/>
234 1632 tao
                </xsl:call-template>
235
              </xsl:for-each>
236
            </td>
237
         </xsl:for-each>
238
        </xsl:when>
239
        <xsl:otherwise>
240
           <td colspan="1" align="center" class="{$stripes}">
241
              <xsl:for-each select="measurementScale">
242
                <xsl:call-template name="measurementscale">
243
                      <xsl:with-param name="docid" select="$docid"/>
244
                      <xsl:with-param name="entitytype" select="$entitytype"/>
245
                      <xsl:with-param name="entityindex" select="$entityindex"/>
246
                      <xsl:with-param name="attributeindex" select="position()"/>
247 1707 tao
                      <xsl:with-param name="stripes" select="$stripes"/>
248 1632 tao
                </xsl:call-template>
249
              </xsl:for-each>
250
           </td>
251
        </xsl:otherwise>
252
     </xsl:choose>
253
   </xsl:for-each>
254 553 tao
  </tr>
255
256 1632 tao
257 1707 tao
  <!-- The seventh row for missing value code-->
258 553 tao
  <tr><th colspan="1" align="center"  class="bordered">Missing Value Code</th>
259 1632 tao
    <xsl:for-each select="attribute">
260
      <xsl:variable name="stripes">
261
         <xsl:choose>
262
            <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
263 1707 tao
            <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
264 1632 tao
         </xsl:choose>
265
     </xsl:variable>
266
     <xsl:choose>
267
         <xsl:when test="references!=''">
268
          <xsl:variable name="ref_id" select="references"/>
269
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
270
          <xsl:for-each select="$references">
271
            <td colspan="1" align="center" class="{$stripes}">
272 1707 tao
              <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
273 1632 tao
                <xsl:for-each select="missingValueCode">
274 1707 tao
                 <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Code</b></td>
275
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="code"/></td></tr>
276
                  <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
277
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="codeExplanation"/></td>
278 1632 tao
                  </tr>
279
               </xsl:for-each>
280
             </table>
281
            </td>
282
          </xsl:for-each>
283
        </xsl:when>
284
        <xsl:otherwise>
285
           <td colspan="1" align="center" class="{$stripes}">
286 1707 tao
             <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
287 1632 tao
                <xsl:for-each select="missingValueCode">
288 1707 tao
                 <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Code</b></td>
289
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="code"/></td></tr>
290
                  <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
291
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="codeExplanation"/></td>
292 1632 tao
                  </tr>
293
               </xsl:for-each>
294
             </table>
295
          </td>
296
        </xsl:otherwise>
297
     </xsl:choose>
298
   </xsl:for-each>
299
  </tr>
300
301
302 1707 tao
  <!-- The eighth row for accuracy report-->
303
  <tr><th colspan="1" align="center"  class="bordered">Accuracy Report</th>
304 1632 tao
     <xsl:for-each select="attribute">
305 553 tao
     <xsl:variable name="stripes">
306 1632 tao
         <xsl:choose>
307
             <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
308 1707 tao
             <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
309 1632 tao
         </xsl:choose>
310
    </xsl:variable>
311
    <xsl:choose>
312
         <xsl:when test="references!=''">
313
          <xsl:variable name="ref_id" select="references"/>
314
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
315
          <xsl:for-each select="$references">
316
            <td colspan="1" align="center" class="{$stripes}">
317
              <xsl:for-each select="accuracy">
318 1707 tao
                <xsl:value-of select="attributeAccuracyReport"/>
319
              </xsl:for-each>
320
            </td>
321
          </xsl:for-each>
322
        </xsl:when>
323
        <xsl:otherwise>
324
           <td colspan="1" align="center" class="{$stripes}">
325
              <xsl:for-each select="accuracy">
326
                <xsl:value-of select="attributeAccuracyReport"/>
327
             </xsl:for-each>
328
           </td>
329
        </xsl:otherwise>
330
     </xsl:choose>
331
  </xsl:for-each>
332
  </tr>
333
334
  <!-- The nineth row for quality accuracy accessment -->
335
  <tr><th colspan="1" align="center"  class="bordered">Accuracy Assessment</th>
336
     <xsl:for-each select="attribute">
337
     <xsl:variable name="stripes">
338
         <xsl:choose>
339
             <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
340
             <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
341
         </xsl:choose>
342
    </xsl:variable>
343
    <xsl:choose>
344
         <xsl:when test="references!=''">
345
          <xsl:variable name="ref_id" select="references"/>
346
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
347
          <xsl:for-each select="$references">
348
            <td colspan="1" align="center" class="{$stripes}">
349
              <xsl:for-each select="accuracy">
350
               <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
351 1632 tao
                  <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
352 1707 tao
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Value</b></td>
353
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
354 1632 tao
                    </tr>
355 1707 tao
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
356
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
357 1632 tao
                    </tr>
358
                  </xsl:for-each>
359
               </table>
360
             </xsl:for-each>
361
            </td>
362
          </xsl:for-each>
363
        </xsl:when>
364
        <xsl:otherwise>
365
           <td colspan="1" align="center" class="{$stripes}">
366
              <xsl:for-each select="accuracy">
367 1707 tao
                 <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
368
                   <xsl:for-each select="quantitativeAttributeAccuracyAssessment">
369
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Value</b></td>
370
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyValue"/></td>
371 1632 tao
                    </tr>
372 1707 tao
                    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Explanation</b></td>
373
                       <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="attributeAccuracyExplanation"/></td>
374 1632 tao
                    </tr>
375
                  </xsl:for-each>
376 1707 tao
                </table>
377 1632 tao
             </xsl:for-each>
378
           </td>
379
        </xsl:otherwise>
380
     </xsl:choose>
381 553 tao
  </xsl:for-each>
382
  </tr>
383 1632 tao
384 1707 tao
   <!-- The tenth row for coverage-->
385 1632 tao
  <tr><th colspan="1" align="center"  class="bordered">Coverage</th>
386
   <xsl:for-each select="attribute">
387
    <xsl:variable name="stripes">
388 553 tao
              <xsl:choose>
389 1707 tao
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
390 553 tao
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
391
              </xsl:choose>
392 1632 tao
    </xsl:variable>
393
    <xsl:choose>
394
         <xsl:when test="references!=''">
395
          <xsl:variable name="ref_id" select="references"/>
396
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
397
          <xsl:for-each select="$references">
398
            <td colspan="1" align="center" class="{$stripes}">
399
              <xsl:for-each select="coverage">
400
                <xsl:call-template name="attributecoverage"/>
401
              </xsl:for-each>
402
            </td>
403
         </xsl:for-each>
404
        </xsl:when>
405
        <xsl:otherwise>
406
           <td colspan="1" align="center" class="{$stripes}">
407
              <xsl:for-each select="coverage">
408
                <xsl:call-template name="attributecoverage">
409
                    <xsl:with-param name="docid" select="$docid"/>
410
                    <xsl:with-param name="entitytype" select="$entitytype"/>
411
                    <xsl:with-param name="entityindex" select="$entityindex"/>
412
                    <xsl:with-param name="attributeindex" select="position()"/>
413
                </xsl:call-template>
414
              </xsl:for-each>
415
           </td>
416
        </xsl:otherwise>
417
     </xsl:choose>
418
   </xsl:for-each>
419 553 tao
  </tr>
420 1632 tao
421 553 tao
422 1707 tao
   <!-- The eleventh row for method-->
423 1632 tao
  <tr><th colspan="1" align="center"  class="bordered">Method</th>
424
   <xsl:for-each select="attribute">
425
    <xsl:variable name="stripes">
426 553 tao
              <xsl:choose>
427 1707 tao
                <xsl:when test="position() mod 2 = 0">coleven</xsl:when>
428 553 tao
                <xsl:when test="position() mod 2 = 1">colodd</xsl:when>
429
              </xsl:choose>
430 1632 tao
    </xsl:variable>
431
    <xsl:choose>
432
         <xsl:when test="references!=''">
433
          <xsl:variable name="ref_id" select="references"/>
434
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
435
          <xsl:for-each select="$references">
436
            <td colspan="1" align="center" class="{$stripes}">
437
              <xsl:for-each select="method">
438
                <xsl:call-template name="attributemethod"/>
439
              </xsl:for-each>
440
            </td>
441
         </xsl:for-each>
442
        </xsl:when>
443
        <xsl:otherwise>
444
           <td colspan="1" align="center" class="{$stripes}">
445
              <xsl:for-each select="method">
446
                <xsl:call-template name="attributemethod">
447
                    <xsl:with-param name="docid" select="$docid"/>
448
                    <xsl:with-param name="entitytype" select="$entitytype"/>
449
                    <xsl:with-param name="entityindex" select="$entityindex"/>
450
                    <xsl:with-param name="attributeindex" select="position()"/>
451
                </xsl:call-template>
452
              </xsl:for-each>
453
           </td>
454
        </xsl:otherwise>
455
     </xsl:choose>
456
   </xsl:for-each>
457
  </tr>
458
 </xsl:template>
459
460
 <xsl:template name="measurementscale">
461 1707 tao
   <xsl:param name="stripes"/>
462 1632 tao
   <xsl:param name="docid"/>
463
   <xsl:param name="entitytype"/>
464
   <xsl:param name="entityindex"/>
465
   <xsl:param name="attributeindex"/>
466 1707 tao
   <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
467 1632 tao
    <xsl:for-each select="nominal">
468 1707 tao
         <xsl:call-template name="attributenonnumericdomain">
469 1632 tao
               <xsl:with-param name="docid" select="$docid"/>
470
               <xsl:with-param name="entitytype" select="$entitytype"/>
471
               <xsl:with-param name="entityindex" select="$entityindex"/>
472
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
473 1707 tao
               <xsl:with-param name="stripes" select="$stripes"/>
474 1632 tao
       </xsl:call-template>
475 553 tao
    </xsl:for-each>
476 1632 tao
    <xsl:for-each select="ordinal">
477
       <xsl:call-template name="attributenonnumericdomain">
478
               <xsl:with-param name="docid" select="$docid"/>
479
               <xsl:with-param name="entitytype" select="$entitytype"/>
480
               <xsl:with-param name="entityindex" select="$entityindex"/>
481
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
482 1707 tao
               <xsl:with-param name="stripes" select="$stripes"/>
483 1632 tao
       </xsl:call-template>
484
    </xsl:for-each>
485
    <xsl:for-each select="interval">
486
       <xsl:call-template name="intervalratio">
487 1707 tao
         <xsl:with-param name="stripes" select="$stripes"/>
488 1632 tao
       </xsl:call-template>
489
    </xsl:for-each>
490
    <xsl:for-each select="ratio">
491
       <xsl:call-template name="intervalratio">
492 1707 tao
         <xsl:with-param name="stripes" select="$stripes"/>
493 1632 tao
       </xsl:call-template>
494
    </xsl:for-each>
495
    <xsl:for-each select="datetime">
496
       <xsl:call-template name="datetime">
497 1707 tao
          <xsl:with-param name="stripes" select="$stripes"/>
498 1632 tao
       </xsl:call-template>
499
    </xsl:for-each>
500
   </table>
501
 </xsl:template>
502
503
 <xsl:template name="attributenonnumericdomain">
504 1707 tao
   <xsl:param name="stripes"/>
505 1632 tao
   <xsl:param name="docid"/>
506
   <xsl:param name="entitytype"/>
507
   <xsl:param name="entityindex"/>
508
   <xsl:param name="attributeindex"/>
509
   <xsl:for-each select="nonNumericDomain">
510
     <xsl:choose>
511
         <xsl:when test="references!=''">
512
          <xsl:variable name="ref_id" select="references"/>
513
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
514
          <xsl:for-each select="$references">
515
            <xsl:call-template name="attributenonnumericdomaincommon">
516
                <xsl:with-param name="docid" select="$docid"/>
517
                <xsl:with-param name="entitytype" select="$entitytype"/>
518
                <xsl:with-param name="entityindex" select="$entityindex"/>
519
                <xsl:with-param name="attributeindex" select="$attributeindex"/>
520 1707 tao
                <xsl:with-param name="stripes" select="$stripes"/>
521 1632 tao
            </xsl:call-template>
522
         </xsl:for-each>
523
        </xsl:when>
524
        <xsl:otherwise>
525
            <xsl:call-template name="attributenonnumericdomaincommon">
526
               <xsl:with-param name="docid" select="$docid"/>
527
               <xsl:with-param name="entitytype" select="$entitytype"/>
528
               <xsl:with-param name="entityindex" select="$entityindex"/>
529
               <xsl:with-param name="attributeindex" select="$attributeindex"/>
530 1707 tao
               <xsl:with-param name="stripes" select="$stripes"/>
531 1632 tao
            </xsl:call-template>
532
        </xsl:otherwise>
533
     </xsl:choose>
534 553 tao
   </xsl:for-each>
535 1632 tao
 </xsl:template>
536
537
 <xsl:template name="attributenonnumericdomaincommon">
538 1707 tao
    <xsl:param name="stripes"/>
539 1632 tao
    <xsl:param name="docid"/>
540
    <xsl:param name="entitytype"/>
541
    <xsl:param name="entityindex"/>
542
    <xsl:param name="attributeindex"/>
543
    <!-- if numericdomain only has one test domain,
544
        it will be displayed inline otherwith will be show a link-->
545
    <xsl:choose>
546
      <xsl:when test="count(textDomain)=1 and not(enumeratedDomain)">
547 1707 tao
        <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Definition</b></td>
548
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="textDomain/definition"/>
549 1632 tao
            </td>
550 553 tao
        </tr>
551 1659 tao
        <xsl:for-each select="textDomain/parttern">
552 1707 tao
          <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Pattern</b></td>
553
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
554 1659 tao
            </td>
555
          </tr>
556
        </xsl:for-each>
557
        <xsl:for-each select="textDomain/source">
558 1707 tao
          <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Source</b></td>
559
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
560 1659 tao
            </td>
561
          </tr>
562
        </xsl:for-each>
563 1632 tao
      </xsl:when>
564
      <xsl:otherwise>
565 1707 tao
         <tr><td colspan="2" align="center" class="{$stripes}" >
566 1632 tao
           <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>
567 1659 tao
           <b>Domain Info</b></a>
568 1632 tao
         </td></tr>
569
      </xsl:otherwise>
570
    </xsl:choose>
571
 </xsl:template>
572
573
 <xsl:template name="intervalratio">
574 1707 tao
    <xsl:param name="stripes"/>
575 1632 tao
    <xsl:if test="unit/standardUnit">
576 1707 tao
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Unit</b></td>
577
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="unit/standardUnit"/>
578 553 tao
            </td>
579 1632 tao
      </tr>
580
    </xsl:if>
581
    <xsl:if test="unit/customUnit">
582 1707 tao
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Unit</b></td>
583
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="unit/customUnit"/>
584 553 tao
            </td>
585 1632 tao
      </tr>
586
   </xsl:if>
587
   <xsl:for-each select="precision">
588 1707 tao
      <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Precision</b></td>
589
            <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="."/>
590 553 tao
            </td>
591 1632 tao
      </tr>
592
   </xsl:for-each>
593
   <xsl:for-each select="numericDomain">
594 1707 tao
       <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Numeric</b></td>
595
            <td width="{$secondColWidth}" class="{$stripes}">
596
             <xsl:call-template name="numericDomain">
597
               <xsl:with-param name="stripes" select="$stripes"/>
598
             </xsl:call-template>
599 1632 tao
          </td>
600
      </tr>
601
   </xsl:for-each>
602 553 tao
  </xsl:template>
603 1632 tao
604
605
 <xsl:template name="numericDomain">
606 1707 tao
     <xsl:param name="stripes"/>
607
     <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
608 1632 tao
        <xsl:choose>
609
         <xsl:when test="references!=''">
610
          <xsl:variable name="ref_id" select="references"/>
611
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
612
          <xsl:for-each select="$references">
613 1707 tao
            <tr><td width="{$firstColWidth}" class="{$stripes}">Type</td>
614
                <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="numberType"/>
615 1632 tao
                </td>
616
            </tr>
617
            <xsl:for-each select="bounds">
618 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
619
                  <td width="{$secondColWidth}" class="{$stripes}">
620 1632 tao
                    <xsl:for-each select="minimum">
621
                      <xsl:value-of select="."/>&#160;
622
                    </xsl:for-each>
623
                  </td>
624
              </tr>
625 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
626
                  <td width="{$secondColWidth}" class="{$stripes}">
627 1632 tao
                    <xsl:for-each select="maximum">
628
                      <xsl:value-of select="."/>&#160;
629
                    </xsl:for-each>
630
                  </td>
631
              </tr>
632
            </xsl:for-each>
633
          </xsl:for-each>
634
        </xsl:when>
635
        <xsl:otherwise>
636 1707 tao
          <tr><td width="{$firstColWidth}" class="{$stripes}">Type</td>
637
                <td width="{$secondColWidth}" class="{$stripes}"><xsl:value-of select="numberType"/>
638 1632 tao
                </td>
639
            </tr>
640
            <xsl:for-each select="bounds">
641 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
642
                  <td width="{$secondColWidth}" class="{$stripes}">
643 1632 tao
                    <xsl:for-each select="minimum">
644
                      <xsl:value-of select="."/>&#160;
645
                    </xsl:for-each>
646
                  </td>
647
              </tr>
648 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
649
                  <td width="{$secondColWidth}" class="{$stripes}">
650 1632 tao
                    <xsl:for-each select="maximum">
651
                      <xsl:value-of select="."/>&#160;
652
                    </xsl:for-each>
653
                  </td>
654
              </tr>
655
            </xsl:for-each>
656
        </xsl:otherwise>
657
      </xsl:choose>
658
  </table>
659
 </xsl:template>
660
661
 <xsl:template name="datetime">
662 1707 tao
    <xsl:param name="stripes"/>
663
    <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Format</b></td>
664
         <td width="{$secondColWidth}" class="{$stripes}">
665 1632 tao
            <xsl:value-of select="formatString"/>
666
         </td>
667
    </tr>
668 1707 tao
     <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Precision</b></td>
669
         <td width="{$secondColWidth}" class="{$stripes}">
670 1632 tao
            <xsl:value-of select="dateTimePrecision"/>
671
         </td>
672
    </tr>
673 1707 tao
     <tr><td width="{$firstColWidth}" class="{$stripes}"><b>Domain</b></td>
674
         <td width="{$secondColWidth}" class="{$stripes}">
675 1632 tao
           <xsl:call-template name="timedomain"/>
676
         </td>
677
    </tr>
678
 </xsl:template>
679
680
681
 <xsl:template name="timedomain">
682 1707 tao
    <xsl:param name="stripes"/>
683
    <table xsl:use-attribute-sets="cellspacing" class="tableinattribute" width="100%">
684 1632 tao
        <xsl:choose>
685
         <xsl:when test="references!=''">
686
          <xsl:variable name="ref_id" select="references"/>
687
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
688
          <xsl:for-each select="$references">
689
            <xsl:for-each select="bounds">
690 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
691
                  <td width="{$secondColWidth}" class="{$stripes}">
692 1632 tao
                    <xsl:for-each select="minimum">
693
                      <xsl:value-of select="."/>&#160;
694
                    </xsl:for-each>
695
                  </td>
696
              </tr>
697 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
698
                  <td width="{$secondColWidth}" class="{$stripes}">
699 1632 tao
                    <xsl:for-each select="maximum">
700
                      <xsl:value-of select="."/>&#160;
701
                    </xsl:for-each>
702
                  </td>
703
              </tr>
704
            </xsl:for-each>
705
          </xsl:for-each>
706
        </xsl:when>
707
        <xsl:otherwise>
708
           <xsl:for-each select="bounds">
709 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Min</td>
710
                  <td width="{$secondColWidth}" class="{$stripes}">
711 1632 tao
                    <xsl:for-each select="minimum">
712
                      <xsl:value-of select="."/>&#160;
713
                    </xsl:for-each>
714
                  </td>
715
              </tr>
716 1707 tao
              <tr><td width="{$firstColWidth}" class="{$stripes}">Max</td>
717
                  <td width="{$secondColWidth}" class="{$stripes}">
718 1632 tao
                    <xsl:for-each select="maximum">
719
                      <xsl:value-of select="."/>&#160;
720
                    </xsl:for-each>
721
                  </td>
722
              </tr>
723
            </xsl:for-each>
724
        </xsl:otherwise>
725
      </xsl:choose>
726
  </table>
727
 </xsl:template>
728
729
 <xsl:template name="attributecoverage">
730
    <xsl:param name="docid"/>
731
    <xsl:param name="entitytype"/>
732
    <xsl:param name="entityindex"/>
733
    <xsl:param name="attributeindex"/>
734
     <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>
735 1659 tao
           <b>Coverage Info</b></a>
736 1632 tao
 </xsl:template>
737
738
 <xsl:template name="attributemethod">
739
    <xsl:param name="docid"/>
740
    <xsl:param name="entitytype"/>
741
    <xsl:param name="entityindex"/>
742
    <xsl:param name="attributeindex"/>
743
     <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>
744 1659 tao
           <b>Coverage Info</b></a>
745 1632 tao
 </xsl:template>
746 553 tao
747
</xsl:stylesheet>