Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  * eml-variable-display2.xsl
4
  *
5
  *      Authors: Matt Jones
6
  *    Copyright: 2000 Regents of the University of California and the 
7
  *               National Center for Ecological Analysis and Synthesis
8
  *  For Details: http://www.nceas.ucsb.edu/
9
  *      Created: 2000 April 5
10
  *    File Info: '$Id: eml-variable-display.xsl 506 2000-10-31 01:12:16Z jones $'
11
  *
12
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
13
  * convert an XML file that is valid with respect to the eml-variable.dtd
14
  * module of the Ecological Metadata Language (EML) into an HTML format 
15
  * suitable for rendering with modern web browsers.
16
-->
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
18

    
19
  <xsl:output method="html" encoding="iso-8859-1"/>
20

    
21
  <xsl:template match="/">
22
    <html>
23
      <head>
24
        <link rel="stylesheet" type="text/css" 
25
              href="@web-base-url@/default.css" />
26
      </head>
27
      <body>
28
        <center>
29
          <h1>Attribute structure description</h1>
30
          <h3>Ecological Metadata Language</h3>
31
        </center>
32
        
33
        <xsl:apply-templates select="eml-variable/meta_file_id"/>
34

    
35
        <h3>Attributes in the Data Set:</h3>
36
        <table width="100%">
37
        <tr>
38
        <th class="tablehead"><xsl:text>Attribute Name</xsl:text></th>
39
        <th class="tablehead"><xsl:text>Attribute Definition</xsl:text></th>
40
        <th class="tablehead"><xsl:text>Unit</xsl:text></th>
41
        <th class="tablehead"><xsl:text>Type</xsl:text></th>
42
        <th class="tablehead"><xsl:text>Codes</xsl:text></th>
43
        <th class="tablehead"><xsl:text>Range</xsl:text></th>
44
        <th class="tablehead"><xsl:text>Missing</xsl:text></th>
45
        <th class="tablehead"><xsl:text>Precision</xsl:text></th>
46
        <th class="tablehead"><xsl:text>Format</xsl:text></th>
47
        </tr>
48

    
49
        <xsl:for-each select="eml-variable/variable">
50
          <tr valign="top">
51
            <xsl:attribute name="class">
52
              <xsl:choose>
53
                <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
54
                <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
55
              </xsl:choose>
56
            </xsl:attribute>
57

    
58
          <td><b><xsl:value-of select="variable_name"/></b>
59
              <xsl:text>&nbsp;</xsl:text></td>
60
          <td><xsl:value-of select="variable_definition"/>
61
              <xsl:text>&nbsp;</xsl:text></td>
62
          <td><xsl:value-of select="unit"/>
63
              <xsl:text>&nbsp;</xsl:text></td>
64
          <td><xsl:value-of select="storage_type"/>
65
              <xsl:text>&nbsp;</xsl:text></td>
66
          <td><ul>
67
              <xsl:for-each select="code_definition">
68
                <li><xsl:value-of select="code"/>
69
                    <xsl:text> - </xsl:text>
70
                    <xsl:value-of select="definition"/>
71
                </li>
72
              </xsl:for-each>
73
              </ul>
74
              <xsl:text>&nbsp;</xsl:text></td>
75
          <td><ul>
76
              <xsl:for-each select="numeric_range">
77
                <li><xsl:value-of select="minimum"/>
78
                    <xsl:text> - </xsl:text>
79
                    <xsl:value-of select="maximum"/>
80
                </li>
81
              </xsl:for-each>
82
              </ul>
83
              <xsl:text>&nbsp;</xsl:text></td>
84
          <td><xsl:for-each select="missing_value_code">
85
                <xsl:value-of select="."/><br />
86
              </xsl:for-each>
87
              <xsl:text>&nbsp;</xsl:text></td>
88
          <td><xsl:value-of select="precision"/>
89
              <xsl:text>&nbsp;</xsl:text></td>
90
          <td><xsl:apply-templates select="field_format"/>
91
              <xsl:text>&nbsp;</xsl:text></td>
92
          </tr>
93
        </xsl:for-each>
94
        </table>
95

    
96
      </body>
97
    </html>
98
  </xsl:template>
99

    
100
  <xsl:template match="meta_file_id">
101
    <table>
102
      <tr>
103
        <td class="highlight">
104
           <b><xsl:text>Metadata File ID:</xsl:text></b>
105
        </td>
106
        <td>
107
            <xsl:value-of select="."/>
108
        </td>
109
      </tr>
110
    </table>
111
  </xsl:template>
112

    
113
  <xsl:template match="field_format">
114
    <xsl:apply-templates/>
115
  </xsl:template>
116

    
117
  <xsl:template match="variable_format">
118
    <xsl:text>Variable: </xsl:text>
119
  </xsl:template>
120

    
121
  <xsl:template match="delimiter">
122
    <xsl:text>Variable </xsl:text>
123
    <xsl:text>(</xsl:text>
124
    <xsl:value-of select="."/>
125
    <xsl:text>)</xsl:text>
126
  </xsl:template>
127

    
128
  <xsl:template match="fixed_format">
129
    <xsl:text>Fixed</xsl:text>
130
  </xsl:template>
131

    
132
  <xsl:template match="field_width">
133
    <xsl:text>Fixed </xsl:text>
134
    <xsl:text>(</xsl:text>
135
    <xsl:value-of select="."/>
136
    <xsl:text>)</xsl:text>
137
  </xsl:template>
138

    
139
</xsl:stylesheet>
(3-3/7)